/* ==========================================================================
   SABER-FE • SISTEMA DE ATENDIMENTO, BUSCA E EVIDÊNCIAS REGULAMENTARES
   FACULDADE DE EDUCAÇÃO (FE) • PPGE • GEaD • LaMCAD • UFG
   Design System 2026: "O Nó das Veredas" (Titânio Acetinado, Glassmorphism & Luz Volumétrica)
   Conformidade: Zero Emojis • e-MAG 3.1 • WCAG 2.2 AAA • ABNT NBR 10520:2023 / 6023:2018 / 6024:2012
   ========================================================================== */

:root {
  /* ==========================================================================
     1. TOKENS PRIMITIVOS: DEEP TEAL GEAD (12 STEPS RADIX) & ESPAÇO OKLCH
     ========================================================================== */
  --gead-teal-1:  oklch(99.0% 0.003 195.11);
  --gead-teal-2:  oklch(97.2% 0.008 195.11);
  --gead-teal-3:  oklch(94.5% 0.016 195.11);
  --gead-teal-4:  oklch(91.5% 0.025 195.11);
  --gead-teal-5:  oklch(87.5% 0.035 195.11);
  --gead-teal-6:  oklch(82.0% 0.040 195.11);
  --gead-teal-7:  oklch(72.0% 0.055 195.11);
  --gead-teal-8:  oklch(60.0% 0.068 195.11);
  --gead-teal-9:  oklch(44.31% 0.081 195.11); /* #227073 Deep Teal Oficial (RGB 34, 112, 115) */
  --gead-teal-10: oklch(39.0% 0.075 195.11);
  --gead-teal-11: oklch(32.0% 0.065 195.11);
  --gead-teal-12: oklch(20.0% 0.045 195.11);

  /* Fallback Hexadecimal para Browsers Antigos */
  --color-teal-base: #227073;
  --color-teal-glow: #2eaab5;
  --color-teal-dark: #174d4f;
  --color-teal-light: #dae7e8;

  /* ==========================================================================
     2. ESCALA NEUTRA ARDÓSIA TITÂNIO / SLATE ACADÊMICO
     ========================================================================== */
  --slate-1:  #f8fafc;
  --slate-2:  #f1f5f9;
  --slate-3:  #e2e8f0;
  --slate-4:  #cbd5e1;
  --slate-5:  #b0bec5;
  --slate-6:  #94a3b8;
  --slate-7:  #64748b;
  --slate-8:  #475569;
  --slate-9:  #334155;
  --slate-10: #1e293b;
  --slate-11: #0f172a;
  --slate-12: #070a10;

  /* ==========================================================================
     3. TOKENS SEMÂNTICOS: MODO CLARO (TITÂNIO-ACETINADO EDITORIAL)
     ========================================================================== */
  --bg-app: #f8fafc;
  --bg-canvas: #f8fafc;
  --bg-sidebar: rgba(244, 247, 248, 0.88);
  --bg-card: rgba(255, 255, 255, 0.85);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-surface-metallic: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 247, 247, 0.88) 100%);
  --bg-bubble-user: rgba(234, 241, 243, 0.92);
  --bg-bubble-bot: rgba(255, 255, 255, 0.94);
  --bg-inspector: rgba(255, 255, 255, 0.90);
  --bg-dock: rgba(255, 255, 255, 0.88);

  --border-color: rgba(219, 228, 230, 0.85);
  --border-hairline: rgba(34, 112, 115, 0.14);
  --border-focus: #227073;
  --border-metallic: inset 0 1px 1px rgba(255, 255, 255, 0.9), 0 0 0 1px rgba(34, 112, 115, 0.16);

  --text-main: #0f172a;        /* Contraste 18.78:1 (WCAG AAA) */
  --text-muted: #475569;       /* Contraste 7.34:1 */
  --text-accent: #174d4f;      /* Contraste 8.55:1 */
  --text-on-accent: #ffffff;

  --accent-primary: #227073;
  --accent-secondary: #2eaab5;
  --accent-hover: #174d4f;
  --accent-light: #dae7e8;
  --accent-surface: rgba(240, 247, 247, 0.8);

  /* Gradientes & Texturas Veredas */
  --gradient-veredas-primary: linear-gradient(135deg, #227073 0%, #2eaab5 100%);
  --gradient-veredas-glow: radial-gradient(circle at 50% 0%, rgba(46, 170, 181, 0.18) 0%, transparent 70%);
  --gradient-metallic: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(218, 231, 232, 0.5) 100%);
  --gradient-mesh: radial-gradient(ellipse at 15% 10%, rgba(34, 112, 115, 0.10) 0%, transparent 55%),
                   radial-gradient(ellipse at 85% 85%, rgba(46, 170, 181, 0.08) 0%, transparent 60%),
                   #f8fafc;

  /* Tipografia Soberana */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --font-serif: "IBM Plex Serif", Georgia, Cambria, serif;

  /* Escala Modular Fluida com clamp() */
  --type-step-minus-2: clamp(0.6875rem, 0.65rem + 0.18vw, 0.75rem);   /* 11px -> 12px: Hashes e Metadados */
  --type-step-minus-1: clamp(0.8125rem, 0.78rem + 0.16vw, 0.875rem);  /* 13px -> 14px: Citações Longas ABNT */
  --type-step-0:       clamp(0.9375rem, 0.90rem + 0.22vw, 1.0625rem); /* 15px -> 17px: Corpo de Texto Base */
  --type-step-1:       clamp(1.0625rem, 1.00rem + 0.35vw, 1.25rem);   /* 17px -> 20px: Subtítulos e Seção 3 */
  --type-step-2:       clamp(1.1875rem, 1.10rem + 0.50vw, 1.45rem);   /* 19px -> 23.2px: Seção 2 ABNT */
  --type-step-3:       clamp(1.375rem,  1.25rem + 0.70vw, 1.75rem);   /* 22px -> 28px: Seção 1 ABNT */
  --type-step-4:       clamp(1.625rem,  1.45rem + 1.00vw, 2.15rem);   /* 26px -> 34.4px: Título Hero */

  /* Dimensões Estruturais da Estação Analítica */
  --sidebar-width: 260px;
  --inspector-width: 400px;
  --header-height: 64px;
  --dock-max-width: 860px;
  --reading-max-width: 880px;

  /* Scrollbar Semântica & Calha Estável */
  --scrollbar-thumb: rgba(34, 112, 115, 0.35);
  --scrollbar-thumb-hover: rgba(34, 112, 115, 0.65);
  --scrollbar-track: transparent;

  /* Evidência Documental Homologada */
  --evidence-verified-bg: rgba(34, 112, 115, 0.08);
  --evidence-verified-border: #227073;
  --evidence-verified-text: #174d4f;

  /* Física de Animação & Transições */
  --ease-precision: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-tactile: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-hover: cubic-bezier(0.25, 1, 0.5, 1);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* Sombras Multicamadas de Oclusão */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px -4px rgba(34, 112, 115, 0.12), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-dock: 0 0 0 1px rgba(255, 255, 255, 0.8),
                 0 8px 24px -4px rgba(34, 112, 115, 0.14),
                 0 24px 48px -8px rgba(15, 23, 42, 0.18);
}

