/* ========================================
   Nova România - Common Styles
   Shared across all pages for consistent layout
======================================== */

:root {
  /* The site's only text sizes. Every font-size uses one of these five. */
  --fs-xs: 0.75rem;   /* 12px: labels, tags, metadata, counts */
  --fs-sm: 0.875rem;  /* 14px: secondary text, buttons, links */
  --fs-md: 1rem;      /* 16px: body text, posts, names */
  --fs-lg: 1.25rem;   /* 20px: card titles, sub-headings */
  --fs-xl: 1.75rem;   /* 28px: page and section titles */
  /* The material of every window that pops up over the page (sign-in, news,
     dialogs): a slightly see-through card, frosted, over a dimmed, blurred page. */
  --window-glass: color-mix(in srgb, var(--bg-card) 80%, transparent);
  --window-glass-filter: blur(18px) saturate(1.2);
  --champagne-filter: blur(24px) saturate(1.25);
  --window-scrim: rgba(15, 23, 42, 0.45);
  --window-scrim-filter: blur(6px);
  --champagne-glass: linear-gradient(145deg, #fffaf0, #fff 65%);
  --champagne-border: #dcd4c1;
  --champagne-shadow: 0 24px 70px rgba(30, 41, 59, .2);

  --sidebar-width: 240px;
  --sidebar-collapsed: 70px;
  --header-height: 62px;

  --primary: #1e293b;
  --secondary: #3b82f6;
  --accent: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;

  --bg-main: #e6eaf0;
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f5f9;

  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --avatar-fallback-bg: color-mix(in srgb, var(--text-primary) 20%, transparent);

  --border-light: #e2e8f0;
  --border-medium: #cbd5e1;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md:
    0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg:
    0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl:
    0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s ease;
}

/* Dark mode variables */
html.dark {
  --champagne-glass: radial-gradient(ellipse at 30% 0%, rgba(244, 207, 128, .17), transparent 65%), linear-gradient(145deg, rgba(65, 65, 65, .94), rgba(37, 44, 55, .94));
  --champagne-border: rgba(242, 211, 150, .36);
  --champagne-shadow: inset 0 1px 0 rgba(255, 241, 210, .18), 0 24px 70px rgba(0, 0, 0, .42), 0 0 44px rgba(226, 183, 95, .09);
  --bg-main: #0f172a;
  --bg-sidebar: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #334155;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  /* #8b9bb0 keeps 4.5:1 on every dark surface (#64748b was 3.1-3.8:1). */
  --text-muted: #8b9bb0;

  --border-light: #334155;
  --border-medium: #475569;

  --primary: #f1f5f9;

  scrollbar-color: #52627a var(--bg-main);
}

html.dark::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html.dark::-webkit-scrollbar-track {
  background: var(--bg-main);
}

html.dark::-webkit-scrollbar-thumb {
  border: 2px solid var(--bg-main);
  border-radius: 999px;
  background: #52627a;
}

html.dark::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

html.dark::-webkit-scrollbar-corner {
  background: var(--bg-main);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Always show scrollbar to prevent layout shift */
html {
  overflow-y: scroll;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ========================================
   LAYOUT STRUCTURE
======================================== */
.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-body {
  display: flex;
  flex: 1;
  padding-top: var(--header-height);
}

/* ========================================
   TOP HEADER - Full Width
======================================== */
.top-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 1.5rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: none;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-center {
  display: flex;
  justify-content: center;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Header Logo */
/* The gold OTV wordmark on a light background (phone header, sign-in
   window). This is its only definition: change it here and every copy
   follows. No plate behind it; a thin dark outline and a soft shadow keep
   the gold letters readable on white. */
:root:not(.dark) .otv-wordmark-ribbon .otv-wordmark {
  position: relative;
  filter:
    drop-shadow(0 0 0.5px #4a2408)
    drop-shadow(0 0 0.5px #4a2408)
    drop-shadow(0 1px 1.5px rgba(45, 16, 5, .45));
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.otv-brand-word {
  color: var(--text-primary);
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1;
}

/* Mobile Menu Button */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: var(--fs-lg);
  cursor: pointer;
  padding: 0.5rem;
  margin-right: 0.5rem;
}

/* Search is switched off for now on every screen; the bar, its results and
   the code behind them stay. Remove this rule to bring it back. */
.top-header .search-container {
  display: none;
}

/* Search */
.search-container {
  position: relative;
  width: 420px;
  max-width: 100%;
}

.search-input {
  width: 100%;
  padding: 0.625rem 3.5rem 0.625rem 2.5rem;
  background: var(--bg-main);
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  font-size: var(--fs-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.search-shortcut {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.125rem 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: var(--fs-xs);
  color: var(--text-muted);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.search-clear {
  position: absolute;
  right: 0.625rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: var(--bg-hover);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  transition: all 0.15s ease;
}

.search-clear:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

/* Show clear button and hide shortcut when focused */
.search-container:focus-within .search-shortcut {
  opacity: 0;
  pointer-events: none;
}

.search-container:focus-within .search-clear {
  display: flex;
}

/* Header Buttons */
.header-btn {
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  border: 1px solid var(--border-light);
  background: color-mix(in srgb, var(--bg-card) 94%, black);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

html.dark #dark-mode-toggle .fa-sun {
  color: var(--accent);
}

.notification-btn {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: var(--fs-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

/* ========================================
   SIDEBAR
======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-light);
  position: fixed;
  left: 0;
  top: var(--header-height);
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 90;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0;
}

/* Keep the navigation scrollbar visually inside the sidebar in dark mode. */
html.dark .sidebar-nav {
  scrollbar-width: thin;
  scrollbar-color: #52627a var(--bg-sidebar);
}

html.dark .sidebar-nav::-webkit-scrollbar {
  width: 10px;
}

html.dark .sidebar-nav::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}

html.dark .sidebar-nav::-webkit-scrollbar-thumb {
  min-height: 48px;
  border: 2px solid var(--bg-sidebar);
  border-radius: 999px;
  background: #52627a;
}

html.dark .sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

html.dark .sidebar-nav::-webkit-scrollbar-corner {
  background: var(--bg-sidebar);
}

.nav-section {
  padding: 0 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

/* Divider only when a *visible* section follows. The admin section is always in
   the DOM but carries [hidden] until the member is an admin, so :last-child alone
   would leave a dangling line under the last visible section for everyone else. */
.nav-section:has(~ .nav-section:not([hidden])) {
  border-bottom: 1px solid var(--border-light);
}

.nav-section-title {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  font-size: var(--fs-sm);
  font-weight: 500;
  position: relative;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(59, 130, 246, 0.16);
  box-shadow: inset 3px 0 0 var(--secondary);
  color: #1d4ed8;
  font-weight: 700;
}

.nav-item i {
  width: 20px;
  text-align: center;
  font-size: var(--fs-md);
}

.nav-item .badge {
  margin-left: auto;
  background: var(--bg-hover);
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

.nav-item.active .badge {
  background: rgba(59, 130, 246, 0.2);
  color: var(--secondary);
}

/* In dark mode the muted count sat at about 2:1 against its own pill, and the
   pill used the exact colour a row takes on hover, so it disappeared on the way
   past. A translucent fill keeps the pill visible over both backgrounds. */
html.dark .nav-item .badge {
  background: rgba(226, 232, 240, 0.12);
  color: #cbd5e1;
}

html.dark .nav-item:hover .badge {
  background: rgba(226, 232, 240, 0.2);
  color: var(--text-primary);
}

html.dark .nav-item.active .badge {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

/* Category colors */
.nav-item[data-route="reforme"] i {
  color: #6366f1;
}
.nav-item[data-route="economic"] i {
  color: #10b981;
}
.nav-item[data-route="juridic"] i {
  color: #8b5cf6;
}
.nav-item[data-route="legislativ"] i {
  color: #f59e0b;
}
.nav-item[data-route="social"] i {
  color: #f97316;
}
.nav-item[data-route="sanatate"] i {
  color: #ef4444;
}
.nav-item[data-route="energie-resurse"] i {
  color: #06b6d4;
}
.nav-item[data-route="tehnologie"] i {
  color: #3b82f6;
}
.nav-item[data-route="educatie"] i {
  color: #ec4899;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-light);
}

/* Sidebar Chat Button */
.sidebar-chat-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: var(--radius-lg);
  color: white;
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-chat-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sidebar-chat-btn.disabled {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}

.sidebar-chat-btn.disabled:hover {
  transform: none;
  box-shadow: none;
}

.sidebar-chat-btn i {
  font-size: var(--fs-md);
}

.sidebar-chat-btn span:not(.chat-status) {
  flex: 1;
}

.chat-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6b7280;
}

.chat-status.online {
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  animation: pulse-online 2s infinite;
}

@keyframes pulse-online {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.15);
  }
}

.user-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}

.user-card:hover {
  background: var(--border-light);
}

.user-card:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--secondary), #6366f1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--fs-sm);
}

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

.user-name {
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--text-primary);
}

.user-role {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.user-menu-btn {
  color: var(--text-muted);
  font-size: var(--fs-md);
}

/* ========================================
   MAIN CONTENT
======================================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - var(--header-height));
  padding: 0;
  /* Prevent horizontal overflow */
  min-width: 0;
  max-width: calc(100vw - var(--sidebar-width));
  overflow-x: hidden;
  /* Smooth SPA transitions */
  transition: opacity 0.1s ease-out;
}

.content-area {
  flex: 1;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  /* Ensure content doesn't exceed available space */
  min-width: 0;
}

body:has(.measure-page-layout) .main-content,
body:has(.measure-page-layout) .content-area {
  overflow-x: clip;
}

body:has(.measure-page-layout) {
  overflow-x: clip;
}

/* Mobile Sidebar Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 89;
  opacity: 0;
  /* Invisible still sat above the page and ate every tap on mobile. */
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* ========================================
   RESPONSIVE DESIGN
======================================== */
@media (max-width: 1024px) {
  .search-container {
    width: 280px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay {
    display: block;
    top: var(--header-height);
  }

  .main-content {
    margin-left: 0;
    max-width: 100vw;
  }

  .mobile-menu-btn {
    display: flex;
  }

  .top-header {
    grid-template-columns: auto 1fr auto;
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .top-header .logo {
    display: none;
  }

  .header-center {
    flex: 1;
  }

  .search-container {
    width: 100%;
  }

  .search-shortcut {
    display: none;
  }

  /* Same 40px hit target; the glyph was reading as a speck in the circle. */
  .header-btn i {
    font-size: var(--fs-lg);
  }

  .content-area {
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .content-area {
    padding: 0.75rem;
  }
}

/* ========================================
   SITE FOOTER
======================================== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-light);
  padding: 1.5rem 2rem;
  margin-top: auto;
}

.site-footer .footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.site-footer .footer-logo h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.site-footer .footer-logo p {
  font-size: var(--fs-sm);
  color: var(--text-muted);
  margin: 0.25rem 0 0;
}

.site-footer .footer-links {
  display: flex;
  gap: 1.5rem;
}

.site-footer .footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color var(--transition-fast);
}

.site-footer .footer-links a:hover {
  color: var(--secondary);
}

@media (max-width: 768px) {
  .site-footer {
    padding: 1.25rem 1rem;
  }

  .site-footer .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

/* ========================================
   PAGE HEADER
======================================== */
.page-header {
  margin-bottom: 2rem;
}

/* A page title with the round refresh button on its right. */
.page-header-with-refresh { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.page-header-with-refresh .page-title { margin-bottom: 0; }

.page-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.page-title-row .page-title {
  margin-bottom: 0;
}

.page-title-row .meta-badge {
  flex-shrink: 0;
}

.page-description {
  color: var(--text-secondary);
  font-size: var(--fs-md);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
  min-height: 1.5em;
}

/* Home Title Row with Live Badge */
.home-title-row {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.home-title-row .page-title {
  margin-bottom: 0;
  font-size: var(--fs-xl);
}

.home-header .page-description {
  padding-top: 8px;
  padding-bottom: 30px;
  max-width: 42rem;
  font-size: var(--fs-md);
  line-height: 1.55;
}

/* Announcement Banner */
.announcement-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50px;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.announcement-badge {
  padding: 0.3rem 0.6rem;
  background: #ef4444;
  color: white;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.announcement-text {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}

html.dark .announcement-banner {
  background: var(--bg-card);
  border-color: var(--border-light);
}

/* Live Activity Bar */
.live-activity-bar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.85rem 1.5rem;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.25);
  border-radius: 50px;
  margin-top: 2rem;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

html.dark .live-activity-bar {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.2);
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: #dc2626;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.live-dot-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  animation: pulse-live 1.5s infinite;
}

.activity-feed {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  overflow: hidden;
  flex: 1;
}

.activity-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  white-space: nowrap;
}

.activity-item strong {
  color: #3b82f6;
  font-weight: 600;
}

.flag-icon,
.bulb-icon {
  font-size: var(--fs-md);
}

html.dark .live-indicator {
  background: #dc2626;
  color: #fff;
}

html.dark .live-dot-pulse {
  background: #fff;
}

@media (max-width: 900px) {
  .live-activity-bar {
    flex-direction: column;
    border-radius: var(--radius-xl);
    gap: 1rem;
    padding: 1rem;
  }

  .activity-feed {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .activity-item {
    white-space: normal;
  }
}

.live-users-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  background: rgba(42, 157, 143, 0.08);
  border: 1px solid rgba(42, 157, 143, 0.2);
  border-radius: 20px;
  font-size: var(--fs-xs);
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a9d8f;
  box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.25);
  animation: pulse-live 2s infinite;
}

@keyframes pulse-live {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(42, 157, 143, 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(42, 157, 143, 0.15);
  }
}

.live-count {
  font-weight: 700;
  color: #2a9d8f;
}

.live-label {
  font-weight: 600;
  color: #64748b;
  letter-spacing: 0.3px;
}

html.dark .live-users-badge {
  background: rgba(42, 157, 143, 0.15);
  border-color: rgba(42, 157, 143, 0.3);
}

html.dark .live-label {
  color: #94a3b8;
}

@media (max-width: 600px) {
  .home-title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .home-title-row .page-title {
    font-size: var(--fs-xl);
  }

  .live-users-badge {
    font-size: var(--fs-xs);
    padding: 0.35rem 0.7rem;
  }
}

.page-description.fade-out {
  opacity: 0;
  transform: translateY(-5px);
}

.page-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 600;
}

/* ========================================
   FILTER BAR
======================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: nowrap;
  width: 100%;
  min-width: 0;
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.filter-tags-wrapper {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  align-items: center;
  overflow: hidden;
  flex: 1 1 0;
  min-width: 0;
}

.filter-tab {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Ensure "Toate" button is always visible */
.filter-tabs > .filter-tab[data-filter="all"] {
  flex-shrink: 0;
}

.filter-tab:hover {
  background: color-mix(in srgb, var(--secondary) 30%, transparent);
  color: var(--text-primary);
  border-color: transparent;
}

.filter-tab.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

/* Filter More Dropdown */
.filter-more-container {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

.filter-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.filter-more-btn i {
  font-size: var(--fs-xs);
  transition: transform var(--transition-fast);
}

.filter-more-container.open .filter-more-btn i {
  transform: rotate(180deg);
}

.filter-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 180px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  display: none;
  flex-direction: column;
  padding: 0.5rem;
}

.filter-more-container.open .filter-dropdown {
  display: flex;
}

.filter-dropdown-item {
  padding: 0.5rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.filter-dropdown-item:hover {
  background: color-mix(
    in srgb,
    var(--category-color, var(--secondary)) 30%,
    transparent
  );
  color: var(--text-primary);
}

.filter-dropdown-item.active {
  background: var(--secondary);
  color: white;
}

.view-toggle {
  display: flex;
  margin-left: auto;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-btn {
  padding: 0.5rem 0.75rem;
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-btn:hover {
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--secondary);
  color: white;
}

/* ========================================
   MEASURES GRID & CARDS
======================================== */
.measures-grid {
  display: grid;
  /* Default: 3 columns on large screens */
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  width: 100%;
}

/* 
 * Responsive breakpoints accounting for sidebar (260px)
 * Content area = viewport - sidebar - padding (64px)
 * 
 * 3 cols need ~900px content → 1224px viewport (with sidebar)
 * 2 cols need ~600px content → 924px viewport (with sidebar)
 */

/* 2 columns when viewport < 1224px (with sidebar visible) */
@media (max-width: 1223px) {
  .measures-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column when viewport < 924px (with sidebar visible) */
@media (max-width: 923px) {
  .measures-grid {
    grid-template-columns: 1fr;
  }
}

/* On mobile (<768px) sidebar is hidden, so we can use 2 columns again */
@media (max-width: 768px) {
  .measures-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Very narrow mobile: single column */
@media (max-width: 580px) {
  .measures-grid {
    grid-template-columns: 1fr;
  }
}

.measure-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  transition: all var(--transition-normal);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.measure-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--category-color, var(--secondary));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

.measure-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: transparent;
}

.measure-card:hover::before {
  transform: scaleX(1);
}

/* Priority Cards - Dark UI for emphasis */
.measure-card.priority {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  border: none;
  color: white;
}

.measure-card.priority::before {
  height: 4px;
  transform: scaleX(0);
  background: linear-gradient(
    90deg,
    var(--category-color, var(--secondary)),
    rgba(255, 255, 255, 0.3)
  );
}

.measure-card.priority:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(-6px);
}

.measure-card.priority:hover::before {
  transform: scaleX(1);
}

.measure-card.priority .measure-title {
  color: white;
}

.measure-card.priority .measure-description {
  color: rgba(255, 255, 255, 0.8);
}

.measure-card.priority .card-header i {
  color: var(--category-color, #60a5fa) !important;
}

.measure-card.priority .tag {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
}

.measure-card.priority .measure-footer {
  border-top-color: rgba(255, 255, 255, 0.15);
}

.measure-card.priority .impact-badge-card {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);
}

.measure-card.priority .measure-arrow {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.measure-card.priority:hover .measure-arrow {
  background: white;
  color: #1e293b;
}

.measure-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.measure-category {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: rgba(59, 130, 246, 0.1);
  color: var(--category-color, var(--secondary));
}

/* Category-specific colors */
.measure-category.economic {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.measure-category.juridic {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}
.measure-category.legislativ {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.measure-category.social {
  background: rgba(249, 115, 22, 0.1);
  color: #f97316;
}
.measure-category.sanatate {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.measure-category.energie-resurse {
  background: rgba(6, 182, 212, 0.1);
  color: #06b6d4;
}
.measure-category.tehnologie {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.measure-title {
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.measure-description {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.measure-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.measure-meta {
  display: flex;
  gap: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

.meta-item i {
  font-size: var(--fs-xs);
}

.measure-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.measure-card:hover .measure-arrow {
  background: var(--category-color, var(--secondary));
  color: white;
  transform: translateX(4px);
}

/* Card Header (icon + title) */
.measure-card .card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.measure-card .card-header i {
  font-size: var(--fs-lg);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.measure-card .card-header .measure-title {
  margin: 0;
  position: relative;
  top: -2px;
}

/* Card Tags */
.card-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.tag {
  background: var(--bg-hover);
  color: var(--text-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
  font-weight: 500;
}

/* Card badges */
.card-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Impact Badge for Cards */
.impact-badge-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 28px;
  padding: 0 0.6rem;
  border-radius: 9999px;
  font-weight: 600;
  font-size: var(--fs-xs);
  transition: all 0.3s ease;
}

.impact-badge-card i {
  font-size: var(--fs-xs);
}

.impact-badge-card.impact-moderat {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.impact-badge-card.impact-mediu {
  background: rgba(243, 156, 18, 0.15);
  color: #d68910;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.impact-badge-card.impact-major {
  background: rgba(46, 204, 113, 0.15);
  color: #1e8449;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

/* Dark mode card styles */
html.dark .tag {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

html.dark .impact-badge-card.impact-moderat {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.4);
}

html.dark .impact-badge-card.impact-mediu {
  background: rgba(243, 156, 18, 0.2);
  color: #f5b041;
  border-color: rgba(243, 156, 18, 0.4);
}

html.dark .impact-badge-card.impact-major {
  background: rgba(46, 204, 113, 0.2);
  color: #58d68d;
  border-color: rgba(46, 204, 113, 0.4);
}

/* Dark mode for filter dropdown */
html.dark .filter-dropdown {
  background: var(--bg-card);
  border-color: var(--border-light);
}

html.dark .filter-dropdown-item:hover {
  background: var(--bg-hover);
}

/* ========================================
   CATEGORY CARDS GRID (Homepage)
======================================== */
.category-cards-grid {
  display: grid;
  /* Default: 3 columns on large screens */
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
  width: 100%;
}

/* 2 columns when viewport < 1224px (with sidebar visible) */
@media (max-width: 1223px) {
  .category-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column when viewport < 924px (with sidebar visible) */
@media (max-width: 923px) {
  .category-cards-grid {
    grid-template-columns: 1fr;
  }

}

/* On mobile (<768px) sidebar is hidden, so we can use 2 columns again */
@media (max-width: 768px) {
  .category-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

}

/* Very narrow mobile: single column */
@media (max-width: 580px) {
  .category-cards-grid {
    grid-template-columns: 1fr;
  }

}

.category-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  min-height: 214px;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  cursor: pointer;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.category-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.category-card-header i {
  font-size: var(--fs-xl);
  width: 28px;
  text-align: center;
}

.category-card-header h3 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.category-card-description {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin: 0 0 1.25rem 0;
  flex-grow: 1;
}

.category-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.category-count {
  background: var(--surface-muted, rgba(0, 0, 0, 0.06));
  color: var(--text-muted);
  padding: 0.35rem 0.75rem;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 600;
  border: 1px solid var(--border-light);
}

.category-card-footer i {
  color: var(--text-muted);
  transition:
    transform 0.2s ease,
    color 0.2s ease;
}

.category-card:hover .category-card-footer i {
  transform: translateX(4px);
  color: var(--secondary);
}

/* Category icon colors */
.category-card[data-category="economic"] .category-card-header i {
  color: #10b981;
}
.category-card[data-category="juridic"] .category-card-header i {
  color: #8b5cf6;
}
.category-card[data-category="legislativ"] .category-card-header i {
  color: #f59e0b;
}
.category-card[data-category="social"] .category-card-header i {
  color: #f97316;
}
.category-card[data-category="sanatate"] .category-card-header i {
  color: #ef4444;
}
.category-card[data-category="energie-resurse"] .category-card-header i {
  color: #06b6d4;
}
.category-card[data-category="tehnologie"] .category-card-header i {
  color: #3b82f6;
}

.nova-live-section { margin: calc(3rem - 20px) 0 1rem; }
.nova-live-badge { color: #64748b; background: #e2e8f0; }
.nova-live-badge i { font-size: .55rem; }
.nova-live-badge.is-live { color: #dc2626; background: rgba(239,68,68,.1); }
.nova-live-badge.is-upcoming { color: #2563eb; background: rgba(59,130,246,.1); }
.nova-live-badge.is-archive { color: #7c3aed; background: rgba(139,92,246,.1); }
.nova-live-badge.is-offline { color: #b45309; background: rgba(245,158,11,.12); }
.nova-live-panel { height: auto; display: grid; grid-template-columns: minmax(0,1.15fr) minmax(300px,.85fr); align-items: stretch; overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.nova-live-player { position: relative; width: 100%; aspect-ratio: 16 / 9; height: auto; min-height: 0; display: grid; place-items: center; overflow: hidden; background: #111827; }
.nova-live-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nova-live-player.is-floating { position: fixed; right: 24px; bottom: 24px; width: min(256px, calc(100vw - 24px)); height: auto; aspect-ratio: auto; display: block; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; background: #0f172a; box-shadow: 0 18px 48px rgba(15,23,42,.38); z-index: 180; }
.nova-floating-player-media { position: relative; width: 100%; height: 200px; overflow: hidden; background: #000; }
.nova-live-player .nova-floating-player-media > iframe { top: 0; left: 0; display: block; }
.nova-floating-player-bar { display: flex; align-items: center; width: 100%; height: 34px; padding: 0 3px; background: #0f172a; color: #fff; }
.nova-floating-player-grip { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; align-self: stretch; padding: 0 6px; border: 0; border-radius: 4px; background: transparent; color: inherit; cursor: grab; touch-action: none; user-select: none; text-align: left; }
.nova-floating-player-grip:active { cursor: grabbing; }
.nova-floating-player-grip i { color: #94a3b8; }
.nova-floating-player-title { overflow: hidden; font-size: var(--fs-xs); font-weight: 600; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.nova-floating-player-actions { display: flex; align-items: center; gap: .15rem; }
.nova-floating-player-actions button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #cbd5e1; cursor: pointer; }
.nova-floating-player-actions button:hover { background: #1e293b; color: #fff; }
.nova-floating-player-bar button:focus-visible { outline: 2px solid #60a5fa; outline-offset: -2px; }
.nova-live-placeholder { display: grid; justify-items: center; gap: .75rem; padding: 2rem; color: #cbd5e1; text-align: center; }
.nova-live-placeholder i { color: #ef4444; font-size: var(--fs-xl); }
.nova-live-content { height: 100%; display: flex; flex-direction: column; justify-content: flex-start; overflow: hidden; padding: 1rem 1.25rem; }
.nova-live-content h3 { display: -webkit-box; margin: .45rem 0; overflow: hidden; color: var(--text-primary); font-size: var(--fs-lg); line-height: 1.3; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.nova-live-content p { display: -webkit-box; margin: 0 0 .55rem; overflow: hidden; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.nova-live-meta { flex-wrap: wrap; }
.nova-live-content .nova-live-meta { margin-bottom: 0; }

@keyframes nova-live-spin { to { transform: rotate(360deg); } }

html.dark .nova-live-panel { background: var(--bg-card); }

/* ========================================
   NOVA 30 — HOMEPAGE CIVIC VIDEO BRIDGE
======================================== */
.nova30-section { container: nova30 / inline-size; margin: 2rem 0 2rem; }
.nova30-panel { min-width: 0; display: grid; grid-template-columns: 160px minmax(330px, 1fr) minmax(220px, .62fr) minmax(250px, .72fr); align-items: stretch; overflow: hidden; border: 1px solid var(--border-light); border-radius: 7px; background: var(--bg-card); color: var(--text-primary); }
.nova30-featured-media { position: relative; min-height: 198px; overflow: hidden; background: #111827; color: #fff; }
.nova30-featured-media::after { content: ''; position: absolute; inset: auto 0 0; height: 42%; background: rgba(15, 23, 42, .48); pointer-events: none; }
.nova30-featured-media img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; transition: transform .22s ease; }
.nova30-featured-media:hover img { transform: scale(1.025); }
.nova30-play { position: absolute; z-index: 2; top: 50%; left: 50%; width: 42px; height: 42px; display: grid; place-items: center; transform: translate(-50%, -50%); border-radius: 50%; background: rgba(15, 23, 42, .82); color: #fff; font-size: var(--fs-xs); }
.nova30-featured-media time { position: absolute; z-index: 2; right: .55rem; bottom: .5rem; padding: .18rem .38rem; border-radius: 3px; background: rgba(15, 23, 42, .88); color: #fff; font-size: var(--fs-xs); font-weight: 800; }

.nova30-featured-copy { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .55rem; padding: 1rem 1.1rem; }
.nova30-brand-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem .75rem; }
.nova30-brand-line h2 { margin: 0; color: var(--text-primary); font-family: "Poppins", sans-serif; font-size: var(--fs-md); line-height: 1.25; }
.nova30-brand-line h2 span { color: var(--text-secondary); font-weight: 700; }
.nova30-question-label { flex: 0 0 auto; padding: .16rem .36rem; border-radius: 3px; background: #dbeafe; color: #1d4ed8; font-size: .56rem; font-weight: 850; letter-spacing: .035em; }
.nova30-featured-copy h3 { margin: 0; color: var(--text-primary); font-size: var(--fs-sm); line-height: 1.35; }
.nova30-speaker { display: flex; flex-wrap: wrap; align-items: center; gap: .28rem; margin: 0; color: var(--text-muted); font-size: var(--fs-xs); }
.nova30-speaker i { color: #2563eb; }
.nova30-speaker strong { color: #2563eb; }
.nova30-featured-copy blockquote { margin: 0; padding: 0 0 0 .65rem; border-left: 2px solid #cbd5e1; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.45; }
.nova30-reform-link { align-self: flex-start; display: inline-flex; align-items: center; gap: .35rem; margin-top: 0; color: #2563eb; font-size: var(--fs-xs); font-weight: 750; text-decoration: none; }
.nova30-reform-link:hover { text-decoration: underline; }

.nova30-actions { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: .55rem; padding: .85rem; border-left: 1px solid var(--border-light); }
.nova30-record,
.nova30-view-all { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: .42rem; padding: .5rem .75rem; border-radius: 6px; font-size: var(--fs-xs); font-weight: 800; line-height: 1.25; text-align: center; text-decoration: none; }
.nova30-record { border: 1px solid #2563eb; background: #2563eb; color: #fff; }
.nova30-record:hover { border-color: #1d4ed8; background: #1d4ed8; }
.nova30-view-all { border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text-secondary); }
.nova30-view-all:hover { border-color: #93c5fd; color: #2563eb; }
.nova30-record:focus-visible,
.nova30-view-all:focus-visible,
.nova30-featured-media:focus-visible,
.nova30-upcoming-item:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: -3px; }
.nova30-actions p { margin: 0; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.4; text-align: center; }

.nova30-upcoming { min-width: 0; padding: .85rem; border-left: 1px solid var(--border-light); }
.nova30-upcoming > h3 { margin: 0 0 .55rem; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.35; }
.nova30-upcoming > h3 span { color: var(--text-muted); font-weight: 600; }
.nova30-upcoming-item { min-width: 0; display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: .6rem; align-items: center; padding: .48rem 0; border-top: 1px solid var(--border-light); color: var(--text-primary); text-decoration: none; }
.nova30-upcoming-item:first-of-type { border-top: 0; }
.nova30-upcoming-item:hover .nova30-upcoming-copy > span { color: #2563eb; }
.nova30-upcoming-media { position: relative; width: 60px; height: 54px; overflow: hidden; border-radius: 5px; background: #111827; }
.nova30-upcoming-media img { width: 100%; height: 100%; display: block; object-fit: cover; }
.nova30-upcoming-media time { position: absolute; right: .25rem; bottom: .22rem; padding: .1rem .22rem; border-radius: 2px; background: rgba(15, 23, 42, .86); color: #fff; font-size: .48rem; font-weight: 800; }
.nova30-upcoming-copy { min-width: 0; display: grid; gap: .18rem; }
.nova30-upcoming-copy strong { overflow: hidden; font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.nova30-upcoming-copy strong small { color: var(--text-muted); font-size: inherit; font-weight: 600; }
.nova30-upcoming-copy > span { display: -webkit-box; overflow: hidden; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.35; transition: color .16s ease; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.nova30-upcoming-copy b { color: var(--text-primary); }

/* The panel is built for a featured clip plus a queue. Before anyone has
   recorded, and while the queue is still short, it has to hold its shape with
   fewer columns rather than leaving gaps. Specificity here intentionally beats
   the container queries below, which only tune the fully populated layout. */
.nova30-section .nova30-panel:not(.is-empty):not(:has(.nova30-upcoming)) { grid-template-columns: 160px minmax(0, 1fr) minmax(250px, .72fr); }
.nova30-section .nova30-panel.is-empty { grid-template-columns: minmax(0, 1fr) minmax(250px, .72fr); }

@container nova30 (max-width: 680px) {
  .nova30-section .nova30-panel:not(.is-empty):not(:has(.nova30-upcoming)) { grid-template-columns: 118px minmax(0, 1fr); }
  .nova30-section .nova30-panel.is-empty { grid-template-columns: minmax(0, 1fr); }
}

.nova30-empty-note { margin: 0; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.45; }

.nova30-featured-fallback,
.nova30-upcoming-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: rgba(255, 255, 255, .45);
}

.nova30-featured-fallback { font-size: var(--fs-lg); }
.nova30-upcoming-fallback { font-size: var(--fs-xs); }

html.dark .nova30-question-label { background: rgba(37, 99, 235, .2); color: #93c5fd; }
html.dark .nova30-featured-copy blockquote { border-left-color: #475569; }

@container nova30 (max-width: 1050px) {
  .nova30-panel { grid-template-columns: 150px minmax(0, 1fr) 220px; }
  .nova30-upcoming { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(170px, .65fr) repeat(2, minmax(0, 1fr)); gap: .7rem; align-items: center; border-top: 1px solid var(--border-light); border-left: 0; }
  .nova30-upcoming > h3 { margin: 0; }
  .nova30-upcoming-item { border-top: 0; border-left: 1px solid var(--border-light); padding: 0 0 0 .7rem; }
}

@container nova30 (max-width: 680px) {
  .nova30-panel { grid-template-columns: 118px minmax(0, 1fr); }
  .nova30-featured-media { min-height: 178px; }
  .nova30-featured-copy { padding: .75rem; }
  .nova30-brand-line h2 { font-size: var(--fs-sm); }
  .nova30-featured-copy blockquote,
  .nova30-reform-link { display: none; }
  .nova30-actions { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); align-items: center; border-top: 1px solid var(--border-light); border-left: 0; }
  .nova30-actions p { grid-column: 1 / -1; }
  .nova30-upcoming { grid-template-columns: 1fr 1fr; }
  .nova30-upcoming > h3 { grid-column: 1 / -1; }
  .nova30-upcoming-item { border-left: 0; }
  .nova30-upcoming-item + .nova30-upcoming-item { border-left: 1px solid var(--border-light); }
}

@container nova30 (max-width: 470px) {
  .nova30-actions { grid-template-columns: 1fr; }
  .nova30-actions p { grid-column: auto; }
  .nova30-upcoming { grid-template-columns: 1fr; }
  .nova30-upcoming-item + .nova30-upcoming-item { border-top: 1px solid var(--border-light); border-left: 0; }
}

@media (max-width: 760px) {
  .nova-live-panel { grid-template-columns: 1fr; }
  .nova-live-content { height: auto; padding: 1.25rem; }
}

/* ========================================
   PAGINATION
======================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.pagination button {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pagination button:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.pagination button.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button:disabled:hover {
  border-color: var(--border-light);
  color: var(--text-secondary);
}

/* Priority & Regular Sections */
.priority-section {
  margin-bottom: 2rem;
}

.regular-section {
  margin-top: 3rem;
}

.priority-section .section-subtitle,
.regular-section .section-subtitle {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.priority-section .section-subtitle i,
.regular-section .section-subtitle i {
  font-size: var(--fs-md);
}

/* ========================================
   EMPTY & LOADING STATES
======================================== */
.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: var(--fs-lg);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.loading-state {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 3rem;
  grid-column: 1 / -1;
}

.loading-spinner.is-small { width: 16px; height: 16px; border-width: 2px; vertical-align: middle; }

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-light);
  border-top-color: var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* The one loading indicator used across the site. A whole page waiting on its
   data centres it in the window, as on Știri; inside a card it sits tighter. */
.content-area > .loading-state,
.community-profile-skeleton > .loading-state,
.otv-detail-body > .loading-state {
  min-height: calc(100vh - var(--header-height, 62px) - 12rem);
}
.loading-state.is-compact,
.nova-square-card .loading-state,
.otv-comments > .loading-state,
.discussion-thread-list > .loading-state {
  padding: 1.5rem;
}
.nova-square-leader-loading { list-style: none; }

/* ========================================
   SEARCH RESULTS DROPDOWN
======================================== */
.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 100;
}

.search-results.active {
  display: block;
}

.search-result-item {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background var(--transition-fast);
  text-decoration: none;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover {
  background: var(--bg-hover);
}

.search-result-item i {
  font-size: var(--fs-md);
  color: var(--text-muted);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.search-result-item > div {
  flex: 1;
  min-width: 0;
}

.search-result-title {
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-category {
  font-size: var(--fs-xs);
  color: var(--secondary);
  font-weight: 500;
  text-transform: capitalize;
}

.search-no-results {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

/* ========================================
   INFO SECTION (Homepage)
======================================== */
.info-section {
  margin: 4rem 0 3rem;
}

.info-grid {
  display: grid;
  /* Default: 3 columns on large screens */
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  width: 100%;
}

/* 2 columns when viewport < 1224px (with sidebar visible) */
@media (max-width: 1223px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column when viewport < 924px (with sidebar visible) */
@media (max-width: 923px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

/* On mobile (<768px) sidebar is hidden, can use 2 columns */
@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Very narrow mobile: single column */
@media (max-width: 580px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
}

.info-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  text-align: center;
  border: 3px dashed var(--text-muted);
}

.info-card i {
  font-size: var(--fs-xl);
  color: var(--secondary);
  margin-bottom: 1rem;
}

.info-card h3 {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.info-card p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin: 0;
}

/* ========================================
   HOME PAGE SECTIONS
======================================== */
.home-section {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-description {
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: 1.6;
  max-width: 600px;
  margin: 0.5rem auto 0;
}

/* Manifesto Container */
.manifesto-container {
  margin: 2rem auto 2.5rem;
  max-width: 850px;
  padding: 0 1rem;
}

.manifesto-accent-line {
  height: 4px;
  background: #3498db;
  background-image: linear-gradient(to right, #3498db, #e74c3c, #3498db);
}

.manifesto-text {
  margin: 0;
  padding: 2rem 3rem;
  font-size: var(--fs-lg);
  line-height: 1.8;
  color: #2c3e50;
  text-align: center;
  font-weight: 500;
  font-style: italic;
  background-color: #fff;
  border: none;
  border-left: 4px solid #3498db;
  border-right: 4px solid #3498db;
  position: relative;
}

.manifesto-quote-mark {
  position: absolute;
  font-family: Georgia, serif;
  font-size: 4rem;
  font-weight: bold;
  color: #3498db;
  opacity: 0.25;
  line-height: 1;
}

.manifesto-quote-mark:first-of-type {
  top: 0.5rem;
  left: 1rem;
}

.manifesto-quote-mark.closing {
  bottom: 0.5rem;
  right: 1rem;
}

.manifesto-text .text-highlight {
  color: #fff !important;
  font-weight: 600 !important;
  font-style: normal !important;
  background: #3498db !important;
  padding: 2px 10px !important;
  border-radius: 4px !important;
  text-decoration: none !important;
  border-bottom: none !important;
  /* Keep the pill padding and rounding on each line when it wraps on phones. */
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* Dark mode manifesto */
html.dark .manifesto-accent-line {
  background-image: linear-gradient(to right, #5dade2, #e74c3c, #5dade2);
}

html.dark .manifesto-text {
  color: #f1f5f9;
  background-color: #1e293b;
  border-left-color: #5dade2;
  border-right-color: #5dade2;
}

html.dark .manifesto-quote-mark {
  color: #5dade2;
}

html.dark .manifesto-text .text-highlight {
  background: #5dade2 !important;
  color: #fff !important;
}

@media (max-width: 768px) {
  .manifesto-container {
    margin: 1.5rem 0.5rem 2rem;
  }

  .manifesto-text {
    font-size: var(--fs-md);
    padding: 1.5rem 2rem;
  }

  .manifesto-quote-mark {
    font-size: 3rem;
  }

  .manifesto-quote-mark:first-of-type {
    top: 0.25rem;
    left: 0.5rem;
  }

  .manifesto-quote-mark.closing {
    bottom: 0.25rem;
    right: 0.5rem;
  }
}

/* ========================================
   ABOUT SECTION (Homepage)
======================================== */
.about-section {
  margin: 3rem 0;
  padding: 1rem 0;
  text-align: center;
}

.about-section .section-title {
  font-size: var(--fs-xl);
  margin-bottom: 1.5rem;
}

.about-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.about-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 2rem;
  border: 1px solid var(--border-light);
  max-width: 760px;
  margin: 0 auto;
}

.about-content p {
  font-size: var(--fs-md);
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0;
}

.text-highlight {
  color: var(--secondary);
  font-weight: 600;
}

/* ========================================
   PARTICIPATION SECTION (Homepage)
======================================== */
.participation-section {
  margin-top: 3rem;
  padding-top: 1rem;
}

.participation-section .section-header {
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.participation-section .section-title {
  margin: 0;
  width: 100%;
  text-align: center;
}

.participation-section .section-subtitle {
  margin: 0;
  max-width: 36rem;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: 1.5;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.section-link {
  color: var(--secondary);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  /* Plain text with its arrow, no pill around it. */
  padding: 0;
  border: 0;
  background: none;
  transition: color var(--transition-fast);
}

.section-link:hover {
  color: var(--secondary);
  text-decoration: underline;
}

.section-link i {
  font-size: var(--fs-xs);
  transition: transform var(--transition-fast);
}

.section-link:hover i {
  transform: translateX(3px);
}

.participation-grid {
  display: grid;
  /* Default: 3 columns on large screens */
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  width: 100%;
}

/* 2 columns when viewport < 1224px (with sidebar visible) */
@media (max-width: 1223px) {
  .participation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 1 column when viewport < 924px (with sidebar visible) */
@media (max-width: 923px) {
  .participation-grid {
    grid-template-columns: 1fr;
  }
}

/* On mobile (<768px) sidebar is hidden, can use 2 columns */
@media (max-width: 768px) {
  .participation-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Very narrow mobile: single column */
@media (max-width: 580px) {
  .participation-grid {
    grid-template-columns: 1fr;
  }
}

.participation-card {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  padding: 1.5rem;
  text-align: center;
  cursor: default;
  transition: none;
  text-decoration: none;
}

.participation-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-lg);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
}

.participation-icon.vote {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
}
.participation-icon.discuss {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.participation-card h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.participation-card p {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}
.participation-icon.propose {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}
.participation-icon.share {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
  color: white;
}

.participation-title {
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.participation-description {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========================================
   NEWSLETTER SECTION (Homepage)
======================================== */
.newsletter-section {
  margin: 3rem 0 2rem;
  background: linear-gradient(135deg, #dc4a4a 0%, #c73e3e 100%);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
}

.newsletter-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: white;
  margin: 0 0 1rem 0;
}

.newsletter-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--fs-md);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-content {
  max-width: 600px;
  margin: 0 auto;
}

.newsletter-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
}

.newsletter-description {
  color: rgba(255, 255, 255, 0.9);
  font-size: var(--fs-md);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.newsletter-form {
  max-width: 500px;
  margin: 0 auto 1rem;
}

.newsletter-input-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.newsletter-input {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  padding: 0.875rem 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.95);
  font-size: var(--fs-md);
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.newsletter-input:focus {
  outline: none;
  border-color: white;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.2);
}

.newsletter-input::placeholder {
  color: #94a3b8;
}

.newsletter-btn {
  padding: 0.875rem 1.75rem;
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50px;
  color: white;
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.newsletter-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
  transform: translateY(-2px);
}

.newsletter-note {
  color: rgba(255, 255, 255, 0.7);
  font-size: var(--fs-sm);
  margin: 0;
}

/* ========================================
   NEW NEWSLETTER SECTION (Teal Gradient)
======================================== */
.newsletter-section-new {
  /* Same 1060px column as the page content above it. */
  width: min(1060px, 100% - 4rem);
  margin: 2rem auto 0;
  padding: 0;
}

.newsletter-container {
  background: linear-gradient(135deg, #e8f5f3 0%, #d4ede8 50%, #c5e8e2 100%);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.newsletter-title-new {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 0.25rem 0;
}

.newsletter-content-new {
  flex: 1;
  text-align: left;
}

.newsletter-description-new {
  color: #64748b;
  font-size: var(--fs-sm);
  line-height: 1.5;
  margin: 0;
}

.newsletter-form-new {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-shrink: 0;
}

.newsletter-input-wrapper {
  position: relative;
  min-width: 240px;
}

.newsletter-input-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: var(--fs-sm);
}

.newsletter-input-new {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: none;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.95);
  font-size: var(--fs-sm);
  color: #1e293b;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.newsletter-input-new:focus {
  outline: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.newsletter-input-new::placeholder {
  color: #94a3b8;
}

.newsletter-btn-new {
  padding: 0.75rem 1.5rem;
  background: #1f7a6f;
  border: none;
  border-radius: 50px;
  color: white;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.newsletter-btn-new:hover {
  background: #1a6b61;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(42, 157, 143, 0.3);
}

/* Dark mode for new newsletter */
html.dark .newsletter-container {
  background: linear-gradient(135deg, #1a3a36 0%, #1e4440 50%, #224a45 100%);
}

html.dark .newsletter-title-new {
  color: #f1f5f9;
}

html.dark .newsletter-description-new {
  color: #94a3b8;
}

html.dark .newsletter-input-new {
  background: rgba(255, 255, 255, 0.1);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

html.dark .newsletter-input-new::placeholder {
  color: #64748b;
}

html.dark .newsletter-input-wrapper i {
  color: #64748b;
}

/* ========================================
   NEW SITE FOOTER
======================================== */
.site-footer-new {
  background: #f8fafc;
  margin-top: 0;
  padding: 0;
  border-top: none;
}

.site-footer-simple {
  background: #f8fafc;
  margin-top: auto;
  padding: 0;
  border-top: 1px solid var(--border-light);
}

html.dark .site-footer-simple {
  background: #0f172a;
  border-top-color: #334155;
}

.footer-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.7fr);
  gap: 3rem;
}

.footer-brand {
  max-width: 380px;
}

.footer-logo-new {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.footer-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(
    to right,
    #5483e0 0%,
    #5483e0 33.33%,
    #fcd116 33.33%,
    #fcd116 66.66%,
    #ef5f6f 66.66%,
    #ef5f6f 100%
  );
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--fs-lg);
  font-weight: 700;
  box-shadow: var(--shadow-md);
  text-shadow:
    0 0 1px rgba(0, 0, 0, 0.4),
    0 1px 2px rgba(0, 0, 0, 0.3);
}

.footer-logo-text {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #1e293b;
}

.footer-description {
  color: #64748b;
  font-size: var(--fs-sm);
  line-height: 1.7;
  margin: 0 0 1.25rem 0;
}

.footer-social {
  display: flex;
  gap: 0.75rem;
}

.social-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #e2e8f0;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-icon:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  transform: translateY(-2px);
}

.footer-links-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-column h4 {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.5px;
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
}

.footer-links-column a {
  color: #475569;
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color 0.2s ease;
}

.footer-links-column a:hover {
  color: #3b82f6;
}

.footer-bottom {
  /* 1060px of content plus its 2rem padding: lines up with the page column. */
  max-width: calc(1060px + 4rem);
  margin: 0 auto;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #e2e8f0;
}

/* Only the homepage footer stacks the newsletter above the fine print; the
   simple footer starts with .footer-bottom and needs no gap above its rule. */
.newsletter-section-new + .footer-bottom {
  margin-top: 2rem;
}

.footer-bottom p {
  margin: 0;
  color: #94a3b8;
  font-size: var(--fs-sm);
}

@media (max-width: 1100px) {
  .footer-independence {
    display: block;
  }
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  justify-content: flex-end;
  white-space: nowrap;
}

.footer-contact-link {
  color: #64748b;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer-contact-link:hover,
.footer-contact-link:focus-visible {
  color: var(--secondary, #2563eb);
  text-decoration: underline;
}

.server-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--fs-xs);
  color: #94a3b8;
  letter-spacing: 0.3px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}

.status-text {
  color: #10b981;
  font-weight: 600;
}

/* Dark mode for new footer */
html.dark .site-footer-new {
  background: #0f172a;
}

html.dark .footer-logo-text {
  color: #f1f5f9;
}

html.dark .footer-description {
  color: #94a3b8;
}

html.dark .social-icon {
  background: #1e293b;
  border-color: #334155;
  color: #94a3b8;
}

html.dark .social-icon:hover {
  border-color: #3b82f6;
  color: #3b82f6;
}

html.dark .footer-links-column h4 {
  color: #64748b;
}

html.dark .footer-links-column a {
  color: #94a3b8;
}

html.dark .footer-links-column a:hover {
  color: #3b82f6;
}

html.dark .footer-bottom {
  border-top-color: #334155;
}

html.dark .footer-bottom p {
  color: var(--text-muted);
}

html.dark .footer-contact-link {
  color: #94a3b8;
}

html.dark .server-status {
  color: #64748b;
}

/* Responsive for new newsletter & footer */
@media (max-width: 900px) {
  .footer-container {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

  .footer-brand {
    grid-column: auto;
    max-width: 100%;
  }
}

@media (max-width: 900px) {
  .newsletter-container {
    flex-direction: column;
    text-align: center;
    padding: 1.25rem 1.5rem;
    gap: 0.75rem;
  }

  .newsletter-content-new {
    text-align: center;
  }

  .newsletter-title-new {
    font-size: var(--fs-md);
    margin-bottom: 0.15rem;
  }

  .newsletter-description-new {
    font-size: var(--fs-xs);
  }

  .newsletter-form-new {
    width: 100%;
    max-width: 360px;
  }
}

@media (max-width: 480px) {
  .newsletter-section-new {
    width: auto;
    margin: 1.5rem 0.75rem 0;
  }

  .newsletter-container {
    border-radius: 12px;
    padding: 1rem;
  }

  /* Field and button stay on one line; the field takes the free width. */
  .newsletter-form-new {
    max-width: 100%;
    gap: 0.5rem;
  }

  .newsletter-input-wrapper {
    flex: 1;
    min-width: 0;
  }

  .newsletter-btn-new {
    flex: none;
    padding: 0.75rem 1.1rem;
  }
}

@media (max-width: 600px) {
  .footer-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
    padding: 1.25rem 1.5rem;
  }

  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }
}

/* ========================================
   QUICK PULSE VOTING SECTION
======================================== */
.quick-pulse-section {
  margin: 3rem 0;
}

.quick-pulse-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.quick-pulse-section .section-header > div {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  margin: 0;
}

.pulse-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.pulse-cards-grid.voteaza-grid {
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* Multi-option consultations need room for their answer buttons and legend. */
.pulse-card-wide {
  grid-column: span 2;
}

.pulse-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  transition: all var(--transition-normal);
}

.voteaza-grid .pulse-card:has(> .pulse-buttons > .pulse-btn:is(.selected, .is-selected))::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 5px solid color-mix(in srgb, var(--pulse-vote-color, var(--secondary)) 50%, var(--bg-card));
  border-radius: calc(var(--radius-xl) - 4px);
  pointer-events: none;
}

.voteaza-grid .pulse-card:has(> .pulse-buttons > .pulse-yes.selected) { --pulse-vote-color: var(--success); }
.voteaza-grid .pulse-card:has(> .pulse-buttons > .pulse-no.selected) { --pulse-vote-color: var(--danger); }

.pulse-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pulse-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
}

.pulse-ended-badge {
  background: var(--border-light);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pulse-card.ended {
  /* Only the disabled answer buttons fade; the question, results and dates
     must stay readable (fading the whole card dropped them below 4.5:1). */
  opacity: 1;
}

.pulse-card.ended .pulse-btn {
  pointer-events: none;
  opacity: 0.5;
}

.ended-polls {
  opacity: 1;
}

.pulse-category {
  display: inline-flex;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.pulse-category.healthcare {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.pulse-category.education {
  background: rgba(59, 130, 246, 0.1);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.pulse-category.tech {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-category.economic {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.pulse-category.juridic {
  background: rgba(139, 92, 246, 0.1);
  color: #7c3aed;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.pulse-category.energy {
  background: rgba(6, 182, 212, 0.1);
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.pulse-category.transport {
  background: rgba(236, 72, 153, 0.1);
  color: #db2777;
  border: 1px solid rgba(236, 72, 153, 0.2);
}

.pulse-category.agriculture {
  background: rgba(132, 204, 22, 0.1);
  color: #65a30d;
  border: 1px solid rgba(132, 204, 22, 0.2);
}

.pulse-category.social {
  background: rgba(249, 115, 22, 0.1);
  color: #ea580c;
  border: 1px solid rgba(249, 115, 22, 0.2);
}

.pulse-category.otv {
  background: rgba(245, 158, 11, 0.1);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.24);
}

.pulse-question {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
  flex: 1;
}

/* A long question stops after three lines rather than stretching the card. */
.pulse-card .pulse-question {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.pulse-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: auto;
}

.pulse-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: none;
}

.pulse-btn.pulse-yes {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pulse-btn.pulse-yes:hover {
  background: #10b981;
  color: white;
  border-color: #10b981;
  transform: translateY(-2px);
}

.pulse-btn.pulse-no {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.pulse-btn.pulse-no:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: translateY(-2px);
}

.pulse-btn.voted {
  opacity: 0.6;
  cursor: default;
  transform: none !important;
  box-shadow: none !important;
}

.pulse-btn.voted.selected {
  opacity: 1;
}

.pulse-btn.pulse-yes.voted.selected {
  background: #10b981;
  color: white;
  border-color: #10b981;
}

.pulse-btn.pulse-no.voted.selected {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

.otv-pulse-buttons {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.pulse-btn.otv-pulse-option {
  background: color-mix(in srgb, var(--option-color) 10%, transparent);
  color: var(--option-color);
  border: 1px solid color-mix(in srgb, var(--option-color) 24%, transparent);
}

.pulse-btn.otv-pulse-option:not(:disabled):hover,
.pulse-btn.otv-pulse-option.is-selected {
  background: var(--option-color);
  color: #fff;
  border-color: var(--option-color);
  transform: translateY(-2px);
}

.otv-pulse-option.option-0,
.otv-pulse-bar-segment.option-0 { --option-color: #16a34a; }
.otv-pulse-option.option-1,
.otv-pulse-bar-segment.option-1 { --option-color: #ef4444; }
.otv-pulse-option.option-2,
.otv-pulse-bar-segment.option-2 { --option-color: #2563eb; }
.otv-pulse-option.option-3,
.otv-pulse-bar-segment.option-3 { --option-color: #9333ea; }
.otv-pulse-option.option-4,
.otv-pulse-bar-segment.option-4 { --option-color: #d97706; }
.otv-pulse-option.option-5,
.otv-pulse-bar-segment.option-5 { --option-color: #0891b2; }

.otv-pulse-description {
  margin: -0.4rem 0 0;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.otv-pulse-bar-segment {
  height: 100%;
  background: var(--option-color);
  transition: width 0.5s ease;
}

/* Pulse Results Bar */
.pulse-results {
  margin-top: 5px;
  padding-top: 0;
  border-top: 0;
}

/* Each answer carries its own share; the bar below is a thin summary. */
.pulse-btn-pct {
  font-weight: 700;
}

.pulse-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--bg-hover);
}

.pulse-bar-support {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  height: 100%;
  transition: width 0.5s ease;
}

.pulse-bar-oppose {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  height: 100%;
  transition: width 0.5s ease;
}

.pulse-vote-count {
  margin-inline-start: auto;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  white-space: nowrap;
}

/* Dark mode pulse results */
html.dark .pulse-results {
  border-top-color: var(--border-light);
}

html.dark .pulse-bar {
  background: rgba(255, 255, 255, 0.1);
}

/* Dark mode pulse cards */
html.dark .pulse-card {
  background: var(--bg-card);
  border-color: var(--border-light);
}

html.dark .pulse-category.healthcare {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
}

html.dark .pulse-category.education {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.3);
}

html.dark .pulse-category.tech {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.3);
}

html.dark .pulse-category.economic {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

html.dark .pulse-category.juridic {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.3);
}

html.dark .pulse-category.energy {
  background: rgba(6, 182, 212, 0.15);
  border-color: rgba(6, 182, 212, 0.3);
}

html.dark .pulse-category.transport {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.3);
}

html.dark .pulse-category.agriculture {
  background: rgba(132, 204, 22, 0.15);
  border-color: rgba(132, 204, 22, 0.3);
}

html.dark .pulse-category.social {
  background: rgba(249, 115, 22, 0.15);
  border-color: rgba(249, 115, 22, 0.3);
}

/* Dark mode: the light-mode text shades (600/700) were too dark to read on
   the dark cards, so tags and answers switch to light ones (300/400). */
html.dark .pulse-category.healthcare { color: #fca5a5; }
html.dark .pulse-category.education { color: #93c5fd; }
html.dark .pulse-category.tech { color: #6ee7b7; }
html.dark .pulse-category.economic { color: #fcd34d; }
html.dark .pulse-category.juridic { color: #c4b5fd; }
html.dark .pulse-category.energy { color: #67e8f9; }
html.dark .pulse-category.transport { color: #f9a8d4; }
html.dark .pulse-category.agriculture { color: #bef264; }
html.dark .pulse-category.social { color: #fdba74; }

html.dark .pulse-btn.pulse-yes:not(.selected) {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
  color: #4ade80;
}
html.dark .pulse-btn.pulse-no:not(.selected) {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(248, 113, 113, 0.4);
  color: #f87171;
}
/* Hover deepens the fill; no glow around the button. */
html.dark .pulse-btn.pulse-yes:not(.selected):hover {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(74, 222, 128, 0.55);
}
html.dark .pulse-btn.pulse-no:not(.selected):hover {
  background: rgba(239, 68, 68, 0.24);
  border-color: rgba(248, 113, 113, 0.6);
}
html.dark .pulse-btn.otv-pulse-option:not(.is-selected) {
  color: color-mix(in srgb, var(--option-color) 55%, #fff);
}

/* Responsive pulse grid */
@media (max-width: 1100px) {
  .pulse-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .pulse-cards-grid {
    grid-template-columns: 1fr;
  }

  .pulse-card-wide {
    grid-column: auto;
  }

  .quick-pulse-section .section-header {
    flex-direction: column;
    gap: 1rem;
  }
}

/* ========================================
   REFORM BACKLOG (Următoarele reforme)
======================================== */
.backlog-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.backlog-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.35rem;
  transition: all var(--transition-fast);
}

.backlog-item:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.backlog-rank {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.backlog-body {
  min-width: 0;
}

.backlog-body > .pulse-category {
  margin-bottom: 0.4rem;
}

.backlog-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0;
}

.backlog-note {
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0.4rem 0 0;
}

.backlog-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.backlog-votes {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.backlog-vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(99, 102, 241, 0.25);
  background: rgba(99, 102, 241, 0.08);
  color: #4f46e5;
  font-family: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.backlog-vote-btn:hover {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.backlog-vote-btn.voted {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
  color: #059669;
}

.backlog-vote-btn.is-saving {
  opacity: 0.6;
  pointer-events: none;
}

@media (max-width: 700px) {
  .backlog-item {
    grid-template-columns: 2rem 1fr;
    row-gap: 0.85rem;
  }

  .backlog-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* ========================================
   Unified OTV Community Feed
======================================== */
.otv-logo-icon {
  background: #facc15 !important;
  color: #111 !important;
  text-shadow: none !important;
}

.otv-logo-icon i { font-size: var(--fs-sm); }
.otv-create-post { border: 0; opacity: 1 !important; pointer-events: auto !important; cursor: pointer !important; background: #facc15 !important; color: #111 !important; }

.unified-community-shell {
  width: min(100%, 860px);
  margin: 0 auto;
}

.unified-feed-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.unified-feed-header h1 {
  margin: 0;
  color: var(--text-primary);
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-xl);
}

.unified-topic-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  scrollbar-width: thin;
}

.unified-topic-tabs a {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text-secondary);
  background: var(--bg-card);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-decoration: none;
}

.unified-topic-tabs a.active {
  border-color: #d4a800;
  background: #facc15;
  color: #111;
}

.unified-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-card);
}

.unified-composer > button {
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--bg-main);
  color: var(--text-muted);
  text-align: left;
  cursor: pointer;
}

.unified-composer > div { display: flex; gap: 0.2rem; }
.unified-composer > div button { width: 34px; height: 34px; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.unified-composer > div button:hover { background: var(--bg-hover); color: #b68f00; }

.unified-feed { display: grid; gap: 0.85rem; }
.unified-post { overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.unified-post-author { display: flex; align-items: center; gap: 0.65rem; padding: 1rem 1.1rem 0; }
.unified-avatar { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 50%; background: #facc15; color: #111; font-size: var(--fs-xs); font-weight: 800; }
.unified-post-author > div { display: grid; min-width: 0; }
.unified-post-author strong { color: var(--text-primary); font-size: var(--fs-sm); }
.unified-post-author div span { color: var(--text-muted); font-size: var(--fs-xs); }
.unified-category { margin-left: auto; padding: 0.28rem 0.45rem; border-radius: 3px; background: var(--bg-hover); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 700; }
.unified-more { width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-muted); cursor: pointer; }
.unified-post-body { padding: 0.9rem 1.1rem 1rem 3.85rem; }
.unified-post-body > p { margin: 0 0 0.75rem; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.6; }
.unified-post-body h2 { margin: 0 0 0.6rem; color: var(--text-primary); font-size: var(--fs-lg); line-height: 1.4; }
.unified-post-body h1 { margin: 0 0 0.65rem; color: var(--text-primary); font-size: var(--fs-xl); line-height: 1.3; }
.unified-post-kicker { color: #927100 !important; font-size: var(--fs-xs) !important; font-weight: 800; letter-spacing: 0.5px; }

.unified-reference {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  color: var(--text-primary);
  background: var(--bg-main);
  text-decoration: none;
}

.unified-reference-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 4px; background: color-mix(in srgb, var(--topic-color) 14%, transparent); color: var(--topic-color); }
.unified-reference > span:nth-child(2) { display: grid; gap: 0.2rem; }
.unified-reference small { color: var(--text-muted); font-size: var(--fs-xs); font-weight: 800; }
.unified-reference strong { font-size: var(--fs-xs); }
.unified-reference > i { color: var(--text-muted); }

.unified-post-actions { display: flex; align-items: center; gap: 0.15rem; padding: 0.55rem 0.8rem; border-top: 1px solid var(--border-light); }
.unified-post-actions button { min-height: 34px; display: inline-flex; align-items: center; gap: 0.38rem; padding: 0.4rem 0.65rem; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; }
.unified-post-actions button:hover { background: var(--bg-hover); }
.unified-post-actions button.active { color: #b68f00; }
.unified-post-actions .save-action { margin-left: auto; }

.unified-video {
  position: relative;
  min-height: 340px;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 0.9rem 0;
  border-radius: 5px;
  background: linear-gradient(rgba(0,0,0,.24), rgba(0,0,0,.58)), url('assets/otv/community-cover.jpeg') center/cover;
  color: #fff;
}
.unified-video > button { width: 58px; height: 58px; border: 0; border-radius: 50%; background: #facc15; color: #111; font-size: var(--fs-md); cursor: pointer; z-index: 2; }
.unified-video > button.playing { background: #fff; }
.unified-video > span { position: absolute; left: 0.8rem; top: 0.8rem; padding: 0.3rem 0.45rem; border-radius: 3px; background: rgba(0,0,0,.75); color: #facc15; font-size: var(--fs-xs); font-weight: 800; }
.unified-video > small { position: absolute; left: 0.8rem; bottom: 0.8rem; color: #fff; }
.unified-live-video > span { background: #e11d48; color: #fff; }
.unified-live-video > span b { display: inline-block; width: 6px; height: 6px; margin-right: 0.3rem; border-radius: 50%; background: #fff; }

.unified-poll { display: grid; gap: 0.45rem; margin-top: 1rem; }
.unified-poll button { position: relative; min-height: 44px; overflow: hidden; display: flex; justify-content: space-between; align-items: center; padding: 0.65rem 0.8rem; border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-main); color: var(--text-primary); cursor: pointer; }
.unified-poll button > * { position: relative; z-index: 2; }
.unified-poll button i { position: absolute; inset: 0 auto 0 0; z-index: 1; background: rgba(250,204,21,.18); }
.unified-poll button.selected { border-color: #d4a800; box-shadow: inset 4px 0 #facc15; }
.unified-poll-meta { display: block; margin-top: 0.7rem; color: var(--text-muted); }

.unified-proposal-progress { margin-top: 1rem; padding: 0.9rem; border-left: 3px solid #facc15; background: var(--bg-main); }
.unified-proposal-progress > div:first-child { display: flex; justify-content: space-between; gap: 1rem; color: var(--text-secondary); font-size: var(--fs-xs); }
.unified-proposal-progress > div:nth-child(2) { height: 6px; margin: 0.65rem 0; overflow: hidden; border-radius: 3px; background: var(--bg-hover); }
.unified-proposal-progress > div:nth-child(2) i { display: block; height: 100%; background: #facc15; }

.unified-back-link { display: inline-flex; align-items: center; gap: 0.45rem; margin-bottom: 1rem; color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 600; text-decoration: none; }
.unified-document-content { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-light); color: var(--text-primary); }
.unified-document-content section { margin-bottom: 1.5rem; }
.unified-document-content h2 { font-size: var(--fs-lg); }
.unified-document-content h3 { color: var(--text-primary); font-size: var(--fs-md); }
.unified-document-content p,
.unified-document-content li { color: var(--text-secondary); line-height: 1.7; }
.unified-document-content img { max-width: 100%; height: auto; }
.unified-comments { margin-top: 1rem; padding: 1.1rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.unified-comments > h2 { margin: 0 0 1rem; color: var(--text-primary); font-size: var(--fs-md); }
.unified-comment { display: flex; gap: 0.75rem; padding: 1rem 0; border-top: 1px solid var(--border-light); }
.unified-comment > div { min-width: 0; }
.unified-comment strong { color: var(--text-primary); font-size: var(--fs-xs); }
.unified-comment strong small { color: var(--text-muted); font-weight: 400; }
.unified-comment p { color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.55; }
.unified-comment button { margin-right: 0.65rem; padding: 0; border: 0; background: transparent; color: var(--text-muted); font-size: var(--fs-xs); cursor: pointer; }
.unified-comment-box { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: center; padding-top: 1rem; border-top: 1px solid var(--border-light); }
.unified-comment-box button { padding: 0.7rem; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-main); color: var(--text-muted); text-align: left; cursor: pointer; }

html.dark .unified-post-kicker { color: #facc15 !important; }

@media (max-width: 700px) {
  .unified-feed-header { align-items: stretch; flex-direction: column; }
  .unified-feed-header .otv-primary-btn { width: 100%; }
  .unified-composer { grid-template-columns: auto minmax(0, 1fr); }
  .unified-composer > div { display: none; }
  .unified-post-body { padding-left: 1.1rem; }
  .unified-category { display: none; }
  .unified-post-actions button span { display: none; }
  .unified-post-actions button { min-width: 42px; justify-content: center; }
  .unified-video { min-height: 240px; }
  .unified-proposal-progress > div:first-child { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
}

/* ========================================
   NEWS SECTION
======================================== */
.news-section {
  margin: 3rem 0;
  container: home-news / inline-size;
}

.news-grid,
.news-grid-top,
.news-grid-bottom {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

@container home-news (min-width: 600px) {
  .news-grid-top:has(> :nth-child(2)) {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  .news-grid-bottom:has(> :nth-child(2)) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.news-card.featured {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--border-light);
  transition: all var(--transition-normal);
  text-decoration: none;
  color: inherit;
}

.news-card.featured:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.news-image {
  position: relative;
  /* Start at 16:9 and limit the height on wide screens. */
  flex: 1 0 auto;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  max-height: 340px;
  overflow: hidden;
}

.news-image img {
  /* Taken out of flow so the photo's own proportions cannot set the card's
     height. The card follows the headline column, and the photo fills it. */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.news-card.featured:hover .news-image img {
  transform: scale(1.05);
}

.news-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.4rem 0.85rem;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.news-badge.live {
  background: #ef4444;
  color: white;
}

.news-badge.live i {
  font-size: 0.5rem;
  animation: pulse-live 1.5s infinite;
}

.news-content {
  padding: 1.5rem;
}

/* Vertically center the text when a top story has no usable photo. */
.news-card.featured:not(:has(.news-image)) .news-content {
  margin: auto 0;
}

.news-category {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.news-category.small {
  font-size: var(--fs-xs);
  padding: 0.2rem 0.5rem;
  margin-bottom: 0.5rem;
}

.news-content h3 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.news-content p {
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
  margin: 0 0 1rem 0;
}

.news-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.news-meta span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.news-meta i {
  font-size: var(--fs-xs);
}

.news-item {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.news-item:hover {
  border-color: var(--secondary);
  box-shadow: var(--shadow-sm);
  transform: translateX(4px);
}

.news-item-content h4 {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.4;
}

/* The summary fills the card under the headline; clamped so a long one
   never pushes past the card the lead photo sets the height of. */
.news-item-summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
}

#page-content > .home-page .news-item-summary {
  font-size: var(--fs-sm);
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.news-grid-top > :nth-child(2) .news-image {
  min-height: 0;
}

#page-content > .home-page .news-item {
  padding: 0.85rem 1.1rem;
}

#page-content > .home-page .news-item-content h4 {
  margin-bottom: 0.35rem;
}

/* On the home page the section stays compact: the lead's summary is cut to
   three lines too, so a long one no longer stretches the whole row. */
#page-content > .home-page .news-content {
  padding: 1.25rem;
}

#page-content > .home-page .news-content p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

#page-content > .home-page .news-grid-top > :nth-child(2) .news-content h3 {
  font-size: var(--fs-md);
}

.news-time {
  font-size: var(--fs-xs);
  color: var(--text-muted);
}

@container home-news (min-width: 1000px) {
  .news-grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: repeat(3, auto);
  }

  .news-grid-top,
  .news-grid-bottom {
    display: contents;
  }

  .news-grid-top > :first-child {
    grid-column: 1;
    grid-row: 1 / 4;
  }

  .news-grid-top > :nth-child(2),
  .news-grid-bottom > * {
    grid-column: 2;
  }

  .news-grid-top > :nth-child(2) .news-image {
    display: none;
  }

  #page-content > .home-page .news-grid-top > :nth-child(2) .news-content {
    margin: 0;
    padding: .85rem 1.1rem;
  }

  #page-content > .home-page .news-grid-top > :nth-child(2) .news-content h3 {
    font-size: var(--fs-sm);
    font-weight: 600;
    margin-bottom: .35rem;
  }

  #page-content > .home-page .news-grid-top > :nth-child(2) .news-content p {
    line-height: 1.5;
    -webkit-line-clamp: 2;
    line-clamp: 2;
  }
}

/* Dark mode news */
html.dark .news-card.featured {
  background: var(--bg-card);
  border-color: var(--border-light);
}

html.dark .news-item {
  background: var(--bg-card);
  border-color: var(--border-light);
}

html.dark .news-category {
  background: rgba(59, 130, 246, 0.15);
  color: #7cb3fb;
}

/* Small labels on raised dark surfaces (#334155) need a lighter grey. */
html.dark .pulse-ended-badge,
html.dark .leader-role {
  color: #cbd5e1;
}

@media (max-width: 600px) {
  .news-image {
    min-height: 180px;
  }

  .news-content h3 {
    font-size: var(--fs-md);
  }
}

/* ========================================
   TELEVOT TEASER (home page)
======================================== */
.televot-section {
  margin: 3rem 0;
}

/* ========================================
   FOCUS SECTION (Debates + Leaderboard)
======================================== */
.focus-section {
  margin: 3rem 0;
}

.focus-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.debates-column .section-header,
.leaderboard-column .section-title {
  margin-bottom: 1.25rem;
}

.debates-column .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carousel-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.carousel-counter {
  margin-right: .25rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  white-space: nowrap;
}

.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.carousel-btn:hover {
  border-color: var(--secondary);
  color: var(--secondary);
}

.debates-carousel {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

.debate-card {
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 320px;
  text-decoration: none;
}

.debate-card[hidden] {
  display: none;
}

.debate-card.dark {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
  color: white;
}

.debate-card.light {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
}

.debate-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debate-category {
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
}

.debate-category.economie {
  background: #ef4444;
  color: white;
}

.debate-category.mediu {
  background: #22c55e;
  color: white;
}

.debate-consensus {
  font-size: var(--fs-xs);
  opacity: 0.7;
}

.debate-card.light .debate-consensus {
  color: var(--text-muted);
}

.debate-title {
  font-size: var(--fs-lg);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.debate-description {
  font-size: var(--fs-sm);
  line-height: 1.5;
  opacity: 0.8;
  margin: 0;
}

.debate-card.light .debate-description {
  color: var(--text-secondary);
}

.debate-progress {
  display: flex;
  justify-content: space-between;
  font-size: var(--fs-xs);
  margin-top: 0.5rem;
}

.progress-label {
  opacity: 0.7;
}

.debate-card.light .progress-label {
  color: var(--text-muted);
}

.progress-value {
  font-weight: 600;
  color: #3b82f6;
}

.debate-card.dark .progress-value {
  color: #60a5fa;
}

.debate-card.light .progress-value {
  color: #22c55e;
}

.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
}

.debate-card.light .progress-bar {
  background: var(--border-light);
}

.progress-fill {
  height: 100%;
  background: #3b82f6;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.progress-fill.green {
  background: #22c55e;
}

.debate-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.vote-count {
  font-size: var(--fs-sm);
  font-weight: 600;
  opacity: 0.8;
}

.vote-btn {
  /* The card is narrow enough that the label used to break across two lines
     and press against the count beside it. The button keeps its size and the
     count gives up the room instead. */
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0.5rem 1.25rem;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: white;
  color: #1e293b;
}

.vote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.vote-btn.outline {
  background: transparent;
  border: 1.5px solid #2a9d8f;
  color: #2a9d8f;
}

.vote-btn.outline:hover {
  background: #2a9d8f;
  color: white;
}

/* Leaderboard */
.leaderboard-list {
  display: flex;
  flex-direction: column;
}

.leader-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.5rem;
  border-bottom: 1px solid var(--border-medium);
  color: inherit;
  text-decoration: none;
}

.leader-item:is(:hover, :focus-visible) {
  background-color: color-mix(in srgb, var(--secondary) 14%, var(--bg-hover));
}

.leader-rank {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.leader-rank.rank-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

.leader-rank.rank-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.leader-rank.rank-3 {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.leader-rank.rank-4,
.leader-rank.rank-5 {
  background: color-mix(in srgb, var(--text-muted) 35%, var(--bg-hover));
  color: var(--text-primary);
}

.leader-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.leader-name {
  font-weight: 600;
  font-size: var(--fs-md);
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-role {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.leader-points {
  font-weight: 700;
  font-size: var(--fs-md);
  color: #2a9d8f;
  white-space: nowrap;
}

.leaderboard-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 500;
  transition: color 0.2s ease;
}

.leaderboard-link:hover {
  color: var(--secondary);
}

/* ========================================
   IMPACT SECTION (Stats)
======================================== */
.impact-section {
  margin: 3rem 0;
  text-align: center;
}

.impact-header {
  margin-bottom: 2rem;
}

.impact-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
}

.impact-description {
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.impact-card {
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.impact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.impact-card i {
  font-size: var(--fs-xl);
  margin-bottom: 0.5rem;
}

.impact-card:nth-child(1) i {
  color: #3b82f6;
}
.impact-card:nth-child(2) i {
  color: #8b5cf6;
}
.impact-card:nth-child(3) i {
  color: #2a9d8f;
}
.impact-card:nth-child(4) i {
  color: #ef4444;
}

.impact-number {
  font-family: "Poppins", sans-serif;
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.impact-label {
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

/* Dark mode for focus & impact sections */
html.dark .debate-card.light {
  background: var(--bg-card);
  border-color: var(--border-light);
}

html.dark .impact-card {
  background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

/* Responsive for focus & impact */
@media (max-width: 1100px) {
  .focus-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-column {
    order: -1;
  }
}

@media (max-width: 900px) {
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 700px) {
  .debates-carousel {
    grid-template-columns: 1fr;
  }

  .debate-card {
    min-height: auto;
  }
}

@media (max-width: 600px) {
  .impact-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .impact-card {
    padding: 1.5rem 1rem;
  }

  .impact-number {
    font-size: var(--fs-xl);
  }

  .impact-title {
    font-size: var(--fs-xl);
  }
}

/* ========================================
   MEASURE DETAIL PAGE
======================================== */

/* New Page Layout - Sidebar at top, fixed while scrolling */
.measure-page-layout {
  display: flex;
  gap: 2rem;
  position: relative;
}

.measure-page-main {
  flex: 1;
  min-width: 0;
  max-width: calc(100% - 280px - 2rem);
  container-name: measure-main;
  container-type: inline-size;
}

.measure-page-sidebar {
  width: 280px;
  flex-shrink: 0;
  align-self: flex-start;
  position: fixed;
  z-index: 10;
  top: calc(var(--header-height) + 2rem);
  right: max(2rem, calc((100vw - var(--sidebar-width) - 1400px) / 2));
  max-height: calc(100dvh - var(--header-height) - 4rem);
  padding-bottom: 3rem;
  box-sizing: border-box;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.measure-page-sidebar::-webkit-scrollbar {
  width: 4px;
}

.measure-page-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.measure-page-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border-light);
  border-radius: 4px;
}

.measure-page-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--border-medium);
}

/* New Measure Detail Header - No Card */
.measure-detail-header {
  margin-bottom: 2rem;
}

.measure-detail-title {
  font-family: "Poppins", sans-serif;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  line-height: 1.25;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  min-height: 58px;
  padding: 0.5rem 0;
  background: var(--bg-main);
  border-bottom: 1px solid var(--border-light);
}

.measure-detail-title-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.measure-preview-body {
  padding-bottom: 2rem;
}

.otv-feed-tabs.measure-preview-tabs.nova-live-controls {
  margin: 1.125rem 0 0;
  border-bottom: 2px solid var(--border-medium);
}

.measure-preview-tabs.nova-live-controls [data-measure-tab] {
  --measure-type-body: 1.1875rem;
  min-height: 50px;
  text-decoration: none;
}

.measure-preview-sources > .nova-context-panel { margin-top: 0; }

.measure-forum {
  padding: clamp(0.875rem, 3vw, 1.5rem);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
}

.measure-forum h2 { margin: 0.75rem 0; }
.measure-forum .measure-forum-back {
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-lg);
  background: var(--bg-hover);
}
.measure-forum .measure-forum-back:hover { border-color: var(--border-medium); }
.measure-forum .measure-forum-back:focus-visible {
  outline: 2px solid var(--otv-accent, #3478ed);
  outline-offset: 2px;
}

.measure-forum-topics,
.measure-forum-thread {
  list-style: none;
  margin: 0;
  padding: 0;
}

.measure-forum-thread { margin-top: 1rem; }

.measure-forum-topics a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: start;
  gap: 0.75rem;
  padding: 0.9rem 0;
  color: var(--text-primary);
  text-decoration: none;
}

.measure-forum-topics a:hover strong { text-decoration: underline; }
.measure-forum-topics li + li { border-top: 1px solid var(--border-light); }
.measure-forum-topics [data-forum-count] {
  min-inline-size: 5.5rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: end;
  white-space: nowrap;
}

.measure-forum-reply {
  margin-top: 0.625rem;
  padding: 0.875rem;
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  overflow-wrap: anywhere;
}

.measure-forum-reply p { margin: 0.35rem 0; white-space: pre-wrap; }
.measure-forum-reply .measure-forum-thread { border-left: 1px solid var(--border-medium); padding-left: 0.625rem; }
.measure-forum-thread .measure-forum-thread > .measure-forum-reply { background: var(--bg-card); }
.measure-forum-reply:focus-visible { outline: 2px solid var(--otv-accent, #3478ed); outline-offset: 2px; }
.measure-forum-reply-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; }
.measure-forum-reply-meta a { color: var(--text-secondary); font-size: 0.875rem; }
.measure-forum-reply-action {
  padding: 0.25rem 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}
.measure-forum-reply-action:hover { text-decoration: underline; }
.measure-forum-toggle { margin-top: 0.5rem; color: var(--text-primary); }

.measure-forum-form {
  display: grid;
  justify-items: start;
  gap: 0.65rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.measure-forum-form p { margin: 0; }
.measure-forum-form > button[type="submit"] { justify-self: end; }
.measure-forum-form [role="status"]:empty { display: none; }
.measure-forum-form textarea {
  box-sizing: border-box;
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  background: var(--bg-main);
  color: var(--text-primary);
  font: inherit;
  resize: vertical;
}

.measure-preview-body .nova-context-card { transition: none; }
.measure-preview-body a.nova-context-card:hover {
  transform: none;
  box-shadow: none;
}

.measure-page-preview .measure-article-content {
  padding-block: 0.875rem;
  padding-inline: clamp(0.75rem, 3vw, 1.25rem);
}

.measure-page-preview .measure-article-content .article-section:last-child {
  margin-bottom: 0;
}

.measure-page-preview .measure-detail-title .measure-impact-badge {
  --measure-type-body: var(--measure-type-caption);
  height: 24px;
  padding: 0 0.625rem;
}

.measure-preview-mobile-share {
  display: none;
}

.measure-preview-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.measure-preview-actions > .otv-secondary-btn { background: var(--bg-card); }
.measure-preview-actions > .otv-secondary-btn:hover { border-color: var(--secondary); }

body:has(.measure-page-preview) {
  --measure-preview-top-gap: 0.625rem;
}

body:has(.measure-page-preview) .content-area {
  padding-top: var(--measure-preview-top-gap);
}

.advocate-box-primary.measure-preview-floating-advocate {
  display: none;
}

@media (max-width: 1100px) {
  .measure-preview-mobile-share {
    display: block;
    margin-bottom: 1.25rem;
  }

  .measure-page-preview .measure-preview-body {
    padding-bottom: calc(3.75rem + env(safe-area-inset-bottom));
  }

  .advocate-box-primary.measure-preview-floating-advocate {
    display: inline-flex;
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: calc(1rem + env(safe-area-inset-bottom));
    z-index: 50;
    width: auto;
    min-height: 44px;
    padding: 0.5rem 0.875rem;
    border-radius: 999px;
    background: #6d28d9;
    color: #fff;
    box-shadow: 0 3px 12px rgb(76 29 149 / 25%);
  }

  .advocate-box-primary.measure-preview-floating-advocate:hover {
    background: #5b21b6;
  }

  body:has(.measure-preview-floating-advocate) .nova-live-player.is-floating {
    bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }

  .measure-page-preview .measure-page-main {
    max-width: 100%;
  }

  .measure-page-preview .measure-page-sidebar {
    display: none;
  }
}

@media (max-width: 900px) {
  .measure-page-preview .measure-detail-title {
    column-gap: 0.875rem;
  }
}

@media (width > 900px) {
  body:has(.measure-page-preview) .main-content {
    height: calc(100dvh - var(--header-height));
  }

  body:has(.measure-page-preview) .content-area {
    min-height: 0;
    padding-bottom: 0;
  }

  .measure-page-preview {
    height: 100%;
  }

  .measure-page-preview .measure-page-main {
    display: flex;
    flex-direction: column;
  }

  .measure-page-preview .measure-detail-title {
    position: static;
    flex-shrink: 0;
    min-height: 0;
    margin-bottom: 0.5rem;
    padding: 0.375rem 0 1rem;
    gap: 0.625rem 0.5rem;
  }

  .measure-page-preview .measure-detail-title .back-btn {
    width: 30px;
    height: 30px;
  }

  .measure-page-preview .measure-detail-description {
    color: var(--text-primary);
    font-weight: 500;
  }

  .measure-page-preview .measure-page-sidebar {
    top: calc(var(--header-height) + var(--measure-preview-top-gap));
    max-height: calc(100vh - var(--header-height) - var(--measure-preview-top-gap) - 0.75rem);
    max-height: calc(100dvh - var(--header-height) - var(--measure-preview-top-gap) - 0.75rem);
    padding-bottom: 0;
  }

  .measure-page-preview .measure-page-sidebar > .toc-box {
    min-height: 0;
    overflow-y: auto;
  }

  .measure-page-preview .measure-page-sidebar > .advocate-box,
  .measure-page-preview .measure-page-sidebar > [data-measure-share-slot] { flex-shrink: 0; }

  .measure-preview-body {
    position: relative;
    overflow-y: scroll;
    overscroll-behavior-y: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-medium) transparent;
  }
}

.measure-detail-title .back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  cursor: pointer;
  font-family: inherit;
}

.measure-detail-title .back-btn:hover {
  background: var(--secondary);
  border-color: var(--secondary);
  color: white;
  transform: translateX(-2px);
}

.measure-detail-title .back-btn i {
  font-size: var(--fs-sm);
}

/* The detail column can become narrow even on a desktop viewport because the
   app sidebar and the civic-status rail both remain visible. Move the impact
   badge below the title based on the space the title actually has, not merely
   on the browser width. */
@container measure-main (max-width: 760px) {
  .measure-detail-title {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .measure-detail-title .measure-impact-badge {
    grid-column: 2;
    grid-row: 2;
    justify-self: start;
  }
}

.measure-detail-description {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  margin: 0 0 1.25rem 0;
  line-height: 1.6;
  max-width: 800px;
}

.measure-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.measure-detail-tags .category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.65rem;
  background: var(--bg-card);
  border-radius: 999px;
  font-size: var(--fs-xs);
  line-height: 1.25;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
  white-space: nowrap;
  cursor: default;
  /* No hover effects */
}

.measure-impact-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 28px;
  padding: 0 0.75rem;
  border-radius: 9999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  flex-shrink: 0;
}

.measure-impact-badge.impact-moderat {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.measure-impact-badge.impact-mediu {
  background: rgba(243, 156, 18, 0.15);
  color: #d68910;
  border: 1px solid rgba(243, 156, 18, 0.3);
}

.measure-impact-badge.impact-major {
  background: rgba(46, 204, 113, 0.15);
  color: #1e8449;
  border: 1px solid rgba(46, 204, 113, 0.3);
}

html.dark .measure-impact-badge.impact-moderat {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.4);
}

html.dark .measure-impact-badge.impact-mediu {
  background: rgba(243, 156, 18, 0.2);
  color: #f5b041;
  border-color: rgba(243, 156, 18, 0.4);
}

html.dark .measure-impact-badge.impact-major {
  background: rgba(46, 204, 113, 0.2);
  color: #58d68d;
  border-color: rgba(46, 204, 113, 0.4);
}

/* Legacy Measure Header - kept for compatibility */
.measure-header {
  margin-bottom: 2rem;
}

.measure-title-section {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.75rem 2rem;
  border-left: 4px solid var(--secondary);
  box-shadow: var(--shadow-sm);
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.measure-title-section h1 {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.75rem 0;
  line-height: 1.35;
}

.measure-title-section .subtitle {
  font-size: var(--fs-md);
  color: var(--text-secondary);
  margin: 0 0 1.25rem 0;
  line-height: 1.6;
}

.measure-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.measure-meta .measure-impact-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-lg);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.measure-meta .measure-impact-badge.impact-moderat {
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
}

.measure-meta .measure-impact-badge.impact-mediu {
  background: rgba(243, 156, 18, 0.15);
  color: #f39c12;
}

.measure-meta .measure-impact-badge.impact-major {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
}

.measure-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.measure-tags .category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  font-size: var(--fs-xs);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

/* Article Container - Content LEFT, Sidebar RIGHT */
.measure-article-container {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Article Content (Left/Main) */
.measure-article-content {
  --measure-section-title-size: 1.25rem;
  --measure-body-size: 0.95rem;
  --measure-meta-size: 0.8rem;
  background: var(--bg-card);
  font-size: var(--measure-body-size);
  border-radius: var(--radius-xl);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.measure-article-content .article-section {
  margin-bottom: 2.5rem;
}

.measure-article-content .article-section:last-child {
  margin-bottom: 1rem;
}

.measure-article-content h2 {
  color: var(--text-primary);
  font-size: var(--measure-section-title-size);
  font-weight: 700;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.measure-article-content .measure-section-heading {
  display: flex;
  align-items: center;
}

.measure-section-heading > .fas {
  flex-shrink: 0;
  width: 1.25em;
  margin-right: 0.5em;
  color: var(--secondary);
  text-align: center;
}

.measure-article-content p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

.measure-article-content p:last-child {
  margin-bottom: 0;
}

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1rem 0;
  max-width: 100%;
}

.benefits-grid .benefit-item:nth-child(n + 9) {
  display: none;
}

@media (max-width: 600px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

.benefit-item {
  background: #edf4ff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  cursor: default;
}

.benefit-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: #e3efff;
}

.benefit-item i {
  font-size: var(--fs-lg);
  color: var(--secondary);
  margin-bottom: 0.875rem;
  display: block;
}

.benefit-item h4 {
  margin: 0;
  font-size: var(--fs-md);
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.3;
}

.benefit-item .hover-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--secondary), #2563eb);
  color: white;
  padding: 0.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  font-size: var(--fs-xs);
  line-height: 1.4;
}

.benefit-item:hover .hover-info {
  transform: translateY(0);
}

html.dark .benefit-item {
  background: rgba(59, 130, 246, 0.13);
  border-color: var(--border-medium);
}

html.dark .benefit-item:hover {
  background: rgba(59, 130, 246, 0.19);
}

/* Arguments List */
.arguments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1rem 0;
}

.argument {
  background: rgba(16, 185, 129, 0.04);
  border-left: 4px solid #10b981;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.argument h4 {
  color: var(--text-primary);
  font-size: var(--fs-md);
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.argument .measure-argument-heading {
  display: flex;
  align-items: baseline;
  margin-bottom: 0.6rem;
}

.argument .measure-argument-heading > span {
  font-size: inherit !important;
}

.measure-argument-heading > i {
  flex: 0 0 1.25em;
  margin-right: 0.55em;
  color: var(--secondary);
  text-align: center;
}

.argument p {
  color: var(--text-primary);
  margin: 0;
  font-size: var(--fs-md);
}

html.dark .argument {
  background: rgba(16, 185, 129, 0.06);
}

/* Case Study */
.case-study {
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
}

.case-study .person-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.case-study .person-info i {
  display: none;
}

.case-study .person-info h4 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

/* Examples */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.example-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
}

.example-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.example-header i {
  color: var(--secondary);
}

.example-header h4 {
  margin: 0;
  color: var(--text-primary);
  font-weight: 600;
}

/* Quote */
.quote {
  position: relative;
  background: linear-gradient(
    135deg,
    rgba(42, 157, 143, 0.03) 0%,
    rgba(42, 157, 143, 0.08) 100%
  );
  border-radius: var(--radius-xl);
  padding: 2.5rem 3rem;
  text-align: center;
  font-style: italic;
  border: 2px solid var(--border-light);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  margin: 2rem 0;
  overflow: hidden;
}

.quote::before {
  content: "\201C";
  position: absolute;
  top: -10px;
  left: 20px;
  font-size: 120px;
  line-height: 1;
  color: var(--secondary);
  opacity: 0.15;
  font-family: Georgia, serif;
  font-weight: bold;
}

.quote p {
  font-size: var(--measure-body-size, 0.95rem);
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  line-height: 1.7;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.quote cite {
  display: block;
  color: var(--text-secondary);
  font-size: var(--measure-meta-size, 0.8rem);
  font-weight: 600;
  font-style: normal;
  margin-top: 1rem;
  position: relative;
  z-index: 1;
}

.quote cite::before {
  content: "";
}

/* Proposal Quote */
.proposal-quote {
  background: #f0f9ff;
  border-left: 4px solid var(--secondary);
  padding: 1.25rem 1.5rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.proposal-quote h4 {
  color: var(--text-primary);
  font-weight: 600;
  margin: 0 0 1rem 0;
}

html.dark .quote {
  background: linear-gradient(
    135deg,
    rgba(42, 157, 143, 0.08) 0%,
    rgba(42, 157, 143, 0.15) 100%
  );
  border-color: rgba(42, 157, 143, 0.2);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

html.dark .quote::before {
  color: var(--secondary);
  opacity: 0.2;
}

html.dark .quote p {
  color: var(--text-primary);
}

html.dark .quote cite {
  color: var(--text-secondary);
}

html.dark .proposal-quote {
  background: rgba(59, 130, 246, 0.1);
}

/* Article Sidebar (Right) - WordPress-style sticky */
.measure-article-sidebar {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: calc(100vh - var(--header-height) - 2rem);
  overflow-y: auto;
  /* Hide scrollbar but keep functionality */
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}

.measure-article-sidebar::-webkit-scrollbar {
  width: 4px;
}

.measure-article-sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.measure-article-sidebar::-webkit-scrollbar-thumb {
  background-color: var(--border-light);
  border-radius: 4px;
}

.measure-article-sidebar::-webkit-scrollbar-thumb:hover {
  background-color: var(--border-medium);
}

.sidebar-box {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.sidebar-box h3 {
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-box h3 i {
  color: var(--secondary);
  font-size: var(--fs-sm);
}

/* TOC */
.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  display: block;
  padding: 0.4rem 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: var(--fs-sm);
  line-height: 1.45;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.toc-list a:hover {
  color: var(--secondary);
  background: var(--bg-hover);
  border-left-color: var(--secondary);
}

.toc-list a.active {
  color: var(--secondary);
  background: rgba(59, 130, 246, 0.1);
  border-left-color: var(--secondary);
  font-weight: 500;
}

/* Share Buttons */
.share-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  border: 1px solid var(--border-light);
  cursor: pointer;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.share-btn.facebook:hover {
  background: #1877f2;
  color: white;
  border-color: #1877f2;
}

.share-btn.twitter:hover {
  background: #000000;
  color: white;
  border-color: #000000;
}

.share-btn.linkedin:hover {
  background: #0077b5;
  color: white;
  border-color: #0077b5;
}

.share-btn.whatsapp:hover {
  background: #25d366;
  color: white;
  border-color: #25d366;
}

.share-btn.copy:hover {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

/* Action Box */
.action-box .support-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, var(--secondary), #2563eb);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: 0.75rem;
}

.action-box .support-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.action-box .support-btn.supported {
  background: linear-gradient(135deg, #10b981, #059669);
}

.action-box .support-count {
  text-align: center;
  color: var(--text-muted);
  font-size: var(--fs-sm);
}

.action-box .reform-participate-btn {
  background: linear-gradient(135deg, #f59e0b, #e8790a);
}

.measure-community {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
}

.measure-community-heading,
.measure-comment-form > div,
.measure-comment header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.measure-community-heading span {
  color: var(--secondary);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
}

.measure-community-heading h2 { margin: 0.2rem 0 0; font-size: var(--fs-lg); }
.measure-community-heading > strong { color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; }

.measure-comment-form { margin: 1.25rem 0; }
.measure-comment-form textarea {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  box-sizing: border-box;
  padding: 0.9rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
}
.measure-comment-form > div { margin-top: 0.65rem; }
.measure-comment-form small { color: var(--text-muted); }
.measure-comment-form button {
  padding: 0.65rem 1.1rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--secondary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.measure-comment-form button:disabled { opacity: 0.55; cursor: wait; }
.measure-comments-list { border-top: 1px solid var(--border-light); }
.measure-comment { display: flex; gap: 0.8rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.measure-comment-avatar {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.12);
  color: var(--secondary);
  font-size: var(--fs-xs);
  font-weight: 800;
}
.measure-comment > div { min-width: 0; flex: 1; }
.measure-comment header { justify-content: flex-start; font-size: var(--fs-sm); }
.measure-comment header span { color: var(--text-muted); }
.measure-comment p { margin: 0.45rem 0 0; line-height: 1.6; overflow-wrap: anywhere; }
.measure-comments-state { padding: 1.25rem 0; color: var(--text-muted); text-align: center; }
.measure-comments-state.is-error { color: #dc2626; }

@media (max-width: 560px) {
  .measure-community { padding: 1rem; }
  .measure-community-heading, .measure-comment-form > div { align-items: flex-start; flex-direction: column; }
  .measure-comment-form button { width: 100%; }
}

/* Related Measures */
.related-measures {
  margin-top: calc(clamp(2.25rem, 4vh, 3rem) + 15px);
  padding: 0;
  background: transparent;
}

.related-measures-separator {
  position: relative;
  height: 1px;
  margin-bottom: 1.35rem;
  background: linear-gradient(90deg, var(--border-medium), var(--border-light));
}

.related-measures-separator::before {
  content: "";
  position: absolute;
  inset: -1px auto auto 0;
  width: 64px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb 0 33.33%, #facc15 33.33% 66.66%, #ef4444 66.66%);
}

.related-measures h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 1.25rem 0;
}

.related-cards {
  display: grid;
  /* 2 columns to use full space since we show only 2 cards */
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

/* Responsive breakpoints */
@media (max-width: 768px) {
  .related-measures {
    margin-top: calc(2.25rem + 15px);
  }

  .related-measures-separator {
    margin-bottom: 1.25rem;
  }

  .related-cards {
    grid-template-columns: 1fr;
  }
}

/* Responsive - Measure Detail */
@media (max-width: 900px) {
  .measure-page-layout {
    flex-direction: column;
  }

  .measure-page-main {
    max-width: 100%;
  }

  .measure-page-sidebar {
    position: static;
    width: 100%;
    order: 2;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    padding-bottom: 0;
    overflow-y: visible;
    margin-top: 2rem;
    right: auto;
  }

  /* Hide TOC on mobile */
  .measure-page-sidebar .toc-box {
    display: none;
  }

  .measure-article-container {
    grid-template-columns: 1fr;
  }

  .measure-article-sidebar {
    position: static;
    order: -1;
    flex-direction: row;
    flex-wrap: wrap;
    max-height: none;
    overflow-y: visible;
  }

  .sidebar-box {
    flex: 1;
    min-width: 200px;
  }

  .measure-title-section h1 {
    font-size: var(--fs-xl);
  }

  .measure-detail-title {
    font-size: var(--fs-xl);
  }

  .measure-detail-description {
    font-size: var(--fs-md);
  }

  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .measure-page-sidebar {
    flex-direction: column;
  }

  .measure-article-sidebar {
    flex-direction: column;
  }

  .sidebar-box {
    min-width: 100%;
  }

  .measure-title-section h1 {
    font-size: var(--fs-lg);
  }

  .measure-detail-title {
    font-size: var(--fs-lg);
    gap: 0.5rem;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .measure-detail-title .measure-impact-badge {
    grid-column: 2;
    justify-self: start;
  }

  .measure-detail-title .back-btn {
    width: 36px;
    height: 36px;
  }

  .measure-detail-description {
    font-size: var(--fs-md);
  }

  .measure-article-content {
    padding: 1.25rem;
  }
}

/* ========================================
   TOAST NOTIFICATIONS
======================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 9999;
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========================================
   RESPONSIVE ADDITIONS
======================================== */
@media (max-width: 768px) {
  .filter-bar {
    flex-direction: row;
    align-items: center;
  }

  .filter-tabs {
    min-width: 0;
    flex: 1;
  }

  .view-toggle {
    margin-left: 0;
    align-self: flex-end;
  }

  .about-title {
    font-size: var(--fs-lg);
  }

  .about-content {
    padding: 1.5rem;
  }

  .about-content p {
    font-size: var(--fs-md);
  }

  .newsletter-section {
    padding: 2rem 1.5rem;
  }

  .newsletter-title {
    font-size: var(--fs-lg);
  }

  .newsletter-form {
    flex-direction: column;
    align-items: center;
  }

  .newsletter-input {
    width: 100%;
    max-width: 100%;
  }

  .newsletter-btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: var(--fs-lg);
  }
}

/* ========================================
   Propose Reform Modal
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--window-scrim); -webkit-backdrop-filter: var(--window-scrim-filter); backdrop-filter: var(--window-scrim-filter);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.modal.open {
  display: flex;
}

.modal-content {
  background: var(--window-glass); -webkit-backdrop-filter: var(--window-glass-filter); backdrop-filter: var(--window-glass-filter);
  padding: 2rem;
  border-radius: var(--radius-xl, 12px);
  max-width: 500px;
  width: 90%;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
}

.modal-content [hidden] { display: none; }

.modal-content h2 {
  margin: 0 0 1.5rem 0;
  font-size: var(--fs-xl);
  color: var(--text-primary);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: var(--fs-xl);
  cursor: pointer;
  color: var(--text-muted);
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.close-modal:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-content form {
  display: grid;
  gap: 1.25rem;
}

.modal-content .form-group {
  position: relative;
}

.modal-content .form-group label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.modal-content .form-group input,
.modal-content .form-group textarea,
.modal-content .form-group select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--fs-md);
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-main);
  transition: border-color 0.2s;
}

.modal-content .form-group input:focus,
.modal-content .form-group textarea:focus,
.modal-content .form-group select:focus {
  border-color: #60a5fa;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modal-content .form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.modal-content .btn,
.modal-content button[type="submit"] {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.875rem 1.5rem;
  font-size: var(--fs-md);
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #3b82f6;
  color: white;
}

.modal-content .btn:hover,
.modal-content button[type="submit"]:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Dark mode modal */
html.dark .modal-content {
  background: var(--bg-card);
}

html.dark .modal-content .form-group input,
html.dark .modal-content .form-group textarea,
html.dark .modal-content .form-group select {
  background: var(--bg-main);
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* ========================================
   MEASURE ARTICLE COMPONENTS
   Styles for dynamic measure content sections
======================================== */

/* Benefits Grid */
.benefits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin: 2rem 0;
}

.benefit-item {
  background: #edf4ff;
  border-radius: var(--radius-lg);
  padding: 1.5rem 1rem;
  text-align: center;
  transition: all 0.3s ease-out;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.benefit-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  background: #e3efff;
  z-index: 10;
}

.benefit-item .hover-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 0.5rem;
  transform: translateY(101%);
  transition: transform 0.3s ease-out;
  font-size: var(--measure-meta-size, 0.8rem);
  line-height: 1.4;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.benefit-item:hover .hover-info {
  transform: translateY(0);
}

.benefit-item i {
  font-size: var(--fs-lg);
  color: var(--secondary);
  margin-bottom: 0.875rem;
}

.benefit-item h4 {
  margin: 0;
  font-size: var(--measure-body-size, 0.95rem);
  color: var(--primary);
  line-height: 1.3;
}

/* Arguments List */
.arguments-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.argument {
  background: rgba(46, 204, 113, 0.04);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(16, 185, 129, 0.28);
}

.argument h4 {
  margin-top: 0;
  color: var(--primary);
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 700;
  margin-bottom: 0.8rem;
}

.argument p {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.6;
}

/* FAQ */
.faq {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 2rem 0;
}

.faq-item {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.faq-question {
  padding: 1rem 1.25rem;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-light);
}

.faq-question h4 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.faq-question h4::before {
  content: "→";
  color: var(--secondary);
  font-size: var(--fs-md);
  font-weight: 700;
  flex-shrink: 0;
}

.faq-answer {
  padding: 1rem 1.25rem;
}

.faq-answer p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.6;
}

/* Impact List */
.impact-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.impact-list li {
  padding: 0.875rem 1rem 0.875rem 2.25rem;
  background: rgba(42, 157, 143, 0.04);
  border-radius: var(--radius-md);
  position: relative;
  border: 1px solid var(--border-light);
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

.impact-list li:before {
  content: "✓";
  position: absolute;
  left: 0.875rem;
  color: var(--secondary);
  font-weight: 700;
  font-size: var(--fs-md);
}

@media (max-width: 768px) {
  .impact-list {
    grid-template-columns: 1fr;
  }
}

/* Tags Container */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin: 2rem 0;
}

.content-tag {
  background: #f1f5f9;
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-lg);
  font-size: var(--measure-meta-size, 0.8rem);
  font-weight: 500;
}

/* Examples */
.examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.example-card {
  background: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border-light);
}

.example-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.example-header i {
  font-size: var(--fs-xl);
  color: var(--secondary);
}

/* Inserted from the heading by initExampleFlags. Fixed width with a 4:3 box keeps
   the headings on one line whatever the flag's own proportions are, and the hairline
   border stops a white flag from dissolving into the card. */
.example-flag {
  width: 1.6rem;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.14);
}

.example-header h4 {
  margin: 0;
  color: var(--primary);
  font-size: var(--measure-body-size, 0.95rem);
}

.example-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.6;
}

/* Case Study */
.case-study {
  background: #f8fafc;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin: 2rem 0;
  border: 1px solid var(--border-light);
}

.person-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.person-info i {
  display: none;
}

.person-info h4 {
  margin: 0;
  color: var(--primary);
  font-size: var(--measure-body-size, 0.95rem);
}

.person-info.has-portrait {
  gap: 0;
}

.case-study-portrait {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  margin-right: 0.875rem;
  border-radius: 50%;
  object-fit: cover;
}

.case-study-portrait-label {
  display: block;
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: var(--measure-type-caption, var(--fs-xs)) !important;
}

.case-study p {
  margin-bottom: 0.8rem;
  color: var(--text-muted);
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.6;
}

.case-study p:last-child {
  margin-bottom: 0;
}

/* Questions */
.questions {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 2rem 0;
}

.question-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0;
  background: transparent;
  border: none;
}

.question-item i {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 4px;
  background: var(--secondary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

.question-item i::before {
  content: "?";
  font-family: inherit;
  font-weight: 700;
}

.measure-page-preview .questions .question-item > i {
  background: var(--otv-yellow, #f4d046);
  color: var(--otv-ink, #0f172a);
}

.question-item i.fas::before {
  content: "?";
}

.question-item p {
  margin: 0;
  font-weight: 500;
  font-size: var(--measure-body-size, 0.95rem);
  color: var(--text-primary);
  line-height: 1.5;
}

/* Infographic Cards */
.infographic-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 1.5rem;
}

.infographic-tab {
  border: 1px solid var(--border-light);
  background: white;
  color: var(--primary);
  border-radius: 999px;
  padding: 0.6rem 1.4rem;
  font-weight: 600;
  font-size: var(--measure-meta-size, 0.8rem);
  cursor: pointer;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.infographic-tab:hover,
.infographic-tab:focus {
  outline: none;
  border-color: rgba(52, 152, 219, 0.4);
  box-shadow: 0 6px 12px rgba(15, 23, 42, 0.08);
}

.infographic-tab.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
  box-shadow: 0 10px 20px rgba(52, 152, 219, 0.28);
}

.infographic-stage {
  position: relative;
}

.infographic-card {
  background: #f8fafc;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
  animation: fadeIn 0.35s ease;
}

.infographic-card.active {
  display: flex;
}

.infographic-card[hidden] {
  display: none !important;
}

.infographic-card h3 {
  margin: 0 0 1.5rem 0;
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 700;
  color: var(--text-primary);
}

.chart-note {
  margin: 1rem 0 0 0;
  font-size: var(--measure-meta-size, 0.8rem);
  line-height: 1.5;
  color: var(--text-muted);
}

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

/* Bar Chart. Each row reads label and value on one line with the bar directly
   underneath, so the bar spans the full width and the two rows can be compared
   against the same edge. The older layout put label, bar and value side by side,
   which left the bar a narrow leftover column and clipped longer values. */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.bar-chart-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.bar-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.bar-label {
  position: relative;
  padding-left: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: var(--measure-meta-size, 0.8rem);
}

/* The dot ties the label to the colour of its bar. */
.bar-label::before {
  content: "";
  position: absolute;
  top: 0.4em;
  left: 0;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
}

.tone-before .bar-label::before {
  background: #dc2626;
}

.tone-after .bar-label::before {
  background: #16a34a;
}

.measure-page-preview #infographic-comparison .bar-label {
  padding-left: 0;
}

.measure-page-preview #infographic-comparison .bar-label::before {
  content: none;
}

/* The number is the point of the chart, so it outranks the label. */
.bar-value {
  flex: 0 1 auto;
  font-weight: 700;
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.35;
  color: var(--text-primary);
  text-align: right;
}

/* The frame is the limit: a full bar reaches its right edge. */
.bar-track {
  position: relative;
  height: 1.75rem;
  background: #eef2f7;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--value) * 1%);
  min-width: 3px;
  border-radius: inherit;
  transition: width 0.6s ease;
}

/* Compact legacy cost charts whose label, track and value are direct children. */
.bar-chart:has(> .bar-chart-row:not(.tone-before):not(.tone-after)) {
  gap: 0.8rem;
}

.bar-chart-row:not(.tone-before):not(.tone-after) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 0.75rem;
  row-gap: 0.3rem;
}

.bar-chart-row:not(.tone-before):not(.tone-after) > .bar-label {
  grid-column: 1;
  grid-row: 1;
  padding-left: 0;
  font-size: var(--measure-meta-size, 0.8rem);
}

.bar-chart-row:not(.tone-before):not(.tone-after) > .bar-label::before {
  display: none;
}

.bar-chart-row:not(.tone-before):not(.tone-after) > .bar-value {
  grid-column: 2;
  grid-row: 1;
  font-size: var(--measure-body-size, 0.95rem);
}

.bar-chart-row:not(.tone-before):not(.tone-after) > .bar-track {
  grid-column: 1 / -1;
  grid-row: 2;
  width: 100%;
  height: 0.75rem;
  border-radius: 999px;
}

.bar-taxed {
  background: linear-gradient(90deg, #f87171, #dc2626);
}

.bar-savings {
  background: linear-gradient(90deg, #4ade80, #16a34a);
}

/* A shared axis under both bars. Ticks sit outside the tracks rather than
   inside them, because a fill would paint over in-track gridlines and hide the
   scale exactly on the bar the reader is trying to measure. */
.bar-axis {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin-top: -0.75rem;
  padding-top: 0.6rem;
  color: var(--text-muted);
  font-size: var(--measure-meta-size, 0.8rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bar-axis::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0.3rem;
  border-right: 1px solid var(--border-medium);
  background: repeating-linear-gradient(
    to right,
    var(--border-medium) 0,
    var(--border-medium) 1px,
    transparent 1px,
    transparent 25%
  );
}

/* Two qualitative statements, where a bar length would be meaningless. */
.compare-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.compare-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-top: 3px solid var(--border-medium);
  border-radius: var(--radius-md);
}

.compare-side.tone-before {
  border-top-color: #dc2626;
}

.compare-side.tone-after {
  border-top-color: #16a34a;
}

.compare-label {
  font-size: var(--measure-meta-size, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.compare-value {
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .bar-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
  }

  .bar-value {
    text-align: left;
  }

  .compare-pair {
    grid-template-columns: 1fr;
  }
}

/* Flow Diagram */
.flow-diagram {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.flow-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .flow-steps {
    flex-direction: row;
    align-items: stretch;
  }
}

.flow-step {
  flex: 1;
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.flow-step h4 {
  margin: 0;
  font-size: var(--measure-body-size, 0.95rem);
  color: var(--primary);
}

.flow-step p {
  margin: 0;
  font-size: var(--measure-body-size, 0.95rem);
  color: var(--text-muted);
}

.flow-arrow {
  align-self: center;
  font-size: var(--fs-xl);
  color: var(--secondary);
}

/* Video Suggestion */
.video-suggestion {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 0;
  margin: 2rem 0;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.video-suggestion > i {
  display: none;
}

/* The card itself keeps padding: 0 because of the variant below, so the wrapper
   is what insets the title and the quote. Without this the text sat against the
   border on all 63 measures that use the plain block. */
.video-suggestion > div {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.25rem 1.5rem;
}

/* One measure uses a richer block whose thumbnail runs edge to edge and whose
   heading and disclaimer strip pad themselves; padding the wrapper would inset
   the image and double pad the rest. */
.video-suggestion > div:has(.video-suggestion-content) {
  gap: 0;
  padding: 0;
}

.video-suggestion-content {
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.video-suggestion-content::before {
  content: "\f03d";
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-lg);
  flex-shrink: 0;
}

.video-suggestion-content h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 700;
  line-height: 1.5;
  flex: 1;
}

.video-suggestion h4 {
  display: inline;
  margin: 0;
  color: var(--text-primary);
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 700;
  line-height: 1.6;
}

.video-suggestion p {
  display: inline;
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.6;
}

.video-suggestion-image {
  width: 100%;
  height: auto;
  display: block;
  border-top: 1px solid var(--border-light);
}

.video-suggestion > .video-suggestion-preview {
  gap: 0;
  padding: 0;
}

.video-suggestion-placeholder {
  position: relative;
  padding-top: 56.25%;
  background: var(--bg-hover);
  border-top: 1px solid var(--border-light);
}

.video-suggestion-placeholder::before {
  content: "\f007";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font: 900 3.5rem/1 "Font Awesome 5 Free";
}

.measure-reading {
  grid-column: 1 / -1;
  padding: 0.75rem;
  border: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, color-mix(in srgb, #facc15 14%, var(--bg-card)), var(--bg-card));
  box-shadow: var(--shadow-sm);
}

.measure-reading h3,
.measure-reading-dialog-body h3 { margin: 0 0 0.6rem; }
.measure-reading-short,
.measure-reading-script {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.measure-reading-dialog-body p { margin: 0 0 0.75rem; line-height: 1.55; color: var(--text-primary); }
.measure-reading-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.measure-preview-actions > button,
.measure-reading-actions > button {
  --measure-type-body: 0.8125rem;
  min-width: 0;
  min-height: 34px;
  padding: 0.325rem 0.375rem;
  gap: 0.25rem;
  white-space: nowrap;
}

.measure-reading-actions > button i { flex-shrink: 0; }

@media (max-width: 900px) {
  .measure-preview-actions > button,
  .measure-reading-actions > button { min-height: 38px; }
}

.measure-video-link { margin-top: 1rem; }

.nova-ui-dialog.measure-reading-dialog:not([open]) { display: none; }

.nova-ui-dialog.measure-reading-dialog {
  width: calc(100% - 2rem);
  max-width: 640px;
  max-height: calc(100vh - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nova-ui-dialog.measure-reading-dialog.is-inline {
  position: static;
  width: 100%;
  max-width: none;
  max-height: none;
  margin: 0 0 1.25rem;
  transform: none;
  scroll-margin-top: calc(var(--header-height) + 8rem);
}

.measure-reading-dialog-head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 1rem;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-card);
}

.measure-reading-dialog-head h2 { margin: 0; font-size: var(--fs-md); }
.measure-reading-dialog-head [data-close-reading] {
  flex: 0 0 36px;
  min-height: 36px;
  padding: 0;
}
.measure-reading-dialog-body { padding: 1rem 1rem 1.5rem; }
.measure-reading-copy.otv-secondary-btn { background: #e3edff; border-color: #bfd3ff; color: #174498; }
.measure-reading-copy.otv-secondary-btn:hover { background: #d0e0fd; }
html.dark .measure-reading-copy.otv-secondary-btn { background: #253e67; border-color: #456a9f; color: #e2edff; }
html.dark .measure-reading-copy.otv-secondary-btn:hover { background: #304f80; }

.measure-page-preview #section-13 > h3 + p { padding-top: 0.5rem; }

.video-disclaimer {
  margin: 0;
  padding: 1rem 1.5rem;
  font-size: var(--measure-meta-size, 0.8rem);
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  background: var(--bg-hover);
  border-top: 1px solid var(--border-light);
}

/* Proposal Quote */
.proposal-quote {
  background: #f8fafc;
  border-left: 4px solid var(--secondary);
  padding: 1.5rem 1.5rem 1.5rem 2rem;
  margin: 2rem 0;
  border-radius: var(--radius-lg);
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.proposal-quote h4 {
  margin-top: 0;
  color: var(--primary);
  font-size: var(--measure-body-size, 0.95rem);
  margin-bottom: 1rem;
}

.proposal-quote p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.7;
}

/* Highlight Box. The "what this means for you" callout. The lead-in prose, the
   sub heading and the list of concrete points each get their own visual layer,
   otherwise the whole thing reads as one undifferentiated block of text. */
.highlight-box {
  background: linear-gradient(
    135deg,
    rgba(59, 130, 246, 0.1),
    rgba(37, 99, 235, 0.05)
  );
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-left: 3px solid var(--secondary);
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: var(--radius-lg);
}

/* One spacing rule for every direct child, so prose, headings, charts, lists
   and tables all breathe the same regardless of the order a measure uses. */
.highlight-box > * + * {
  margin-top: 0.875rem;
}

/* margin-bottom is reset because .measure-article-content p adds one, which
   would fight the sibling spacing above and leave a gap under the box. */
.highlight-box p {
  margin-bottom: 0;
  color: var(--text-primary);
  line-height: 1.7;
  font-size: var(--measure-body-size, 0.95rem);
}

/* The opening sentence carries the point, so let it lead. */
.highlight-box > p:first-child {
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 500;
}

/* A closing aside such as "Nu lux, dar demnitate." */
.highlight-box > p > em:only-child {
  color: var(--text-secondary);
  font-size: var(--measure-meta-size, 0.8rem);
}

.highlight-box h4 {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--measure-body-size, 0.95rem);
  font-weight: 700;
  line-height: 1.45;
  color: var(--text-primary);
}

.highlight-box h4 i {
  color: var(--secondary);
  font-size: 0.95em;
}

/* Unclassed lists turn into chips: short entries line up side by side, while a
   long explanation still claims a full row. Lists that carry their own class,
   such as .impact-list, keep the layout that class defines. */
.highlight-box ul:not([class]) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.highlight-box ul:not([class]) > li {
  flex: 1 1 auto;
  min-width: min(100%, 9.5rem);
  position: relative;
  padding: 0.625rem 0.875rem 0.625rem 2.125rem;
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--radius-md);
  font-size: var(--measure-body-size, 0.95rem);
  line-height: 1.55;
  color: var(--text-primary);
}

.highlight-box ul:not([class]) > li::before {
  content: "\2713";
  position: absolute;
  left: 0.875rem;
  color: var(--secondary);
  font-weight: 700;
}

.highlight-box ul:not([class]) > li strong {
  color: var(--text-primary);
}

/* Comparison tables, for the measures that answer with "before vs. after". */
.highlight-box table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--measure-body-size, 0.95rem);
  background: var(--bg-card);
  border: 1px solid rgba(59, 130, 246, 0.18);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.highlight-box th {
  padding: 0.625rem 0.875rem;
  background: rgba(59, 130, 246, 0.08);
  font-size: var(--measure-meta-size, 0.8rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
  text-align: center;
}

.highlight-box th:first-child {
  text-align: left;
}

.highlight-box td {
  padding: 0.625rem 0.875rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-primary);
  text-align: center;
}

.highlight-box td:first-child {
  text-align: left;
}

.highlight-box td.yes {
  color: var(--success);
  font-weight: 700;
}

.highlight-box td.no {
  color: var(--danger);
  font-weight: 700;
}

@media (max-width: 600px) {
  .highlight-box {
    padding: 1.125rem;
  }

  .highlight-box > p:first-child {
    font-size: var(--measure-body-size, 0.95rem);
  }

  /* One chip per row, the side by side layout gets too tight to read. */
  .highlight-box ul:not([class]) > li {
    min-width: 100%;
  }
}

/* ========================================
   DARK MODE - ARTICLE COMPONENTS
======================================== */
html.dark .benefits-grid .benefit-item {
  background: rgba(59, 130, 246, 0.13);
  border-color: var(--border-light);
}

html.dark .benefits-grid .benefit-item:hover {
  box-shadow: var(--shadow-lg);
  background: rgba(59, 130, 246, 0.19);
}

html.dark .proposal-quote,
html.dark .argument,
html.dark .faq-item,
html.dark .impact-list li {
  background: rgba(42, 157, 143, 0.08);
  border-color: var(--border-light);
}

html.dark .argument {
  border-color: rgba(52, 211, 153, 0.3);
}

/* The left accent stays blue in dark mode, it is what ties the box to the
   chips and headings inside it. */
html.dark .highlight-box {
  background: rgba(42, 157, 143, 0.08);
  border-color: var(--border-light);
  border-left-color: var(--secondary);
}

html.dark .highlight-box ul:not([class]) > li,
html.dark .highlight-box table {
  background: rgba(15, 23, 42, 0.35);
  border-color: var(--border-light);
}

html.dark .highlight-box th {
  background: rgba(59, 130, 246, 0.12);
}

html.dark .example-card,
html.dark .case-study,
html.dark .infographic-card,
html.dark .video-suggestion {
  background: var(--bg-card);
  border-color: var(--border-light);
}

html.dark .question-item {
  background: transparent;
}

html.dark .proposal-quote h4,
html.dark .highlight-box p,
html.dark .benefit-item h4,
html.dark .argument h4,
html.dark .faq-question h4,
html.dark .example-header h4,
html.dark .person-info h4 {
  color: var(--text-primary);
}

/* The light theme hairline is a dark one; on a dark card it would disappear and a
   flag with white in it would bleed into the background. */
html.dark .example-flag {
  box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.22);
}

html.dark .question-item p {
  color: var(--text-primary);
}

html.dark .question-item i {
  background: var(--secondary);
  color: white;
}

html.dark .proposal-quote p,
html.dark .argument p,
html.dark .faq-answer p,
html.dark .example-card p,
html.dark .case-study p,
html.dark .video-suggestion p,
html.dark .chart-note {
  color: var(--text-secondary);
}

html.dark .video-suggestion h4 {
  color: var(--text-primary);
}

html.dark .video-suggestion-content h3 {
  color: var(--text-primary);
}

html.dark .video-disclaimer {
  background: var(--bg-hover);
  color: var(--text-muted);
  border-color: var(--border-light);
}

html.dark .content-tag {
  background: #1e252b;
  color: #b0b8c1;
}

html.dark .bar-track {
  background: #172033;
  border-color: var(--border-medium);
}

html.dark .compare-side {
  background: rgba(15, 23, 42, 0.45);
  border-color: var(--border-light);
}

html.dark .infographic-tab {
  background: var(--bg-card);
  border-color: var(--border-light);
  color: var(--text-primary);
}

html.dark .infographic-tab.active {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
}

html.dark .flow-step {
  background: var(--bg-card);
  border-color: var(--border-light);
}

/* ========================================
   OTV Community Prototype
======================================== */
.simulation-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #927100;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.otv-home-band {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.6fr);
  gap: 2rem;
  align-items: center;
  margin: 3rem 0;
  padding: 2rem;
  background: #101010;
  color: #fff;
  border-left: 4px solid #facc15;
  border-radius: 6px;
}

.otv-home-copy h2,
.otv-home-status strong {
  color: #fff;
}

.otv-home-copy h2 { margin: 0 0 0.6rem; font-size: var(--fs-xl); }
.otv-home-copy p { margin: 0; color: #b7b7b7; line-height: 1.65; }
.otv-home-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.35rem; }

.otv-primary-btn,
.otv-secondary-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.7rem 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.otv-primary-btn { background: #facc15; color: #111; }
.otv-primary-btn:hover { background: #eab308; color: #111; }
.otv-secondary-btn { background: transparent; color: var(--text-primary); border-color: var(--border-light); }
.otv-home-band .otv-secondary-btn { color: #fff; border-color: #4a4a4a; }
.otv-home-status { padding-left: 1.5rem; border-left: 1px solid #383838; display: grid; gap: 0.65rem; }
.otv-home-status small { color: #9d9d9d; }

.live-pill {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.55rem;
  background: #e11d48;
  color: #fff;
  border-radius: 4px;
  font-size: var(--fs-xs);
  font-weight: 800;
}
.live-pill span { width: 7px; height: 7px; border-radius: 50%; background: #fff; }

.otv-community-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.otv-community-header > div { min-width: 0; flex: 1; }
.otv-community-header h1 { margin: 0 0 0.5rem; font-family: "Poppins", sans-serif; font-size: var(--fs-xl); font-weight: 700; color: var(--text-primary); }
.otv-community-header p { margin: 0; max-width: 720px; color: var(--text-secondary); line-height: 1.65; }
.otv-community-header .otv-primary-btn {
  flex: 0 0 auto;
  align-self: flex-start;
  white-space: nowrap;
  min-height: 40px;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.otv-community-header .otv-primary-btn:hover {
  box-shadow: var(--shadow-md);
}
.otv-interest-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin-bottom: 1.5rem; }
.otv-interest-grid a { min-width: 0; display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); color: var(--text-primary); text-decoration: none; }
.otv-interest-grid a:hover { border-color: #d4a800; background: color-mix(in srgb, #facc15 6%, var(--bg-card)); }
.otv-interest-grid a > i { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 4px; background: rgba(250,204,21,.16); color: #9a7800; }
.otv-interest-grid a > span { min-width: 0; display: grid; gap: 0.18rem; }
.otv-interest-grid strong { font-size: var(--fs-sm); }
.otv-interest-grid small { overflow: hidden; color: var(--text-muted); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.otv-community-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.otv-main-column { min-width: 0; }

.otv-live-player,
.classic-feature {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  background: #111;
  border-radius: 6px;
  color: #fff;
}
.otv-player-image,
.classic-feature-image,
.otv-classic-promo-image {
  position: absolute;
  inset: 0;
  background-image: url('assets/otv/community-cover.jpeg');
  background-size: cover;
  background-position: center;
}
.otv-player-image { filter: brightness(0.55) saturate(0.75); transform: scale(1.02); }
.otv-player-shade,
.classic-feature-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.9), rgba(0,0,0,.2)); }
.otv-live-meta { position: absolute; left: 2rem; bottom: 2rem; max-width: 520px; z-index: 2; }
.otv-live-meta h2 { margin: 0.85rem 0 0.5rem; color: #fff; font-size: var(--fs-xl); }
.otv-live-meta p { margin: 0 0 1rem; color: #d2d2d2; line-height: 1.55; }
.otv-live-meta div { color: #bdbdbd; font-size: var(--fs-sm); display: flex; gap: 0.45rem; }
.otv-play-btn {
  position: absolute;
  right: 2rem;
  top: 50%;
  translate: 0 -50%;
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 50%;
  background: #facc15;
  color: #111;
  font-size: var(--fs-lg);
  cursor: pointer;
  z-index: 3;
}
.otv-play-btn.playing { background: #fff; }
.otv-now-playing { position: absolute; right: 1rem; top: 1rem; z-index: 2; color: #d4d4d4; font-size: var(--fs-xs); }

.otv-section-block { margin-top: 2.5rem; }
.otv-section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1rem; }
.otv-section-heading span,
.otv-eyebrow,
.classic-feature-copy > span,
.classic-watch-party span { color: #927100; font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.5px; }
.otv-section-heading h2 { margin: 0.25rem 0 0; color: var(--text-primary); font-size: var(--fs-lg); }
.otv-text-btn { border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.otv-proposals-list { display: grid; gap: 0.8rem; }
.otv-proposal-card { padding: 1.25rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.otv-proposal-topline { display: flex; justify-content: space-between; gap: 1rem; }
.otv-topic { color: #806400; font-size: var(--fs-xs); font-weight: 700; }
.otv-stage { color: var(--text-muted); font-size: var(--fs-xs); }
.otv-proposal-card h3 { margin: 0.65rem 0 0.45rem; color: var(--text-primary); font-size: var(--fs-md); }
.otv-proposal-card > p { margin: 0; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.55; }
.otv-author-row { display: flex; align-items: center; gap: 0.55rem; margin: 1rem 0; color: var(--text-muted); font-size: var(--fs-xs); }
.otv-author-row > span:last-child { margin-left: auto; }
.otv-mini-avatar,
.otv-user-avatar { display: grid; place-items: center; flex: 0 0 auto; background: #facc15; color: #111; font-weight: 800; border-radius: 50%; }
.otv-user-avatar:not(img, .account-signin *) { background: var(--avatar-fallback-bg); color: var(--text-primary); }
.otv-mini-avatar { width: 28px; height: 28px; font-size: var(--fs-xs); }
.otv-user-avatar { width: 34px; height: 34px; font-size: var(--fs-xs); }
.demo-status-dot { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: #10b981; }
.otv-threshold > div:first-child { display: flex; justify-content: space-between; color: var(--text-muted); font-size: var(--fs-xs); }
.otv-progress { height: 6px; margin: 0.5rem 0 0.9rem; overflow: hidden; background: var(--bg-hover); border-radius: 3px; }
.otv-progress span { display: block; height: 100%; background: #facc15; }
.otv-support-btn { width: 100%; padding: 0.65rem; border: 1px solid var(--border-light); border-radius: 5px; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.otv-support-btn.supported { border-color: #16a34a; background: rgba(22,163,74,.08); color: #15803d; }

.otv-community-rail { display: grid; gap: 1rem; }
.otv-leader-panel { overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.otv-leader-image { aspect-ratio: 16/7; background: url('assets/otv/dan-diaconescu-direct.jpg') center/cover; }
.otv-leader-copy { padding: 1rem; }
.otv-leader-copy h3 { margin: 0.3rem 0; color: var(--text-primary); font-size: var(--fs-lg); }
.otv-leader-copy p { margin: 0 0 0.75rem; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.5; }
.otv-leader-copy .otv-text-btn { padding: 0; color: #927100; font-weight: 700; }
.otv-news-panel { padding: 1.15rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.otv-news-panel > a { display: grid; gap: 0.25rem; padding: 0.75rem 0; border-top: 1px solid var(--border-light); color: var(--text-primary); text-decoration: none; }
.otv-news-panel > a small { color: var(--text-muted); font-size: var(--fs-xs); }
.otv-news-panel > a strong { font-size: var(--fs-xs); line-height: 1.4; }
.otv-poll-panel,
.otv-members-panel { padding: 1.15rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.otv-poll-panel h3 { color: var(--text-primary); font-size: var(--fs-md); line-height: 1.45; }
.otv-poll-options { display: grid; gap: 0.55rem; }
.otv-poll-options button { display: flex; justify-content: space-between; padding: 0.7rem; border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-main); color: var(--text-primary); cursor: pointer; }
.otv-poll-options button.selected { border-color: #c59a00; box-shadow: inset 4px 0 #facc15; }
.otv-poll-panel > small { display: block; margin-top: 0.75rem; color: var(--text-muted); font-size: var(--fs-xs); }
.otv-section-heading.compact { margin-bottom: 0.75rem; }
.otv-member { display: flex; align-items: center; gap: 0.65rem; padding: 0.7rem 0; border-top: 1px solid var(--border-light); }
.otv-member div { display: grid; gap: 0.15rem; min-width: 0; }
.otv-member strong { color: var(--text-primary); font-size: var(--fs-xs); }
.otv-member small { color: var(--text-muted); font-size: var(--fs-xs); }
.member-online { width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #10b981; }
.otv-classic-promo { position: relative; min-height: 220px; padding: 1.25rem; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; border-radius: 6px; color: #fff; text-decoration: none; }
.otv-classic-promo::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent, rgba(0,0,0,.95)); }
.otv-classic-promo > *:not(.otv-classic-promo-image) { position: relative; z-index: 2; }
.otv-classic-promo span { color: #facc15; font-size: var(--fs-xs); font-weight: 800; }
.otv-classic-promo h3 { margin: 0.3rem 0; color: #fff; }
.otv-classic-promo p { margin: 0 0 0.75rem; color: #d1d1d1; font-size: var(--fs-xs); }
.otv-classic-promo strong { color: #facc15; font-size: var(--fs-xs); }

.classic-feature { min-height: 500px; }
.classic-feature-image { filter: brightness(.48) saturate(.65); }
.classic-feature-copy { position: absolute; left: 2.5rem; bottom: 2.5rem; z-index: 2; max-width: 580px; }
.classic-feature-copy h2 { margin: 0.6rem 0; color: #fff; font-size: var(--fs-xl); }
.classic-feature-copy p { color: #d0d0d0; line-height: 1.6; }
.classic-duration { position: absolute; right: 1rem; bottom: 1rem; z-index: 2; padding: 0.25rem 0.4rem; background: rgba(0,0,0,.8); border-radius: 3px; font-size: var(--fs-xs); }
.classic-library { margin-bottom: 2.5rem; }
.classic-filters { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.classic-filters button { border: 0; padding: 0.45rem 0.65rem; border-radius: 4px; background: transparent; color: var(--text-secondary); cursor: pointer; }
.classic-filters button.active { background: var(--text-primary); color: var(--bg-card); }
.classic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.classic-card { min-width: 0; padding: 0; border: 0; background: transparent; text-align: left; cursor: pointer; }
.classic-thumb { position: relative; display: grid; place-items: center; aspect-ratio: 16/10; background: url('assets/otv/community-cover.jpeg') center/240% auto; border-radius: 5px; overflow: hidden; color: #fff; }
.classic-thumb::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.2); }
.classic-thumb i { position: relative; z-index: 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: rgba(0,0,0,.72); }
.classic-thumb small { position: absolute; right: 0.4rem; bottom: 0.4rem; z-index: 2; padding: 0.18rem 0.3rem; background: #111; border-radius: 2px; }
.classic-card-copy { display: grid; gap: 0.25rem; margin-top: 0.65rem; }
.classic-card-copy strong { color: var(--text-primary); font-size: var(--fs-sm); }
.classic-card-copy small { color: var(--text-muted); }
.classic-watch-party { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.5rem 0; border-top: 1px solid var(--border-light); }
.classic-watch-party h2 { margin: 0.4rem 0; color: var(--text-primary); font-size: var(--fs-lg); }
.classic-watch-party p { margin: 0; color: var(--text-secondary); }
.classic-watch-party .confirmed { border-color: #16a34a; color: #15803d; }

.reforms-category-grid { margin-top: 0.5rem; }

.proposal-type-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; margin-bottom: 1.25rem; padding: 3px; background: var(--bg-hover); border-radius: 6px; }
.proposal-type-switch button { padding: 0.6rem; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.proposal-type-switch button.active { background: var(--bg-card); color: var(--text-primary); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.proposal-success { display: grid; justify-items: center; gap: 0.5rem; padding: 1.5rem 0 0.5rem; text-align: center; }
.proposal-success > i { color: #16a34a; font-size: 3rem; margin-bottom: 0.35rem; }
.proposal-success h3 { margin: 0; font-family: 'Poppins', sans-serif; font-size: var(--fs-lg); letter-spacing: -0.02em; color: var(--text-primary); }
.proposal-success p { margin: 0; max-width: 40ch; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.6; }
.proposal-success .btn { margin-top: 1.25rem; }

html.dark .simulation-label,
html.dark .otv-section-heading span,
html.dark .otv-eyebrow { color: #facc15; }

@media (max-width: 1050px) {
  .otv-interest-grid { grid-template-columns: repeat(2, 1fr); }
  .otv-community-layout { grid-template-columns: 1fr; }
  .otv-community-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .otv-classic-promo { min-height: 240px; }
  .classic-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .otv-interest-grid { grid-template-columns: 1fr; }
  .otv-home-band { grid-template-columns: 1fr; padding: 1.25rem; }
  .otv-home-status { padding: 1rem 0 0; border-left: 0; border-top: 1px solid #383838; }
  .otv-community-header { align-items: stretch; flex-direction: column; }
  .otv-community-header .otv-primary-btn { width: 100%; }
  .otv-community-layout,
  .otv-community-rail { display: grid; grid-template-columns: 1fr; }
  .otv-live-player { min-height: 390px; }
  .otv-live-meta { left: 1.1rem; right: 1.1rem; bottom: 1.1rem; }
  .otv-live-meta h2 { font-size: var(--fs-lg); }
  .otv-play-btn { right: 1rem; top: 1rem; translate: 0; width: 48px; height: 48px; }
  .otv-now-playing { display: none; }
  .otv-section-heading { align-items: flex-start; flex-direction: column; }
  .classic-feature { min-height: 440px; }
  .classic-feature-copy { left: 1.25rem; right: 1.25rem; bottom: 1.5rem; }
  .classic-feature-copy h2 { font-size: var(--fs-lg); }
  .classic-grid { grid-template-columns: 1fr; }
  .classic-watch-party { align-items: flex-start; flex-direction: column; }
  .classic-watch-party .otv-secondary-btn { width: 100%; }
}

/* ========================================
   RESPONSIVE - ARTICLE COMPONENTS
======================================== */
@media (max-width: 768px) {
  .benefits-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .benefit-item {
    padding: 1rem;
  }

  .video-suggestion > div {
    padding: 1rem;
  }

  .video-suggestion-content {
    padding: 1rem;
  }

  .video-suggestion-content::before {
    width: 42px;
    height: 42px;
    min-width: 42px;
    font-size: var(--fs-md);
  }

  .quote {
    padding: 2rem 1.5rem;
  }

  .quote::before {
    font-size: 80px;
    top: -5px;
    left: 10px;
  }

  .quote p {
    font-size: var(--measure-body-size, 0.95rem);
  }

  .quote cite {
    font-size: var(--measure-meta-size, 0.8rem);
  }
}

/* ========================================
   Cum funcționează Page Content Styles
   ======================================== */

.measure-article section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light, #e2e8f0);
}

.measure-article section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.measure-article h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0 0 1rem;
  line-height: 1.4;
}

.measure-article p {
  font-size: var(--fs-md);
  line-height: 1.75;
  color: var(--text-secondary, #475569);
  margin: 0 0 0.875rem;
}

.measure-article p:last-child {
  margin-bottom: 0;
}

.measure-article ul,
.measure-article ol {
  margin: 1rem 0;
  padding-left: 1.5rem;
  color: var(--text-secondary, #475569);
}

.measure-article li {
  margin-bottom: 0.5rem;
  line-height: 1.7;
}

.measure-article li:last-child {
  margin-bottom: 0;
}

.measure-article strong {
  color: var(--text-primary, #1e293b);
  font-weight: 600;
}

.measure-article em {
  color: var(--text-muted, #64748b);
}

.measure-article blockquote {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary, #f8fafc);
  border-left: 3px solid var(--secondary, #3b82f6);
  border-radius: 0 8px 8px 0;
  font-size: var(--fs-md);
}

.measure-article blockquote p {
  margin: 0;
}

.measure-article blockquote strong {
  color: var(--secondary, #3b82f6);
}

/* Override - ensure section styling is applied */
.measure-page-main .measure-article section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid #e2e8f0;
}

.measure-page-main .measure-article section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.measure-page-main .measure-article section h2 {
  font-size: var(--fs-lg);
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #e2e8f0;
}

.measure-page-main .measure-article section p {
  font-size: var(--fs-md);
  line-height: 1.8;
  color: #475569;
  margin-bottom: 1rem;
}

.measure-page-main .measure-article section ul,
.measure-page-main .measure-article section ol {
  margin: 1rem 0 1.25rem;
  padding-left: 1.75rem;
}

.measure-page-main .measure-article section li {
  margin-bottom: 0.6rem;
  line-height: 1.75;
  color: #475569;
}

.measure-page-main .measure-article section blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(to right, #eff6ff, #f8fafc);
  border-left: 4px solid #3b82f6;
  border-radius: 0 10px 10px 0;
}

.measure-page-main .measure-article section blockquote p {
  margin: 0;
  color: #1e40af;
  font-size: var(--fs-md);
}

.measure-page-main .measure-article section blockquote strong {
  color: #1e40af;
}

.measure-page-main .measure-article section blockquote em {
  color: #3b82f6;
}

/* Footer disabled links */
.footer-link-disabled {
  color: #94a3b8;
  cursor: not-allowed;
  opacity: 0.6;
  font-size: var(--fs-md);
}

/* Footer disclaimer */
.footer-disclaimer {
  font-size: var(--fs-xs);
  color: #64748b;
  margin-top: 0.25rem;
  opacity: 0.8;
}

/* ========================================
   Dev Auth Screen
======================================== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
}

.auth-container {
  background: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.auth-logo-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(
    to right,
    #5483e0 0%,
    #5483e0 33.33%,
    #fcd116 33.33%,
    #fcd116 66.66%,
    #ef5f6f 66.66%,
    #ef5f6f 100%
  );
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: white;
  font-family: "Poppins", sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auth-logo-text {
  font-size: var(--fs-xl);
  font-weight: 700;
  color: white;
  font-family: "Poppins", sans-serif;
}

.auth-title {
  color: white;
  font-size: var(--fs-xl);
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.auth-subtitle {
  color: #94a3b8;
  font-size: var(--fs-md);
  margin: 0 0 2rem;
  line-height: 1.6;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-wrapper i {
  position: absolute;
  left: 1rem;
  color: #64748b;
  font-size: var(--fs-md);
}

.auth-input-wrapper input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: white;
  font-size: var(--fs-md);
  transition: all 0.2s ease;
}

.auth-input-wrapper input::placeholder {
  color: #64748b;
}

.auth-input-wrapper input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-error {
  color: #ef4444;
  font-size: var(--fs-sm);
  margin: 0;
  min-height: 1.25rem;
}

.auth-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: var(--fs-md);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-btn:hover {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -5px rgba(59, 130, 246, 0.4);
}

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

.auth-footer {
  color: #64748b;
  font-size: var(--fs-xs);
  margin: 2rem 0 0;
}

/* ========================================
   RAPORT DIRECT NEWS
======================================== */
.rd-news-page {
  position: relative;
  width: min(100%, 1200px);
  margin: 0 auto;
  color: var(--text-primary);
}

.rd-page-header {
  display: grid;
  grid-template-areas: "heading actions";
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* Sits 20px higher than the page padding would put it. */
  margin: calc(0.25rem - 20px) 0 1.5rem;
}


.rd-page-header h1 {
  margin: 0.45rem 0 0.25rem;
  font-size: var(--fs-xl);
  line-height: 1.2;
  letter-spacing: 0;
}

.rd-page-header p {
  color: var(--text-secondary);
  line-height: 1.5;
}

.rd-header-actions {
  grid-area: actions;
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.rd-refresh-btn {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.rd-refresh-btn:hover {
  color: var(--secondary);
  border-color: var(--secondary);
  background: var(--bg-hover);
}

.rd-refresh-btn i {
  display: inline-block;
  transform-origin: center;
}

.rd-refresh-btn.is-loading i,
.rd-refresh-btn[aria-busy="true"] i {
  animation: rd-spin 0.9s linear infinite;
}

@keyframes rd-spin {
  to { transform: rotate(360deg); }
}

/* Sits where the page title used to be, left of the refresh button: a compact
   pill-shaped segmented control. */
.rd-category-switcher {
  grid-area: heading;
  justify-self: start;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0.25rem;
  overflow-x: auto;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  scrollbar-width: none;
}

.rd-category-switcher::-webkit-scrollbar { display: none; }

.rd-category-switcher button {
  flex: 0 0 auto;
  min-width: 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.4rem 1rem;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.rd-category-switcher button:not(:first-of-type)::before {
  content: '';
  position: absolute;
  left: 0;
  width: 1px;
  height: 18px;
  background: var(--border-light);
}

.rd-category-switcher button {
  position: relative;
}

.rd-category-switcher button:hover:not(.active) {
  background: var(--bg-hover);
}

/* Drawn inside the pill so the active tab never gets a second ring around it. */
.rd-category-switcher button:focus {
  outline: none;
}

.rd-category-switcher button:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: -2px;
}

.rd-category-switcher button.active:focus-visible {
  outline-color: rgba(255, 255, 255, 0.85);
  outline-offset: -4px;
}

.rd-category-switcher strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.rd-category-switcher button.active {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.24);
}

.rd-category-switcher button.active::before {
  display: none;
}

/* No divider touching a filled tab, active or hovered, on either side. */
.rd-category-switcher button.active + button::before,
.rd-category-switcher button:hover::before,
.rd-category-switcher button:hover + button::before {
  display: none;
}

.rd-category-switcher button.active strong {
  color: #fff;
}

/* Lifted off the dark page, matching the live player's channel picker. */
html.dark .rd-category-switcher,
html.dark .rd-refresh-btn {
  border-color: rgba(255, 255, 255, 0.14);
  background: #323c4d;
}

html.dark .rd-category-switcher strong,
html.dark .rd-refresh-btn {
  color: #e2e8f0;
}

html.dark .rd-category-switcher button:hover:not(.active),
html.dark .rd-refresh-btn:hover {
  background: #3d4a5e;
}

html.dark .rd-category-switcher button:not(:first-of-type)::before {
  background: rgba(255, 255, 255, 0.16);
}

html.dark .rd-category-switcher button.active {
  background: #2563eb;
}

html.dark .rd-category-switcher button.active strong {
  color: #fff;
}

/* The sliding pill (news.js) replaces each tab's own fill. It only animates
   on a click, so the page never opens with it growing in. */
.rd-category-switcher { position: relative; isolation: isolate; }

.rd-category-pill {
  position: absolute;
  z-index: -1;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: 0;
  border-radius: 999px;
  background: var(--secondary);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.24);
  pointer-events: none;
}

html.dark .rd-category-pill { background: #2563eb; }

.rd-category-switcher.is-sliding .rd-category-pill {
  transition: left 0.28s cubic-bezier(0.3, 0.7, 0.2, 1), width 0.28s cubic-bezier(0.3, 0.7, 0.2, 1);
}

.rd-category-switcher:has(.rd-category-pill) button.active,
html.dark .rd-category-switcher:has(.rd-category-pill) button.active {
  background: transparent;
  box-shadow: none;
}

.rd-category-switcher:has(.rd-category-pill) button strong { transition: color 0.2s ease; }

@media (prefers-reduced-motion: reduce) {
  .rd-category-switcher.is-sliding .rd-category-pill { transition: none; }
}

.rd-brief-bubble {
  position: relative;
  max-width: 720px;
  margin: 1.5rem auto 0;
  padding: 0.9rem 1rem;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  background: #eff6ff;
  color: #1e3a5f;
}

.rd-brief-bubble::after {
  content: "";
  position: absolute;
  left: 38px;
  top: -7px;
  width: 12px;
  height: 12px;
  border-left: 1px solid #bfdbfe;
  border-top: 1px solid #bfdbfe;
  background: #eff6ff;
  transform: rotate(45deg);
}

.rd-brief-bubble span {
  display: block;
  margin-bottom: 0.25rem;
  color: #2563eb;
  font-size: var(--fs-xs);
  font-weight: 800;
}

.rd-brief-bubble p {
  font-size: var(--fs-sm);
  line-height: 1.45;
}

html.dark .rd-brief-bubble {
  border-color: #315a8d;
  background: #172b46;
  color: #dbeafe;
}

html.dark .rd-brief-bubble::after { border-color: #315a8d; background: #172b46; }
html.dark .rd-brief-bubble span { color: #93c5fd; }

.rd-hero {
  text-align: center;
  padding: 0.75rem 0 2.5rem;
}

/* Mirrors raportdirect.ro: a polaroid that takes the photo's own proportions
   (never cropped), tilted 2°, at most 350px tall. Until the photo arrives it
   holds a square so the page does not jump. */
.rd-hero-frame {
  position: relative;
  display: inline-block;
  max-width: min(760px, calc(100% - 2rem));
  margin: 0 auto 2rem;
  padding: 14px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  line-height: 0;
  transform: rotate(-2deg);
  transform-origin: 50% 55%;
}

.rd-hero-frame[hidden] { display: none; }

.rd-hero-frame:not(.loaded) {
  min-width: min(350px, calc(100vw - 88px));
  min-height: min(350px, calc(100vw - 88px));
  background: #fff;
}

.rd-hero-frame img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 350px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.rd-hero-frame.loaded img { opacity: 1; }

.rd-hero-skeleton {
  position: absolute;
  inset: 14px;
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 45%, #e2e8f0 65%);
  background-size: 200% 100%;
  animation: rd-shimmer 1.25s infinite;
}

/* The lead photo, faded across the page behind everything. */
.rd-news-page {
  position: relative;
  isolation: isolate;
}

.rd-news-page::before {
  content: "";
  position: fixed;
  inset: var(--header-height) 0 0 var(--sidebar-width);
  z-index: -1;
  background: var(--rd-hero-bg, none) center / cover no-repeat;
  opacity: 0.15;
  /* A light blur keeps the text over it easy to read; the slight zoom hides
     the soft edges the blur leaves. */
  filter: blur(6px);
  transform: scale(1.04);
  pointer-events: none;
}

@media (max-width: 768px) {
  .rd-news-page::before { left: 0; }
}

/* Until the first batch arrives only the category bar and a centred spinner
   show, never an empty hero with placeholder text. */
.rd-boot-spinner { display: none; }
.rd-news-page.is-booting .rd-boot-spinner {
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-height, 64px) - 12rem);
}
.rd-news-page.is-booting > :not(.rd-page-header):not(.rd-boot-spinner) { display: none !important; }

.rd-hero-frame.loaded .rd-hero-skeleton { display: none; }

@keyframes rd-shimmer {
  to { background-position: -200% 0; }
}

.rd-hero h2 {
  max-width: 900px;
  margin: 0 auto 0.7rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-xl);
  line-height: 1.12;
  letter-spacing: 0;
}

.rd-hero h2 a {
  color: var(--text-primary);
  text-decoration: none;
}

.rd-hero-meta,
.rd-news-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.rd-hero-meta { justify-content: center; }

.rd-important-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 2.25rem;
}

/* Lets the faded lead photo show through, as on raportdirect.ro. */
.rd-important-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 5px 16px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(2px);
}

html.dark .rd-important-card {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.55);
}

.rd-important-strip[hidden] { display: none; }

.rd-important-card .rd-news-meta { margin: 0.4rem 0 0.35rem; }

.rd-important-card a {
  display: block;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.25;
}

.rd-important-card div {
  margin: 0.45rem 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.rd-important-card p {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.casa-publica-editorial-card {
  display: flex;
  flex-direction: column;
  align-self: start;
  border-top-color: #b88222;
}

.rd-important-card .casa-publica-editorial-title {
  color: var(--text-primary);
}

.rd-important-card .casa-publica-editorial-meta {
  margin: 0.55rem 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.casa-publica-editorial-meta i { color: #b88222; }

.casa-publica-editorial-card > p {
  margin-bottom: 1rem;
}

.rd-important-card .casa-publica-measure-link {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: Inter, sans-serif;
  font-size: var(--fs-xs);
}

.casa-publica-measure-link > span {
  display: block;
  margin-bottom: 0.38rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.rd-important-card .casa-publica-measure-link > a {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  color: #2563eb;
  font-family: Inter, sans-serif;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.35;
  text-decoration: none;
}

.casa-publica-measure-link > a i {
  flex: 0 0 auto;
  margin-top: 0.12rem;
}

.casa-publica-editorial-empty {
  grid-column: 1 / -1;
  padding: 1.5rem;
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  text-align: center;
}

.rd-news-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
  align-items: start;
}

.rd-news-column {
  min-width: 0;
}

.rd-news-item {
  position: relative;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--border-light);
}

.rd-news-item:first-child { padding-top: 0; }

.rd-news-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-hover);
}

.rd-headline {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-primary);
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-md);
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.rd-headline:hover,
.rd-important-card a:hover,
.rd-hero h2 a:hover { color: var(--secondary); }

.rd-news-item.rd-ultra .rd-headline { color: #dc2626; }
html.dark .rd-news-item.rd-ultra .rd-headline { color: #f87171; }
.rd-news-item.rd-very-important .rd-headline { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.rd-news-item.rd-important .rd-headline { color: #dc2626; }

.rd-summary-btn {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid var(--border-medium);
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-family: Georgia, serif;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity var(--transition-fast), background var(--transition-fast);
}

.rd-summary-btn:hover,
.rd-summary-btn:focus-visible {
  opacity: 1;
  background: var(--bg-hover);
}

.rd-summary-popup {
  position: absolute;
  z-index: 300;
  width: min(360px, calc(100vw - 24px));
  max-height: min(70vh, 420px);
  overflow: auto;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-xl);
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.rd-news-description {
  display: none;
  overflow: hidden;
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rd-news-page.rd-show-article-descriptions .rd-news-description {
  display: -webkit-box;
}

html:not(.dark) .rd-news-page::before {
  opacity: 0.07;
}

html:not(.dark) .rd-news-page :is(.rd-hero-meta, .rd-news-meta, .rd-summary-btn) {
  color: #475569;
}

html:not(.dark) .rd-news-page .rd-news-description {
  color: #334155;
}

html:not(.dark) .rd-news-page .rd-news-item {
  border-bottom-color: #bac5d4;
}

html:not(.dark) .rd-news-page .rd-summary-btn {
  border-color: #8997aa;
  opacity: 1;
}

.rd-quote {
  max-width: 760px;
  margin: 2.5rem auto 1rem;
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  text-align: center;
}

.rd-quote span {
  color: var(--secondary);
  font-size: var(--fs-xs);
  font-weight: 800;
}

.rd-quote blockquote {
  margin: 0.65rem 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-lg);
  line-height: 1.35;
}

.rd-quote cite { color: var(--text-secondary); font-size: var(--fs-xs); }

.rd-updated {
  padding: 1rem 0 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-align: center;
}

.rd-news-error {
  grid-column: 1 / -1;
  padding: 4rem 1rem;
  color: var(--text-secondary);
  text-align: center;
}

.rd-news-error i { margin-bottom: 0.75rem; color: #ef4444; font-size: var(--fs-xl); }
.rd-news-error h3 { margin-bottom: 0.4rem; color: var(--text-primary); }

@media (max-width: 960px) {
  .rd-news-columns { gap: 1.25rem; }
}

@media (max-width: 720px) {
  .rd-page-header { gap: 0.6rem; }
  .rd-category-switcher { justify-self: stretch; }
  .rd-category-switcher button { flex: 1 0 auto; min-height: 34px; padding: 0.35rem 0.6rem; }
  .rd-category-switcher strong { font-size: var(--fs-sm); }
  .rd-hero { padding-top: 0.25rem; }
  .rd-hero-frame { max-width: min(360px, calc(100vw - 52px)); padding: 12px; margin-bottom: 1.35rem; transform: rotate(-1.6deg); }
  .rd-hero-skeleton { inset: 12px; }
  .rd-hero h2 { font-size: var(--fs-xl); }
  .rd-important-strip,
  .rd-news-columns { grid-template-columns: 1fr; }
  .rd-important-strip { gap: 0.65rem; }
  .rd-news-columns { gap: 0; }
  .rd-news-column + .rd-news-column { margin-top: 0; }
  .rd-headline { font-size: var(--fs-md); }
  .rd-updated { text-align: center; }
}

/* ========================================
   NOVA EDITORIAL
======================================== */
.editorial-page-header { align-items: end; }
.editorial-eyebrow {
  display: inline-block;
  color: #9a6b16;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.12em;
}
.editorial-count {
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
  white-space: nowrap;
}
.editorial-hero-summary {
  max-width: 720px;
  margin: 0.9rem auto 0;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.editorial-image-placeholder {
  position: absolute;
  inset: 12px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 50% 42%, #f8ead0, #d8c19a);
  color: rgba(90, 60, 18, 0.52);
  font-size: 4rem;
}
.editorial-columns .rd-news-description { display: -webkit-box; }
.editorial-page .rd-important-card.rd-ultra { border-top-color: #dc2626; }
.editorial-page .rd-important-card.rd-ultra > a,
.editorial-page .rd-important-card.rd-important > a { color: #dc2626; }
.editorial-measure-links {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  margin: 0.65rem 0;
}
.editorial-hero .editorial-measure-links { justify-content: center; }
.editorial-measure-label {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.editorial-measure-label i { margin-right: 0.35rem; color: #3b82f6; }
.editorial-measure-chips {
  display: flex;
  align-items: center;
  justify-content: inherit;
  gap: 0.4rem;
  min-width: 0;
}
.editorial-measure-chips a,
.editorial-page .rd-important-card .editorial-measure-chips a {
  min-width: 0;
  max-width: 420px;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  overflow: hidden;
  padding: 0.32rem 0.55rem;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.08);
  color: #2563eb;
  font-family: Inter, sans-serif;
  font-size: var(--fs-xs);
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.editorial-measure-chips a:hover { border-color: #3b82f6; background: rgba(59, 130, 246, 0.14); }
.editorial-measure-chips a i { flex: 0 0 auto; }
.editorial-measure-more {
  flex: 0 0 auto;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.editorial-page .rd-important-card .editorial-measure-links,
.editorial-page .rd-important-card .editorial-measure-chips {
  margin: 0.55rem 0;
  color: inherit;
  font-size: inherit;
}
.editorial-reader-header .editorial-measure-links {
  flex-direction: column;
  justify-content: center;
  margin-top: 1rem;
}
.editorial-reader-header .editorial-measure-chips { flex-wrap: wrap; }
.editorial-reader-header .editorial-measure-chips a { max-width: none; white-space: normal; }

.editorial-reader {
  width: min(100%, 860px);
  margin: 0 auto;
  color: var(--text-primary);
}
.editorial-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  font-weight: 700;
  text-decoration: none;
}
.editorial-back:hover { color: var(--secondary); }
.editorial-reader-header { text-align: center; }
.editorial-reader-header h1 {
  max-width: 820px;
  margin: 0.65rem auto 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-xl);
  line-height: 1.08;
  letter-spacing: -0.025em;
}
.editorial-reader-topic {
  max-width: 700px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: var(--fs-md);
  line-height: 1.55;
}
.editorial-byline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.25rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}
.editorial-byline i { color: #b88222; }
.editorial-byline strong { color: var(--text-primary); }
.editorial-byline span::before { content: '·'; margin-right: 0.5rem; }
.editorial-reader-image {
  margin: 2.25rem 0;
  padding: 10px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
  transform: rotate(-0.5deg);
}
.editorial-reader-image img {
  width: 100%;
  max-height: 560px;
  display: block;
  object-fit: cover;
}
.editorial-reader-body {
  max-width: 720px;
  margin: 2rem auto 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--fs-lg);
  line-height: 1.82;
}
.editorial-reader-body p { margin: 0 0 1.45em; }
.editorial-reader-body h2 { margin: 2em 0 0.7em; font-size: var(--fs-lg); line-height: 1.3; }
.editorial-reader-body ul { margin: 0 0 1.5em; padding-left: 1.4rem; }
.editorial-sources {
  max-width: 720px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-light);
}
.editorial-sources h2 { margin-bottom: 0.75rem; font-size: var(--fs-md); }
.editorial-sources ol { padding-left: 1.25rem; }
.editorial-sources li { margin: 0.45rem 0; color: var(--text-secondary); font-size: var(--fs-sm); }
.editorial-sources a { color: var(--secondary); overflow-wrap: anywhere; }
.editorial-reader-state {
  min-height: 45vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
}
.editorial-reader-state > i { color: #ef4444; font-size: var(--fs-xl); }

@media (max-width: 720px) {
  .editorial-page-header { align-items: center; }
  .editorial-count { display: none; }
  .editorial-reader-header { text-align: left; }
  .editorial-reader-topic { margin: 0; }
  .editorial-byline { justify-content: flex-start; flex-wrap: wrap; }
  .editorial-reader-header .editorial-measure-links { align-items: flex-start; justify-content: flex-start; flex-direction: column; }
  .editorial-reader-header .editorial-measure-chips { justify-content: flex-start; }
  .editorial-reader-image { margin-inline: -0.5rem; padding: 6px; }
  .editorial-reader-body { line-height: 1.72; }
}

/* ========================================
   COMMUNITY LEADERBOARD PAGE
======================================== */
.leaderboard-page-header { margin-bottom: 1.5rem; }
.page-eyebrow { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .65rem; color: #2563eb; font-size: var(--fs-xs); font-weight: 700; }

.leaderboard-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.5rem;
  gap: .65rem;
}

.leaderboard-summary div {
  min-width: 0;
  min-height: 60px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: .65rem;
  align-items: center;
  padding: .65rem .8rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-card);
}
.leaderboard-summary span { grid-row: 1 / 3; display: block; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 750; line-height: 1; }
.leaderboard-summary small { display: block; align-self: center; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.25; }

.leaderboard-page-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .8fr); gap: 1.25rem; align-items: start; }
.leaderboard-page-grid > *,
.leaderboard-ranking-panel,
.leaderboard-full-list { min-width: 0; }
.leaderboard-ranking-panel,
.leaderboard-activity-panel,
.leaderboard-method-panel { border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.leaderboard-ranking-panel {
  --rank-width: 30px;
  --rank-divider: calc(var(--rank-width) - 1px);
  overflow: hidden;
  background: linear-gradient(to right,
    color-mix(in srgb, var(--bg-hover) 55%, var(--bg-card)) 0 var(--rank-divider),
    var(--border-light) var(--rank-divider) var(--rank-width),
    var(--bg-card) var(--rank-width));
}

.leaderboard-ranking-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.25rem; border-bottom: 1px solid var(--border-light); }
.leaderboard-ranking-header h2,
.leaderboard-side-panel h2 { margin: 0; color: var(--text-primary); font-size: var(--fs-md); }
.leaderboard-ranking-header p { margin: .3rem 0 0; color: var(--text-muted); font-size: var(--fs-xs); }

.leaderboard-view-switch { display: grid; grid-template-columns: repeat(3, auto); gap: .25rem; padding: .25rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-secondary); }
.leaderboard-view-switch button { min-height: 32px; padding: .35rem .65rem; border: 0; border-radius: 4px; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.leaderboard-view-switch button.active { background: #2563eb; color: #fff; box-shadow: 0 2px 5px rgba(37,99,235,.2); }

.leaderboard-table-head,
.leaderboard-full-row { display: grid; grid-template-columns: var(--rank-width) minmax(190px, 1.35fr) minmax(180px, 1fr) 100px; gap: .85rem; align-items: center; }
.leaderboard-table-head { padding: .7rem 1.25rem .7rem 0; border-bottom: 1px solid var(--border-light); color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; }
.leaderboard-table-head > :first-child { text-align: center; }
.leaderboard-full-row { --rank-row-padding: .85rem; min-height: 78px; margin: 0; padding: var(--rank-row-padding) 1.25rem var(--rank-row-padding) 0; border-bottom: 1px solid var(--border-light); }
.leaderboard-full-row:last-child { border-bottom: 0; }

.leaderboard-position {
  display: grid;
  place-items: center;
  align-self: stretch;
  margin-block: calc(-1 * var(--rank-row-padding));
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.leaderboard-position:is(.top-2, .top-3) { color: var(--text-primary); }
.leaderboard-position.top-1 { background: #f5b524; color: #172033; }

.leaderboard-table-head > :nth-child(2),
.leaderboard-table-head > :nth-child(3),
.leaderboard-person,
.leaderboard-contributions { padding-inline-start: 4px; }

.leaderboard-person { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.leaderboard-avatar { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 50%; color: var(--text-primary); font-size: var(--fs-xs); font-weight: 800; }
.leaderboard-avatar:not(:has(img)) { background: var(--avatar-fallback-bg); }
.leaderboard-person > span:last-child { min-width: 0; }
.leaderboard-person strong { display: block; overflow: hidden; color: var(--text-primary); font-size: var(--fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-person small { display: block; margin-top: .18rem; overflow: hidden; color: var(--text-muted); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }

.leaderboard-contributions { display: flex; flex-direction: column; gap: .28rem; color: var(--text-secondary); font-size: var(--fs-xs); }
.leaderboard-contributions i { width: 15px; color: #94a3b8; }
.leaderboard-score { position: relative; display: grid; justify-items: end; padding-right: 28px; }
.leaderboard-score strong { color: #0f9f8f; font-size: var(--fs-sm); }
.leaderboard-score small { color: var(--text-muted); font-size: var(--fs-xs); }
.leader-trend { position: absolute; right: 0; top: 50%; display: inline-flex; align-items: center; gap: 2px; transform: translateY(-50%); font-size: var(--fs-xs); font-weight: 700; }
.leader-trend.up { color: #10b981; }
.leader-trend.down { color: #ef4444; }
.leader-trend.steady { color: #94a3b8; }

.leaderboard-side-panel { display: grid; gap: 1.25rem; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.15rem; border-bottom: 1px solid var(--border-light); }
.panel-heading span { padding: .2rem .45rem; border-radius: 20px; background: rgba(239,68,68,.1); color: #dc2626; font-size: var(--fs-xs); font-weight: 700; }
.community-activity-list { padding: 0 1.15rem; }
.community-activity-list > div { display: grid; grid-template-columns: 30px 1fr; gap: .65rem; padding: .9rem 0; border-bottom: 1px solid var(--border-light); }
.community-activity-list > div:last-child { border-bottom: 0; }
.activity-avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, var(--activity-color) 15%, var(--bg-card)); color: var(--activity-color); font-size: var(--fs-xs); font-weight: 700; }
.community-activity-list p { margin: 0; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.45; }
.community-activity-list p strong { color: var(--text-primary); }
.community-activity-list time { grid-column: 2; color: var(--text-muted); font-size: var(--fs-xs); }

.leaderboard-method-panel { padding: 1.2rem; }
.leaderboard-method-heading { display: flex; align-items: center; gap: .65rem; }
.method-icon { width: 36px; height: 36px; flex-shrink: 0; display: grid; place-items: center; border-radius: 6px; background: rgba(59,130,246,.1); color: #2563eb; }
.leaderboard-method-panel p { margin: .5rem 0 1rem; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.5; }
.method-score { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--border-light); color: var(--text-secondary); font-size: var(--fs-xs); }
.method-score strong { color: #2563eb; }

@media (max-width: 1230px) {
  .leaderboard-table-head { display: none; }
  .leaderboard-full-row { grid-template-columns: var(--rank-width) minmax(0, 1fr) 82px; gap: .55rem; padding-right: .9rem; }
  .leaderboard-position { grid-row: span 2; }
  .leaderboard-contributions { grid-column: 2 / 4; grid-row: 2; flex-direction: row; flex-wrap: wrap; }
  .leaderboard-score { grid-column: 3; grid-row: 1; padding-right: 0; }
}

.leaderboard-ranking-panel.has-post-metrics :is(.leaderboard-full-row, .leaderboard-table-head) {
  grid-template-columns: var(--rank-width) minmax(0, 1fr) 3.5rem 4rem;
}

.has-post-metrics .leaderboard-position { grid-row: 1; }
.has-post-metrics .leaderboard-full-row { min-height: 64px; --rank-row-padding: .65rem; }
.has-post-metrics .leaderboard-table-head > :nth-child(n + 3) { padding: 0; text-align: center; }

.leaderboard-metric {
  display: grid;
  gap: .15rem;
  text-align: center;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.leaderboard-metric strong { color: var(--text-primary); font-size: var(--fs-md); }
.leaderboard-metric small { color: var(--text-muted); font-size: var(--fs-xs); }
.leaderboard-metric.is-votes { border-inline-start: 1px solid var(--border-light); padding-inline-start: .4rem; }
.leaderboard-metric.is-votes strong { color: #0f9f8f; }

@media (max-width: 880px) {
  .leaderboard-page-grid { grid-template-columns: 1fr; }
  .leaderboard-side-panel { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .leaderboard-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaderboard-ranking-header { flex-direction: column; }
  .leaderboard-view-switch { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .leaderboard-full-row { margin: 0; }
  .leaderboard-side-panel { grid-template-columns: 1fr; }
}

/* ========================================
   DISCUSSIONS FEED
======================================== */
.discussions-page { max-width: 1120px; margin: 0 auto; }
.discussions-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; margin-bottom: 1.5rem; }
.discussions-header h1 { margin: .35rem 0 .25rem; color: var(--text-primary); font-size: var(--fs-xl); }
.discussions-header p { max-width: 680px; margin: 0; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.55; }
.discussions-layout { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 1.5rem; align-items: start; }
.discussions-main { min-width: 0; }

.discussion-composer-sentinel { height: 1px; margin-bottom: -1px; pointer-events: none; }
.discussion-composer { position: relative; z-index: 12; display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: .8rem; padding: 1rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); transition: padding var(--transition-fast), box-shadow var(--transition-fast); }
.discussion-composer.is-stuck { position: fixed; top: calc(var(--header-height) + .75rem); left: var(--composer-fixed-left); width: var(--composer-fixed-width); box-shadow: 0 10px 24px rgba(15,23,42,.14); }
.discussion-composer.is-stuck:not(.is-expanded) { grid-template-columns: 36px minmax(0, 1fr); gap: .65rem; padding: .65rem .75rem; }
.discussion-composer.is-stuck:not(.is-expanded) .discussion-avatar { width: 36px; height: 36px; flex-basis: 36px; }
.discussion-composer.is-stuck:not(.is-expanded) textarea { min-height: 40px; height: 40px; padding: .45rem 0; resize: none; overflow: hidden; }
.discussion-composer.is-stuck:not(.is-expanded) .discussion-composer-footer { padding-top: .4rem; }
.discussion-avatar { width: 42px; height: 42px; display: grid; place-items: center; flex: 0 0 42px; border-radius: 50%; background: #e0ecff; color: #2563eb; font-size: var(--fs-xs); font-weight: 800; }
.discussion-avatar.is-current { background: #facc15; color: #172033; }
.discussion-composer-body { min-width: 0; }
.discussion-composer textarea { width: 100%; min-height: 76px; resize: vertical; padding: .35rem 0; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: var(--fs-md); line-height: 1.55; }
.discussion-composer textarea::placeholder { color: var(--text-muted); }
.discussion-composer-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-top: .7rem; border-top: 1px solid var(--border-light); }
.discussion-composer-tools { min-width: 0; display: flex; align-items: center; gap: .35rem; }
.discussion-tool { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 4px; background: transparent; color: #2563eb; cursor: pointer; }
.discussion-tool:hover { background: rgba(37,99,235,.08); }
.discussion-composer-tools select { min-width: 0; height: 34px; margin-left: .25rem; padding: 0 1.8rem 0 .65rem; border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-card); color: var(--text-secondary); font: inherit; font-size: var(--fs-xs); }
.discussion-persistence-note { display: inline-flex; align-items: center; gap: .35rem; margin-left: .25rem; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; }
.discussion-persistence-note i { color: #059669; }
.discussion-compose-submit { display: flex; align-items: center; gap: .7rem; }
.discussion-compose-submit span { color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; }
.discussion-compose-submit span.near-limit { color: #dc2626; font-weight: 700; }
.discussion-compose-submit button { min-width: 78px; height: 34px; padding: 0 .9rem; border: 0; border-radius: 4px; background: #2563eb; color: #fff; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.discussion-compose-submit button:disabled { background: #cbd5e1; color: #fff; cursor: not-allowed; }
.discussion-media-preview { position: relative; display: grid; grid-template-columns: 72px minmax(0, 1fr) 30px; gap: .7rem; align-items: center; margin: .5rem 0 .75rem; padding: .55rem; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-secondary); }
.discussion-media-preview[hidden] { display: none; }
.discussion-media-preview img,
.discussion-media-preview video { width: 72px; height: 52px; object-fit: cover; border-radius: 4px; background: #111827; }
.discussion-media-preview div { min-width: 0; display: grid; gap: .2rem; }
.discussion-media-preview strong { overflow: hidden; color: var(--text-primary); font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.discussion-media-preview span { color: var(--text-muted); font-size: var(--fs-xs); }
.discussion-media-preview button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; }

.discussion-feed-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 1rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); overflow: hidden; }
.discussion-feed-tabs button { height: 42px; padding: 0 .5rem; border: 0; border-right: 1px solid var(--border-light); background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.discussion-feed-tabs button:last-child { border-right: 0; }
.discussion-feed-tabs button.active { background: rgba(37,99,235,.08); color: #2563eb; box-shadow: inset 0 -2px #2563eb; }
.discussion-feed { display: grid; gap: .75rem; margin-top: .75rem; }
.discussion-loading,
.discussion-empty { min-height: 180px; display: grid; place-items: center; align-content: center; gap: .55rem; padding: 2rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); color: var(--text-muted); text-align: center; font-size: var(--fs-xs); }
.discussion-empty i { font-size: var(--fs-xl); color: #94a3b8; }
.discussion-empty strong { color: var(--text-primary); font-size: var(--fs-sm); }
.discussion-empty button { padding: .5rem .8rem; border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-card); color: var(--text-primary); cursor: pointer; }

.discussion-post { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: .8rem; padding: 1rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.discussion-post-body { min-width: 0; }
.discussion-post-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.discussion-post-header > div { min-width: 0; display: flex; align-items: center; gap: .3rem; flex-wrap: wrap; }
.discussion-post-header strong { color: var(--text-primary); font-size: var(--fs-sm); }
.discussion-author-name { display: inline-flex; align-items: center; gap: .25rem; color: inherit; text-decoration: none; }
.discussion-author-name:hover strong { color: var(--secondary); text-decoration: underline; text-underline-offset: 2px; }
.discussion-avatar-link { color: #2563eb; text-decoration: none; }
.discussion-avatar-link:hover { box-shadow: 0 0 0 2px rgba(37,99,235,.2); }
.discussion-avatar img,
.discussion-comment-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: inherit; }
.discussion-post-header span { color: var(--text-muted); font-size: var(--fs-xs); }
.discussion-verified { color: #2563eb; font-size: var(--fs-xs); }
.discussion-topic { display: inline-block; margin-top: .35rem; padding: .18rem .42rem; border-radius: 3px; background: rgba(37,99,235,.08); color: #2563eb; font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; }
.discussion-post-text { margin: .65rem 0 .8rem; color: var(--text-primary); font-size: var(--fs-sm); line-height: 1.55; white-space: pre-wrap; }
.discussion-external-link { color: var(--secondary); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; overflow-wrap: anywhere; }
.discussion-external-link:hover { color: #2563eb; }
.discussion-video,
.discussion-image { position: relative; width: 100%; display: block; padding: 0; overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: #111827; cursor: pointer; }
.discussion-video { aspect-ratio: 16 / 9; }
.discussion-image { max-height: 420px; background: var(--bg-secondary); }
.discussion-video img { width: 100%; height: 100%; display: block; object-fit: cover; }
.discussion-image img { width: 100%; max-height: 420px; display: block; object-fit: cover; }
.discussion-video::after { content: ''; position: absolute; inset: 0; background: rgba(15,23,42,.12); }
.discussion-video-play { position: absolute; top: 50%; left: 50%; width: 50px; height: 50px; display: grid; place-items: center; transform: translate(-50%, -50%); border-radius: 50%; background: #ef233c; color: #fff; z-index: 2; }
.discussion-video small { position: absolute; left: .65rem; bottom: .65rem; padding: .22rem .42rem; border-radius: 3px; background: rgba(15,23,42,.85); color: #fff; font-size: var(--fs-xs); font-weight: 800; z-index: 2; }
.discussion-video-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 6px; background: #111827; }
.discussion-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.discussion-uploaded-video { width: 100%; max-height: 460px; display: block; border-radius: 6px; background: #111827; }
.discussion-post-actions { display: grid; grid-template-columns: auto auto auto 1fr; align-items: center; gap: .35rem; margin-top: .75rem; }
.discussion-post-actions button { min-width: 58px; height: 32px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: 0 .55rem; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); font: inherit; font-size: var(--fs-xs); cursor: pointer; }
.discussion-post-actions button:hover { background: var(--bg-hover); color: #2563eb; }
.discussion-post-actions button.supported { color: #e11d48; }
.discussion-post-actions button:disabled { cursor: wait; opacity: .55; }
.discussion-post-actions button b { font-size: inherit; font-weight: 700; }
.discussion-views { justify-self: end; color: var(--text-muted); font-size: var(--fs-xs); }
.discussion-inline-reply { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .45rem; margin-top: .65rem; }
.discussion-inline-reply[hidden] { display: none; }
.discussion-inline-reply input { min-width: 0; height: 36px; padding: 0 .7rem; border: 1px solid var(--border-light); border-radius: 4px; background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: var(--fs-xs); outline: 0; }
.discussion-inline-reply input:focus { border-color: #2563eb; }
.discussion-inline-reply button { padding: 0 .8rem; border: 0; border-radius: 4px; background: #2563eb; color: #fff; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }

.discussion-thread { margin-top: .8rem; overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-secondary); }
.discussion-thread[hidden] { display: none; }
.discussion-thread-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem .8rem; border-bottom: 1px solid var(--border-light); background: var(--bg-card); }
.discussion-thread-head strong { color: var(--text-primary); font-size: var(--fs-xs); }
.discussion-thread-head button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--text-muted); cursor: pointer; }
.discussion-thread-list { display: grid; gap: .75rem; padding: .8rem; }
.discussion-thread-state { padding: .75rem; color: var(--text-muted); font-size: var(--fs-xs); text-align: center; }
.discussion-thread-state.is-error { color: #dc2626; }
.discussion-comment { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: .55rem; }
.discussion-comment.is-reply { margin-top: .7rem; padding-left: .7rem; border-left: 2px solid rgba(37,99,235,.18); }
.discussion-comment-avatar { width: 30px; height: 30px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: #dbeafe; color: #2563eb; font-size: var(--fs-xs); font-weight: 800; }
.discussion-avatar:not(:has(img)),
.discussion-comment-avatar:not(:has(img)) { background: var(--avatar-fallback-bg); color: var(--text-primary); }
.discussion-comment header { display: flex; align-items: baseline; gap: .35rem; flex-wrap: wrap; }
.discussion-comment header strong { color: var(--text-primary); font-size: var(--fs-xs); }
.discussion-comment header span { color: var(--text-muted); font-size: var(--fs-xs); }
.discussion-comment p { margin: .22rem 0 .28rem; color: var(--text-primary); font-size: var(--fs-xs); line-height: 1.5; white-space: pre-wrap; }
.discussion-comment > div > button { padding: 0; border: 0; background: transparent; color: #2563eb; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.discussion-comment-replies { display: grid; gap: .65rem; }
.discussion-reply-context { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0 .8rem; padding: .5rem .65rem; border-radius: 4px; background: rgba(37,99,235,.08); color: #2563eb; font-size: var(--fs-xs); }
.discussion-reply-context[hidden] { display: none; }
.discussion-reply-context button { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; cursor: pointer; }
.discussion-thread-form { display: grid; gap: .45rem; padding: .8rem; border-top: 1px solid var(--border-light); background: var(--bg-card); }
.discussion-thread-form textarea { width: 100%; min-height: 58px; resize: vertical; padding: .55rem .65rem; border: 1px solid var(--border-light); border-radius: 4px; outline: 0; background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: var(--fs-xs); line-height: 1.45; }
.discussion-thread-form textarea:focus { border-color: #2563eb; }
.discussion-thread-form > div { display: flex; align-items: center; justify-content: space-between; }
.discussion-thread-form > div > span { color: var(--text-muted); font-size: var(--fs-xs); }
.discussion-thread-form button[type="submit"] { height: 32px; padding: 0 .75rem; border: 0; border-radius: 4px; background: #2563eb; color: #fff; font-size: var(--fs-xs); font-weight: 750; cursor: pointer; }
.discussion-thread-form button[type="submit"]:disabled { cursor: wait; opacity: .6; }

.discussions-rail { display: grid; gap: 1rem; position: sticky; top: calc(var(--header-height) + 1rem); }
.discussion-rail-panel { overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.discussion-rail-title { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--border-light); }
.discussion-rail-title h2,
.discussion-rail-guide h2 { margin: 0; color: var(--text-primary); font-size: var(--fs-sm); }
.discussion-rail-title i { color: #f59e0b; }
.discussion-rail-panel > button { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .72rem 1rem; border: 0; border-bottom: 1px solid var(--border-light); background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-xs); text-align: left; cursor: pointer; }
.discussion-rail-panel > button:last-child { border-bottom: 0; }
.discussion-rail-panel > button:hover,
.discussion-rail-panel > button.active { background: var(--bg-hover); color: #2563eb; }
.discussion-rail-panel > button strong { color: var(--text-muted); font-size: var(--fs-xs); }
.discussion-rail-guide { padding: 1rem; }
.discussion-guide-icon { width: 34px; height: 34px; display: grid; place-items: center; margin-bottom: .7rem; border-radius: 5px; background: rgba(16,185,129,.1); color: #059669; }
.discussion-rail-guide p { margin: .55rem 0 .85rem; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.5; }
.discussion-rail-guide a { color: #2563eb; font-size: var(--fs-xs); font-weight: 700; text-decoration: none; }
.discussion-bridge-status { display: flex; align-items: center; gap: .45rem; padding: 0 .2rem; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; }
.discussion-bridge-status span { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; }
.discussion-bridge-status.is-live span { background: #10b981; }

@media (max-width: 1000px) {
  .discussions-layout { grid-template-columns: minmax(0, 1fr) 250px; }
}

@media (max-width: 820px) {
  .discussions-layout { grid-template-columns: 1fr; }
  .discussions-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discussion-bridge-status { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .discussions-header { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .discussions-header .otv-primary-btn { width: 100%; }
  .discussion-composer,
  .discussion-post { grid-template-columns: 36px minmax(0, 1fr); gap: .65rem; padding: .85rem; }
  .discussion-composer { top: calc(var(--header-height) + .35rem); }
  .discussion-avatar { width: 36px; height: 36px; flex-basis: 36px; }
  .discussion-composer-footer { align-items: flex-start; flex-direction: column; }
  .discussion-composer-tools,
  .discussion-compose-submit { width: 100%; }
  .discussion-composer-tools select { flex: 1; }
  .discussion-compose-submit { justify-content: space-between; }
  .discussion-feed-tabs button { font-size: var(--fs-xs); }
  .discussion-post-actions { grid-template-columns: repeat(3, auto) 1fr; }
  .discussion-post-actions button { min-width: 38px; padding: 0 .35rem; }
  .discussion-post-actions button b { display: none; }
  .discussion-persistence-note { display: none; }
  .discussions-rail { grid-template-columns: 1fr; }
  .discussion-bridge-status { grid-column: auto; }
}

/* ========================================
   SHARED CIVIC COMMUNITY — HOME + DISCUSSIONS
======================================== */
.civic-community { width: 100%; min-width: 0; color: var(--text-primary); }
.home-civic-community-section { margin: 2rem 0 3rem; }
.civic-community-loading { min-height: 220px; display: grid; place-items: center; align-content: center; gap: .7rem; color: var(--text-muted); font-size: var(--fs-xs); }
.civic-community-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; }
.civic-community-header > div { min-width: 0; }
.civic-community-kicker { display: inline-flex; align-items: center; gap: .45rem; color: #2563eb; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; }
.civic-community-header h2 { margin: .35rem 0 .25rem; color: var(--text-primary); font-family: "Poppins", sans-serif; font-size: var(--fs-xl); line-height: 1.16; }
.civic-community-header p { max-width: 720px; margin: 0; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.55; }
.civic-compose-open { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; flex: 0 0 auto; padding: 0 1rem; border: 0; border-radius: 6px; background: #2563eb; color: #fff; font: inherit; font-size: var(--fs-xs); font-weight: 750; cursor: pointer; }
.civic-compose-open:hover { background: #1d4ed8; }

.civic-community-layout { min-width: 0; }
.civic-community-layout.has-rail { display: grid; grid-template-columns: minmax(0, 1fr) 285px; gap: 1rem; align-items: start; }
.civic-community-main { min-width: 0; }
.civic-community-rail { display: grid; gap: 1rem; position: sticky; top: calc(var(--header-height) + 1rem); }
.civic-rail-card { overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.civic-rail-card > header { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border-light); }
.civic-rail-card > header i { color: #f59e0b; }
.civic-rail-card h3 { margin: 0; color: var(--text-primary); font-size: var(--fs-sm); }
.civic-rail-card > a { display: grid; gap: .2rem; padding: .75rem 1rem; border-bottom: 1px solid var(--border-light); color: var(--text-primary); text-decoration: none; }
.civic-rail-card > a:last-child { border-bottom: 0; }
.civic-rail-card > a:hover { background: var(--bg-hover); }
.civic-rail-card > a span { font-size: var(--fs-xs); font-weight: 700; line-height: 1.35; }
.civic-rail-card > a small { color: var(--text-muted); font-size: var(--fs-xs); }
.civic-rail-card > p { margin: 0; padding: 1rem; color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.5; }

.civic-community-pulse { display: grid; gap: .8rem; margin-bottom: 1rem; }
.civic-community-pulse[hidden] { display: none; }
.civic-poll { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(175px, .6fr); gap: 1rem; align-items: center; padding: 1rem; border: 1px solid #bfdbfe; border-radius: 7px; background: linear-gradient(135deg, #eff6ff, var(--bg-card)); }
.civic-poll-copy { min-width: 0; }
.civic-poll-copy > span { display: inline-flex; align-items: center; gap: .35rem; color: #1d4ed8; font-size: var(--fs-xs); font-weight: 850; letter-spacing: .06em; }
.civic-poll-copy h3 { margin: .3rem 0 .2rem; color: var(--text-primary); font-size: var(--fs-sm); line-height: 1.4; }
.civic-poll-copy small { color: var(--text-muted); font-size: var(--fs-xs); }
.civic-poll-actions { display: grid; grid-template-columns: repeat(2, minmax(72px, 1fr)); gap: .45rem; }
.civic-poll-actions button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .35rem; padding: 0 .8rem; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: var(--fs-xs); font-weight: 800; cursor: pointer; }
.civic-poll-actions button.is-yes:hover,
.civic-poll-actions button.is-yes.is-selected { border-color: #10b981; background: #ecfdf5; color: #047857; }
.civic-poll-actions button.is-no:hover,
.civic-poll-actions button.is-no.is-selected { border-color: #f43f5e; background: #fff1f2; color: #be123c; }
.civic-poll-actions button:disabled { cursor: default; opacity: .68; }
.civic-poll-results { min-width: 0; color: var(--text-muted); font-size: var(--fs-xs); }
.civic-poll-results > div { height: 7px; display: flex; overflow: hidden; border-radius: 999px; background: var(--bg-hover); }
.civic-poll-results > div span:first-child { background: #10b981; }
.civic-poll-results > div span:last-child { background: #f43f5e; }
.civic-poll-results p { display: flex; justify-content: space-between; gap: .5rem; margin: .35rem 0 .2rem; }
.civic-poll-results p strong:first-child { color: #047857; }
.civic-poll-results p strong:last-child { color: #be123c; }
.civic-poll-results > small { display: block; color: var(--text-muted); text-align: right; }
.civic-poll.is-compact { grid-template-columns: minmax(0, 1fr) auto; margin: .75rem 0; padding: .8rem; }
.civic-poll.is-compact .civic-poll-copy h3 { font-size: var(--fs-xs); }
.civic-poll.is-compact .civic-poll-copy small { display: none; }
.civic-poll.is-compact .civic-poll-results { grid-column: 1 / -1; }

.civic-argument-balance { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.civic-top-argument { min-width: 0; min-height: 112px; display: grid; align-content: start; gap: .35rem; padding: .9rem; border: 1px solid var(--border-light); border-left: 4px solid #10b981; border-radius: 6px; background: var(--bg-card); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.civic-top-argument.contra { border-left-color: #f43f5e; }
.civic-top-argument.is-empty { cursor: default; }
.civic-top-argument > span { color: #047857; font-size: var(--fs-xs); font-weight: 850; letter-spacing: .06em; }
.civic-top-argument.contra > span { color: #be123c; }
.civic-top-argument p { margin: 0; font-size: var(--fs-xs); line-height: 1.5; }
.civic-top-argument small { color: var(--text-muted); font-size: var(--fs-xs); }

.civic-composer { margin-bottom: .8rem; }
.civic-composer-context-locked { display: flex; align-items: center; gap: .6rem; margin-bottom: .65rem; padding: .55rem .65rem; border: 1px solid #bfdbfe; border-radius: 5px; background: #eff6ff; color: #1d4ed8; }
.civic-composer-context-locked i { flex: 0 0 auto; }
.civic-composer-context-locked span { min-width: 0; }
.civic-composer-context-locked small { display: block; font-size: var(--fs-xs); font-weight: 750; text-transform: uppercase; }
.civic-composer-context-locked strong { display: block; overflow: hidden; font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.civic-composer-select { display: grid; gap: .3rem; margin-bottom: .6rem; }
.civic-composer-select > span,
.civic-composer-classification label > span { color: var(--text-muted); font-size: var(--fs-xs); font-weight: 750; text-transform: uppercase; }
.civic-composer-select select,
.civic-composer-classification select { width: 100%; min-width: 0; min-height: 40px; padding: 0 2rem 0 .7rem; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: var(--fs-xs); }
.civic-composer-classification { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-bottom: .35rem; }
.civic-composer-classification label { display: grid; gap: .25rem; }

.civic-feed-tabs { grid-template-columns: repeat(var(--tab-count, 3), minmax(0, 1fr)); }
.civic-post { position: relative; }
.civic-post-menu { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); cursor: pointer; }
.civic-post-menu:hover { background: var(--bg-hover); color: var(--text-primary); }
.civic-post-labels { display: flex; gap: .35rem; align-items: center; flex-wrap: wrap; margin-top: .5rem; }
.civic-post-labels span { padding: .2rem .42rem; border-radius: 999px; background: var(--bg-hover); color: var(--text-muted); font-size: .56rem; font-weight: 800; text-transform: uppercase; }
.civic-post-labels .stance-pro { background: #ecfdf5; color: #047857; }
.civic-post-labels .stance-contra { background: #fff1f2; color: #be123c; }
.civic-post-context { min-width: 0; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: .55rem; align-items: center; margin-top: .55rem; padding: .55rem .65rem; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-secondary); color: var(--text-primary); text-decoration: none; }
.civic-post-context:hover { border-color: #93c5fd; }
.civic-post-context > i { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 5px; background: #dbeafe; color: #2563eb; }
.civic-post-context span { min-width: 0; }
.civic-post-context small { display: block; color: #2563eb; font-size: .52rem; font-weight: 850; }
.civic-post-context strong { display: block; overflow: hidden; font-size: var(--fs-xs); text-overflow: ellipsis; white-space: nowrap; }
.civic-post-context > b { color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; }
.civic-post .discussion-post-actions button.supported { color: #d97706; }

.civic-report-dialog { width: min(520px, calc(100vw - 2rem)); max-height: min(680px, calc(100dvh - 2rem)); padding: 0; overflow: hidden; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-card); color: var(--text-primary); box-shadow: 0 24px 70px rgba(15, 23, 42, .25); }
.civic-report-dialog::backdrop { background: rgba(15, 23, 42, .55); backdrop-filter: blur(2px); }
.civic-report-form { display: grid; gap: 1rem; padding: 1.2rem; }
.civic-report-handle { display: none; }
.civic-report-form > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.civic-report-form > header span { color: #e11d48; font-size: var(--fs-xs); font-weight: 850; letter-spacing: .08em; }
.civic-report-form h3 { margin: .2rem 0 0; font-size: var(--fs-md); }
.civic-report-form > header button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--bg-hover); color: var(--text-muted); cursor: pointer; }
.civic-report-form > label { display: grid; gap: .35rem; color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 700; }
.civic-report-form select,
.civic-report-form textarea { width: 100%; box-sizing: border-box; padding: .7rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: var(--fs-xs); }
.civic-report-feedback { min-height: 1.1rem; margin: 0; color: #be123c; font-size: var(--fs-xs); }
.civic-report-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.civic-report-actions button { min-height: 44px; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: var(--fs-xs); font-weight: 750; cursor: pointer; }
.civic-report-actions button[type="submit"] { border-color: #e11d48; background: #e11d48; color: #fff; }

html.dark .civic-poll,
html.dark .civic-composer-context-locked { border-color: #315a8d; background: linear-gradient(135deg, #172b46, var(--bg-card)); }
html.dark .civic-poll-actions button.is-yes.is-selected { background: rgba(16,185,129,.16); color: #6ee7b7; }
html.dark .civic-poll-actions button.is-no.is-selected { background: rgba(244,63,94,.16); color: #fda4af; }
html.dark .civic-post-labels .stance-pro { background: rgba(16,185,129,.16); color: #6ee7b7; }
html.dark .civic-post-labels .stance-contra { background: rgba(244,63,94,.16); color: #fda4af; }

.measure-mobile-actions { display: none; }

@media (max-width: 960px) {
  .civic-community-layout.has-rail { grid-template-columns: 1fr; }
  .civic-community-rail { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .civic-poll { grid-template-columns: minmax(0, 1fr) auto; }
  .civic-poll-results { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .civic-community-header { align-items: center; gap: .75rem; }
  .civic-community-header h2 { font-size: var(--fs-lg); }
  .civic-community-header p { font-size: var(--fs-xs); }
  .civic-compose-open { width: 44px; padding: 0; border-radius: 50%; }
  .civic-compose-open span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .civic-community-rail { grid-template-columns: 1fr; }
  .civic-poll,
  .civic-poll.is-compact { grid-template-columns: 1fr; gap: .75rem; padding: .85rem; }
  .civic-poll-actions { width: 100%; }
  .civic-poll-results,
  .civic-poll.is-compact .civic-poll-results { grid-column: auto; }
  .civic-poll-results > small { text-align: left; }
  .civic-argument-balance { grid-template-columns: 1fr; }
  .civic-top-argument { min-height: 0; }
  .civic-composer { grid-template-columns: 32px minmax(0, 1fr); gap: .55rem; padding: .75rem; }
  .civic-composer .discussion-avatar { width: 32px; height: 32px; flex-basis: 32px; }
  .civic-composer-classification { grid-template-columns: 1fr; }
  .civic-composer select,
  .civic-composer textarea,
  .civic-report-form select,
  .civic-report-form textarea { font-size: var(--fs-md); }
  .civic-feed-tabs { display: flex; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .civic-feed-tabs::-webkit-scrollbar { display: none; }
  .civic-feed-tabs button { min-width: 92px; flex: 1 0 auto; }
  .civic-post { grid-template-columns: 32px minmax(0, 1fr); gap: .55rem; padding: .75rem; }
  .civic-post > .discussion-avatar { width: 32px; height: 32px; }
  .civic-post-context { grid-template-columns: 26px minmax(0, 1fr); }
  .civic-post-context > b { display: none; }
  .civic-post-context > i { width: 26px; height: 26px; }
  .civic-post .discussion-post-actions { grid-template-columns: repeat(3, minmax(44px, auto)) 1fr; gap: .15rem; }
  .civic-post .discussion-post-actions button { min-width: 44px; min-height: 44px; }
  .civic-post .discussion-views { display: none; }
  .civic-report-dialog { width: 100%; max-width: none; max-height: calc(100dvh - var(--header-height)); margin: auto 0 0; border-width: 1px 0 0; border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .civic-report-form { padding: .65rem 1rem 1rem; }
  .civic-report-handle { width: 38px; height: 4px; display: block; justify-self: center; border-radius: 999px; background: var(--border-medium); }
  .home-civic-community-section { margin: 1.25rem 0 2rem; }
}

@media (max-width: 380px) {
  .civic-community-header p { display: none; }
  .civic-post .discussion-post-actions button b { display: none; }
  .civic-post .discussion-post-actions { grid-template-columns: repeat(3, 44px); }
}

@media (max-width: 900px) {
  .measure-mobile-actions { position: fixed; z-index: 84; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: .4rem max(.55rem, env(safe-area-inset-right)) calc(.4rem + env(safe-area-inset-bottom)) max(.55rem, env(safe-area-inset-left)); border-top: 1px solid var(--border-light); background: color-mix(in srgb, var(--bg-card) 94%, transparent); box-shadow: 0 -8px 24px rgba(15,23,42,.12); backdrop-filter: blur(14px); }
  .measure-mobile-actions button,
  .measure-mobile-actions a { min-width: 0; min-height: 48px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .18rem; padding: .25rem; border: 0; border-radius: 6px; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-xs); font-weight: 750; text-decoration: none; cursor: pointer; }
  .measure-mobile-actions i { font-size: var(--fs-md); }
  .measure-mobile-actions button.is-active { background: #eff6ff; color: #1d4ed8; }
  .measure-mobile-actions button:disabled { opacity: .55; }
  body:has(.measure-mobile-actions) .main-content { padding-bottom: calc(62px + env(safe-area-inset-bottom)); }
}

/* Community profile */
.community-profile-page { width: min(980px, 100%); margin: 0 auto; padding: 2rem; }
.community-profile-back { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem; color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 700; text-decoration: none; }
.community-profile-back:hover { color: var(--secondary); }
.community-profile-loading { min-height: 420px; display: flex; align-items: center; justify-content: center; gap: .65rem; color: var(--text-secondary); font-size: var(--fs-sm); }
.community-profile-skeleton-card { overflow: hidden; border: 1px solid var(--border-light); border-radius: 16px; background: var(--bg-card); }
.community-skeleton-block { display: block; border-radius: 6px; background: var(--bg-hover); animation: community-skeleton-pulse 1.35s ease-in-out infinite; }
.community-skeleton-cover { height: 92px; background: var(--bg-hover); animation: community-skeleton-pulse 1.35s ease-in-out infinite; }
.community-skeleton-profile-body { min-height: 172px; display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 1.35rem; align-items: start; padding: 0 1.5rem 1.5rem; }
.community-skeleton-avatar { width: 124px; height: 124px; margin-top: -58px; border: 4px solid var(--bg-card); border-radius: 50%; box-shadow: 0 0 0 1px var(--border-light); }
.community-skeleton-profile-copy { min-width: 0; padding-top: 1.15rem; }
.community-skeleton-name { width: 42%; height: 26px; }
.community-skeleton-handle { width: 24%; height: 12px; margin-top: .5rem; }
.community-skeleton-bio { width: 72%; height: 12px; margin-top: 1rem; }
.community-skeleton-meta { width: 46%; height: 25px; margin-top: .8rem; border-radius: 999px; }
.community-skeleton-actions { display: flex; gap: .5rem; margin-top: .9rem; }
.community-skeleton-actions span:first-child { width: 138px; height: 38px; }
.community-skeleton-actions span:last-child { width: 38px; height: 38px; }
.community-profile-skeleton-score { display: flex; flex-direction: column; padding: 1.25rem; }
.community-skeleton-score-top { display: flex; justify-content: space-between; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-light); }
.community-skeleton-score-top span:first-child { width: 42%; height: 48px; }
.community-skeleton-score-top span:last-child { width: 24%; height: 48px; }
.community-skeleton-level { width: 58%; height: 42px; margin-top: 1rem; }
.community-skeleton-progress-label { width: 74%; height: 12px; margin-top: 1.15rem; }
.community-skeleton-progress { width: 100%; height: 6px; margin-top: .55rem; border-radius: 999px; }
.community-skeleton-score-journal { display: grid; gap: .45rem; margin-top: .85rem; padding-top: .7rem; border-top: 1px solid var(--border-light); }
.community-skeleton-score-journal span { width: 100%; height: 11px; }
.community-skeleton-score-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: auto; padding-top: 1.25rem; }
.community-skeleton-score-footer span { width: 38%; height: 12px; }
.community-profile-skeleton-primary { overflow: hidden; }
.community-profile-skeleton-stream { min-height: 380px; border-top: 1px solid var(--border-light); }
.community-skeleton-tabs { height: 51px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; align-items: center; padding: 0 1.25rem; border-bottom: 1px solid var(--border-light); }
.community-skeleton-tabs span { width: 72%; height: 12px; justify-self: center; }
.community-skeleton-feed-card { min-height: 278px; margin: 1rem; padding: 1rem; border: 1px solid var(--border-light); border-radius: 10px; }
.community-skeleton-feed-title { width: 48%; height: 18px; }
.community-skeleton-feed-line { width: 86%; height: 12px; margin-top: 1rem; }
.community-skeleton-feed-line.short { width: 62%; }
.community-profile-skeleton-rail { grid-template-columns: 1fr; }
.community-skeleton-rail-card { min-height: 132px; display: grid; gap: .75rem; padding: 1rem; }
.community-skeleton-rail-card.tall { min-height: 190px; }
.community-skeleton-rail-card .community-skeleton-block { width: 100%; height: 12px; }
.community-skeleton-rail-card .community-skeleton-rail-title { width: 48%; height: 17px; margin-bottom: .25rem; }
@keyframes community-skeleton-pulse { 0%, 100% { opacity: .48; } 50% { opacity: .92; } }
@media (prefers-reduced-motion: reduce) { .community-skeleton-block, .community-skeleton-cover { animation: none; opacity: .7; } }
.community-profile-hero { overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.community-profile-cover { height: 126px; background: linear-gradient(100deg, #2563eb 0 34%, #f43f5e 34% 66%, #fbbf24 66%); }
.community-profile-identity { position: relative; padding: 0 1.5rem 1.4rem; }
.community-profile-avatar { width: 104px; height: 104px; display: grid; place-items: center; margin-top: -54px; overflow: hidden; border: 5px solid var(--bg-card); border-radius: 50%; background: #dbeafe; color: #2563eb; font-size: var(--fs-lg); font-weight: 800; }
.community-profile-avatar:not(:has(img)) { background: color-mix(in srgb, var(--text-primary) 20%, var(--bg-card)); background-clip: padding-box; color: var(--text-primary); }
.community-profile-avatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.community-profile-actions { position: absolute; top: 1rem; right: 1.5rem; }
.community-profile-otv-link { height: 38px; display: inline-flex; align-items: center; gap: .5rem; padding: 0 .9rem; border: 1px solid var(--border-medium); border-radius: 5px; color: var(--text-primary); font-size: var(--fs-xs); font-weight: 750; text-decoration: none; }
.community-profile-otv-link:hover { border-color: var(--secondary); color: var(--secondary); }
.community-profile-name { margin-top: .65rem; }
.community-profile-name h1 { display: flex; align-items: center; gap: .4rem; margin: 0; color: var(--text-primary); font-size: var(--fs-xl); letter-spacing: 0; }
.community-profile-name > span { display: block; margin-top: .15rem; color: var(--text-muted); font-size: var(--fs-xs); }
.community-profile-verified { color: #2563eb; font-size: var(--fs-sm); }
.community-profile-bio { max-width: 680px; margin: .85rem 0 0; color: var(--text-primary); font-size: var(--fs-sm); line-height: 1.55; white-space: pre-wrap; }
.community-profile-bio.is-empty { color: var(--text-muted); }
.community-profile-meta { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: .8rem; color: var(--text-secondary); font-size: var(--fs-xs); }
.community-profile-meta span,
.community-profile-meta a { display: inline-flex; align-items: center; gap: .35rem; color: inherit; text-decoration: none; }
.community-profile-meta a:hover { color: var(--secondary); text-decoration: underline; }
.community-profile-follow-counts { display: flex; gap: 1.1rem; margin-top: .75rem; color: var(--text-secondary); font-size: var(--fs-sm); }
.community-profile-follow-counts strong { color: var(--text-primary); }
.community-profile-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1rem; overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.community-profile-stats > div { min-width: 0; padding: 1rem 1.15rem; border-right: 1px solid var(--border-light); }
.community-profile-stats > div:last-child { border-right: 0; }
.community-profile-stats strong { display: block; color: var(--text-primary); font-size: var(--fs-lg); }
.community-profile-stats span { display: block; margin-top: .15rem; color: var(--text-muted); font-size: var(--fs-xs); }
.community-profile-content-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 2rem 0 1rem; }
.community-profile-content-header h2 { margin: .3rem 0 0; color: var(--text-primary); font-size: var(--fs-lg); letter-spacing: 0; }
.community-profile-filters { display: inline-flex; padding: 3px; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-card); }
.community-profile-filters button { height: 31px; padding: 0 .7rem; border: 0; border-radius: 3px; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.community-profile-filters button.active { background: #2563eb; color: #fff; }
.community-profile-posts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.community-profile-post { min-width: 0; display: flex; flex-direction: column; padding: 1rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.community-profile-post > header { display: flex; align-items: center; justify-content: space-between; gap: .7rem; }
.community-profile-post > header .discussion-topic { margin-top: 0; }
.community-profile-post > header time { color: var(--text-muted); font-size: var(--fs-xs); }
.community-profile-post > p { margin: .75rem 0; color: var(--text-primary); font-size: var(--fs-xs); line-height: 1.5; white-space: pre-wrap; }
.community-profile-video,
.community-profile-image { width: 100%; max-height: 360px; display: block; margin-top: .75rem; overflow: hidden; border-radius: 5px; background: #111827; }
.community-profile-video { margin-top: auto; }
.community-profile-image img { width: 100%; max-height: 360px; display: block; object-fit: cover; }
.community-profile-post > footer { display: flex; align-items: center; gap: 1rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--border-light); color: var(--text-muted); font-size: var(--fs-xs); }
.community-profile-post > footer span { display: inline-flex; align-items: center; gap: .3rem; }
.community-profile-post > footer a { margin-left: auto; color: var(--text-muted); }
.community-profile-post > footer a:hover { color: var(--secondary); }
.community-profile-empty { grid-column: 1 / -1; min-height: 240px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .55rem; padding: 2rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); color: var(--text-muted); text-align: center; }
.community-profile-empty > i { font-size: var(--fs-xl); color: var(--secondary); }
.community-profile-empty strong { color: var(--text-primary); font-size: var(--fs-sm); }
.community-profile-empty span { font-size: var(--fs-xs); }
.community-profile-empty.is-error { min-height: 420px; }

@media (max-width: 760px) {
  .community-profile-page { padding: 1rem; }
  .community-profile-cover { height: 96px; }
  .community-profile-identity { padding: 0 1rem 1rem; }
  .community-profile-avatar { width: 82px; height: 82px; margin-top: -43px; }
  .community-profile-actions { top: .75rem; right: 1rem; }
  .community-profile-name h1 { font-size: var(--fs-lg); }
  .community-profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-profile-stats > div:nth-child(2) { border-right: 0; }
  .community-profile-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--border-light); }
  .community-profile-content-header { align-items: flex-start; flex-direction: column; }
  .community-profile-filters { width: 100%; }
  .community-profile-filters button { flex: 1; }
  .community-profile-posts { grid-template-columns: 1fr; }
}

/* Community profile v2: verified participation and points */
.community-profile-v2 { --community-rail-copy-size: var(--fs-xs); box-sizing: border-box; width: 100%; max-width: 1240px; margin: 0; padding: 0; container-type: inline-size; }
.community-profile-v2 .community-profile-back { margin-bottom: .8rem; }
.community-profile-layout { width: 100%; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(280px, 29%, 320px); gap: 1rem; align-items: start; }
.community-profile-primary { min-width: 0; border: 1px solid var(--border-light); background: var(--bg-card); }
.community-profile-v2 .community-profile-hero { overflow: visible; }
.community-profile-v2 .community-profile-identity { min-height: 236px; display: grid; grid-template-columns: 132px minmax(0, 1fr); grid-template-rows: auto auto auto auto; column-gap: 1.35rem; align-content: center; padding: 1.5rem; }
.community-profile-v2 .community-profile-avatar { grid-row: 1 / 6; width: 124px; height: 124px; align-self: start; margin: 0; border: 4px solid var(--bg-card); box-shadow: 0 0 0 1px var(--border-light); }
.community-profile-v2 .community-profile-actions { position: static; grid-column: 2; grid-row: 4; justify-self: start; max-width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.community-profile-follow-btn,
.community-profile-message-btn,
.community-profile-more { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: 0 .9rem; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: var(--fs-xs); font-weight: 750; text-decoration: none; cursor: pointer; }
.community-profile-follow-btn { border-color: #2563eb; background: #2563eb; color: #fff; }
.community-profile-follow-btn:hover { background: #1d4ed8; }
.community-profile-follow-btn.is-following { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }
.community-profile-message-btn:hover,
.community-profile-more:hover { border-color: #93c5fd; color: #2563eb; }
.community-profile-more { width: 38px; padding: 0; border-radius: 50%; }
.community-profile-account-menu { position: relative; z-index: 50; flex: 0 0 38px; }
.community-profile-account-popover[hidden] { display: none; }
.community-profile-account-popover { position: absolute; z-index: 40; top: calc(100% + 6px); right: 0; width: 154px; padding: 4px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-card); box-shadow: 0 10px 26px rgba(15, 23, 42, .14); }
.community-profile-account-popover > button, .community-profile-account-popover > a { width: 100%; min-height: 40px; display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: .5rem; align-items: center; padding: .4rem .55rem; border: 0; border-radius: 7px; background: transparent; color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.community-profile-account-popover > button:hover { background: #fff1f2; color: #be123c; }
.community-profile-account-popover > button:disabled { opacity: .65; cursor: wait; }
.community-profile-account-popover > button > i { width: 24px; height: 24px; display: grid; place-items: center; color: #e11d48; font-size: var(--fs-xs); }
.community-profile-account-popover strong { display: block; font-size: var(--fs-xs); }
.community-profile-v2 .community-profile-name { grid-column: 2; margin: .1rem 0 0; }
.community-profile-v2 .community-profile-name h1 { font-size: var(--fs-xl); }
.community-profile-v2 .community-profile-bio { grid-column: 2; max-width: 620px; margin: .65rem 0 0; font-size: var(--fs-xs); }
.community-profile-v2 .community-profile-meta { grid-column: 2; margin-top: .7rem; }
.community-profile-v2 .community-profile-meta a { max-width: 390px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.community-profile-v2 .community-profile-follow-counts { grid-column: 2; grid-row: 5; margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--border-light); }

.community-profile-score-card { min-width: 0; display: flex; flex-direction: column; padding: 1.25rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.community-score-topline { display: grid; grid-template-columns: 1fr auto; gap: 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-light); }
.community-score-topline > div:last-child { text-align: right; }
.community-score-topline small,
.community-level-row small { display: block; color: var(--text-muted); font-size: var(--community-rail-copy-size); }
.community-score-topline strong { display: block; margin-top: .2rem; color: var(--text-primary); font-size: var(--fs-xl); line-height: 1; }
.community-score-topline strong span { font-size: var(--community-rail-copy-size); font-weight: 600; }
.community-level-row { display: flex; align-items: center; gap: .65rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.community-level-row strong { display: block; margin-top: .15rem; color: var(--text-primary); font-size: var(--fs-sm); }
.community-level-icon { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; border-radius: 50%; background: #fff7ed; color: #f59e0b; font-size: var(--fs-md); }
.community-level-progress-label { display: flex; justify-content: space-between; gap: .6rem; margin-top: .95rem; color: var(--text-secondary); font-size: var(--community-rail-copy-size); }
.community-level-progress-label strong { color: var(--text-secondary); font-weight: 650; }
.community-level-progress { height: 6px; margin-top: .45rem; overflow: hidden; border-radius: 99px; background: var(--bg-hover); }
.community-level-progress span { height: 100%; display: block; border-radius: inherit; background: #2563eb; }
.community-score-journal { margin-top: .8rem; padding-top: .65rem; border-top: 1px solid var(--border-light); }
.community-score-journal > strong { display: block; margin-bottom: .25rem; color: var(--text-primary); font-size: var(--community-rail-copy-size); }
.community-score-journal > div { min-height: 30px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: .45rem; align-items: center; }
.community-score-journal b { color: #059669; font-size: var(--community-rail-copy-size); }
.community-score-journal span { overflow: hidden; color: var(--text-secondary); font-size: var(--community-rail-copy-size); text-overflow: ellipsis; white-space: nowrap; }
.community-score-journal time { color: var(--text-muted); font-size: var(--community-rail-copy-size); }
.community-score-footer { display: flex; align-items: center; justify-content: space-between; gap: .65rem; margin-top: auto; padding-top: .65rem; border-top: 1px solid var(--border-light); color: #059669; font-size: var(--community-rail-copy-size); font-weight: 700; }
.community-score-footer button { padding: 0; border: 0; background: none; color: #2563eb; font: inherit; font-size: var(--community-rail-copy-size); font-weight: 700; cursor: pointer; }

.community-profile-stream { min-width: 0; max-width: 100%; overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.community-profile-tabs { max-width: 100%; display: flex; align-items: center; gap: .2rem; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; padding: 0 1.25rem; border-bottom: 1px solid var(--border-light); }
.community-profile-tabs::-webkit-scrollbar { display: none; }
.community-profile-tabs button { position: relative; min-width: 104px; height: 50px; padding: 0 .75rem; border: 0; background: transparent; color: var(--text-secondary); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; }
.community-profile-tabs button::after { position: absolute; right: .5rem; bottom: -1px; left: .5rem; height: 2px; background: transparent; content: ''; }
.community-profile-tabs button.active { color: #2563eb; }
.community-profile-tabs button.active::after { background: #2563eb; }
.community-profile-tab-panel { padding: 1rem; }
.community-profile-post-feed { min-width: 0; }
.community-profile-post-feed .civic-community-layout,
.community-profile-post-feed .civic-community-main,
.community-profile-post-feed .civic-community-feed { min-width: 0; width: 100%; }
.community-profile-post-feed .discussion-post:first-child { margin-top: 0; }
.community-contribution-card { padding: 1rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.community-contribution-card + .community-contribution-card { margin-top: .85rem; }
.community-contribution-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; color: var(--text-muted); font-size: var(--fs-xs); }
.community-contribution-type { color: #2563eb; font-weight: 800; }
.community-contribution-card h3 { margin: .55rem 0 0; color: var(--text-primary); font-size: var(--fs-md); line-height: 1.35; }
.community-contribution-card > p { max-width: 680px; margin: .5rem 0 0; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.55; }
.community-contribution-body { display: grid; grid-template-columns: minmax(0, 1fr) 205px; gap: 1rem; align-items: end; margin-top: .8rem; }
.community-contribution-body:not(.has-media) { grid-template-columns: 1fr 205px; }
.community-contribution-body .community-profile-video,
.community-contribution-body .community-profile-image { max-height: 300px; margin: 0; }
.community-contribution-body .community-profile-video { aspect-ratio: 16 / 9; object-fit: cover; }
.community-point-award { min-height: 96px; display: flex; flex-direction: column; justify-content: center; padding: .85rem; border: 1px solid #d1fae5; border-radius: 6px; background: #f0fdf4; }
.community-point-award strong { color: #059669; font-size: var(--fs-md); }
.community-point-award strong span { font-size: var(--fs-xs); }
.community-point-award > span { display: flex; align-items: center; gap: .35rem; margin-top: .3rem; color: #059669; font-size: var(--fs-xs); }
.community-point-award small { margin-top: .85rem; color: #64748b; font-size: var(--fs-xs); }
.community-point-award.is-pending { border-color: #fde68a; background: #fffbeb; }
.community-point-award.is-pending strong,
.community-point-award.is-pending > span { color: #b45309; }
.community-contribution-card footer { display: flex; align-items: center; gap: 1.25rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--border-light); color: var(--text-muted); font-size: var(--fs-xs); }
.community-contribution-card footer span { display: inline-flex; align-items: center; gap: .35rem; }
.community-contribution-card footer .community-contribution-views { margin-left: auto; }
.community-contribution-card footer a { color: var(--text-muted); }
.community-contribution-card footer a:hover { color: #2563eb; }

.community-profile-rail { min-width: 0; display: grid; gap: 1rem; }
.community-profile-rail-card { overflow: hidden; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.community-profile-rail-card > header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--border-light); }
.community-profile-rail-card > header h2 { margin: 0; color: var(--text-primary); font-size: var(--fs-sm); }
.community-profile-rail-card > header button { border: 0; background: none; color: var(--text-muted); cursor: pointer; }
.community-impact-list > div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 43px; padding: 0 1rem; border-bottom: 1px solid var(--border-light); color: var(--text-secondary); font-size: var(--community-rail-copy-size); }
.community-impact-list > div:last-child { border-bottom: 0; }
.community-impact-list span { display: flex; align-items: center; gap: .55rem; }
.community-impact-list i { width: 18px; color: #64748b; text-align: center; }
.community-impact-list div:nth-child(2) i { color: #10b981; }
.community-impact-list strong { color: var(--text-primary); }
.community-active-reforms > a { min-height: 82px; display: grid; grid-template-columns: 36px minmax(0, 1fr) 12px; gap: .7rem; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--border-light); color: inherit; text-decoration: none; }
.community-active-reforms > a:last-child { border-bottom: 0; }
.community-active-reforms > a:hover { background: var(--bg-hover); }
.community-profile-reform-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: #ecfdf5; color: #10b981; }
.community-profile-reform-icon.participating { background: #eff6ff; color: #2563eb; }
.community-active-reforms > a > span:nth-child(2) { min-width: 0; }
.community-active-reforms strong { display: -webkit-box; max-height: 2.6em; overflow: hidden; margin-top: .18rem; color: var(--text-primary); font-size: var(--community-rail-copy-size); line-height: 1.3; text-overflow: ellipsis; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
.community-active-reforms span span:not(.community-reform-status):not(.community-mini-progress) { display: block; margin-top: .25rem; color: var(--text-muted); font-size: var(--community-rail-copy-size); }
.community-reform-status { display: inline-block; color: #059669; font-size: var(--community-rail-copy-size); font-weight: 800; }
.community-reform-status.participating { color: #2563eb; }
.community-mini-progress { width: 100%; height: 4px; display: block; margin-top: .35rem; overflow: hidden; border-radius: 99px; background: var(--bg-hover); }
.community-mini-progress i { height: 100%; display: block; border-radius: inherit; background: #2563eb; }
.community-active-reforms > a > i { color: var(--text-muted); font-size: var(--fs-xs); }
.community-profile-reform-list > article { display: grid; grid-template-columns: 42px minmax(0, 1fr) 22px; gap: .85rem; align-items: start; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.community-profile-reform-list > article:last-child { border-bottom: 0; }
.community-profile-reform-list h3 { margin: .3rem 0 0; color: var(--text-primary); font-size: var(--fs-sm); }
.community-profile-reform-list p { margin: .35rem 0 0; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.45; }
.community-profile-reform-list small { color: var(--text-muted); font-size: var(--fs-xs); }
.community-profile-reform-list article > a { align-self: center; color: var(--text-muted); }
.community-reform-progress { height: 5px; margin: .65rem 0 .28rem; overflow: hidden; border-radius: 99px; background: var(--bg-hover); }
.community-reform-progress span { height: 100%; display: block; border-radius: inherit; background: #2563eb; }
.community-profile-activity-list article { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: .8rem; padding: 1rem 0; border-bottom: 1px solid var(--border-light); }
.community-profile-activity-list article:last-child { border-bottom: 0; }
.community-profile-activity-list .activity-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: color-mix(in srgb, #2563eb 14%, var(--bg-card)); color: #3b82f6; }
.community-profile-activity-list .activity-icon.points { background: color-mix(in srgb, #f59e0b 14%, var(--bg-card)); color: #f59e0b; }
.community-profile-activity-list .activity-icon.comment { background: color-mix(in srgb, #10b981 14%, var(--bg-card)); color: #10b981; }
.community-profile-activity-list strong { color: var(--text-primary); font-size: var(--fs-sm); }
.community-profile-activity-list p { margin: .25rem 0; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.5; }
.community-profile-activity-list time { color: var(--text-muted); font-size: var(--fs-xs); }

.community-points-dialog[hidden] { display: none; }
.community-points-dialog { position: fixed; z-index: 1200; inset: 0; display: grid; place-items: center; padding: 1rem; }
.community-points-dialog-backdrop { position: absolute; inset: 0; background: var(--window-scrim); -webkit-backdrop-filter: var(--window-scrim-filter); backdrop-filter: var(--window-scrim-filter); }
.community-points-dialog > section { position: relative; width: min(440px, 100%); max-height: calc(100dvh - 2rem); overflow: auto; padding: 2rem 1.75rem 1.5rem; border: 1px solid var(--border-light); border-radius: 22px; background: var(--window-glass); -webkit-backdrop-filter: var(--window-glass-filter); backdrop-filter: var(--window-glass-filter); box-shadow: 0 24px 60px rgba(2,6,23,.35); animation: novaAuthIn .18s ease-out; }
.community-points-dialog header { display: grid; justify-items: center; gap: .35rem; text-align: center; }
.community-points-badge { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: .5rem; border-radius: 18px; background: color-mix(in srgb, var(--otv-gold, #eab308) 16%, transparent); color: var(--otv-gold, #eab308); font-size: var(--fs-lg); }
.community-points-dialog h2 { margin: 0; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 700; line-height: 1.2; }
.community-points-dialog header p { margin: 0; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.45; }
.community-points-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: color-mix(in srgb, var(--text-primary) 8%, transparent); color: var(--text-secondary); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.community-points-close:hover { background: color-mix(in srgb, var(--text-primary) 14%, transparent); color: var(--text-primary); }
/* The steps hang off one line, number to number. */
.community-points-steps { position: relative; display: grid; gap: 1.25rem; margin: 1.75rem 0 0; padding: 0; list-style: none; }
.community-points-steps::before { content: ""; position: absolute; top: 14px; bottom: 14px; left: 13px; width: 2px; border-radius: 2px; background: color-mix(in srgb, var(--otv-gold, #eab308) 25%, transparent); }
.community-points-steps li { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .9rem; align-items: start; }
.community-points-step { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--otv-gold, #eab308); color: #1f2937; font-size: var(--fs-sm); font-weight: 700; box-shadow: 0 0 0 4px var(--bg-card); }
.community-points-steps b { display: block; padding-top: 3px; color: var(--text-primary); font-size: var(--fs-md); font-weight: 700; line-height: 1.35; }
.community-points-steps small { display: block; margin-top: .2rem; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.5; }

html.dark .community-point-award { border-color: rgba(16,185,129,.25); background: rgba(16,185,129,.09); }
html.dark .community-point-award.is-pending { border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.1); }

@container (max-width: 1080px) {
  .community-profile-layout { grid-template-columns: minmax(0, 1fr) 280px; }
  .community-profile-v2 .community-profile-identity { grid-template-columns: 100px minmax(0, 1fr); }
  .community-profile-v2 .community-profile-avatar { width: 92px; height: 92px; }
}

@container (max-width: 820px) {
  .community-profile-layout { grid-template-columns: minmax(0, 1fr); }
  .community-profile-layout > * { min-width: 0; }
  .community-profile-score-card { min-height: 220px; }
  .community-profile-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .community-profile-rail > .community-profile-score-card,
  .community-profile-rail > .community-profile-skeleton-score { grid-column: 1 / -1; }
}

@container (max-width: 620px) {
  .community-skeleton-profile-body { display: flex; flex-direction: column; gap: 0; padding: 0 1rem 1rem; }
  .community-skeleton-avatar { width: 88px; height: 88px; margin-top: -44px; }
  .community-skeleton-profile-copy { width: 100%; padding-top: .85rem; }
  .community-skeleton-name { width: 55%; }
  .community-skeleton-bio { width: 88%; }
  .community-skeleton-tabs { gap: .45rem; padding-inline: .5rem; }
  .community-profile-v2 .community-profile-identity { min-height: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 1rem; }
  .community-profile-v2 .community-profile-avatar { width: 88px; height: 88px; }
  .community-profile-v2 .community-profile-name { order: 2; margin-top: .8rem; }
  .community-profile-v2 .community-profile-bio { order: 3; }
  .community-profile-v2 .community-profile-meta { order: 4; }
  .community-profile-v2 .community-profile-follow-counts { order: 5; width: 100%; }
  .community-profile-v2 .community-profile-actions { order: 6; width: 100%; display: grid; grid-template-columns: 1fr 1fr 38px; margin-top: 1rem; }
  .community-profile-v2 .community-profile-actions:has(.community-profile-edit-btn) { grid-template-columns: 1fr 38px; }
  .community-profile-v2 .community-profile-more { width: 38px; }
  .community-profile-account-popover { width: min(154px, calc(100vw - 2rem)); }
  .community-profile-rail { grid-template-columns: 1fr; }
  .community-profile-tabs { padding: 0 .5rem; }
  .community-profile-tabs button { min-width: 0; flex: 1; padding-inline: .25rem; font-size: var(--community-type-meta); }
  .community-profile-tab-panel { padding: .7rem; }
  .community-contribution-header { align-items: flex-start; flex-direction: column; gap: .3rem; }
  .community-contribution-body,
  .community-contribution-body:not(.has-media) { grid-template-columns: 1fr; }
  .community-contribution-card footer { flex-wrap: wrap; gap: .8rem; }
  .community-contribution-card footer .community-contribution-views { margin-left: 0; }
  .community-contribution-card footer a { margin-left: auto; }
  .community-level-progress-label { align-items: flex-start; flex-direction: column; }
  .community-score-footer { align-items: flex-start; flex-direction: column; }
}

/* Profile header: cover band, portrait breaking into it, own-profile actions */
.community-profile-v2 .community-profile-hero { position: relative; z-index: 2; overflow: visible; }
.community-profile-v2 .community-profile-primary,
.community-profile-v2 .community-profile-score-card,
.community-profile-v2 .community-profile-rail-card { border-radius: 16px; }
.community-profile-v2 .community-profile-primary .community-profile-hero { border: 0; border-radius: 0; background: transparent; }
.community-profile-v2 .community-profile-primary .community-profile-stream { border: 0; border-radius: 0; background: transparent; }
.community-profile-v2 .community-profile-cover { height: 92px; border-radius: 15px 15px 0 0; background: linear-gradient(115deg, #1d4ed8 0, #3b82f6 46%, #f59e0b 100%); }
.community-profile-v2 .community-profile-identity { min-height: 172px; align-content: start; padding-top: 0; }
.community-profile-v2 .community-profile-avatar { margin-top: -58px; }
.community-profile-v2 .community-profile-name { margin-top: .5rem; }
.community-profile-v2 .community-profile-meta { gap: .4rem; }
.community-profile-v2 .community-profile-meta span,
.community-profile-v2 .community-profile-meta a { padding: .26rem .6rem; border-radius: 999px; background: var(--bg-hover); font-size: var(--fs-xs); }
.community-profile-v2 .community-profile-meta a:hover { background: #eff6ff; color: #2563eb; text-decoration: none; }
.community-profile-v2 .community-profile-follow-counts { gap: .75rem 1.4rem; flex-wrap: wrap; }
.community-profile-v2 .community-profile-name,
.community-profile-v2 .community-profile-bio,
.community-profile-v2 .community-profile-meta,
.community-profile-v2 .community-profile-follow-counts { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.community-profile-v2 .community-profile-meta span,
.community-profile-v2 .community-profile-meta a { max-width: 100%; }
.community-profile-v2 .community-profile-primary { overflow: hidden; }
.community-profile-v2 .community-score-topline > div,
.community-profile-v2 .community-level-row > div,
.community-profile-v2 .community-level-progress-label > span,
.community-profile-v2 .community-level-progress-label > strong,
.community-profile-v2 .community-impact-list span { min-width: 0; overflow-wrap: anywhere; }
.community-profile-edit-btn { height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: 0 1rem; border: 1px solid #2563eb; border-radius: 5px; background: transparent; color: #2563eb; font: inherit; font-size: var(--fs-xs); font-weight: 750; cursor: pointer; }
.community-profile-edit-btn:hover { background: #2563eb; color: #fff; }
.community-profile-edit-btn:disabled { opacity: .6; cursor: default; }

.community-profile-rail-card > header .community-profile-view-all {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem 0;
  color: #2563eb;
  font-size: var(--community-rail-copy-size);
  font-weight: 750;
}
.community-profile-rail-card > header .community-profile-view-all:hover { color: #1d4ed8; }
.community-profile-rail-card > header .community-profile-view-all i { font-size: .5rem; }
.community-profile-rail .community-profile-empty span { font-size: var(--community-rail-copy-size); }

/* Profile editor. Specific enough to win over the auth modal's narrower card,
   whose rule sits further down this file. */
.nova-profile-modal.nova-auth-modal .auth-container { max-width: 560px; padding: 1.6rem 1.5rem 1.35rem; }
.nova-profile-avatar-row { display: flex; justify-content: center; margin-bottom: .35rem; }
.nova-profile-textarea { box-sizing: border-box; width: 100%; padding: .7rem .9rem; border: 1px solid var(--border-light); border-radius: 10px; background: var(--bg-hover); color: var(--text-primary); font: inherit; font-size: var(--fs-sm); line-height: 1.5; resize: vertical; }
.nova-profile-textarea:focus { border-color: #3b82f6; background: var(--bg-card); outline: none; }
.nova-profile-counter { justify-self: end; font-variant-numeric: tabular-nums; }
.nova-profile-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .85rem; }
.nova-profile-actions { display: flex; justify-content: flex-end; gap: .6rem; }
.nova-profile-actions .auth-btn { padding: .75rem 1.5rem; font-size: var(--fs-sm); }

@media (max-width: 560px) {
  .nova-profile-pair { grid-template-columns: 1fr; }
  .nova-profile-actions { flex-direction: column-reverse; }
  .nova-profile-actions .auth-btn { width: 100%; }
}

/* Profile typography: the site's own scale (--fs-*), four of its steps. */
.community-profile-v2 {
  --community-type-meta: var(--fs-xs);
  --community-type-body: var(--fs-sm);
  --community-type-emphasis: var(--fs-md);
  --community-type-display: var(--fs-xl);
  --community-rail-copy-size: var(--community-type-meta);
}

.community-profile-v2 .community-profile-name h1,
.community-profile-v2 .community-profile-avatar,
.community-profile-v2 .community-score-topline strong {
  font-size: var(--community-type-display);
}

.community-profile-v2 .community-profile-tabs button,
.community-profile-v2 .community-level-row strong,
.community-profile-v2 .community-profile-rail-card > header h2,
.community-profile-v2 .community-contribution-card h3,
.community-profile-v2 .community-profile-reform-list h3,
.community-profile-v2 .community-profile-activity-list strong,
.community-profile-v2 .community-profile-empty strong,
.community-profile-v2 .community-point-award strong {
  font-size: var(--community-type-emphasis);
}

.community-profile-v2 .community-profile-bio,
.community-profile-v2 .community-profile-follow-counts,
.community-profile-v2 .discussion-author-name strong,
.community-profile-v2 .discussion-post-text,
.community-profile-v2 .community-contribution-card > p,
.community-profile-v2 .community-profile-activity-list p {
  font-size: var(--community-type-body);
}

.community-profile-v2 .community-profile-name > span,
.community-profile-v2 .community-profile-meta,
.community-profile-v2 .community-profile-meta span,
.community-profile-v2 .community-profile-meta a,
.community-profile-v2 .community-profile-follow-btn,
.community-profile-v2 .community-profile-message-btn,
.community-profile-v2 .community-profile-edit-btn,
.community-profile-v2 .community-profile-account-popover strong,
.community-profile-v2 .community-score-topline small,
.community-profile-v2 .community-score-topline strong span,
.community-profile-v2 .community-level-row small,
.community-profile-v2 .community-level-progress-label,
.community-profile-v2 .community-score-journal > strong,
.community-profile-v2 .community-score-journal b,
.community-profile-v2 .community-score-journal span,
.community-profile-v2 .community-score-journal time,
.community-profile-v2 .community-score-footer,
.community-profile-v2 .community-score-footer button,
.community-profile-v2 .community-impact-list > div,
.community-profile-v2 .community-active-reforms strong,
.community-profile-v2 .community-active-reforms span span:not(.community-reform-status):not(.community-mini-progress),
.community-profile-v2 .community-reform-status,
.community-profile-v2 .community-profile-reform-list p,
.community-profile-v2 .community-profile-reform-list small,
.community-profile-v2 .community-profile-activity-list time,
.community-profile-v2 .discussion-author-name + span,
.community-profile-v2 .discussion-topic,
.community-profile-v2 .discussion-post-actions,
.community-profile-v2 .discussion-post-actions button,
.community-profile-v2 .discussion-views,
.community-profile-v2 .community-contribution-header,
.community-profile-v2 .community-point-award strong span,
.community-profile-v2 .community-point-award > span,
.community-profile-v2 .community-point-award small,
.community-profile-v2 .community-contribution-card footer,
.community-profile-v2 .community-profile-empty span {
  font-size: var(--community-type-meta);
}

@container (max-width: 620px) {
  .community-profile-v2 .community-profile-tabs button {
    min-width: 0;
    flex: 1 1 0;
    padding-inline: .25rem;
    font-size: var(--community-type-meta);
  }
}

/* The stacked profile shows the header and feed in a single column. */
@container (max-width: 820px) {
  .community-profile-v2 .community-profile-primary { display: contents; }
  .community-profile-v2 .community-profile-primary .community-profile-hero,
  .community-profile-v2 .community-profile-skeleton-hero {
    grid-row: 1;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border-light);
    border-radius: 16px;
    background: var(--bg-card);
  }
  .community-profile-v2 .community-profile-rail { display: none; }
  /* The feed stays on the page surface. */
  .community-profile-v2 .community-profile-primary .community-profile-stream,
  .community-profile-v2 .community-profile-skeleton-stream {
    grid-row: 2;
    min-width: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
}

/* Live OTV polls */
.otv-polls-page { width: min(1080px, 100%); margin: 0 auto; padding: 2rem; }
.otv-polls-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; margin-bottom: 1rem; }
.otv-polls-header h1 { display: flex; align-items: center; gap: .65rem; margin: .35rem 0 .25rem; color: var(--text-primary); font-size: var(--fs-xl); letter-spacing: 0; }
.otv-polls-header h1 i { color: #f59e0b; }
.otv-polls-header p { margin: 0; color: var(--text-secondary); font-size: var(--fs-sm); }
.otv-polls-refresh { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-card); color: var(--text-secondary); cursor: pointer; }
.otv-polls-refresh:hover { border-color: var(--secondary); color: var(--secondary); }
.otv-polls-refresh:disabled { opacity: .6; cursor: wait; }
.otv-polls-auth-note { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: .8rem; margin: 1rem 0; padding: .85rem 1rem; border: 1px solid rgba(245,158,11,.35); border-radius: 6px; background: rgba(245,158,11,.08); }
.otv-polls-auth-note[hidden] { display: none; }
.otv-polls-auth-note > i { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 5px; background: rgba(245,158,11,.14); color: #d97706; }
.otv-polls-auth-note > div { display: grid; gap: .15rem; }
.otv-polls-auth-note strong { color: var(--text-primary); font-size: var(--fs-xs); }
.otv-polls-auth-note span { color: var(--text-secondary); font-size: var(--fs-xs); }
.otv-polls-auth-note a { height: 34px; display: inline-flex; align-items: center; gap: .4rem; padding: 0 .75rem; border-radius: 4px; background: #172033; color: #fff; font-size: var(--fs-xs); font-weight: 750; text-decoration: none; }
.otv-polls-status { min-height: 0; color: var(--text-secondary); font-size: var(--fs-xs); }
.otv-polls-status.is-error { margin: .8rem 0; padding: .7rem .8rem; border: 1px solid rgba(239,68,68,.25); border-radius: 5px; background: rgba(239,68,68,.07); color: #dc2626; }
.otv-polls-loading { min-height: 280px; display: flex; align-items: center; justify-content: center; gap: .6rem; color: var(--text-secondary); font-size: var(--fs-xs); }
.otv-polls-loading[hidden] { display: none; }
.otv-polls-section { margin-top: 1.5rem; }
.otv-polls-section.is-closed { margin-top: 2.5rem; }
.otv-polls-section-title { display: flex; align-items: center; gap: .55rem; margin-bottom: .85rem; }
.otv-polls-section-title h2 { margin: 0; color: var(--text-primary); font-size: var(--fs-md); letter-spacing: 0; }
.otv-polls-section-title > span { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 .35rem; border-radius: 11px; background: var(--border-light); color: var(--text-secondary); font-size: var(--fs-xs); font-weight: 800; }
.otv-live-polls-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
.otv-live-poll { min-width: 0; display: flex; flex-direction: column; padding: 1.15rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); }
.otv-live-poll > header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.otv-live-poll-status { display: inline-flex; align-items: center; gap: .35rem; color: #059669; font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; }
.otv-live-poll-status i { font-size: .5rem; }
.otv-live-poll-source { color: var(--text-muted); font-size: .56rem; font-weight: 800; }
.otv-live-poll h2 { margin: .75rem 0 .35rem; color: var(--text-primary); font-size: var(--fs-md); line-height: 1.4; letter-spacing: 0; }
.otv-live-poll > p { margin: 0 0 .7rem; color: var(--text-secondary); font-size: var(--fs-xs); line-height: 1.5; }
.otv-live-poll-options { display: grid; gap: .5rem; margin-top: auto; padding-top: .75rem; }
.otv-live-poll-options button { position: relative; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: .8rem; overflow: hidden; padding: .55rem .7rem; border: 1px solid var(--border-light); border-radius: 5px; background: var(--bg-main); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.otv-live-poll-options button:not(:disabled):hover { border-color: var(--secondary); }
.otv-live-poll-options button:disabled { cursor: default; }
.otv-live-poll-options button.is-selected { border-color: #2563eb; box-shadow: inset 3px 0 #2563eb; }
.otv-live-poll-fill { position: absolute; inset: 0 auto 0 0; background: rgba(37,99,235,.09); pointer-events: none; }
.otv-live-poll-option-label,
.otv-live-poll-option-result { position: relative; z-index: 1; }
.otv-live-poll-option-label { display: inline-flex; align-items: center; gap: .4rem; font-size: var(--fs-xs); font-weight: 700; }
.otv-live-poll-option-label i { color: #2563eb; }
.otv-live-poll-option-result { display: flex; align-items: flex-end; flex-direction: column; flex: 0 0 auto; }
.otv-live-poll-option-result strong { font-size: var(--fs-xs); }
.otv-live-poll-option-result small { color: var(--text-muted); font-size: var(--fs-xs); }
.otv-live-poll > footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .85rem; padding-top: .75rem; border-top: 1px solid var(--border-light); color: var(--text-muted); font-size: var(--fs-xs); }
.otv-live-poll > footer span { display: inline-flex; align-items: center; gap: .35rem; }
.otv-live-poll.is-closed { background: color-mix(in srgb, var(--bg-card) 86%, var(--bg-main)); }
.otv-live-poll.is-closed .otv-live-poll-status { color: var(--text-muted); }
.otv-live-poll.is-closed .otv-live-poll-fill { background: rgba(100,116,139,.08); }
.otv-polls-empty { min-height: 300px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: .5rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); color: var(--text-muted); text-align: center; }
.otv-polls-empty i { color: var(--secondary); font-size: var(--fs-xl); }
.otv-polls-empty strong { color: var(--text-primary); font-size: var(--fs-sm); }
.otv-polls-empty span { font-size: var(--fs-xs); }

@media (max-width: 760px) {
  .otv-polls-page { padding: 1rem; }
  .otv-polls-header { align-items: flex-start; }
  .otv-polls-header h1 { font-size: var(--fs-xl); }
  .otv-polls-auth-note { grid-template-columns: 36px minmax(0, 1fr); }
  .otv-polls-auth-note a { grid-column: 1 / -1; justify-content: center; }
  .otv-live-polls-grid { grid-template-columns: 1fr; }
  .otv-live-poll > footer { align-items: flex-start; flex-direction: column; gap: .4rem; }
}

/* ============================================================
   Account area (sidebar) + real login modal
   ============================================================ */

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-account {
  position: relative;
}

.sidebar-account .user-card {
  flex: 1;
  min-width: 0;
  border: 0;
  font: inherit;
  text-align: left;
}

/* The "…" takes the same 28px slot as the wallet's +, so the two line up. */
.sidebar-account .user-card .user-menu-btn {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
}

/* Account menu: profile, Setări, sign-out; opens upward from the card. */
.sidebar-account .account-menu {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 60;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--window-glass);
  -webkit-backdrop-filter: var(--window-glass-filter);
  backdrop-filter: var(--window-glass-filter);
  box-shadow: var(--shadow-xl);
  animation: account-menu-in .16s ease-out;
}
.sidebar-account .account-menu[hidden] { display: none; }
.account-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.account-menu-item:hover { background: var(--bg-hover); }
@keyframes account-menu-in { from { opacity: 0; transform: translateY(6px); } }

/* Signed in, Setări lives in the account menu; visitors keep the button. */
.sidebar-account .account-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  opacity: 0.6;
}

.account-signin {
  width: 100%;
  border: none;
  font: inherit;
  text-align: left;
}

/* The avatar font size is set for two initials, which leaves a glyph looking
   lost in the circle. */
.account-signin .otv-user-avatar {
  font-size: var(--fs-md);
}

img.otv-user-avatar {
  object-fit: cover;
}

.verified-tick {
  color: #3b82f6;
  font-size: var(--fs-xs);
}

/* Login modal reuses the dev-gate auth markup, but sits over the app instead of
   replacing it. The dev gate is permanently dark; this modal follows the theme,
   so every hardcoded colour it would inherit is remapped to a variable. */
.nova-auth-modal {
  background: var(--window-scrim); -webkit-backdrop-filter: var(--window-scrim-filter); backdrop-filter: var(--window-scrim-filter);
  padding: 1rem;
}

.nova-auth-modal .auth-container {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xl, 0 25px 50px -12px rgba(0, 0, 0, 0.25));
  color: var(--text-primary);
  animation: novaAuthIn 0.18s ease-out;
}

@keyframes novaAuthIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.nova-auth-modal .auth-logo-text,
.nova-auth-modal .auth-title {
  color: var(--text-primary);
}

.nova-auth-modal .auth-subtitle {
  color: var(--text-secondary);
}

.nova-auth-modal .auth-input-wrapper input {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-primary);
}

.nova-auth-modal .auth-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.nova-auth-modal .auth-input-wrapper input:focus {
  background: var(--bg-card);
  border-color: #3b82f6;
}

.nova-auth-modal .auth-input-wrapper i {
  color: var(--text-muted);
}

/* Show/hide password toggle */
.nova-auth-modal .auth-input-wrapper.has-reveal input {
  padding-right: 3rem;
}

.auth-reveal {
  position: absolute;
  right: 0.5rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

/* The wrapper positions any icon on the left; the one in this button must not move. */
.nova-auth-modal .auth-reveal i {
  position: static;
  left: auto;
  color: inherit;
  font-size: var(--fs-md);
}

.auth-reveal:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.auth-reveal:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.auth-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.auth-close:hover {
  background: var(--border-light);
  color: var(--text-primary);
}

.nova-auth-modal .auth-form {
  gap: 0.85rem;
}

.nova-auth-modal .auth-footer {
  color: var(--text-secondary);
}

.nova-auth-modal .auth-footer a {
  color: #3b82f6;
  font-weight: 600;
  text-decoration: none;
}

.nova-auth-modal .auth-footer a:hover {
  text-decoration: underline;
}

.auth-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

/* Sign in / create account, in one card */
.nova-auth-modal .auth-container {
  width: 100%;
  max-width: 430px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  padding: 2rem 1.75rem 1.5rem;
  border-radius: 14px;
  text-align: left;
}

.nova-auth-modal .auth-logo {
  margin-bottom: 1.25rem;
}

.nova-auth-modal .auth-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.nova-auth-modal .auth-logo-text {
  font-size: var(--fs-lg);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-hover);
}

.auth-tabs button {
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.auth-tabs button:hover {
  color: var(--text-primary);
}

.auth-tabs button.active {
  color: var(--text-primary);
}

/* One pill slides between the two tabs, like the live channel picker. */
.auth-tabs { position: relative; isolation: isolate; }
.auth-tabs::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 0.25rem;
  bottom: 0.25rem;
  left: 0.25rem;
  width: calc(50% - 0.375rem);
  border-radius: 999px;
  background: var(--bg-card);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
  transition: transform 0.28s cubic-bezier(0.3, 0.7, 0.2, 1);
}
.auth-tabs:has(button:nth-child(2).active)::before { transform: translateX(calc(100% + 0.25rem)); }
@media (prefers-reduced-motion: reduce) { .auth-tabs::before { transition: none; } }

.auth-pane[hidden] {
  display: none;
}

.auth-google {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.72rem 1rem;
  border: 1px solid #dadce0;
  border-radius: 10px;
  background: #fff;
  color: #1f1f1f;
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.18);
  transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.auth-google:hover {
  background: #f0f4f9;
  border-color: #b8c4d4;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.22);
}

.auth-google:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.auth-google:disabled {
  opacity: 0.65;
  cursor: wait;
}

.auth-google svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.auth-google-error {
  margin: -0.35rem 0 0;
  text-align: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--border-light);
}

.auth-divider span {
  white-space: nowrap;
}

.auth-field {
  display: grid;
  gap: 0.35rem;
}

.auth-label {
  color: var(--text-primary);
  font-size: var(--fs-xs);
  font-weight: 650;
}

.auth-hint {
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.nova-auth-modal .auth-input-wrapper input {
  padding: 0.8rem 1rem 0.8rem 2.7rem;
  border-radius: 10px;
  font-size: var(--fs-sm);
}

.nova-auth-modal .auth-input-wrapper i {
  left: 0.9rem;
  font-size: var(--fs-sm);
}

.auth-check {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-secondary);
  font-size: var(--fs-xs);
  cursor: pointer;
}

.auth-check input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.auth-note {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.auth-honeypot {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.nova-auth-modal .auth-btn {
  padding: 0.85rem 1.5rem;
  border-radius: 10px;
  font-size: var(--fs-sm);
}

.nova-auth-modal .auth-btn.secondary {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  box-shadow: none;
}

.nova-auth-modal .auth-btn.secondary:hover {
  background: var(--bg-hover);
  transform: none;
  box-shadow: none;
}

.auth-success {
  display: grid;
  justify-items: center;
  gap: 0.6rem;
  padding: 1.5rem 1.25rem;
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.08);
  text-align: center;
}

.auth-success i {
  color: #16a34a;
  font-size: var(--fs-xl);
}

.auth-success strong {
  color: var(--text-primary);
  font-size: var(--fs-md);
}

.auth-success p {
  margin: 0;
  color: var(--text-secondary);
  font-size: var(--fs-sm);
  line-height: 1.55;
}

.auth-success .auth-btn {
  width: 100%;
  margin-top: 0.35rem;
}

.nova-auth-modal .auth-footer {
  margin: 1.25rem 0 0;
  font-size: var(--fs-xs);
  text-align: center;
}

.auth-link {
  padding: 0;
  border: 0;
  background: none;
  color: #3b82f6;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Profile picture picker */
.avatar-picker {
  display: grid;
  justify-items: center;
  gap: 0.4rem;
}

.avatar-picker-face {
  position: relative;
  width: 84px;
  height: 84px;
  padding: 0;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: var(--bg-hover);
  cursor: pointer;
}

.avatar-picker-face:not(:has(img:not([hidden]))) { background: var(--avatar-fallback-bg); }

.avatar-picker-face:hover {
  border-color: #3b82f6;
}

.avatar-picker-face:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.avatar-picker-initial {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--text-secondary);
  font-size: var(--fs-xl);
  font-weight: 700;
}

.avatar-picker-face img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.avatar-picker-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 2px solid var(--bg-card);
  border-radius: 50%;
  background: #3b82f6;
  color: #fff;
  font-size: var(--fs-xs);
}

.avatar-picker-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--fs-xs);
  text-align: center;
}

.avatar-picker .auth-error {
  min-height: 0;
  font-size: var(--fs-xs);
  text-align: center;
}

/* Square crop dialog */
.nova-crop-modal {
  z-index: 100000;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
}

.crop-container {
  width: 100%;
  max-width: 330px;
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--bg-card);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.crop-container h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--fs-md);
  text-align: center;
}

.crop-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 12px;
  background: #0f172a;
  cursor: grab;
  touch-action: none;
}

.crop-viewport.is-dragging {
  cursor: grabbing;
}

.crop-viewport img {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  user-select: none;
  -webkit-user-drag: none;
}

/* Shows the circle the picture will be cropped to, without clipping the drag area. */
.crop-mask {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.55);
  pointer-events: none;
}

.crop-zoom {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-muted);
  font-size: var(--fs-xs);
}

.crop-zoom input {
  flex: 1;
  accent-color: #3b82f6;
  cursor: pointer;
}

.crop-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.crop-actions .auth-btn {
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: var(--fs-sm);
}

.crop-actions .auth-btn.secondary {
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  box-shadow: none;
}

.crop-actions .auth-btn.secondary:hover {
  background: var(--bg-hover);
  transform: none;
  box-shadow: none;
}

/* Pre-launch population preview. Synthetic rows stay visibly distinct from
   real civic totals and verified community activity. */
.demo-population-inline,
.demo-population-banner {
  border: 1px solid #c4b5fd;
  background: #f5f3ff;
  color: #5b21b6;
}

.demo-population-inline {
  padding: 0.55rem 0.75rem;
  font-size: var(--fs-xs);
  line-height: 1.35;
}

.demo-population-inline span,
.demo-population-banner > span,
.community-profile-simulation-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  background: #7c3aed;
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.35rem 0.5rem;
}

.demo-population-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  margin: 1rem 1.25rem 0;
  padding: 0.85rem;
  border-radius: var(--radius-md);
}

.demo-population-banner strong { display: block; color: #4c1d95; font-size: var(--fs-sm); }
.demo-population-banner p { margin: 0.15rem 0 0; color: #6d28d9; font-size: var(--fs-xs); line-height: 1.45; }
.leaderboard-full-row.is-synthetic { background: linear-gradient(90deg, rgba(124, 58, 237, 0.035), transparent); }
.leaderboard-full-row.is-synthetic:hover { background: rgba(124, 58, 237, 0.07); }
.leaderboard-person strong em { margin-left: 0.3rem; color: #7c3aed; font-size: var(--fs-xs); font-style: normal; letter-spacing: 0.05em; }
.community-profile-simulation-label { margin: 0 0 0.65rem; }
.community-contribution-card.is-synthetic,
.community-profile-activity-list article.is-synthetic { border-color: #c4b5fd; background: linear-gradient(135deg, #fff, #faf5ff); }
.community-contribution-card.is-synthetic .community-point-award { border-color: #ddd6fe; background: rgba(255, 255, 255, .82); box-shadow: inset 3px 0 0 #8b5cf6; }
.community-contribution-card.is-synthetic .community-point-award strong,
.community-contribution-card.is-synthetic .community-point-award > span { color: #6d28d9; }

html.dark .demo-population-inline,
html.dark .demo-population-banner { border-color: #6d28d9; background: rgba(91, 33, 182, 0.2); color: #ddd6fe; }
html.dark .demo-population-banner strong { color: #ede9fe; }
html.dark .demo-population-banner p { color: #c4b5fd; }
html.dark .community-contribution-card.is-synthetic,
html.dark .community-profile-activity-list article.is-synthetic { border-color: #6d28d9; background: rgba(91, 33, 182, 0.12); }
html.dark .community-contribution-card.is-synthetic .community-point-award { border-color: rgba(196, 181, 253, .35); background: rgba(255, 255, 255, .05); box-shadow: inset 3px 0 0 #8b5cf6; }
html.dark .community-contribution-card.is-synthetic .community-point-award strong,
html.dark .community-contribution-card.is-synthetic .community-point-award > span { color: #c4b5fd; }

/* --------------------------------------------------------------------------
   Nova Voices — standalone, video-first civic feed on /discutii
   -------------------------------------------------------------------------- */

.nova-voices-root {
  /* Four-size scale shared with the rest of the app: 2rem / 1rem / .9rem / .8rem.
     Meta stays an alias of ui so the page renders exactly four text sizes. */
  --voices-type-display: 2rem;
  --voices-type-heading: 1rem;
  --voices-type-body: .9rem;
  --voices-type-ui: .8rem;
  --voices-type-meta: .8rem;
  width: 100%;
  min-width: 0;
  color: var(--text-primary);
}

.voices-loading {
  min-height: 55vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .7rem;
  color: var(--text-secondary);
  font-size: var(--voices-type-ui);
}

.voices-page {
  width: 100%;
  max-width: 1120px;
  box-sizing: border-box;
  margin: 0 auto;
  padding: 0 0 5rem;
}

/* Header uses the shared .page-header / .page-title / .page-description
   pattern (same as Televot and Lideri Comunitate). */
.voices-header { margin-bottom: 1.25rem; }

.voices-compose-strip {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-card);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.voices-compose-head {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.voices-compose-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: #eff6ff;
  color: #2563eb;
}

.voices-compose-head strong {
  display: block;
  font-family: "Poppins", sans-serif;
  font-size: var(--voices-type-heading);
}

.voices-compose-head > div > span {
  display: block;
  margin-top: .14rem;
  color: var(--text-secondary);
  font-size: var(--voices-type-ui);
  line-height: 1.45;
}

.voices-filter-row label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: 0 .75rem;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg-card);
}

.voices-filter-row select,
.voices-filter-row input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--voices-type-ui);
  font-weight: 650;
}

.voices-stance-group {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
}

.voices-stance-group button {
  min-width: 0;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: 0 .65rem;
  border: 0;
  border-right: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--voices-type-ui);
  font-weight: 750;
  cursor: pointer;
}

.voices-stance-group button:last-child { border-right: 0; }
.voices-stance-group button:hover { background: var(--bg-hover); color: #2563eb; }
.voices-stance-group button.active { background: #eff6ff; color: #2563eb; box-shadow: inset 0 0 0 1px #2563eb; }

.voice-studio-stances {
  gap: 4px;
  padding: 3px;
  border: 0;
  border-radius: 8px;
  background: var(--bg-secondary);
  overflow: visible;
}

.voice-studio-stances button {
  justify-content: center;
  gap: .35rem;
  padding: 0 .45rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  text-align: center;
  white-space: nowrap;
}

.voice-studio-stances button:hover { background: var(--bg-card); }

.voice-studio-stances button span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

.voice-studio-stances button:last-child { border-right: 1px solid transparent; }
.voice-studio-stances button[data-studio-stance="pro"].active { border-color: #86efac; background: #ecfdf5; color: #047857; box-shadow: none; }
.voice-studio-stances button[data-studio-stance="contra"].active { border-color: #fda4af; background: #fff1f2; color: #be123c; box-shadow: none; }
.voice-studio-stances button[data-studio-stance="question"].active { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; box-shadow: none; }

.voices-record-primary,
.voice-publish {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .17);
}

.voices-record-primary {
  flex: 0 0 auto;
  min-width: 0;
  height: 44px;
  padding: 0 1.1rem;
  font-size: var(--voices-type-ui);
}

.voices-record-primary > span { display: inline; text-align: left; }

.voices-record-primary:hover,
.voice-publish:hover { background: #1d4ed8; }

.voices-record-primary > i { font-size: var(--voices-type-meta); }

.voices-discovery {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
  align-items: start;
  margin-top: 1.25rem;
}

.voices-feed-tabs {
  width: max-content;
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .22rem;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-card);
}

.voices-feed-tabs button {
  height: 34px;
  padding: 0 .85rem;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--voices-type-ui);
  font-weight: 750;
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.voices-feed-tabs button:hover { color: #2563eb; background: var(--bg-hover); }
.voices-feed-tabs button.active { background: #eff6ff; color: #2563eb; box-shadow: inset 0 0 0 1px #bfdbfe; }

.voices-filter-row {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 190px 190px;
  gap: .55rem;
}

.voices-filter-row label {
  height: 36px;
  padding: 0 .65rem;
}

.voices-filter-row label > i { color: var(--text-muted); font-size: var(--voices-type-ui); }
.voices-filter-row select,
.voices-filter-row input { font-weight: 600; }
.voices-filter-row input::placeholder { color: var(--text-muted); font-weight: 400; opacity: 1; }
.voices-search-filter:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37, 99, 235, .09); }

.voices-feed { margin-top: 1rem; }

.voices-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.voice-card {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(145px, 36%) minmax(0, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 7px;
  background: var(--bg-card);
  transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.voice-card:hover {
  border-color: #bfdbfe;
  transform: translateY(-2px);
  box-shadow: 0 9px 24px rgba(15, 23, 42, .08);
}

.voice-card-media {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 9 / 16;
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: #0f172a;
  cursor: pointer;
}

.voice-card-media img,
.voice-card-media video {
  width: 100%;
  height: 100%;
  aspect-ratio: 9 / 16;
  display: block;
  object-fit: cover;
  object-position: center;
}

.voice-card-media video { pointer-events: none; }

.voice-play {
  position: absolute;
  left: .65rem;
  bottom: .65rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .88);
  border-radius: 50%;
  background: rgba(15, 23, 42, .55);
  color: #fff;
  font-size: var(--voices-type-ui);
  backdrop-filter: blur(4px);
}

.voice-card-media.is-playing .voice-play { opacity: 0; }

.voice-card-media > time {
  position: absolute;
  right: .5rem;
  bottom: .5rem;
  padding: .2rem .32rem;
  border-radius: 3px;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  font-size: var(--voices-type-meta);
  font-weight: 750;
}

.voice-caption {
  position: absolute;
  right: .55rem;
  bottom: 3rem;
  left: .55rem;
  display: -webkit-box;
  max-height: 2.7em;
  overflow: hidden;
  padding: .18rem .35rem;
  color: #fff;
  font-size: var(--voices-type-meta);
  line-height: 1.35;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .8);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.voice-card-body {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: .78rem;
  /* The footer labels shorten with the card, not with the window: two cards per
     row at 1200px are narrower than one card per row at 500px. */
  container-type: inline-size;
}

.voice-reform-title {
  display: -webkit-box;
  min-height: 2.55em;
  overflow: hidden;
  color: #2563eb;
  font-family: "Poppins", sans-serif;
  font-size: var(--voices-type-body);
  font-weight: 700;
  line-height: 1.28;
  text-decoration: none;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.voice-reform-title:hover { text-decoration: underline; }

.voice-card-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .55rem;
  align-items: center;
  margin-top: .6rem;
  color: var(--text-muted);
  font-size: var(--voices-type-meta);
}

.voice-card-signals {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin-top: .55rem;
}

.voice-stance {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .28rem .5rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  font-size: var(--voices-type-meta);
  font-weight: 750;
  white-space: nowrap;
}

.voice-stance.pro { color: #059669; }
.voice-stance.contra { color: #e11d48; }
.voice-stance.question { color: #475569; }
.voice-author { min-width: 0; display: flex; align-items: center; gap: .4rem; overflow: hidden; color: var(--text-secondary); }
.voice-author > span { min-width: 0; display: flex; align-items: baseline; gap: .3rem; overflow: hidden; }
.voice-author b { overflow: hidden; color: var(--text-primary); font-size: var(--voices-type-ui); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.voice-author small { overflow: hidden; color: var(--text-muted); font-size: var(--voices-type-ui); text-overflow: ellipsis; white-space: nowrap; }

/* Marks the card a #post- link pointed at, so arriving from the homepage lands
   somewhere obvious instead of mid-feed with no explanation. */
.voice-card.is-highlighted {
  outline: 2px solid var(--secondary, #2563eb);
  outline-offset: 2px;
}

.voice-author-avatar {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-secondary, #f1f5f9);
}

.voice-author-avatar.is-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--avatar-fallback-bg);
  color: var(--text-primary);
  font-size: var(--voices-type-meta);
  font-weight: 800;
  line-height: 1;
}

.voice-useful {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: 0 .5rem;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--voices-type-meta);
  font-weight: 750;
  cursor: pointer;
}

.voice-useful:hover { border-color: #93c5fd; color: #2563eb; }
.voice-useful.active { border-color: #86efac; background: #f0fdf4; color: #059669; }
.voice-useful b { font-size: var(--voices-type-meta); }

.voice-card-body > p {
  display: -webkit-box;
  min-height: 4.5em;
  max-height: 4.5em;
  overflow: hidden;
  margin: .65rem 0 0;
  color: var(--text-secondary);
  font-size: var(--voices-type-ui);
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

.voice-card footer {
  display: grid;
  grid-template-columns: 1.25fr .95fr;
  gap: .4rem;
  margin-top: auto;
  padding-top: .58rem;
  border-top: 1px solid var(--border-light);
}

.voice-card footer button {
  min-width: 0;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  padding: 0 .4rem;
  border: 1px solid var(--border-light);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--voices-type-meta);
  font-weight: 750;
  cursor: pointer;
}

.voice-card footer button:hover { border-color: #93c5fd; color: #2563eb; }
.voice-card footer button > span { white-space: nowrap; }

/* Narrower than this and "Răspunde video" breaks over two lines, which makes the
   button taller than the one beside it. Next to the camera icon, "Răspunde"
   alone says the same thing. */
@container (max-width: 250px) {
  .voice-action-qualifier { display: none; }
}

.voices-sentinel { height: 2px; }

.voices-empty {
  grid-column: 1 / -1;
  min-height: 290px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: .55rem;
  padding: 2rem;
  border: 1px dashed var(--border-medium);
  border-radius: 8px;
  color: var(--text-muted);
  text-align: center;
}

.voices-empty > i { color: #93c5fd; font-size: var(--voices-type-display); }
.voices-empty strong { color: var(--text-primary); }
.voices-empty span { font-size: var(--voices-type-ui); }
.voices-empty-actions { display: flex; gap: .5rem; margin-top: .35rem; }
.voices-empty button { min-height: 40px; padding: 0 .9rem; border: 0; border-radius: 5px; background: #2563eb; color: #fff; font: inherit; font-size: var(--voices-type-ui); font-weight: 750; cursor: pointer; }
.voices-empty button.is-secondary { border: 1px solid var(--border-light); background: var(--bg-card); color: var(--text-secondary); }
.voices-empty button.is-secondary:hover { border-color: #93c5fd; color: #2563eb; }

/* Recording studio */
.voice-studio {
  position: fixed;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  width: min(1040px, calc(100vw - 2rem));
  max-height: min(800px, calc(100dvh - 2rem));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 28px 80px rgba(15, 23, 42, .3);
}

.voice-studio::backdrop { background: rgba(15, 23, 42, .65); backdrop-filter: blur(4px); }
.voice-studio-shell > header { position: sticky; z-index: 2; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--border-light); background: color-mix(in srgb, var(--bg-card) 96%, transparent); backdrop-filter: blur(12px); }
.voice-studio-shell > header h2 { margin: 0; font-family: "Poppins", sans-serif; font-size: var(--voices-type-heading); }
.voice-studio-shell > header button { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--bg-hover); color: var(--text-secondary); cursor: pointer; }

.voice-studio-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr);
  gap: 1rem;
  padding: 1rem;
}

.voice-camera-pane { min-width: 0; --voice-stage-height: min(62dvh, 600px); }
.voice-camera-stage { position: relative; width: min(100%, calc(var(--voice-stage-height) * 9 / 16)); max-height: var(--voice-stage-height); aspect-ratio: 9 / 16; margin-inline: auto; overflow: hidden; border-radius: 8px; background: #0f172a; }
.voice-camera-stage > video { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; background: #0f172a; }
.voice-camera-placeholder { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: .55rem; color: #cbd5e1; text-align: center; }
.voice-camera-placeholder[hidden] { display: none; }
.voice-camera-placeholder > i { font-size: var(--voices-type-display); color: #60a5fa; }
.voice-camera-placeholder strong { color: #fff; font-size: var(--voices-type-body); }
.voice-camera-placeholder span { max-width: 320px; color: #94a3b8; font-size: var(--voices-type-ui); }
.voice-recording-status { position: absolute; z-index: 3; top: .75rem; left: .75rem; display: flex; align-items: center; gap: .35rem; padding: .35rem .5rem; border-radius: 5px; background: rgba(15, 23, 42, .78); color: #fff; font-size: var(--voices-type-ui); }
.voice-recording-status[hidden] { display: none; }
.voice-recording-status > i { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; animation: voice-rec-pulse 1s ease-in-out infinite; }
.voice-recording-status strong { margin-left: .35rem; }

@keyframes voice-rec-pulse { 50% { opacity: .35; } }

.voice-teleprompter { position: absolute; z-index: 2; right: .5rem; bottom: .5rem; left: .5rem; max-height: 45%; overflow: auto; padding: .6rem .7rem; border-radius: 6px; background: rgba(15, 23, 42, .72); color: #fff; text-align: center; backdrop-filter: blur(5px); }
.voice-teleprompter > span { color: #93c5fd; font-size: var(--voices-type-ui); font-weight: 850; letter-spacing: .06em; }
.voice-teleprompter p { max-width: 560px; margin: .35rem auto; font-size: var(--voices-type-ui); line-height: 1.45; }
.voice-teleprompter small { color: #cbd5e1; font-size: var(--voices-type-ui); }

.voice-camera-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .55rem; margin-top: .65rem; }
.voice-camera-actions button,
.voice-camera-actions label { min-height: 42px; display: flex; align-items: center; justify-content: center; gap: .4rem; padding: 0 .65rem; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: var(--voices-type-ui); font-weight: 750; cursor: pointer; }
.voice-camera-actions button:hover,
.voice-camera-actions label:hover { border-color: #93c5fd; color: #2563eb; }
.voice-camera-actions button:disabled { opacity: .45; cursor: not-allowed; }
.voice-camera-actions [data-action="record"]:not(:disabled) { border-color: #fecaca; color: #dc2626; }

.voice-studio-form { min-width: 0; display: flex; flex-direction: column; gap: .9rem; }
.voice-studio-form > label { position: relative; display: grid; gap: .35rem; color: var(--text-secondary); font-size: var(--voices-type-ui); font-weight: 750; }
.voice-studio-form > label > span,
.voice-studio-form legend { color: var(--text-muted); font-size: var(--voices-type-ui); font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.voice-studio-form select,
.voice-studio-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border-light); border-radius: 6px; background: var(--bg-secondary); color: var(--text-primary); font: inherit; font-size: var(--voices-type-ui); }
.voice-studio-form select { min-height: 44px; padding: 0 .7rem; }
.voice-studio-form textarea { resize: vertical; min-height: 100px; padding: .7rem; line-height: 1.5; }
.voice-studio-form > label > small { justify-self: end; color: var(--text-muted); font-size: var(--voices-type-ui); }
.voice-studio-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.voice-studio-form legend { margin-bottom: .35rem; }
.voice-studio-stances button { min-height: 42px; font-size: var(--voices-type-ui); }
.voice-studio-note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: .55rem; align-items: start; padding: .65rem; border: 1px solid #bfdbfe; border-radius: 6px; background: #eff6ff; color: #1d4ed8; }
.voice-studio-note > i { width: 28px; height: 28px; display: grid; place-items: center; }
.voice-studio-note p { margin: 0; }
.voice-studio-note strong { display: block; font-size: var(--voices-type-ui); }
.voice-studio-note span { display: block; margin-top: .2rem; font-size: var(--voices-type-ui); line-height: 1.45; }
.voice-publish { min-height: 46px; padding: 0 1rem; font-size: var(--voices-type-ui); }
.voice-publish:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.voice-studio-feedback { min-height: 1.2em; margin: -.35rem 0 0; color: var(--text-secondary); font-size: var(--voices-type-ui); line-height: 1.45; }

html.dark .voices-stance-group button.active { background: rgba(37, 99, 235, .18); color: #93c5fd; }
html.dark .voices-compose-icon { background: rgba(37, 99, 235, .18); color: #93c5fd; }
html.dark .voice-studio-stances button:hover { background: var(--bg-hover); }
html.dark .voice-studio-stances button[data-studio-stance="pro"].active { border-color: rgba(16, 185, 129, .5); background: rgba(16, 185, 129, .14); color: #6ee7b7; }
html.dark .voice-studio-stances button[data-studio-stance="contra"].active { border-color: rgba(244, 63, 94, .5); background: rgba(244, 63, 94, .14); color: #fda4af; }
html.dark .voice-studio-stances button[data-studio-stance="question"].active { border-color: rgba(96, 165, 250, .5); background: rgba(37, 99, 235, .16); color: #93c5fd; }
html.dark .voice-useful.active { border-color: rgba(16, 185, 129, .45); background: rgba(16, 185, 129, .12); color: #6ee7b7; }
html.dark .voice-studio-note { border-color: #315a8d; background: #172b46; color: #bfdbfe; }
html.dark .voice-stance.question { color: #cbd5e1; }

@media (max-width: 1180px) {
  .voices-discovery { grid-template-columns: 1fr; gap: .75rem; }
  .voices-filter-row { padding-bottom: .7rem; }
}

@media (max-width: 980px) {
  .voices-grid { grid-template-columns: 1fr; }
  .voice-studio-body { grid-template-columns: 1fr; }
  .voice-camera-pane { --voice-stage-height: min(58dvh, 520px); }
}

@media (max-width: 720px) {
  .voices-page { padding: 0 0 5.5rem; }
  .voices-compose-strip { flex-direction: column; align-items: stretch; padding: .8rem; }
  .voices-record-primary { width: 100%; }
  .voices-stance-group { width: 100%; }
  .voices-feed-tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .voices-feed-tabs::-webkit-scrollbar { display: none; }
  .voices-feed-tabs button { min-width: 96px; flex: 1 0 auto; }
  .voices-filter-row { grid-template-columns: 1fr; }
  .voices-filter-row label { height: 44px; }
  .voices-filter-row select,
  .voices-filter-row input,
  .voice-studio-form select,
  .voice-studio-form textarea { font-size: var(--fs-md); }
  .voices-grid { grid-template-columns: 1fr; gap: .75rem; }
  .voice-studio { inset: auto 0 0; width: 100%; max-width: none; max-height: calc(100dvh - var(--header-height)); margin: 0; transform: none; border-width: 1px 0 0; border-radius: 16px 16px 0 0; }
  .voice-studio-body { padding: .75rem; }
  .voice-camera-pane { --voice-stage-height: min(46dvh, 420px); }
  /* The script panel covers the lower part of the stage, so keep the camera-off hint above it. */
  .voice-camera-placeholder { align-content: start; padding: 18% .75rem 0; }
  .voice-camera-actions { grid-template-columns: 1fr; }
  .voice-camera-actions button,
  .voice-camera-actions label { min-height: 46px; }
}

@media (max-width: 560px) {
  .voice-card { grid-template-columns: minmax(118px, 36%) minmax(0, 1fr); }
  .voice-card-body { padding: .65rem; }
}

@media (max-width: 420px) {
  .voice-card footer { grid-template-columns: repeat(2, 1fr); }
  .voice-card footer button { min-height: 42px; font-size: var(--voices-type-ui); }
}

/* ========================================
   LEGAL PAGES
======================================== */
/* No table-of-contents rail here, so the main column would otherwise keep the
   280px gap reserved for one. Capped instead at a readable line length. */
.legal-page .measure-page-main {
  max-width: 62rem;
  margin: 0 auto;
}

.legal-page .legal-updated {
  margin: 0 0 1.5rem;
  color: var(--text-muted, #64748b);
}

.legal-page .legal-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-lg, 12px);
  background: rgba(245, 158, 11, 0.08);
  color: var(--text-secondary, #475569);
  line-height: 1.6;
}

.legal-page .legal-notice i {
  margin-top: 0.15rem;
  color: #d97706;
}

/* Deliberately loud. These gaps must be impossible to ship past by accident. */
.legal-page .legal-todo {
  display: inline;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.18);
  box-shadow: inset 0 0 0 1px rgba(217, 119, 6, 0.35);
  color: #b45309;
  font-weight: 600;
}

.legal-page .measure-article h3 {
  margin: 1.5rem 0 0.6rem;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
}

.legal-page .measure-page-main .measure-article section h2 {
  color: var(--text-primary, #1e293b);
  border-bottom: 0;
}

.legal-page .measure-page-main .measure-article section :is(p, li) {
  color: var(--text-secondary, #475569);
}

.legal-page .measure-page-main .measure-article section {
  border-bottom: 0;
}

.legal-page .measure-article a {
  color: var(--secondary, #2563eb);
  text-decoration: underline;
  text-underline-offset: 2px;
}

html.dark .legal-page .measure-article a { color: #93c5fd; }

html.dark .legal-page .legal-notice {
  border-color: rgba(251, 191, 36, 0.32);
  background: rgba(245, 158, 11, 0.12);
}

html.dark .legal-page .legal-notice i { color: #fbbf24; }

html.dark .legal-page .legal-todo {
  background: rgba(245, 158, 11, 0.2);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.4);
  color: #fcd34d;
}

/* ========================================
   HOMEPAGE — CONSISTENT VERTICAL RHYTHM
======================================== */
.home-page > section { margin-top: 0; margin-bottom: 0; }
.home-page > section + section { margin-top: 2rem; }
.home-page > .participation-section { padding-top: 0; }

/* The theme switch's sun: Font Awesome's far fa-sun reads as a settings cog,
   so the glyph is redrawn as a plain sun (circle and eight rays). */
:is(#dark-mode-toggle, #sidebar-theme-toggle) .fa-sun::before {
  content: "";
  display: block;
  width: 1.15em;
  height: 1.15em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* The mark alone is the phone header's logo (nova-mobile.css). */
.otv-brand-icon { display: none; }

/* ---------- Desktop without a top bar ---------- */
/* The menu and the right-hand column run to the top of the window, as on X:
   the logo heads the menu, the theme switch sits at its foot, and chat is
   already one of its links. Phones keep their top bar (nova-mobile.css). */
.sidebar-brand { display: none; }

@media (min-width: 769px) {
  :root { --header-height: 0px; }
  .top-header { display: none; }

  .sidebar-brand {
    display: flex;
    align-items: center;
    padding: 1.1rem 1.25rem 0.6rem;
  }
  .sidebar-brand img { display: block; width: auto; height: 34px; }

}

/* Televot placeholders shown while the home polls load. */
.televot-skeleton { pointer-events: none; }
.televot-skeleton:hover { box-shadow: none; transform: none; }
.televot-skeleton-tag { width: 5.75rem; border: 1px solid transparent; }
.televot-skeleton-question .community-skeleton-block {
  height: 1lh;
  border-block: 3px solid transparent;
  background-clip: padding-box;
}
.televot-skeleton-question .is-short { width: 65%; }
.televot-skeleton-btn { border: 1px solid transparent; border-radius: var(--radius-md); }
.televot-skeleton-bar { border-radius: 3px; }
.televot-skeleton-count { width: 2.75rem; height: var(--fs-xs); margin-inline-start: auto; }

/* Home news: the source tag and, on the right, how long ago it was published. */
.news-meta-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.75rem; }
.news-meta-row .news-category { margin-bottom: 0; }
.news-meta-row .news-time { flex-shrink: 0; color: var(--text-muted); font-size: var(--fs-xs); white-space: nowrap; }
.news-item .news-meta-row { margin-bottom: 0.5rem; }

/* News reader window (router.js openNewsReader), built on .nova-ui-dialog. */
.news-reader { width: min(640px, calc(100vw - 1.5rem)); overflow: hidden; }
.news-reader-content { max-height: inherit; overflow-y: auto; overscroll-behavior: contain; }
/* No outline around the reader: the photo and the card meet the backdrop directly. */
.nova-ui-dialog.news-reader {
  border: 0;
  overflow: hidden;
  top: calc((100dvh + var(--header-height, 0px) - var(--mobile-bottom-space, 0px)) / 2);
  max-height: min(760px, calc(100dvh - var(--header-height, 0px) - var(--mobile-bottom-space, 0px) - 32px));
  overscroll-behavior: contain;
}
.news-reader-close { position: absolute; top: 12px; right: 12px; z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: rgba(15, 23, 42, 0.6); color: #fff; font-size: var(--fs-md); cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.news-reader-close:hover { background: rgba(15, 23, 42, 0.8); }
.news-reader-image { display: block; width: 100%; aspect-ratio: 16 / 9; max-height: 30dvh; object-fit: cover; background: var(--bg-hover); }
.news-reader-body { padding: 1.25rem 1.5rem 1.5rem; }
.news-reader-body h2 { margin: 0 0 0.75rem; color: var(--text-primary); font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.news-reader-body p { margin: 0 0 1.25rem; color: var(--text-secondary); font-size: var(--fs-md); line-height: 1.6; }
.news-reader-cta { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.7rem 1.2rem; border-radius: 999px; background: var(--secondary); color: #fff; font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }
.news-reader-cta:hover { filter: brightness(1.08); }
.news-reader:not(:has(.news-reader-image)) .news-reader-body { padding-top: 3.25rem; }

/* The page keeps its scrollbar's room while a window locks scrolling, so
   nothing behind the window shifts sideways when the bar disappears. */
html { scrollbar-gutter: stable; }

/* The reader fades and grows in, and back out on close. The dialog is centred
   with transform, so the animation uses scale and leaves transform alone. */
.news-reader[open] { animation: newsReaderIn 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.news-reader[open]::backdrop { animation: newsReaderFade 0.2s ease-out; }
.news-reader.is-closing { animation: newsReaderOut 0.16s ease-in forwards; }
.news-reader.is-closing::backdrop { animation: newsReaderFade 0.16s ease-in reverse forwards; }
@keyframes newsReaderIn { from { opacity: 0; scale: 0.95; } }
@keyframes newsReaderOut { to { opacity: 0; scale: 0.96; } }
@keyframes newsReaderFade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .news-reader[open], .news-reader[open]::backdrop, .news-reader.is-closing, .news-reader.is-closing::backdrop { animation: none; }
}

/* Guests get a settings link only after the sign-in button is rendered. */
.sidebar-footer .sidebar-settings-btn {
  display: none;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 40px;
  margin-bottom: 0.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: var(--fs-sm);
  font-weight: 500;
  text-decoration: none;
  grid-column: 1 / -1;
}
.sidebar-footer:has(#nova-signin-btn) .sidebar-settings-btn { display: flex; }
.sidebar-footer .sidebar-settings-btn:hover { background: var(--bg-hover); }
.sidebar-footer .sidebar-settings-btn.active { border-color: color-mix(in srgb, var(--secondary) 45%, var(--border-light)); color: var(--secondary); }
.sidebar-footer .sidebar-settings-btn i { width: 18px; text-align: center; font-size: var(--fs-md); }


/* ---------- Sign-in / sign-up window, laid out like otv.today's login ---------- */
.nova-auth-modal { flex-direction: column; gap: 14px; }
.nova-auth-modal .auth-container { max-width: 460px; max-height: calc(100dvh - 4.5rem); padding: 2.25rem 2rem 1.75rem; border-radius: 22px; }
html.dark .nova-auth-modal .auth-input-wrapper input {
  background: rgba(255, 246, 222, .08);
  border-color: rgba(240, 223, 188, .25);
}
html.dark .nova-auth-modal .auth-input-wrapper input:focus {
  background: rgba(255, 246, 222, .12);
  border-color: #e9c779;
  box-shadow: 0 0 0 3px rgba(233, 199, 121, .14);
}
html.dark .nova-auth-modal .auth-close {
  background: rgba(255, 246, 222, .1);
  color: #e7dfcf;
}
html.dark .nova-auth-modal .auth-close:hover { background: rgba(255, 246, 222, .18); }
.nova-auth-modal .auth-form { gap: 1.1rem; }
.nova-auth-modal [data-auth-pane="signup"] [data-auth-submit] { margin-top: 0.5rem; }

#nova-auth-overlay .auth-container { padding-top: 1rem; }
.nova-auth-modal .auth-brand { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 1rem; }
.nova-auth-modal .auth-brand-mark { grid-column: 2; }
.nova-auth-modal .auth-brand img { display: block; width: 75px; height: 30px; object-fit: contain; }
:root:not(.dark) .nova-auth-modal .auth-brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 102px;
  height: 44px;
}
.nova-auth-modal .auth-brand .auth-close { position: static; justify-self: end; }
.nova-auth-modal .auth-title { margin: 0; color: var(--text-primary); font-size: var(--fs-xl); font-weight: 700; line-height: 1.15; }
.nova-auth-modal .auth-subtitle { margin: 0.2rem 0 0; color: var(--text-secondary); font-size: var(--fs-md); }

.nova-auth-modal .auth-field { gap: 0.5rem; }
.nova-auth-modal .auth-label { font-size: var(--fs-sm); font-weight: 600; }
.nova-auth-modal .auth-input-wrapper input { min-height: 50px; padding: 0.8rem 1.1rem; border-radius: 14px; font-size: var(--fs-md); }
.nova-auth-modal .auth-input-wrapper:has(> i) input { padding-inline-start: 2.7rem; }
.nova-auth-modal .auth-input-wrapper.has-reveal input { padding-right: 3.25rem; }
.nova-auth-modal .auth-reveal { right: 0.6rem; color: var(--secondary); }

.nova-auth-modal .auth-forgot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: var(--text-secondary); font-size: var(--fs-sm); }
.nova-auth-modal .auth-forgot .auth-link { font-weight: 600; text-decoration: none; }

.nova-auth-modal .auth-btn,
.nova-auth-modal .auth-google { display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem; width: 100%; min-height: 50px; border-radius: 14px; font-size: var(--fs-md); font-weight: 600; }
.nova-auth-modal .auth-btn.secondary { border: 0; background: color-mix(in srgb, var(--secondary) 14%, transparent); color: var(--secondary); }
.nova-auth-modal .auth-btn.secondary:hover { background: color-mix(in srgb, var(--secondary) 22%, transparent); }
.nova-auth-modal .auth-btn.secondary[data-auth-goto] { background: #e6ce9a; color: #282116; }
.nova-auth-modal .auth-btn.secondary[data-auth-goto]:hover { background: #f1dcae; }
.nova-auth-modal .auth-btn.secondary[data-auth-goto]:focus-visible { outline: 2px solid #f1dcae; outline-offset: 3px; }
.nova-auth-modal .auth-google-error:empty,
.nova-auth-modal .auth-error:empty { display: none; }

.nova-auth-modal .auth-divider { margin: 0.25rem 0; font-size: var(--fs-xs); letter-spacing: 0.08em; }

.nova-auth-modal .auth-note { font-size: var(--fs-xs); text-align: center; }
.nova-auth-modal .auth-note.is-center { font-size: var(--fs-sm); }
.nova-auth-modal .auth-note.is-center,
.nova-auth-modal .auth-error.is-center { text-align: center; }
.nova-auth-modal .auth-note .auth-link { font-weight: 600; }
/* The resend line sits close under the note above it. */
.nova-auth-modal .auth-note.is-center + .auth-note.is-center { margin-top: -0.8rem; }
.nova-auth-modal .auth-error.is-success { color: #22c55e; }
.nova-auth-modal .auth-check { font-size: var(--fs-md); color: var(--text-primary); }
.nova-auth-modal .auth-check input { width: 20px; height: 20px; flex-basis: 20px; }

html:not(.dark) .nova-auth-modal .auth-input-wrapper input {
  border-color: var(--border-medium);
}
html:not(.dark) .nova-auth-modal .auth-input-wrapper input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}
html:not(.dark) .nova-auth-modal :is(.auth-reveal, .auth-link) { color: #1d4ed8; }
html:not(.dark) .nova-auth-modal [data-auth-submit] { background: #1d4ed8; }
html:not(.dark) .nova-auth-modal [data-auth-submit]:hover { background: #1e40af; }
html:not(.dark) .nova-auth-modal .auth-error.is-success { color: #15803d; }

/* "Termeni și Condiții" under the card, on the sign-up view. */
.auth-terms { color: rgba(255, 255, 255, 0.75); font-size: var(--fs-sm); text-decoration: underline; text-underline-offset: 3px; }
.auth-terms:hover { color: #fff; }
.auth-terms[hidden] { display: none; }
.auth-legal-links:not([hidden]) { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.auth-newsletter-note { margin: 0; color: var(--text-secondary); font-size: var(--fs-sm); }

@media (max-width: 520px) {
  .nova-auth-modal .auth-container { padding: 1.75rem 1.25rem 1.5rem; border-radius: 18px; }
}

/* One look for every menu: the post menu's (.otv-dropdown in otv-post.css).
   Same card, 44px rows, an 18px line icon, 16px medium text, no underlines. */
.community-profile-v2 .community-profile-account-popover,
.sidebar-account .account-menu {
  width: 192px;
  padding: 0;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-card);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .3), 0 8px 10px -6px rgba(0, 0, 0, .3);
}
.sidebar-account .account-menu { width: auto; }
.community-profile-v2 .community-profile-account-popover > a,
.community-profile-v2 .community-profile-account-popover > button,
.sidebar-account .account-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1.2;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.community-profile-v2 .community-profile-account-popover svg,
.sidebar-account .account-menu-item svg { flex: none; width: 18px; height: 18px; color: currentColor; }
.community-profile-v2 .community-profile-account-popover > a:hover,
.community-profile-v2 .community-profile-account-popover > button:hover,
.sidebar-account .account-menu-item:hover { background: var(--otv-row-hover, var(--bg-hover)); color: var(--text-primary); }

/* Dark theme contrast (WCAG AA, 4.5:1 for text). The site blue #3b82f6 reads
   at only 3-4:1 as text on the dark cards, so blue text uses #60a5fa there;
   filled blue buttons keep their own colours. */
html.dark .nav-item.active,
html.dark .mobile-tab.active,
html.dark .mobile-tab[aria-expanded="true"],
html.dark .sidebar-footer .sidebar-settings-btn.active,
html.dark .nova-square-card-heading a,
html.dark .auth-link {
  color: #60a5fa;
}

html.dark .nq-attach-btn span {
  color: #cbd5e1;
}

/* Keyboard focus on the leaderboard rows (they had no visible ring). */
.leader-item:focus-visible {
  outline: 2px solid #60a5fa;
  outline-offset: 2px;
}

/* Shared popup material. Scope the palette to cards so the page, menus and
   media previews keep their own surfaces. Specificity survives component CSS. */
:root body :is(.nova-auth-modal .auth-container, .nq-drawer, .modal-content,
  .community-points-dialog > section, .nova-ui-dialog, .ncoin-card,
  .np-sheet, .np-review, .np-cam-error-card, .otv-compose-dialog,
  .otv-report-card, .otv-settings-dialog, .na-modal-card) {
  --text-muted: #64748b;
  background: var(--champagne-glass);
  border: 1px solid var(--champagne-border);
  box-shadow: var(--champagne-shadow);
  -webkit-backdrop-filter: var(--champagne-filter);
  backdrop-filter: var(--champagne-filter);
  color: var(--text-primary);
}
html.dark body :is(.nova-auth-modal .auth-container, .nq-drawer, .modal-content,
  .community-points-dialog > section, .nova-ui-dialog, .ncoin-card,
  .np-sheet, .np-review, .np-cam-error-card, .otv-compose-dialog,
  .otv-report-card, .otv-settings-dialog, .na-modal-card) {
  --text-primary: #faf7ef;
  --text-secondary: #d2cfc6;
  --text-muted: #b7b8bb;
  --border-light: rgba(240, 223, 188, .2);
  --bg-card: #30343a;
  --bg-hover: rgba(255, 246, 222, .08);
  --otv-line: rgba(240, 223, 188, .2);
  --otv-input-bg: rgba(255, 246, 222, .08);
  --otv-input-border: rgba(240, 223, 188, .25);
  --otv-row-hover: rgba(255, 246, 222, .12);
  --otv-gold-text: #e9c779;
}
:root body .otv-settings-dialog.is-danger { border-color: rgba(239, 68, 68, .5); }
:root body .na-modal-card .na-modal-body { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
:root body .otv-report { background: var(--window-scrim); -webkit-backdrop-filter: var(--window-scrim-filter); backdrop-filter: var(--window-scrim-filter); }
