/* ===================================================
   DESIGN SYSTEM — Jove.py Portfolio
   Paleta: Azul Profissional (Tech / Enterprise)
   =================================================== */
:root {
  /* Accent — azul confiança + ciano tech */
  --primary:        #1d6ae5;
  --primary-light:  #60a5fa;
  --primary-glow:   rgba(29, 106, 229, 0.22);
  --secondary:      #0ea5e9;
  --secondary-glow: rgba(14, 165, 233, 0.15);

  /* Backgrounds */
  --bg-deep:        #0d1117;
  --bg-card:        rgba(255, 255, 255, 0.035);
  --bg-card-hover:  rgba(255, 255, 255, 0.065);
  --bg-glass:       rgba(13, 17, 23, 0.85);
  --bg-chat:        #0b1120;

  /* Borders */
  --border-subtle:  rgba(255, 255, 255, 0.07);
  --border-accent:  rgba(29, 106, 229, 0.35);

  /* Text */
  --text-primary:   #e6edf3;
  --text-secondary: #8d96a0;
  --text-muted:     #4d5562;

  /* Gradients */
  --gradient-main:  linear-gradient(135deg, #1d4ed8 0%, #0ea5e9 100%);
  --gradient-dark:  linear-gradient(135deg, rgba(29,78,216,0.14) 0%, rgba(14,165,233,0.07) 100%);

  /* Shadows */
  --shadow-card:    0 8px 32px rgba(0, 0, 0, 0.55);
  --shadow-glow:    0 0 28px rgba(29, 106, 229, 0.16);
  --shadow-btn:     0 4px 18px rgba(29, 106, 229, 0.4);

  /* Radii */
  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-pill:    999px;

  --transition:     0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================================================
   BASE
   =================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  background-color: var(--bg-deep) !important;
  font-family: 'Poppins', sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

img, svg {
  max-width: 100%;
}

/* ===================================================
   PARTICLES
   =================================================== */
#particles-js {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none; /* deixa cliques passarem para o conteúdo */
}

#particles-js canvas {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
  pointer-events: none !important; /* detect_on:"window" cuida dos eventos */
}

/* Ripple animado no ponto de clique */
.particles-click-burst {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #60a5fa 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(1);
  animation: burstRipple 0.7s ease-out forwards;
  pointer-events: none;
  z-index: 9999;
}

@keyframes burstRipple {
  0%   { transform: translate(-50%, -50%) scale(1);  opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(22); opacity: 0; }
}

/* ===================================================
   NAVBAR — Glass Dark
   =================================================== */
.navbar-glass {
  background: var(--bg-glass) !important;
  backdrop-filter: blur(18px) saturate(1.3);
  -webkit-backdrop-filter: blur(18px) saturate(1.3);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: 0 1px 16px rgba(0, 0, 0, 0.4);
  position: relative;
  z-index: 200;
}

.navbar-glass .navbar-brand {
  font-weight: 700;
  font-size: 1.2rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.navbar-glass .nav-link {
  color: var(--text-secondary) !important;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem !important;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
}

.navbar-glass .nav-link:hover,
.navbar-glass .nav-link.active {
  color: var(--text-primary) !important;
  background: rgba(255, 255, 255, 0.06);
}

.navbar-glass .dropdown-menu {
  background: #0e141f;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 0.35rem;
}

.navbar-glass .dropdown-item {
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.85rem;
  transition: background var(--transition), color var(--transition);
}

.navbar-glass .dropdown-item:hover {
  background: rgba(29, 106, 229, 0.15) !important;
  color: var(--text-primary) !important;
}

.navbar-glass .dropdown-divider {
  border-color: var(--border-subtle);
  margin: 0.25rem 0.5rem;
}

.navbar-glass .navbar-toggler {
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.55rem;
}

.navbar-glass .navbar-toggler-icon {
  filter: invert(1) opacity(0.55);
}

/* Search inside navbar */
.navbar-search .form-control {
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  max-width: 220px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.navbar-search .form-control::placeholder { color: var(--text-muted); }

.navbar-search .form-control:focus {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-accent);
  box-shadow: 0 0 0 3px var(--primary-glow);
  color: var(--text-primary);
  max-width: 220px;
}

.navbar-search .btn-search {
  background: var(--gradient-main);
  border: none;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0;
  padding: 0.42rem 1rem;
  transition: opacity var(--transition), box-shadow var(--transition);
}

.navbar-search .btn-search:hover {
  opacity: 0.88;
  box-shadow: var(--shadow-btn);
}

/* ===================================================
   HERO — Homepage
   =================================================== */
.hero-section {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 1.25rem 2rem;
}

.hero-inner {
  width: 100%;
  max-width: 640px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gradient-dark);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  color: var(--primary-light);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 0.32rem 0.9rem;
  margin-bottom: 1.4rem;
  animation: fadeSlideDown 0.55s ease both;
}

.hero-name {
  font-size: clamp(2.2rem, 8vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--text-primary);
  animation: fadeSlideDown 0.65s ease both;
  animation-delay: 0.08s;
  word-break: break-word;
}

