/* =====================================================
   CongressoAberto.BR — Premium Glassmorphic Design System
   Rich HSL tailored variables, cyber glowing details, transitions.
   ===================================================== */
:root {
  /* HSL Tailored Palette */
  --bg-h: 224;
  --bg-s: 47%;
  --bg-l: 4%;  /* #030712 - deep rich near-black space canvas */
  --bg: hsl(var(--bg-h), var(--bg-s), var(--bg-l));
  
  --bg-grad-1: hsl(223, 38%, 7%);
  --bg-grad-2: hsl(224, 47%, 3%);
  
  --surface-h: 223;
  --surface-s: 30%;
  --surface-l: 9%; /* Dark glass structure */
  --surface: hsl(var(--surface-h), var(--surface-s), var(--surface-l));
  --surface-opacity: 0.65;
  --surface-glass: hsla(var(--surface-h), var(--surface-s), var(--surface-l), var(--surface-opacity));
  
  --surface-2: hsl(223, 24%, 13%);
  --surface-3: hsl(223, 20%, 18%);
  
  --border-h: 223;
  --border-s: 15%;
  --border-opacity: 0.08;
  --border: hsla(var(--border-h), var(--border-s), 80%, var(--border-opacity));
  --border-strong: hsla(var(--border-h), var(--border-s), 80%, 0.16);
  --border-glow: hsla(160, 100%, 42%, 0.15);
  
  /* High contrast text */
  --text: hsl(220, 40%, 96%);
  --text-soft: hsl(220, 20%, 78%);
  --muted: hsl(220, 14%, 58%);
  
  /* Cyber glowing accents */
  --accent: hsl(160, 100%, 42%);      /* Emerald Green (#00d68f) */
  --accent-glow: hsla(160, 100%, 42%, 0.25);
  --accent-2: hsl(195, 100%, 64%);    /* Cyber Teal (#4ad7ff) */
  --accent-2-glow: hsla(195, 100%, 64%, 0.2);
  --accent-3: hsl(48, 100%, 52%);     /* Amber Gold (#ffd60a) */
  --accent-4: hsl(270, 100%, 70%);    /* Neon Purple (#b46aff) */
  
  --danger: hsl(350, 100%, 66%);      /* Crimson (#ff5470) */
  --danger-glow: hsla(350, 100%, 66%, 0.15);
  --warning: hsl(35, 100%, 62%);      /* Orange (#ffa940) */
  
  /* Spacing and Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  
  /* Premium Shadows & Blurs */
  --shadow-lg: 0 20px 40px -15px rgba(0, 0, 0, 0.7);
  --shadow-glow: 0 0 0 1px hsla(160, 100%, 42%, 0.2), 0 8px 30px -8px hsla(160, 100%, 42%, 0.3);
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: 
    radial-gradient(1200px 600px at 15% -15%, hsla(160, 100%, 42%, 0.12), transparent 50%),
    radial-gradient(1000px 500px at 90% 30%, hsla(195, 100%, 64%, 0.08), transparent 50%),
    linear-gradient(180deg, var(--bg-grad-1), var(--bg-grad-2));
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

h1, h2, h3, h4, .logo span, .section-title h2 {
  font-family: 'Space Grotesk', 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: -0.03em;
}

/* Custom premium scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 99px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--surface-3);
}

::selection {
  background: hsla(160, 100%, 42%, 0.3);
  color: #fff;
}

a {
  color: var(--accent-2);
  text-decoration: none;
  transition: color 0.15s ease;
}
a:hover {
  color: #fff;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  outline: none;
}

input, select, textarea {
  font-family: inherit;
}

code {
  font-family: 'JetBrains Mono', monospace;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  color: var(--accent-2);
}

/* ======== Header ======== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsla(224, 47%, 4%, 0.75);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 28px;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
}
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 20px;
  transition: opacity 0.15s ease;
}
.logo:hover {
  opacity: 0.9;
}
.logo-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: conic-gradient(from 220deg at 50% 50%, var(--accent), var(--accent-2) 35%, var(--accent-3) 70%, var(--accent));
  display: grid;
  place-items: center;
  color: #030712;
  font-weight: 900;
  box-shadow: 0 6px 20px -8px hsla(160, 100%, 42%, 0.7);
}
.nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nav button {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-soft);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav button:hover {
  background: var(--surface-2);
  color: #fff;
  transform: translateY(-1px);
}
.nav button.active {
  background: linear-gradient(180deg, hsla(160, 100%, 42%, 0.16), hsla(160, 100%, 42%, 0.05));
  color: #fff;
  box-shadow: inset 0 0 0 1px hsla(160, 100%, 42%, 0.4);
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
}
.live-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; box-shadow: 0 0 12px var(--accent); }
  50% { transform: scale(0.9); opacity: 0.55; box-shadow: 0 0 4px var(--accent); }
}

/* ======== Layout ======== */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 28px 100px;
}
.hero {
  padding: 60px 0 40px;
  text-align: center;
}
.hero h1 {
  font-size: clamp(38px, 6vw, 64px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.15;
  background: linear-gradient(180deg, #ffffff 30%, var(--text-soft) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero h1 .accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin-top: 18px;
  color: var(--text-soft);
  font-size: 19px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
  line-height: 1.6;
}

/* Suggestion Chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 30px;
}
.chip {
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: hsla(220, 15%, 100%, 0.02);
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.chip:hover {
  border-color: var(--accent);
  color: #fff;
  background: hsla(160, 100%, 42%, 0.1);
  transform: translateY(-1px);
}
.chip.active {
  background: hsla(160, 100%, 42%, 0.16);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px hsla(160, 100%, 42%, 0.15);
}

/* Spotlight Search */
.searchbar {
  margin: 40px auto 0;
  max-width: 820px;
  display: flex;
  gap: 12px;
  align-items: center;
  background: hsla(223, 30%, 10%, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 10px;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.searchbar:focus-within {
  border-color: hsla(160, 100%, 42%, 0.55);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
.searchbar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  padding: 14px 18px;
  font-size: 17px;
}
.searchbar input::placeholder {
  color: var(--muted);
}
.searchbar select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.searchbar select:focus {
  border-color: var(--accent);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent), hsl(160, 100%, 35%));
  color: #030712;
  font-weight: 700;
  padding: 14px 26px;
  border-radius: var(--radius-md);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px -10px hsla(160, 100%, 42%, 0.7);
}
.btn-primary:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
  box-shadow: 0 12px 28px -8px hsla(160, 100%, 42%, 0.85);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text-soft);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.btn-secondary:hover {
  color: #fff;
  border-color: var(--border-strong);
  background: var(--surface-3);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: translateY(0);
}

/* Sections (Tabs Layout) */
.view {
  display: none;
  animation: viewFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.view.active {
  display: block;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin: 48px 0 20px;
  flex-wrap: wrap;
}
.section-title h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #fff, var(--text-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.section-title .hint {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* Glassmorphic Cards Grid */
.grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  background: linear-gradient(180deg, hsla(220, 15%, 100%, 0.04), hsla(220, 15%, 100%, 0));
  background-color: var(--surface-glass);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, hsla(220, 15%, 100%, 0.1), transparent);
  pointer-events: none;
}
.card:hover {
  border-color: var(--border-strong);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}