/* ==========================================================================
   4. TOKENS SEMÂNTICOS: MODO ESCURO NOTURNO (DARK SLATE / OLED DEEP TECH)
   ========================================================================== */
html.dark, body.dark {
  --bg-app: #070a10;
  --bg-canvas: #070a10;
  --bg-sidebar: rgba(11, 17, 28, 0.85);
  --bg-card: rgba(15, 26, 44, 0.82);
  --bg-card-hover: rgba(22, 36, 60, 0.95);
  --bg-surface-metallic: linear-gradient(135deg, rgba(22, 34, 53, 0.85) 0%, rgba(11, 17, 28, 0.95) 100%);
  --bg-bubble-user: rgba(19, 32, 54, 0.9);
  --bg-bubble-bot: rgba(15, 26, 44, 0.92);
  --bg-inspector: rgba(11, 19, 32, 0.88);
  --bg-dock: rgba(11, 17, 28, 0.85);

  --border-color: rgba(26, 40, 62, 0.85);
  --border-hairline: rgba(66, 194, 204, 0.16);
  --border-focus: #42c2cc;
  --border-metallic: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(66, 194, 204, 0.22);

  --text-main: #f8fafc;        /* Contraste 17.51:1 (WCAG AAA) */
  --text-muted: #94a3b8;       /* Contraste 7.82:1 */
  --text-accent: #42c2cc;      /* Contraste 9.81:1 */
  --text-on-accent: #070a10;

  --accent-primary: #2eaab5;
  --accent-secondary: #42c2cc;
  --accent-hover: #78d6df;
  --accent-light: #162a36;
  --accent-surface: rgba(14, 42, 44, 0.75);

  --gradient-mesh: radial-gradient(ellipse at 15% 10%, rgba(46, 170, 181, 0.12) 0%, transparent 55%),
                   radial-gradient(ellipse at 85% 85%, rgba(34, 112, 115, 0.16) 0%, transparent 60%),
                   #070a10;

  --scrollbar-thumb: rgba(66, 194, 204, 0.30);
  --scrollbar-thumb-hover: rgba(66, 194, 204, 0.60);

  --evidence-verified-bg: rgba(46, 170, 181, 0.10);
  --evidence-verified-border: #42c2cc;
  --evidence-verified-text: #78d6df;

  --shadow-dock: 0 0 0 1px rgba(255, 255, 255, 0.08),
                 0 12px 28px -4px rgba(0, 0, 0, 0.55),
                 0 28px 56px -8px rgba(0, 0, 0, 0.75),
                 0 0 32px -4px rgba(66, 194, 204, 0.10);
}