.hero-name span {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(0.9rem, 3vw, 1.1rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-top: 0.75rem;
  margin-bottom: 2rem;
  line-height: 1.6;
  animation: fadeSlideDown 0.75s ease both;
  animation-delay: 0.15s;
  padding: 0 0.5rem;
}

/* Hero chat form */
.hero-chat-form {
  display: flex;
  width: 100%;
  animation: fadeSlideDown 0.85s ease both;
  animation-delay: 0.22s;
}

.hero-chat-input {
  flex: 1;
  min-width: 0; /* prevent flex overflow */
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid var(--border-subtle) !important;
  border-right: none !important;
  color: var(--text-primary) !important;
  font-size: 0.9rem;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill) !important;
  padding: 0.7rem 1.1rem !important;
  transition: border-color var(--transition), background var(--transition),
              box-shadow var(--transition);
}

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

.hero-chat-input:focus {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: var(--border-accent) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
  outline: none;
}

.hero-chat-btn {
  flex-shrink: 0;
  background: var(--gradient-main) !important;
  border: none !important;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.88rem;
  border-radius: 0 var(--radius-pill) var(--radius-pill) 0 !important;
  padding: 0.7rem 1.3rem !important;
  white-space: nowrap;
  transition: opacity var(--transition), box-shadow var(--transition);
}

.hero-chat-btn:hover {
  opacity: 0.88;
  box-shadow: var(--shadow-btn);
}

.hero-hint {
  margin-top: 0.9rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  animation: fadeSlideDown 0.95s ease both;
  animation-delay: 0.3s;
  padding: 0 0.5rem;
}

/* Tech Stack */
.tech-stack-section {
  margin-top: 2.5rem;
  animation: fadeSlideDown 1.05s ease both;
  animation-delay: 0.4s;
}

.tech-stack-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.tech-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
}

.tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.22rem 0.65rem;
  letter-spacing: 0.02em;
  transition: background var(--transition), border-color var(--transition),
              color var(--transition);
}

.tech-badge:hover {
  background: rgba(29, 106, 229, 0.1);
  border-color: var(--border-accent);
  color: var(--primary-light);
}

.tech-group {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  padding: 0.2rem 0;
}

.tech-group-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  width: 100%;
  text-align: center;
  margin-top: 0.4rem;
  margin-bottom: 0.1rem;
}

/* ===================================================
   CARDS — Glass
   =================================================== */
.card-glass {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-card);
  color: var(--text-primary);
  transition: background var(--transition), box-shadow var(--transition),
              border-color var(--transition), transform var(--transition);
}

.card-glass:hover {
  background: var(--bg-card-hover);
  border-color: rgba(29, 106, 229, 0.22);
  box-shadow: var(--shadow-card), var(--shadow-glow);
  transform: translateY(-3px);
}

.card-glass .card-title  { color: var(--text-primary); font-weight: 600; }
.card-glass .card-text   { color: var(--text-secondary); font-size: 0.88rem; line-height: 1.72; }

.card-glass .section-title {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 700;
  padding-bottom: 0.55rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  letter-spacing: -0.01em;
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn-primary-gradient {
  background: var(--gradient-main);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--radius-pill);
  padding: 0.5rem 1.25rem;
  transition: opacity var(--transition), box-shadow var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-primary-gradient:hover {
  opacity: 0.88;
  box-shadow: var(--shadow-btn);
  color: #fff;
}

.btn-outline-accent {
  background: transparent;
  border: 1px solid var(--border-accent);
  color: var(--primary-light);
  font-weight: 500;
  font-size: 0.82rem;
  border-radius: var(--radius-pill);
  padding: 0.42rem 1.1rem;
  transition: background var(--transition), box-shadow var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-outline-accent:hover {
  background: var(--primary-glow);
  box-shadow: 0 0 12px var(--primary-glow);
  color: var(--primary-light);
}

/* ===================================================
   HOVER UNDERLINE
   =================================================== */
.hover-underline { position: relative; display: inline-block; }

.hover-underline::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 0;
  background: var(--gradient-main);
  visibility: hidden;
  transition: all var(--transition);
}

.hover-underline:hover::after { width: 100%; visibility: visible; }

/* ===================================================
   SERVICE LINKS (sobre.html)
   =================================================== */
.service-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition);
  border: 1px solid transparent;
}

.service-link::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gradient-main);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.service-link:hover {
  background: rgba(29, 106, 229, 0.09);
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.service-link:hover::before { transform: scale(1.5); }

/* ===================================================
   LINKEDIN PROFILE HEADER (sobre.html)
   =================================================== */
.linkedin-profile-header {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.94), rgba(17, 24, 39, 0.88));
}