.card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 12px 0 8px;
  letter-spacing: -0.01em;
  color: #fff;
}
.card .ementa {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

/* Badges styling */
.card .badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: hsla(195, 100%, 64%, 0.1);
  color: var(--accent-2);
  border: 1px solid hsla(195, 100%, 64%, 0.2);
}
.card .badge.aprov {
  background: hsla(160, 100%, 42%, 0.12);
  color: var(--accent);
  border-color: hsla(160, 100%, 42%, 0.25);
}
.card .badge.rej {
  background: hsla(350, 100%, 66%, 0.12);
  color: var(--danger);
  border-color: hsla(350, 100%, 66%, 0.25);
}
.card .badge.warn {
  background: hsla(48, 100%, 52%, 0.1);
  color: var(--accent-3);
  border-color: hsla(48, 100%, 52%, 0.22);
}

/* Parlamentarian catalog card */
.parl-card {
  display: flex;
  gap: 16px;
  align-items: center;
}
.parl-photo {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.card:hover .parl-photo {
  transform: scale(1.04);
}
.parl-info h3 {
  margin: 0 0 6px;
}
.parl-info .party {
  font-size: 13px;
  color: var(--text-soft);
  font-weight: 500;
}
.party-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

/* Custom visual list transitions for View Transitions */
.view, .card, .dossie-hero, .kpis, .subtabs {
  view-transition-name: var(--vt-name);
}

/* Tables visual redesign */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 14px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--surface-2);
  font-weight: 700;
  color: var(--text-soft);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