/* ==========================================================================
   5. MODO ALTO CONTRASTE GOVERNAMENTAL (e-MAG 3.1 & WCAG 2.2 AAA STRICT)
   ========================================================================== */
html.high-contrast,
body.high-contrast,
@media (forced-colors: active) {
  --bg-app: #000000 !important;
  --bg-canvas: #000000 !important;
  --bg-sidebar: #000000 !important;
  --bg-card: #000000 !important;
  --bg-card-hover: #111111 !important;
  --bg-inspector: #000000 !important;
  --bg-bubble-user: #111111 !important;
  --bg-bubble-bot: #000000 !important;
  --bg-dock: #000000 !important;

  --text-main: #ffffff !important;
  --text-muted: #ffffff !important;
  --text-accent: #ffff00 !important;
  --text-on-accent: #000000 !important;

  --border-color: #ffffff !important;
  --border-hairline: #ffffff !important;
  --border-focus: #ffff00 !important;

  --accent-primary: #ffff00 !important;
  --accent-secondary: #00ffff !important;
  --accent-hover: #ffffff !important;
  --accent-surface: #000000 !important;

  --shadow-sm: none !important;
  --shadow-md: none !important;
  --shadow-dock: none !important;
}

html.high-contrast .bento-card,
html.high-contrast .sidebar,
html.high-contrast .floating-dock-capsule,
html.high-contrast .modal-window,
html.high-contrast .inspector-card,
html.high-contrast .inspector-content {
  border: 2px solid #ffffff !important;
  background-color: #000000 !important;
  color: #ffffff !important;
}

html.high-contrast a,
html.high-contrast .btn-open-pdf,
html.high-contrast .bento-card-action {
  color: #00ffff !important;
  text-decoration: underline !important;
}

html.high-contrast :focus-visible {
  outline: 3px solid #ffff00 !important;
  outline-offset: 3px !important;
  box-shadow: none !important;
}

/* ==========================================================================
   6. RESET GLOBAL E OTIMIZAÇÃO DO MOTOR DE RENDERIZAÇÃO
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-main);
  background: var(--bg-app);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv05", "cv08", "tnum", "ss01", "calt", "kern";
}

/* Skip Links Acessíveis para Navegação por Teclado */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  z-index: 100000;
  text-decoration: none;
  transition: top 0.2s var(--ease-precision);
  border: 2px solid var(--accent-secondary);
}