.linkedin-profile-cover {
  min-height: 132px;
  background:
    radial-gradient(circle at 8% 10%, rgba(255, 255, 255, 0.2) 0, transparent 30%),
    radial-gradient(circle at 75% 20%, rgba(96, 165, 250, 0.18) 0, transparent 38%),
    linear-gradient(135deg, #0a66c2 0%, #1d4ed8 52%, #0f172a 100%);
  overflow: hidden;
}

.linkedin-cover-image {
  width: 100%;
  height: 100%;
  min-height: 132px;
  object-fit: cover;
  object-position: center;
  display: block;
}

.linkedin-profile-content {
  position: relative;
  display: flex;
  gap: 0.9rem;
  padding: 0 1rem 1rem;
}

.linkedin-avatar-wrap {
  margin-top: -44px;
  flex-shrink: 0;
}

.linkedin-avatar-image {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 4px solid rgba(17, 24, 39, 0.95);
  display: block;
  object-fit: cover;
  background: #1e3a8a;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.linkedin-profile-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 86px;
}

.linkedin-profile-name {
  color: var(--text-primary);
  font-size: 1.22rem;
  font-weight: 700;
}

.linkedin-profile-headline,
.linkedin-profile-location {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.linkedin-profile-link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(127, 199, 255, 0.35);
  color: #7fc7ff;
  background: rgba(23, 78, 147, 0.22);
  vertical-align: middle;
  transition: transform var(--transition), background var(--transition), color var(--transition), border-color var(--transition);
}

.linkedin-profile-link-btn:hover {
  color: #a8dcff;
  border-color: rgba(168, 220, 255, 0.6);
  background: rgba(23, 78, 147, 0.4);
  transform: translateY(-1px);
}

@media (max-width: 576px) {
  .linkedin-profile-cover { min-height: 112px; }
  .linkedin-cover-image { min-height: 112px; }
  .linkedin-avatar-wrap { margin-top: -36px; }
  .linkedin-avatar-image {
    width: 74px;
    height: 74px;
  }
  .linkedin-profile-content {
    gap: 0.75rem;
    padding: 0 0.8rem 0.9rem;
  }
  .linkedin-profile-name { font-size: 1.03rem; }
}

/* ===================================================
   CHAT FAB BUTTON
   =================================================== */
.chat-fab {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1001;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--gradient-main);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(29, 106, 229, 0.5);
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: pointer;
  /* safe area for iOS */
  bottom: calc(20px + env(safe-area-inset-bottom));
  right: calc(20px + env(safe-area-inset-right));
}

.chat-fab:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 8px 26px rgba(29, 106, 229, 0.6);
}

.chat-fab svg { width: 24px; height: 24px; }

/* ===================================================
   CHAT MODAL
   =================================================== */
.chat-overlay {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  animation: fadeIn 0.18s ease;
  /* iOS safe area */
  padding-bottom: env(safe-area-inset-bottom);
}

.chat-modal-box {
  background: var(--bg-chat);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  width: 92%;
  max-width: 660px;
  height: 74vh;
  max-height: 620px;
  margin: 6vh auto 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.75),
              0 0 0 1px rgba(29,106,229,0.12);
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

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

.chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-avatar svg { width: 17px; height: 17px; color: #fff; }

.chat-header-info h6 {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.chat-header-info small { font-size: 0.7rem; color: var(--text-muted); }

.chat-online-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 4px;
  box-shadow: 0 0 6px rgba(34,197,94,0.7);
}

.chat-close-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}

.chat-close-btn:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.chat-messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
  overscroll-behavior: contain;
}

.chat-messages-area::-webkit-scrollbar { width: 3px; }
.chat-messages-area::-webkit-scrollbar-track { background: transparent; }
.chat-messages-area::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 2px;
}

/* Bubbles */
.msg {
  max-width: 82%;
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  line-height: 1.65;
  word-wrap: break-word;
  word-break: break-word;
  animation: msgIn 0.18s ease;
}

.msg-label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-bottom: 0.18rem;
  opacity: 0.6;
}