tr:last-child td {
  border-bottom: none;
}
tr:hover td {
  background: hsla(220, 15%, 100%, 0.02);
}
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

/* Glowing vote badges */
.vote-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid transparent;
}
.vote-sim {
  background: hsla(160, 100%, 42%, 0.12);
  color: var(--accent);
  border-color: hsla(160, 100%, 42%, 0.25);
  box-shadow: 0 0 12px hsla(160, 100%, 42%, 0.1);
}
.vote-nao {
  background: hsla(350, 100%, 66%, 0.12);
  color: var(--danger);
  border-color: hsla(350, 100%, 66%, 0.25);
  box-shadow: 0 0 12px hsla(350, 100%, 66%, 0.1);
}
.vote-abstencao {
  background: hsla(48, 100%, 52%, 0.08);
  color: var(--accent-3);
  border-color: hsla(48, 100%, 52%, 0.2);
}
.vote-obstrucao {
  background: hsla(35, 100%, 62%, 0.08);
  color: var(--warning);
  border-color: hsla(35, 100%, 62%, 0.2);
}
.vote-other {
  background: var(--surface-3);
  color: var(--text-soft);
  border-color: var(--border);
}

/* Premium Collapsible Proposal Details */
.vote-details {
  margin-top: 10px;
}
.vote-details summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  user-select: none;
  transition: opacity 0.2s ease, color 0.2s ease;
  outline: none;
}
.vote-details summary:hover {
  color: #fff;
  opacity: 0.9;
}
.vote-details summary::-webkit-details-marker {
  display: none; /* Hide default browser arrow */
}
.vote-details[open] summary {
  margin-bottom: 8px;
}
.vote-details-body {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-soft);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}
.vote-details-body strong {
  color: #fff;
  font-weight: 600;
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
}

.loader {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid hsla(220, 15%, 100%, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s cubic-bezier(0.445, 0.05, 0.55, 0.95) infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
  font-weight: 500;
}
.empty {
  padding: 80px 24px;
  text-align: center;
  color: var(--muted);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-glass);
  font-weight: 500;
}

/* Dashboard KPIs widgets */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 30px;
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .kpis { grid-template-columns: 1fr; }
}

.kpi {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  pointer-events: none;
}
.kpi:nth-child(2)::before { background: linear-gradient(90deg, var(--accent-4), var(--accent-2)); }
.kpi:nth-child(3)::before { background: linear-gradient(90deg, var(--accent-3), var(--warning)); }
.kpi:nth-child(4)::before { background: linear-gradient(90deg, var(--accent), var(--accent-3)); }

.kpi:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.kpi .label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.kpi .value {
  font-size: 28px;
  font-weight: 900;
  margin-top: 8px;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #fff, var(--text-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.kpi .delta {
  font-size: 12.5px;
  margin-top: 6px;
  color: var(--accent);
  font-weight: 600;
}
.kpi.warn::before {
  background: linear-gradient(90deg, var(--warning), var(--danger));
}
.kpi.warn .delta {
  color: var(--accent-3);
}

/* Filters Bar Refactoring */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.filters > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filters label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.filters select, .filters input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  min-width: 150px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.filters select:focus, .filters input:focus {
  border-color: var(--accent);
  background: var(--surface-3);
}

/* Compare Tool Column Layout */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.compare-add {
  border: 2px dashed var(--border-strong);
  background: transparent;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  min-height: 140px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-weight: 600;
}
.compare-add:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: hsla(160, 100%, 42%, 0.05);
  transform: translateY(-2px);
}

/* Footer note */
.footer-note {
  margin-top: 80px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  font-weight: 500;
}
.footer-note a {
  color: var(--text-soft);
  font-weight: 600;
}

/* High contrast charts panel */
.chart-wrap {
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  min-height: 300px;
  transition: border-color 0.15s ease;
}
.chart-wrap:hover {
  border-color: var(--border-strong);
}
.chart-wrap h4 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}

/* Staggered load animation */
.stagger > * {
  animation: riseUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.05s; }