.skip-link:focus-visible {
  top: 16px;
  outline: none;
  box-shadow: 0 0 0 4px rgba(46, 170, 181, 0.4);
}

/* Foco Acessível com Anel Duplo */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.95), 0 0 0 6px var(--accent-primary);
  border-radius: var(--radius-sm);
}

.dark :focus-visible {
  outline: 2px solid #42c2cc;
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #070a10, 0 0 0 6px #42c2cc;
}

/* ==========================================================================
   7. ARQUITETURA ESPACIAL EM 3 COLUNAS (SPATIAL MACRO GRID)
   ========================================================================== */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr) var(--inspector-width);
  grid-template-rows: 100vh;
  grid-template-areas: "sidebar canvas inspector";
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: var(--bg-app);
}

/* Background Canvas Interativo */
.veredas-bg-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* ==========================================================================
   8. COLUNA 1: SIDEBAR DE NAVEGAÇÃO & CONTEXTO
   ========================================================================== */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  z-index: 50;
  position: relative;
  min-width: 0;
  transition: transform 0.28s var(--ease-precision), width 0.28s var(--ease-precision);
}

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

.sidebar-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--bg-surface-metallic);
  border: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.brand-svg-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-text {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.sidebar-brand-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  display: block;
}

.sidebar-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
}

.sidebar-section-title {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  margin: 14px 8px 6px 8px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-main);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s var(--ease-hover);
  margin-bottom: 2px;
}

.menu-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hairline);
  color: var(--accent-primary);
  transform: translateX(2px);
}

.menu-item.active {
  background: var(--accent-surface);
  border-color: var(--accent-secondary);
  color: var(--accent-primary);
  font-weight: 700;
}

.menu-item-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(34, 112, 115, 0.12);
  color: var(--accent-primary);
  margin-left: auto;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.theme-toggle-btn {
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}

.theme-toggle-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* ==========================================================================
   9. COLUNA 2: CANVAS DE SÍNTESE ANALÍTICA & DIÁLOGO
   ========================================================================== */
.main-canvas-workspace {
  grid-area: canvas;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  position: relative;
  background-color: var(--bg-canvas);
  background-image: var(--gradient-mesh);
  container-type: inline-size;
  container-name: synthesis-canvas;
}

/* Cabeçalho da Estação Analítica */
.canvas-header {
  height: var(--header-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  z-index: 30;
  flex-shrink: 0;
}

.header-left-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text-main);
}

.header-title-group {
  display: flex;
  flex-direction: column;
}

.header-main-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.header-sub-title {
  font-size: 11px;
  color: var(--text-muted);
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-main);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.header-action-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

/* Área de Rolagem do Conteúdo */
.synthesis-scroll-viewport {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  overscroll-behavior-y: contain;
  position: relative;
  z-index: 10;
}

.synthesis-reading-sheet {
  width: 100%;
  max-width: var(--reading-max-width);
  padding: 28px 24px 140px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0 auto;
}

/* ==========================================================================
   10. HERO SCREEN: MURAL DO CICLO DE VIDA DISCENTE
   ========================================================================== */
.hero-canvas-welcome {
  text-align: center;
  padding: 20px 0 10px 0;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.hero-veredas-badge {
  width: 110px;
  height: 110px;
  margin: 0 auto 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 34px;
  background: radial-gradient(circle at 50% 30%, rgba(46, 170, 181, 0.22) 0%, rgba(34, 112, 115, 0.08) 60%, transparent 85%);
  padding: 10px;
  border: 1px solid var(--border-metallic);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), 0 16px 40px -10px rgba(34, 112, 115, 0.30);
  animation: veredasFloat 6s ease-in-out infinite;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

html.dark .hero-veredas-badge {
  background: radial-gradient(circle at 50% 30%, rgba(66, 194, 204, 0.28) 0%, rgba(14, 42, 44, 0.7) 70%, transparent 90%);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.18), 0 20px 48px -8px rgba(0, 0, 0, 0.8), 0 0 28px rgba(66, 194, 204, 0.2);
}