.msg.user {
  background: var(--gradient-main);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.msg.user .msg-label { text-align: right; color: rgba(255,255,255,0.75); }

.msg.assistant {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.msg.assistant .msg-label { color: var(--primary-light); }

/* Typing indicator */
.typing-indicator {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  padding: 0.3rem 0;
}

.typing-dots span {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

/* Suggestion chips */
.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.chat-suggestion-chip {
  background: rgba(29, 106, 229, 0.1);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-pill);
  color: var(--primary-light);
  font-size: 0.72rem;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.chat-suggestion-chip:hover,
.chat-suggestion-chip:active {
  background: rgba(29, 106, 229, 0.2);
  transform: translateY(-1px);
}

/* Input area */
.chat-input-area {
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-shrink: 0;
  background: rgba(0, 0, 0, 0.18);
}

.chat-text-input {
  flex: 1;
  min-width: 0;
  background: rgba(255, 255, 255, 0.055) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: var(--radius-pill) !important;
  color: var(--text-primary) !important;
  font-size: 0.85rem;
  padding: 0.55rem 0.95rem !important;
  transition: border-color var(--transition), box-shadow var(--transition);
}

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

.chat-text-input:focus {
  border-color: var(--border-accent) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
  outline: none;
  background: rgba(255, 255, 255, 0.08) !important;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--gradient-main);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity var(--transition), box-shadow var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.chat-send-btn:hover { opacity: 0.85; box-shadow: 0 0 14px rgba(29,106,229,0.5); }
.chat-send-btn svg { width: 15px; height: 15px; }

/* ===================================================
   SEARCH BAR
   =================================================== */
.search-bar {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-subtle) !important;
  color: var(--text-primary) !important;
  border-radius: var(--radius-pill) !important;
  padding: 0.7rem 1.2rem !important;
  font-size: 0.88rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

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

.search-bar:focus {
  border-color: var(--border-accent) !important;
  box-shadow: 0 0 0 3px var(--primary-glow) !important;
  background: rgba(255,255,255,0.065) !important;
  outline: none;
}

/* ===================================================
   PAGE SECTIONS
   =================================================== */
.page-section {
  position: relative;
  z-index: 1;
  padding: 1.5rem 1rem 3rem;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 0.2rem;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-subtle);
  padding-bottom: env(safe-area-inset-bottom);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(10px);
}

.site-footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

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

/* ===================================================
   ANIMATIONS
   =================================================== */
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-14px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* ===================================================
   RESPONSIVE — TABLET (≤ 768px)
   =================================================== */
@media (max-width: 768px) {
  .hero-section {
    padding: 2rem 1rem 2rem;
    min-height: calc(100vh - 56px);
  }

  .hero-name { font-size: clamp(2rem, 9vw, 3rem); }

  .hero-tagline { font-size: 0.92rem; }

  /* Stack form vertically on tablet */
  .hero-chat-form {
    flex-direction: column;
    gap: 0.5rem;
  }

  .hero-chat-input {
    border-right: 1px solid var(--border-subtle) !important;
    border-radius: var(--radius-pill) !important;
    width: 100%;
  }

  .hero-chat-btn {
    border-radius: var(--radius-pill) !important;
    width: 100%;
    justify-content: center;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }

  /* Chat modal — quase fullscreen no tablet */
  .chat-modal-box {
    width: 96%;
    height: 82vh;
    max-height: none;
    margin: 3vh auto 0;
    border-radius: var(--radius-lg);
  }

  /* Navbar search — full width no collapse */
  .navbar-search .form-control { max-width: 100%; }

  .page-section { padding: 1.25rem 0.75rem 2.5rem; }

  .card-glass { border-radius: var(--radius-md); }

  .tech-badges { gap: 0.35rem; }
}

/* ===================================================
   RESPONSIVE — MOBILE (≤ 480px)
   =================================================== */
@media (max-width: 480px) {
  .hero-section { padding: 1.5rem 0.75rem; }

  .hero-name { font-size: clamp(1.9rem, 10vw, 2.4rem); }

  .hero-badge { font-size: 0.65rem; padding: 0.28rem 0.75rem; }

  .hero-hint { font-size: 0.68rem; }

  /* Chat modal — fullscreen no mobile */
  .chat-modal-box {
    width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .chat-fab {
    width: 48px;
    height: 48px;
    bottom: calc(16px + env(safe-area-inset-bottom));
    right: calc(16px + env(safe-area-inset-right));
  }

  .chat-fab svg { width: 22px; height: 22px; }

  .msg { max-width: 90%; font-size: 0.82rem; }

  .page-section { padding: 1rem 0.65rem 2rem; }

  .page-title { font-size: 1.2rem; }

  .card-glass { border-radius: var(--radius-md); }

  .tech-badge { font-size: 0.65rem; padding: 0.2rem 0.55rem; }

  .social-ctas { gap: 0.5rem; }
  .social-cta-btn { font-size: 0.78rem; padding: 0.45rem 0.9rem; }
}

/* ===================================================
   SOCIAL CTAs — Homepage
   =================================================== */
.social-ctas {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  animation: fadeSlideDown 1.15s ease both;
  animation-delay: 0.5s;
}

.social-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: background var(--transition), border-color var(--transition),
              color var(--transition), transform var(--transition);
}

.social-cta-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.social-cta-linkedin:hover {
  border-color: rgba(10, 102, 194, 0.45);
  color: #60a5fa;
}

/* ===================================================
   FOOTER SOCIAL
   =================================================== */
.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.footer-social a {
  color: var(--text-muted);
  font-size: 1.15rem;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
}

.footer-social a:hover {
  color: var(--primary-light);
  transform: translateY(-2px);
}

/* ===================================================
   CHAT BADGE — FAB notification
   =================================================== */
.chat-fab { position: fixed; } /* garante position para o badge absoluto */

.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: #ef4444;
  border-radius: var(--radius-pill);
  font-size: 0.62rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.65);
  animation: badgePop 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

@keyframes badgePop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* ===================================================
   CHAT — Links e Listas nas mensagens
   =================================================== */
.chat-link {
  color: var(--primary-light);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
  transition: color var(--transition);
}

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

.chat-list {
  margin: 0.4rem 0 0.25rem 0;
  padding-left: 1.1rem;
}

.chat-list li {
  margin-bottom: 0.25rem;
  line-height: 1.55;
}

/* ===================================================
   NEWSLETTER WIDGET (homepage)
   =================================================== */
/* ===================================================
   FOOTER — Newsletter strip
   =================================================== */
.footer-nl {
  border-bottom: 1px solid rgba(29,106,229,0.15);
  padding: 20px 16px;
  background: linear-gradient(135deg, rgba(29,106,229,0.07) 0%, rgba(14,165,233,0.04) 100%);
}

.footer-nl-inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.footer-nl-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  flex-shrink: 0;
}

.footer-nl-form {
  display: flex;
  gap: 8px;
  flex: 1;
  min-width: 0;        /* evita overflow */
  width: 100%;
}