.stagger > *:nth-child(3) { animation-delay: 0.08s; }
.stagger > *:nth-child(4) { animation-delay: 0.11s; }
.stagger > *:nth-child(5) { animation-delay: 0.14s; }
.stagger > *:nth-child(6) { animation-delay: 0.17s; }
.stagger > *:nth-child(7) { animation-delay: 0.20s; }
.stagger > *:nth-child(8) { animation-delay: 0.23s; }

@keyframes riseUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stagger > *, .view, .card, .btn-primary, .btn-secondary, .nav button {
    animation: none !important;
    transform: none !important;
    transition: none !important;
  }
}

/* Detail header (spotlight banner) */
.detail-head {
  background: linear-gradient(135deg, hsla(160, 100%, 42%, 0.1), hsla(195, 100%, 64%, 0.05) 50%, transparent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 30px;
  margin-bottom: 24px;
  position: relative;
}
.detail-head h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.detail-head .ementa-full {
  color: var(--text-soft);
  margin-top: 12px;
  font-size: 15.5px;
  line-height: 1.7;
}
.back-link {
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 14px;
  transition: color 0.15s ease;
}
.back-link:hover {
  color: var(--accent);
}

/* Scroll-State visual fade indicator (replaces scrollbars for visual indicators) */
.vote-list {
  max-height: 580px;
  overflow-y: auto;
  padding-right: 6px;
  container-type: scroll-state;
  position: relative;
}

/* Toast alert visual popup */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: hsla(223, 30%, 12%, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 16px 22px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  display: none;
  z-index: 100;
  max-width: 360px;
  animation: toastRise 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes toastRise {
  from { opacity: 0; transform: translateY(18px) scale(0.95); }
  to { opacity: 1; transform: none; }
}

/* ======== Dossiê (Editorial Profile Overlay) ======== */
.dossie-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  padding: 36px;
  border-radius: var(--radius-lg);
  background: 
    radial-gradient(circle at 10% 10%, hsla(160, 100%, 42%, 0.15), transparent 60%),
    radial-gradient(circle at 90% 90%, hsla(270, 100%, 70%, 0.1), transparent 60%),
    linear-gradient(135deg, hsla(220, 15%, 100%, 0.05), transparent);
  border: 1px solid var(--border-strong);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
.dossie-hero img {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  border: 2px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.dossie-hero h1 {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}
.dossie-hero .lead {
  color: var(--text-soft);
  font-size: 15px;
  margin-top: 8px;
  font-weight: 500;
}
.dossie-hero .badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.dossie-hero .actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@media (max-width: 780px) {
  .dossie-hero { grid-template-columns: 1fr; padding: 28px; }
  .dossie-hero img { width: 100px; height: 100px; }
  .dossie-hero .actions { flex-direction: row; }
}

/* Subtabs capsules selector */
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  background: var(--surface-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 24px;
}
.subtabs button {
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-soft);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.subtabs button:hover {
  background: var(--surface-2);
  color: #fff;
}
.subtabs button.active {
  background: linear-gradient(180deg, hsla(160, 100%, 42%, 0.22), hsla(160, 100%, 42%, 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px hsla(160, 100%, 42%, 0.4);
}

.cat-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-3);
  color: var(--text-soft);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid var(--border);
}

/* Rankings beautiful row details */
.rank-row {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
  transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.rank-row:hover {
  background: hsla(220, 15%, 100%, 0.02);
}
.rank-row .pos {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 800;
  color: var(--muted);
  width: 44px;
  text-align: center;
}
.rank-row .pos.top1 {
  color: var(--accent-3);
  text-shadow: 0 0 12px hsla(48, 100%, 52%, 0.4);
}
.rank-row .pos.top2 {
  color: #d1d5db;
}
.rank-row .pos.top3 {
  color: #b45309;
}
.rank-row .pos.alert {
  color: var(--danger);
  text-shadow: 0 0 12px hsla(350, 100%, 66%, 0.4);
}
.rank-row img {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.rank-row .info {
  flex: 1;
}
.rank-row .info .nm {
  font-weight: 700;
  font-size: 15.5px;
  color: #fff;
}
.rank-row .info .sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
}
.rank-row .val {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 16.5px;
  color: #fff;
}
.rank-row .val small {
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  margin-left: 6px;
}

/* Status capsule badges */
.status-pill {
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  background: hsla(160, 100%, 42%, 0.14);
  color: var(--accent);
  border: 1px solid hsla(160, 100%, 42%, 0.25);
}
.status-pill.gray {
  background: var(--surface-3);
  color: var(--text-soft);
  border: 1px solid var(--border);
}
.status-pill.warn {
  background: hsla(35, 100%, 62%, 0.12);
  color: var(--warning);
  border: 1px solid hsla(35, 100%, 62%, 0.25);
}

/* Curated theme list cover banner */
.theme-cover {
  border-radius: var(--radius-lg);
  padding: 48px;
  background: 
    radial-gradient(800px 400px at 15% 20%, hsla(160, 100%, 42%, 0.15), transparent 70%),
    radial-gradient(600px 300px at 85% 80%, hsla(270, 100%, 70%, 0.12), transparent 70%),
    linear-gradient(180deg, hsl(223, 30%, 14%), var(--bg));
  border: 1px solid var(--border-strong);
  margin-bottom: 24px;
}
.theme-cover .kicker {
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
}
.theme-cover h2 {
  font-size: 40px;
  font-weight: 900;
  margin: 8px 0;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(180deg, #fff, var(--text-soft));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.theme-cover p {
  color: var(--text-soft);
  font-size: 16.5px;
  max-width: 800px;
  margin-top: 10px;
  line-height: 1.65;
}

/* Token block layout for safety */
.token-banner {
  background: linear-gradient(135deg, hsla(48, 100%, 52%, 0.08), hsla(35, 100%, 62%, 0.04));
  border: 1px solid hsla(48, 100%, 52%, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 18px;
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.token-banner .ic {
  font-size: 28px;
}
.token-banner .msg {
  flex: 1;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
}
.token-banner .msg b {
  color: #fff;
}
.token-banner input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: 'JetBrains Mono', monospace;
  min-width: 300px;
  outline: none;
  transition: border-color 0.15s ease;
}
.token-banner input:focus {
  border-color: var(--accent-3);
}

/* Compact list modules */
.list-tight {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.list-tight .item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.list-tight .item:hover {
  border-color: var(--border-strong);
  transform: translateX(2px);
}
.list-tight .item .l {
  color: #fff;
  font-weight: 500;
}
.list-tight .item .r {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

/* Micro bar chart modules */
.bar-h {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar-h .label {
  min-width: 130px;
  font-size: 13.5px;
  color: var(--text-soft);
  font-weight: 500;
}
.bar-h .track {
  flex: 1;
  height: 10px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
}
.bar-h .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.bar-h .v {
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  min-width: 80px;
  text-align: right;
}

/* =====================================================
   CongressoAberto.BR — Premium Bento & Aurora Layout Overhauls
   ===================================================== */
.aurora-mesh {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.aurora-blob {
  position: absolute;
  width: clamp(350px, 45vw, 680px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.14;
  mix-blend-mode: screen;
  pointer-events: none;
}
.aurora-blob-1 {
  background: var(--accent);
  top: -15%; left: -10%;
  animation: float-aurora-1 25s infinite alternate ease-in-out;
}
.aurora-blob-2 {
  background: var(--accent-2);
  bottom: -10%; right: -10%;
  animation: float-aurora-2 30s infinite alternate ease-in-out;
}
.aurora-blob-3 {
  background: var(--accent-4);
  top: 35%; left: 55%;
  animation: float-aurora-3 20s infinite alternate ease-in-out;
}
@keyframes float-aurora-1 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(140px, 90px) scale(1.2); }
}
@keyframes float-aurora-2 {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(-120px, -140px) scale(0.85); }
}
@keyframes float-aurora-3 {
  0% { transform: translate(0, 0) scale(0.9); }
  100% { transform: translate(90px, -70px) scale(1.15); }
}

/* Bento Grid System */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 20px;
  margin-top: 30px;
}
.bento-card {
  grid-column: span 12;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, hsla(220, 15%, 100%, 0.05), hsla(220, 15%, 100%, 0.01));
  background-color: var(--surface-glass);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.bento-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, hsla(220, 15%, 100%, 0.08), transparent 45%, hsla(160, 100%, 42%, 0.08) 80%, hsla(160, 100%, 42%, 0.16));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}
.bento-card:hover {
  transform: translateY(-4px) scale(1.002);
  border-color: var(--border-strong);
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 30px -10px hsla(160, 100%, 42%, 0.25);
}
.bento-card:hover::before {
  opacity: 1;
}

.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

@media (max-width: 1024px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 6; }
}
@media (max-width: 768px) {
  .bento-grid { display: flex; flex-direction: column; gap: 16px; }
  .bento-card { grid-column: span 12 !important; }
}

/* Split Ratio progress bar */
.vote-ratio-container {
  margin-top: 14px;
  width: 100%;
}
.vote-ratio-bar {
  display: flex;
  height: 8px;
  background: var(--surface-3);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 6px;
}
.vote-ratio-fill {
  height: 100%;
  transition: width 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.vote-ratio-yes {
  background: linear-gradient(90deg, var(--accent), hsl(160, 100%, 35%));
  box-shadow: 0 0 8px hsla(160, 100%, 42%, 0.4);
}
.vote-ratio-no {
  background: linear-gradient(90deg, var(--danger), hsl(350, 100%, 55%));
  box-shadow: 0 0 8px hsla(350, 100%, 66%, 0.4);
}
.vote-ratio-abstain {
  background: var(--accent-3);
}
.vote-ratio-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-soft);
}
.vote-ratio-labels span.yes { color: var(--accent); }
.vote-ratio-labels span.no { color: var(--danger); }

/* UF Explorer Grid */
.uf-explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-top: 14px;
  width: 100%;
}
.uf-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 4px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-soft);
  position: relative;
}
.uf-pill:hover {
  background: hsla(160, 100%, 42%, 0.08);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px hsla(160, 100%, 42%, 0.15);
}
.uf-pill.active {
  background: hsla(160, 100%, 42%, 0.18);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 16px hsla(160, 100%, 42%, 0.2);
}
.uf-pill .uf-count {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 3px;
}
.uf-pill:hover .uf-count, .uf-pill.active .uf-count {
  color: var(--accent-2);
}