.hero-veredas-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 12px 24px rgba(34, 112, 115, 0.45));
  transition: transform 0.35s var(--ease-precision);
}

.hero-veredas-badge:hover .hero-veredas-img {
  transform: scale(1.08);
}

@keyframes veredasFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-6px); }
}

.hero-title {
  font-size: var(--type-step-4);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.15;
}

html.dark .hero-title {
  background: linear-gradient(135deg, #ffffff 40%, #78d6df 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-acronym-banner {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent-primary);
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  display: inline-block;
}

.acronym-letter {
  font-weight: 800;
  color: var(--accent-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hero-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 6px auto;
  line-height: 1.45;
}

.hero-provenance-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Régua Institucional com Proporção Áurea */
.hero-institutional-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 13px; /* 8px * 1.618 */
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.hero-logo-box {
  padding: 7px 13px;
  background: var(--bg-surface-metallic);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.22s var(--ease-precision);
  backdrop-filter: blur(8px);
}

.hero-logo-box:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(46, 170, 181, 0.22);
}

.inst-hero-logo {
  height: 24px;
  max-width: 90px;
  object-fit: contain;
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

/* Bento Grid 2.0 com Spotlight */
.bento-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  width: 100%;
  margin-top: 10px;
}

.bento-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 18px 20px;
  background: var(--bg-card);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.24s var(--ease-precision), 
              box-shadow 0.24s var(--ease-precision), 
              border-color 0.24s var(--ease-precision);
  font-family: inherit;
  color: var(--text-main);
}

.bento-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: inherit;
  background: radial-gradient(
    420px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(46, 170, 181, 0.15),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.bento-card:hover::before {
  opacity: 1;
}

.bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 24px -4px rgba(34, 112, 115, 0.22);
}

.card-header-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  margin-bottom: 4px;
}

.card-action-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.card-action-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}

.bento-card-highlight {
  background: linear-gradient(135deg, rgba(46, 170, 181, 0.08) 0%, rgba(30, 112, 117, 0.03) 100%);
  border-color: rgba(46, 170, 181, 0.3);
}

/* ==========================================================================
   11. FLUXO CONVERSACIONAL & RESPOSTAS EM 4 ATOS
   ========================================================================== */
.synthesis-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.message-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  padding: 22px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

.user-message-card {
  background: var(--bg-bubble-user);
  border-color: var(--border-hairline);
  align-self: flex-end;
  max-width: 85%;
  padding: 14px 18px;
}

.bot-message-card {
  background: var(--bg-bubble-bot);
  border-color: var(--border-color);
  align-self: stretch;
}

.message-meta-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-hairline);
}

.message-sender-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-primary);
}

.sender-mini-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.message-timestamp {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Microtipografia ABNT das Respostas */
.message-body {
  font-size: var(--type-step-0);
  line-height: 1.62;
  color: var(--text-main);
  overflow-wrap: break-word;
}

.message-body p {
  margin-bottom: 1.15rem;
  text-wrap: pretty;
}

/* Seção 1 ABNT (Caixa Alta + Negrito) */
.message-body h2,
.abnt-section-1 {
  font-size: var(--type-step-2);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-main);
  margin-top: 1.8rem;
  margin-bottom: 0.85rem;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-hairline);
}

/* Seção 2 ABNT (Caixa Alta + Normal) */
.message-body h3,
.abnt-section-2 {
  font-size: var(--type-step-1);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--accent-primary);
  margin-top: 1.4rem;
  margin-bottom: 0.65rem;
}

/* Citações Longas ABNT NBR 10520:2023 (Recuo de 48px, 13px, sem itálico) */
.message-body blockquote,
.abnt-quote-long {
  margin: 1.2rem 0 1.2rem 48px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.28;
  text-align: justify;
  font-style: normal !important;
  color: var(--text-main);
  background: var(--evidence-verified-bg);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0 6px 6px 0;
}