.footer-nl-input {
  flex: 1;
  min-width: 0;        /* permite encolher em mobile */
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(29,106,229,0.45);
  color: #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1rem;     /* 16px — evita zoom automático no iOS */
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.footer-nl-input::placeholder { color: #64748b; }
.footer-nl-input:focus {
  outline: none;
  border-color: #1d6ae5;
  background: rgba(29,106,229,0.1);
}

.footer-nl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #1d6ae5, #0ea5e9);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.footer-nl-btn:hover { opacity: 0.88; }
.footer-nl-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.footer-nl-success {
  font-size: 0.82rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}
.footer-nl-error {
  font-size: 0.82rem;
  color: #f59e0b;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  justify-content: center;
}

.footer-bottom {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Mobile: empilha texto + formulário, cada um ocupa largura total */
@media (max-width: 640px) {
  .footer-nl-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .footer-nl-text {
    justify-content: center;
    font-size: 0.8rem;
  }
  .footer-nl-form {
    flex-direction: row; /* input + botão lado a lado */
  }
  .footer-nl-btn {
    padding: 10px 14px;
    font-size: 0.82rem;
  }
}

/* ===================================================
   ECONOMIA — Dashboard BCB
   =================================================== */

/* Hero strip */
.eco-hero {
  position: relative;
  z-index: 1;
  padding: 64px 0 32px;
  text-align: center;
}

.eco-hero-inner { max-width: 640px; margin: 0 auto; }

.eco-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #34d399;
  background: rgba(52,211,153,0.10);
  border: 1px solid rgba(52,211,153,0.25);
  border-radius: var(--radius-pill);
  padding: 5px 14px;
  margin-bottom: 18px;
}

.eco-hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 14px;
  line-height: 1.2;
}

.eco-highlight {
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.eco-hero-sub {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Section wrapper */
.eco-section { position: relative; z-index: 1; padding: 0 0 40px; }

/* Summary cards */
.eco-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.eco-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: background var(--transition), border-color var(--transition);
}

.eco-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
}

.eco-card-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.eco-card--selic .eco-card-icon { background: rgba(29,106,229,0.15); color: #1d6ae5; }
.eco-card--ipca  .eco-card-icon { background: rgba(167,139,250,0.15); color: #a78bfa; }
.eco-card--usd   .eco-card-icon { background: rgba(52,211,153,0.15);  color: #34d399; }
.eco-card--cdi   .eco-card-icon { background: rgba(14,165,233,0.15);  color: #0ea5e9; }

.eco-card-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.eco-card-value {
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

.eco-card-unit {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.eco-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Charts grid */
.eco-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.eco-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

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

.eco-chart-header h3 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.eco-chart-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.05em;
}

.eco-chart-badge--selic { background: rgba(29,106,229,0.15);  color: #60a5fa; }
.eco-chart-badge--ipca  { background: rgba(167,139,250,0.15); color: #a78bfa; }
.eco-chart-badge--usd   { background: rgba(52,211,153,0.12);  color: #34d399; }
.eco-chart-badge--cdi   { background: rgba(14,165,233,0.12);  color: #0ea5e9; }
.eco-chart-badge--nk    { background: rgba(34,197,94,0.12);   color: #4ade80; }
.eco-chart-badge--nk-gap{ background: rgba(14,165,233,0.12);  color: #38bdf8; }

.eco-chart-body {
  padding: 16px 16px 8px;
  height: 240px;
  position: relative;
}

.eco-chart-fonte {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding: 0 16px 12px;
  margin: 0;
}

/* Global source note */
.eco-fonte-global {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0 8px;
}

.eco-fonte-global a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.eco-fonte-global a:hover { color: var(--primary-light); }

/* ── Chart card expandable ───────────────────────────────────────────────── */
.eco-chart-card--expandable {
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.eco-chart-card--expandable:hover {
  border-color: rgba(99,102,241,0.45);
  box-shadow: 0 4px 22px rgba(0,0,0,0.35);
}
.eco-chart-expand-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 8px;
  padding: 3px 7px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-pill);
  color: #818cf8;
  font-size: 0.7rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.eco-chart-expand-btn:hover {
  background: rgba(99,102,241,0.25);
  color: #a5b4fc;
}
.eco-chart-expand-btn i { font-size: 0.75rem; }

/* ── Modal fullscreen chart ──────────────────────────────────────────────── */
.eco-chart-modal-dialog {
  max-width: 93vw;
  width: 93vw;
  margin: auto;
}
.eco-chart-modal-content {
  background: #000;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  height: 84vh;
  display: flex;
  flex-direction: column;
}
.eco-chart-modal-header {
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: #000;
  border-radius: 12px 12px 0 0;
  flex-shrink: 0;
}
.eco-chart-offcanvas-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e2e8f0;
}
.eco-chart-modal-body {
  padding: 20px 24px 16px;
  flex: 1;
  position: relative;
  background: #000;
  border-radius: 0 0 12px 12px;
  overflow: hidden;
}
#chartOffcanvasCanvas {
  position: absolute;
  inset: 20px 24px 16px;
  width: calc(100% - 48px) !important;
  height: calc(100% - 36px) !important;
}
/* Backdrop mais escuro para contraste */
.eco-chart-modal-dialog + .modal-backdrop,
#chartModal ~ .modal-backdrop {
  --bs-backdrop-opacity: 0.85;
}

/* ── VAR Section ─────────────────────────────────────────────────────────── */
.eco-var-section { padding-top: 0; }

.eco-var-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.eco-var-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.35rem;
}

.eco-var-tag {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
}

.eco-var-tag--nk {
  background: rgba(34,197,94,0.15);
  color: #4ade80;
}

.eco-nk-summary-card {
  border-color: rgba(74, 222, 128, 0.18);
  box-shadow: inset 0 1px 0 rgba(74, 222, 128, 0.10);
}

.eco-nk-value--taxa { color: #4ade80; }
.eco-nk-value--selic { color: #7dd3fc; }
.eco-nk-value--desvio { color: #fbbf24; }

.eco-var-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 560px;
}

.eco-var-btns {
  display: inline-flex;
  gap: 0;
  flex-shrink: 0;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 10px;
  padding: 3px;
}

.eco-var-btn {
  padding: 0.4rem 1.1rem;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  letter-spacing: .01em;
  white-space: nowrap;
}
.eco-var-btn:hover {
  background: rgba(255,255,255,0.06);
  color: #94a3b8;
}

/* Estado ativo padrão para filtros/botões (ACF/PACF, Granger, recuo etc.) */
.eco-var-btn.active {
  background: rgba(14,165,233,0.18);
  border-color: rgba(56,189,248,0.55);
  color: #7dd3fc;
  box-shadow: 0 0 12px rgba(14,165,233,0.22);
}

/* Filtro de recuo dos modelos avançados */
.eco-collapse-toggle.active {
  background: rgba(245,158,11,0.20) !important;
  border-color: rgba(251,191,36,0.55) !important;
  color: #fde68a !important;
  box-shadow: 0 0 12px rgba(245,158,11,0.25) !important;
}
.eco-collapse-toggle[aria-pressed="true"] {
  background: linear-gradient(180deg, rgba(245,158,11,0.26), rgba(217,119,6,0.18)) !important;
  border-color: rgba(251,191,36,0.70) !important;
  color: #fef3c7 !important;
  box-shadow: 0 0 0 1px rgba(251,191,36,0.25) inset, 0 0 14px rgba(245,158,11,0.30) !important;
}

/* SELIC — azul */
.eco-var-btn[data-var="selic"].active {
  background: rgba(29,106,229,0.2) !important;
  border-color: rgba(96,165,250,0.55) !important;
  color: #93c5fd !important;
  box-shadow: 0 0 14px rgba(29,106,229,0.25) !important;
}
/* IPCA — roxo */
.eco-var-btn[data-var="ipca"].active {
  background: rgba(139,92,246,0.2) !important;
  border-color: rgba(167,139,250,0.55) !important;
  color: #c4b5fd !important;
  box-shadow: 0 0 14px rgba(139,92,246,0.25) !important;
}
/* USD — verde */
.eco-var-btn[data-var="usd"].active {
  background: rgba(52,211,153,0.16) !important;
  border-color: rgba(52,211,153,0.5) !important;
  color: #6ee7b7 !important;
  box-shadow: 0 0 14px rgba(52,211,153,0.2) !important;
}

.eco-var-chart-card { margin-bottom: 0; }

.eco-var-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem 0.25rem;
  border-top: 1px solid var(--border-subtle);
}

.eco-var-pill {
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 10px;
}
.eco-var-pill--hist { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.eco-var-pill--prev { background: rgba(167,139,250,0.12); color: #a78bfa;
  border: 1px dashed rgba(167,139,250,0.4); }
.eco-var-pill--ic   { background: rgba(255,255,255,0.04); color: #475569;
  border: 1px solid rgba(255,255,255,0.08); }

.eco-var-metodologia {
  margin-left: auto;
  font-size: 0.68rem;
  color: #334155;
  font-style: italic;
}

/* ── Explorador de Séries ─────────────────────────────────────────────────── */
.eco-explorer-section { padding-top: 0; padding-bottom: 64px; }

.eserie-notes {
  margin-top: 0.85rem;
  border: 1px solid rgba(56,189,248,0.18);
  background: rgba(14,165,233,0.06);
  border-radius: 10px;
  padding: 0.7rem 0.85rem 0.65rem;
  max-width: 980px;
}

.eserie-notes-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.35rem;
}

.eserie-notes-list {
  margin: 0;
  padding-left: 1.05rem;
  color: #94a3b8;
  font-size: 0.78rem;
  line-height: 1.45;
}

.eserie-notes-list li + li { margin-top: 0.3rem; }

.eserie-form {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.eserie-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.eserie-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.85rem;
  padding: 0.5rem 0.85rem;
  outline: none;
  transition: border-color .18s;
}
.eserie-input:focus { border-color: #38bdf8; }
.eserie-input--code  { width: 150px; }
.eserie-input--label { flex: 1; min-width: 120px; }

.eserie-add-btn {
  width: 36px; height: 36px;
  border-radius: 8px;
  border: 1px solid rgba(56,189,248,0.4);
  background: rgba(56,189,248,0.1);
  color: #38bdf8;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s;
  flex-shrink: 0;
}
.eserie-add-btn:hover { background: rgba(56,189,248,0.2); }

.eserie-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
  min-height: 0;
}

.eserie-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 4px 10px 4px 12px;
  border-radius: 20px;
  border: 1px solid;
  background: rgba(255,255,255,0.03);
  font-size: 0.78rem;
  font-weight: 600;
}
.eserie-chip-num { font-size: 0.7rem; opacity: .6; font-weight: 400; }
.eserie-chip-rm {
  background: none; border: none;
  color: inherit; opacity: .5;
  cursor: pointer; font-size: 1rem;
  line-height: 1; padding: 0 0 0 2px;
}
.eserie-chip-rm:hover { opacity: 1; }

.eserie-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.eserie-hint {
  font-size: 0.78rem;
  color: #475569;
}

.eserie-analyze-btn {
  padding: 0.5rem 1.5rem;
  border-radius: 9px;
  border: 1px solid rgba(56,189,248,0.4);
  background: rgba(56,189,248,0.1);
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
}
.eserie-analyze-btn:not(:disabled):hover {
  background: rgba(56,189,248,0.2);
  box-shadow: 0 0 16px rgba(56,189,248,0.2);
}
.eserie-analyze-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

.eserie-loading {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: #64748b;
  font-size: 0.85rem;
  padding: 1.5rem 0;
}
.eserie-spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(56,189,248,0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: espin .7s linear infinite;
}
@keyframes espin { to { transform: rotate(360deg); } }

.eserie-charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.eserie-var-block { margin-top: 0.5rem; }
.eserie-var-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}
.eserie-var-btns {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.eserie-error {
  color: #f87171;
  padding: 1rem;
  border: 1px solid rgba(248,113,113,0.2);
  border-radius: 8px;
  font-size: 0.85rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ACF / PACF
   ═══════════════════════════════════════════════════════════════════════════ */
.eco-acf-section { padding-top: 0; }

.eco-acf-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-end;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   GRANGER
   ═══════════════════════════════════════════════════════════════════════════ */
.eco-granger-section { padding-top: 0; }

.eco-granger-card { overflow: visible; }

.eco-granger-table-wrap {
  overflow-x: auto;
  padding: 1rem 1.25rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.eco-granger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 340px;
}

.eco-granger-table thead tr {
  border-bottom: 1px solid var(--border-subtle);
}

.eco-granger-table th {
  padding: 0.55rem 1rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
}

.eco-granger-corner {
  text-align: left !important;
  color: var(--text-muted);
  font-size: 0.7rem !important;
  white-space: nowrap;
}

.eco-granger-table td {
  padding: 0.6rem 1rem;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: middle;
}

.eco-granger-row-label {
  text-align: left !important;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.8rem;
  white-space: nowrap;
}

.eco-granger-diag {
  color: var(--text-muted);
  background: rgba(255,255,255,0.02);
  font-size: 1rem;
}

.eco-granger-cell { transition: background 0.18s; }

.eco-granger-cell--sig {
  background: rgba(52,211,153,0.06);
}

.eco-granger-cell--sig:hover {
  background: rgba(52,211,153,0.12);
}

.eco-granger-cell--ns {
  color: var(--text-muted);
}

.eco-granger-f {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: 'Courier New', monospace;
  line-height: 1.4;
}

.eco-granger-stars {
  display: block;
  font-size: 0.85rem;
  color: #34d399;
  line-height: 1.2;
  letter-spacing: 0.05em;
}

.eco-granger-legend {
  padding: 0.6rem 1.25rem 0.85rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle);
}

.eco-granger-sig {
  color: #34d399;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.eco-granger-notsig {
  color: var(--text-muted);
  font-style: italic;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DECOMPOSIÇÃO
   ═══════════════════════════════════════════════════════════════════════════ */
.eco-decomp-section { padding-top: 0; }

.eco-decomp-grid {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.eco-decomp-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.eco-decomp-row:last-child { border-bottom: none; }

.eco-decomp-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0 0 0 1rem;
  text-align: left;
  flex-shrink: 0;
}

.eco-decomp-chart-wrap {
  height: 110px;
  position: relative;
  padding: 6px 12px 6px 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   COINTEGRAÇÃO
   ═══════════════════════════════════════════════════════════════════════════ */
.eco-coint-section { padding-top: 0; }

.eco-coint-card { overflow: visible; }

.eco-coint-table-wrap {
  overflow-x: auto;
  padding: 1rem 1.25rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.eco-coint-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
  min-width: 400px;
}

.eco-coint-table thead tr {
  border-bottom: 1px solid var(--border-subtle);
}

.eco-coint-table th {
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: left;
}

.eco-coint-table th:not(:first-child) { text-align: center; }

.eco-coint-row {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background 0.18s;
}
.eco-coint-row:last-child { border-bottom: none; }

.eco-coint-row--yes { background: rgba(52,211,153,0.05); }
.eco-coint-row--yes:hover { background: rgba(52,211,153,0.1); }
.eco-coint-row--no  { background: transparent; }
.eco-coint-row--no:hover  { background: rgba(255,255,255,0.02); }

.eco-coint-table td { padding: 0.65rem 1rem; vertical-align: middle; }

.eco-coint-par {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  font-size: 0.85rem;
}

.eco-coint-num {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.eco-coint-concl { font-size: 0.8rem; }

.eco-coint-badge {
  display: inline-block;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  margin-right: 0.4rem;
}

.eco-coint-badge--yes {
  background: rgba(52,211,153,0.15);
  color: #34d399;
  border: 1px solid rgba(52,211,153,0.3);
}

.eco-coint-badge--no {
  background: rgba(100,116,139,0.12);
  color: #64748b;
  border: 1px solid rgba(100,116,139,0.25);
}

.eco-coint-text {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.eco-coint-footnote {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.5rem 1.25rem 0.85rem;
  margin: 0;
  border-top: 1px solid var(--border-subtle);
  font-family: 'Courier New', monospace;
}

/* ═══════════════════════════════════════════════════════════════════════════
   IRF
   ═══════════════════════════════════════════════════════════════════════════ */
.eco-irf-section { padding-top: 0; }

.eco-irf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

/* Mobile */
@media (max-width: 640px) {
  .eco-hero { padding: 48px 0 24px; }
  .eco-charts-grid { grid-template-columns: 1fr; }
  .eco-card-value { font-size: 1.2rem; }
  .eco-var-header { flex-direction: column; }
  .eco-var-metodologia { margin-left: 0; }
  .eserie-charts-grid { grid-template-columns: 1fr; }
  .eserie-input--code { width: 120px; }
  .eco-acf-controls  { align-items: flex-start; }
  .eco-decomp-row    { grid-template-columns: 72px 1fr; }
  .eco-decomp-label  { font-size: 0.62rem; padding-left: 0.6rem; }
  .eco-irf-grid      { grid-template-columns: 1fr; }
  .eco-granger-table-wrap,
  .eco-coint-table-wrap { padding: 0.75rem; }
}

/* ── Category navigation ──────────────────────────────────────────────────── */
.eco-cat-nav {
  position: sticky;
  top: 56px;
  z-index: 190;
  background: rgba(13,17,23,0.97);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  padding: 6px 0;
}

.eco-cat-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.eco-cat-tabs::-webkit-scrollbar { display: none; }

.eco-cat-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  line-height: 1.2;
}
.eco-cat-label { font-weight: 600; font-size: 0.85rem; }
.eco-cat-sub   { font-size: 0.63rem; font-weight: 400; opacity: 0.65; }

.eco-cat-tab:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

/* Tema de cada tab definido por custom property --tab-c; estado .active usa color-mix */
.eco-cat-tab--monetaria     { --tab-c: #d97706; }
.eco-cat-tab--real          { --tab-c: #16a34a; }
.eco-cat-tab--fiscal        { --tab-c: #7c3aed; }
.eco-cat-tab--pix           { --tab-c: #00b4d8; }
.eco-cat-tab--expectativas  { --tab-c: #22d3ee; }
.eco-cat-tab--personalizada { --tab-c: #0ea5e9; }
.eco-cat-tab.active {
  background: color-mix(in srgb, var(--tab-c) 12%, transparent) !important;
  border-color: color-mix(in srgb, var(--tab-c) 40%, transparent) !important;
  color: var(--tab-c) !important;
}

/* ── Category panels ──────────────────────────────────────────────────────── */
.eco-panel { display: none; }
.eco-panel.active { display: block; }

/* ── Dynamic category section header ─────────────────────────────────────── */
.eco-cat-section-header { margin-bottom: 1.5rem; }
.eco-cat-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.eco-cat-section-sub {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin: 0;
}

/* ── Dynamic card variant (left border accent) ────────────────────────────── */
.eco-cards-grid--dyn { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.eco-card--dyn {
  border-left: 3px solid transparent;
  padding-left: 1rem;
}

@media (max-width: 640px) {
  .eco-cat-tab { padding: 6px 12px; }
  .eco-cat-sub { display: none; }
  .eco-cards-grid--dyn { grid-template-columns: 1fr; gap: 12px; }
  .eco-card--dyn { padding: 14px; padding-left: 0.8rem; gap: 12px; }
  .eco-card--dyn .eco-card-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .eco-card--dyn .eco-card-label { font-size: 0.65rem; }
  .eco-card--dyn .eco-card-value {
    font-size: clamp(1.15rem, 6vw, 1.6rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* ── Time range selector ──────────────────────────────────────────────────── */
.eco-timerange-bar {
  background: rgba(255,255,255,0.018);
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 0;
}
.eco-timerange {
  display: flex;
  align-items: center;
  gap: 4px;
}
.eco-tr-label {
  font-size: .75rem;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}
.eco-tr-btn {
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .02em;
}
.eco-tr-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.eco-tr-btn.active {
  background: rgba(29,106,229,0.14) !important;
  border-color: rgba(29,106,229,0.45) !important;
  color: var(--primary-light) !important;
}
.eco-unit-btn {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: .72rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: .02em;
}
.eco-unit-btn:hover {
  background: rgba(255,255,255,0.05);
  color: var(--text-primary);
}
.eco-unit-btn.active {
  background: rgba(16,185,129,0.14) !important;
  border-color: rgba(16,185,129,0.45) !important;
  color: #34d399 !important;
}

/* ── EUR / Papel Moeda card accents ──────────────────────────────────────── */
.eco-card--eur { border-left: 3px solid #f59e0b; }
.eco-card--eur .eco-card-icon { color: #f59e0b; }
.eco-card--eur .eco-card-value { color: #fbbf24; }
.eco-card--pm { border-left: 3px solid #ec4899; }
.eco-card--pm .eco-card-icon { color: #ec4899; }
.eco-card--pm .eco-card-value { color: #f472b6; }

/* ── Explorer — econometric result sections ───────────────────────────────── */
.eserie-eco-section {
  margin-top: 2.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}