/* Premium Visual Headers & Spotlights */
.badge-glowing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(90deg, hsla(160, 100%, 42%, 0.15), hsla(195, 100%, 64%, 0.15));
  border: 1px solid hsla(160, 100%, 42%, 0.3);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  box-shadow: 0 0 15px -3px hsla(160, 100%, 42%, 0.3);
  margin-bottom: 20px;
  width: fit-content;
}
.hero-container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 40px 0;
  text-align: left;
}
@media (max-width: 900px) {
  .hero-container { grid-template-columns: 1fr; text-align: center; }
  .hero-container .hero-left { display: flex; flex-direction: column; align-items: center; }
  .hero-container .searchbar { margin: 24px auto 0; }
}
.hero-left h1 {
  font-size: clamp(34px, 5.5vw, 54px) !important;
  line-height: 1.1 !important;
  text-align: inherit;
}
.hero-left p {
  margin-left: 0;
  margin-right: 0;
  text-align: inherit;
  font-size: 17px;
}

/* Spotlight search styling overlay */
.searchbar-glow {
  border: 1px solid hsla(160, 100%, 42%, 0.25) !important;
  background: hsla(223, 40%, 8%, 0.8) !important;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.8), inset 0 0 0 1px hsla(160, 100%, 42%, 0.1) !important;
}
.searchbar-glow:focus-within {
  border-color: var(--accent) !important;
  box-shadow: 0 0 35px -5px hsla(160, 100%, 42%, 0.3), inset 0 0 0 1px var(--accent) !important;
}

/* Floating telemetry widget */
.telemetry-floating {
  background: linear-gradient(135deg, hsla(220, 15%, 100%, 0.06), hsla(220, 15%, 100%, 0.01));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  position: relative;
  transform: perspective(1000px) rotateY(-8deg) rotateX(4deg);
  transition: all 0.4s ease;
}
.telemetry-floating:hover {
  transform: perspective(1000px) rotateY(0) rotateX(0);
  border-color: var(--accent-2);
}
.telemetry-floating .item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.telemetry-floating .item:last-child {
  border-bottom: none;
}
.telemetry-floating .item .l {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}
.telemetry-floating .item .l .icon {
  font-size: 20px;
  width: 38px;
  height: 38px;
  background: var(--surface-2);
  border-radius: 10px;
  display: grid;
  place-items: center;
}
.telemetry-floating .item .v {
  font-size: 20px;
  font-weight: 800;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent-2);
}