.message-body blockquote p {
  margin-bottom: 0.5rem;
  font-size: inherit;
  line-height: inherit;
}

.message-body blockquote p:last-child {
  margin-bottom: 0;
}

/* Referências ABNT NBR 6023:2018 (Alinhadas estritamente à esquerda) */
.abnt-references-block {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--border-hairline);
  text-align: left !important;
}

.abnt-references-block p,
.abnt-ref-item {
  font-size: 13px;
  line-height: 1.35;
  text-align: left !important;
  margin-bottom: 0.85rem;
  color: var(--text-main);
  overflow-wrap: break-word;
}

.abnt-references-block p strong,
.abnt-ref-item strong {
  font-weight: 700;
}

/* Barra de Avaliação e Apontamento (Feedback) */
.feedback-bar {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.feedback-query-text {
  font-size: 12px;
  color: var(--text-muted);
}

.feedback-btn-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.feedback-btn {
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.feedback-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Botão de Cópia Tátil */
.btn-copy-tactile {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s var(--ease-precision);
}

.btn-copy-tactile:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.btn-copy-tactile.copied {
  color: var(--accent-primary);
  border-color: var(--accent-secondary);
  background: rgba(46, 170, 181, 0.12);
  animation: copyPulse 0.4s var(--ease-precision);
}

@keyframes copyPulse {
  0% { transform: scale(0.96); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* ==========================================================================
   12. DOCA FLUTUANTE DE PROMPT (SPATIAL FLOATING OMNIBAR)
   ========================================================================== */
.spatial-dock-container {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(var(--dock-max-width), calc(100% - 32px));
  z-index: 100;
  pointer-events: none;
}

.floating-dock-capsule {
  pointer-events: auto;
  background: var(--bg-dock);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-color);
  border-radius: 22px;
  padding: 12px 14px 10px 18px;
  box-shadow: var(--shadow-dock);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s var(--ease-precision), box-shadow 0.2s var(--ease-precision);
}

.floating-dock-capsule:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), var(--shadow-dock);
}

.dock-input-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.dock-textarea {
  flex: 1;
  min-height: 26px;
  max-height: 164px;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 14.5px;
  line-height: 1.5;
  padding: 0;
  margin: 0;
  overflow-y: hidden;
  field-sizing: content;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) transparent;
}

.dock-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.dock-actions-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}

.dock-shortcuts-hint {
  display: flex;
  gap: 6px;
}

.shortcut-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: rgba(34, 112, 115, 0.06);
  border: 1px solid var(--border-hairline);
  padding: 2px 6px;
  border-radius: 4px;
  user-select: none;
}

.dock-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--accent-primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
  flex-shrink: 0;
}

.dock-send-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: scale(1.06);
}

.dock-send-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.dock-send-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

/* ==========================================================================
   13. COLUNA 3: DOCUMENT INSPECTOR & RASTREABILIDADE REGTECH
   ========================================================================== */
.document-inspector-panel {
  grid-area: inspector;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: var(--inspector-width);
  background: var(--bg-inspector);
  border-left: 1px solid var(--border-color);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  z-index: 40;
  position: relative;
  min-width: 0;
  transition: transform 0.28s var(--ease-precision), width 0.28s var(--ease-precision);
}

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

.inspector-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.inspector-subtitle {
  font-size: 10.5px;
  color: var(--text-muted);
  display: block;
}

.inspector-content {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-gutter: stable;
  overscroll-behavior-y: contain;
}

.inspector-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}

.inspector-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 12px rgba(34, 112, 115, 0.12);
}

.inspector-card.is-active {
  border-color: var(--accent-primary);
  border-left-width: 4px;
  background: var(--accent-surface);
  box-shadow: 0 6px 16px rgba(34, 112, 115, 0.18);
}

.card-provenance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.provenance-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--accent-primary);
  color: #ffffff;
}

.act-title-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.act-device-text {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 8px;
}

.normative-quote {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-main);
  background: rgba(34, 112, 115, 0.05);
  border-left: 2px solid var(--accent-primary);
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 10px;
}

.btn-open-pdf {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-open-pdf:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* ==========================================================================
   14. SKELETON LOADERS COM EFEITO SHIMMER GPU-ACCELERATED
   ========================================================================== */
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.skeleton-line {
  height: 14px;
  border-radius: 4px;
  background-color: rgba(34, 112, 115, 0.08);
  position: relative;
  overflow: hidden;
}

html.dark .skeleton-line {
  background-color: rgba(66, 194, 204, 0.08);
}

.skeleton-line::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.35) 50%, transparent 100%);
  animation: shimmerWave 1.6s var(--ease-precision) infinite;
  will-change: transform;
}

html.dark .skeleton-line::after {
  background: linear-gradient(90deg, transparent 0%, rgba(66, 194, 204, 0.18) 50%, transparent 100%);
}

@keyframes shimmerWave {
  0% { transform: translateX(-100%); }
  60%, 100% { transform: translateX(100%); }
}

/* ==========================================================================
   15. MODAIS INSTITUCIONAIS & DIÁLOGOS DE AUDITORIA
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(7, 10, 16, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease-precision), visibility 0.22s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-window {
  width: min(720px, 100%);
  max-height: 85vh;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px -12px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.96) translateY(8px);
  transition: transform 0.24s var(--ease-precision);
}

.modal-overlay.active .modal-window {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  color: var(--text-main);
  background: var(--border-hairline);
}

.modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-main);
}

/* ==========================================================================
   16. RESPONSIVIDADE EM 4 FAIXAS (MOBILE, TABLET, DESKTOP, ULTRA-WIDE)
   ========================================================================== */

/* Telas Médias e Laptops (768px a 1199px): Dual-Pane com Drawers */
@media (max-width: 1199px) {
  .app-container {
    grid-template-columns: 1fr;
    grid-template-areas: "canvas";
  }

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translate3d(-100%, 0, 0);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7);
  }

  .sidebar.is-open {
    transform: translate3d(0, 0, 0);
  }

  .document-inspector-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    transform: translate3d(100%, 0, 0);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
  }

  .document-inspector-panel.is-open {
    transform: translate3d(0, 0, 0);
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(7, 10, 16, 0.65);
    backdrop-filter: blur(4px);
    z-index: 45;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  .sidebar-backdrop.active {
    opacity: 1;
    visibility: visible;
  }
}

/* Telas Pequenas e Smartphones (< 768px): Coluna Única com Bottom Sheets */
@media (max-width: 767px) {
  .hero-canvas-welcome {
    padding: 10px 0;
  }

  .hero-veredas-badge {
    width: 90px;
    height: 90px;
    border-radius: 26px;
  }

  .bento-grid-container {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .hero-institutional-logos {
    gap: 8px;
  }

  .hero-logo-box {
    padding: 5px 8px;
  }

  .inst-hero-logo {
    height: 18px;
  }

  .spatial-dock-container {
    bottom: 12px;
    width: calc(100% - 16px);
  }

  .dock-shortcuts-hint {
    display: none;
  }

  .floating-dock-capsule {
    padding: 10px 12px 8px 14px;
    border-radius: 18px;
  }

  .synthesis-reading-sheet {
    padding: 16px 12px 110px 12px;
    gap: 16px;
  }

  .message-body blockquote {
    margin-left: 20px;
  }

  .document-inspector-panel {
    width: 100vw;
    left: 0;
    right: 0;
    transform: translate3d(0, 100%, 0);
    border-left: none;
    border-top: 1px solid var(--border-color);
    border-radius: 20px 20px 0 0;
  }
}

/* ==========================================================================
   17. ACESSIBILIDADE, REDUÇÃO DE MOVIMENTO & VLIBRAS
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .veredas-bg-canvas {
    display: none !important;
  }
  .skeleton-line::after {
    display: none !important;
  }
}

[vw].enabled {
  z-index: 999999 !important;
}
[vw] [vw-access-button] {
  cursor: pointer !important;
  z-index: 999999 !important;
}
[vw] [vw-plugin-wrapper] {
  z-index: 999999 !important;
}
