:root {
  color-scheme: light;

  /* Paleta de Cores — Referência Visual Guia TdC (Modo Claro) */
  --bg-app: #F3F5F8;
  --bg-surface: #FFFFFF;
  --bg-surface-alt: #F8FAFC;
  --bg-surface-hover: #F1F5F9;
  --bg-sidebar: #FFFFFF;
  --bg-header: #FFFFFF;

  /* Cores Primárias (Laranja de Ação e Destaque) */
  --brand-orange: #F05A28;
  --brand-orange-hover: #D94618;
  --brand-orange-light: #FFF3EE;
  --brand-orange-border: #FDBA9C;

  /* Cores Institucionais e Módulos Complementares (Azul Clínico) */
  --brand-blue-dark: #152C4E;
  --brand-blue: #1E3A6D;
  --brand-blue-mid: #2563EB;
  --brand-blue-light: #EFF6FF;
  --brand-blue-border: #BFDBFE;

  /* Badges de Diretriz Vigente / Emerald */
  --badge-emerald-bg: #ECFDF5;
  --badge-emerald-text: #047857;
  --badge-emerald-border: #A7F3D0;

  /* Highlight de Busca Inteligente */
  --hl-bg: #FEF08A;
  --hl-text: #713F12;

  /* Cores Semânticas e Categorias */
  --cat-diretriz-bg: #EFF6FF;
  --cat-diretriz-text: #1D4ED8;
  --cat-artigo-bg: #FFF3EE;
  --cat-artigo-text: #C2410C;
  --cat-sindrome-bg: #F0FDF4;
  --cat-sindrome-text: #15803D;
  --cat-revisao-bg: #F5F3FF;
  --cat-revisao-text: #6D28D9;
  --cat-caso-bg: #FEF3C7;
  --cat-caso-text: #B45309;
  --cat-emtempo-bg: #ECFEFF;
  --cat-emtempo-text: #0E7490;
  --cat-comofazer-bg: #FDF2F8;
  --cat-comofazer-text: #BE185D;

  /* Estados Semânticos */
  --status-success: #16A34A;
  --status-success-bg: #DCFCE7;
  --status-warning: #D97706;
  --status-warning-bg: #FEF3C7;
  --status-danger: #DC2626;
  --status-danger-bg: #FEE2E2;

  /* Tipografia e Texto */
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --text-inverse: #FFFFFF;

  /* Bordas e Divisores */
  --border-subtle: #E2E8F0;
  --border-default: #CBD5E1;
  --border-focus: #F05A28;

  /* Sombras Discretas */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 24px -4px rgba(15, 23, 42, 0.12), 0 4px 8px -2px rgba(15, 23, 42, 0.06);

  /* Raios de Borda */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  /* Espaçamento */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Dimensões Estruturais */
  --header-height: 64px;
  --sidebar-width: 256px;
  --sidebar-collapsed-width: 72px;
  --right-col-width: 330px;
  --content-max-width: 1480px;

  /* Fontes */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-serif: 'Merriweather', Georgia, Cambria, serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transições */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 220ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   MODO ESCURO COMPLETO E CORRIGIDO (WCAG AA/AAA CONTRAST & ZERO CORES CLARAS VAZADAS)
   ========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;

  --bg-app: #0B1120;
  --bg-surface: #151F32;
  --bg-surface-alt: #0F172A;
  --bg-surface-hover: #1E293B;
  --bg-sidebar: #0F172A;
  --bg-header: #0F172A;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --text-light: #64748B;
  --text-inverse: #FFFFFF;

  /* Bordas visíveis em superfícies escuras (corrigido: antes era #1E293B igual ao surface) */
  --border-subtle: #26354D;
  --border-default: #334155;
  --border-focus: #FB923C;

  /* Cores de Marca adaptadas para Modo Escuro */
  --brand-orange: #FF6B35;
  --brand-orange-hover: #F05A28;
  --brand-orange-light: rgba(240, 90, 40, 0.16);
  --brand-orange-border: rgba(251, 146, 60, 0.38);

  --brand-blue-dark: #0F2342;
  --brand-blue: #1D4ED8;
  --brand-blue-mid: #60A5FA;
  --brand-blue-light: rgba(59, 130, 246, 0.16);
  --brand-blue-border: rgba(96, 165, 250, 0.35);

  /* Badges Emerald / Diretriz Vigente no Modo Escuro */
  --badge-emerald-bg: rgba(16, 185, 129, 0.16);
  --badge-emerald-text: #34D399;
  --badge-emerald-border: rgba(52, 211, 153, 0.38);

  /* Highlight de Busca Inteligente no Modo Escuro */
  --hl-bg: rgba(250, 204, 21, 0.28);
  --hl-text: #FEF08A;

  /* Categorias Semânticas adaptadas para Modo Escuro */
  --cat-diretriz-bg: rgba(59, 130, 246, 0.18);
  --cat-diretriz-text: #93C5FD;
  --cat-artigo-bg: rgba(249, 115, 22, 0.18);
  --cat-artigo-text: #FDBA74;
  --cat-sindrome-bg: rgba(34, 197, 94, 0.18);
  --cat-sindrome-text: #86EFAC;
  --cat-revisao-bg: rgba(168, 85, 247, 0.20);
  --cat-revisao-text: #D8B4FE;
  --cat-caso-bg: rgba(245, 158, 11, 0.18);
  --cat-caso-text: #FCD34D;
  --cat-emtempo-bg: rgba(6, 182, 212, 0.18);
  --cat-emtempo-text: #67E8F9;
  --cat-comofazer-bg: rgba(236, 72, 153, 0.18);
  --cat-comofazer-text: #F9A8D4;

  /* Estados Semânticos no Modo Escuro */
  --status-success: #4ADE80;
  --status-success-bg: rgba(34, 197, 94, 0.16);
  --status-warning: #FBBF24;
  --status-warning-bg: rgba(245, 158, 11, 0.16);
  --status-danger: #F87171;
  --status-danger-bg: rgba(239, 68, 68, 0.16);

  /* Sombras profundas para Modo Escuro */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 2px 5px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 14px 28px rgba(0, 0, 0, 0.65);
}

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

html {
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  background-color: var(--bg-app);
  color: var(--text-primary);
  overflow-x: hidden;
  overflow-y: auto;
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

a {
  color: inherit;
  text-decoration: none;
}

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

input::placeholder {
  color: var(--text-muted);
  opacity: 0.85;
}

select option {
  background-color: var(--bg-surface);
  color: var(--text-primary);
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

mark.search-hl {
  background-color: var(--hl-bg);
  color: var(--hl-text);
  padding: 0 3px;
  border-radius: 3px;
  font-weight: 700;
}

/* ==========================================================================
   CABEÇALHO SUPERIOR (5.1)
   ========================================================================== */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-xs);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--brand-orange);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-orange) 0%, #FF7A45 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.5px;
  box-shadow: 0 2px 6px rgba(240, 90, 40, 0.3);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--brand-blue-dark);
  line-height: 1.1;
}

[data-theme="dark"] .brand-title {
  color: #F8FAFC;
}

.brand-title span {
  color: var(--brand-orange);
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.header-center {
  flex: 1;
  max-width: 560px;
  margin: 0 var(--space-6);
  display: flex;
  align-items: center;
  position: relative;
}

.header-quick-search {
  width: 100%;
  position: relative;
  display: flex;
  align-items: center;
}

.header-quick-search input {
  width: 100%;
  height: 38px;
  padding: 0 72px 0 38px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 13.5px;
  transition: all var(--transition-fast);
}

.header-quick-search input:focus {
  background-color: var(--bg-surface);
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.16);
  outline: none;
}

.header-quick-search .search-icon {
  position: absolute;
  left: 13px;
  color: var(--text-muted);
  pointer-events: none;
}

.header-quick-search .kbd-shortcut {
  position: absolute;
  right: 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 1px 6px;
  pointer-events: none;
}

.header-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.header-Edition-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background-color: var(--brand-orange-light);
  color: var(--brand-orange);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--brand-orange-border);
  transition: transform var(--transition-fast), background-color var(--transition-fast);
}

.header-Edition-pill.pill-emerald {
  background-color: var(--badge-emerald-bg);
  color: var(--badge-emerald-text);
  border-color: var(--badge-emerald-border);
}

.header-Edition-pill.pill-blue {
  background-color: var(--brand-blue-light);
  color: var(--brand-blue-mid);
  border-color: var(--brand-blue-border);
}

.header-Edition-pill:hover {
  transform: translateY(-1px);
}

.header-icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-alt);
  transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

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

/* ==========================================================================
   LAYOUT GERAL — ROLAGEM UNIFICADA E FLUIDA DA PÁGINA INTEIRA
   ========================================================================== */
.app-shell {
  display: flex;
  padding-top: var(--header-height);
  min-height: 100vh;
}

.app-sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 90;
  transition: width var(--transition-normal), transform var(--transition-normal);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: var(--space-3) var(--space-2);
}

.app-sidebar::-webkit-scrollbar {
  width: 5px;
}

.app-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 4px;
}

body.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
}

body.sidebar-collapsed .app-sidebar .nav-label,
body.sidebar-collapsed .app-sidebar .nav-badge,
body.sidebar-collapsed .app-sidebar .nav-chevron,
body.sidebar-collapsed .app-sidebar .nav-submenu,
body.sidebar-collapsed .app-sidebar .sidebar-section-title,
body.sidebar-collapsed .app-sidebar .sidebar-footer-text {
  display: none !important;
}

body.sidebar-collapsed .app-sidebar .nav-item {
  justify-content: center;
  padding: 10px 0;
}

body.sidebar-collapsed .app-sidebar .nav-item-left {
  justify-content: center;
  gap: 0;
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-light);
  padding: 12px 12px 4px;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13.8px;
  font-weight: 500;
  transition: all var(--transition-fast);
  text-align: left;
}

.nav-item-left {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.nav-icon {
  width: 19px;
  height: 19px;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.nav-item:hover .nav-icon {
  color: var(--brand-orange);
}

.nav-item.active {
  background-color: var(--brand-orange-light);
  color: var(--brand-orange);
  font-weight: 700;
}

.nav-item.active .nav-icon {
  color: var(--brand-orange);
}

.nav-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.nav-item.active .nav-badge {
  background-color: var(--brand-orange);
  color: #FFFFFF;
  border-color: var(--brand-orange);
}

.nav-chevron {
  width: 15px;
  height: 15px;
  color: var(--text-light);
  transition: transform var(--transition-fast);
}

.nav-item.expanded .nav-chevron {
  transform: rotate(180deg);
}

.nav-submenu {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0 6px 26px;
  border-left: 2px solid var(--border-subtle);
  margin-left: 18px;
  margin-top: 2px;
  margin-bottom: 4px;
}

.nav-submenu.open {
  display: flex;
}

.nav-subitem {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 12.8px;
  color: var(--text-secondary);
  text-align: left;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-subitem:hover {
  background-color: var(--bg-surface-hover);
  color: var(--brand-orange);
}

.nav-subitem.active {
  color: var(--brand-orange);
  font-weight: 700;
  background-color: var(--brand-orange-light);
}

.sidebar-footer {
  margin-top: var(--space-4);
  padding: var(--space-3);
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.app-body {
  display: flex;
  flex: 1;
  width: 100%;
  min-width: 0;
}

.app-main,
.app-main-wrapper {
  flex: 1;
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  transition: margin-left var(--transition-normal), width var(--transition-normal);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

body.sidebar-collapsed .app-main,
body.sidebar-collapsed .app-main-wrapper {
  margin-left: var(--sidebar-collapsed-width);
  width: calc(100% - var(--sidebar-collapsed-width));
}

.dashboard-container {
  width: 100%;
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: var(--space-5) var(--space-6);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: var(--space-5);
  align-items: start;
}

.dashboard-container.full-width {
  grid-template-columns: minmax(0, 1fr);
}

/* ==========================================================================
   ÁREA CENTRAL DO DASHBOARD E BUSCA INTELIGENTE
   ========================================================================== */
.main-content-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
}

.hero-search-box {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-wrapper .search-main-icon {
  position: absolute;
  left: 14px;
  color: var(--brand-orange);
  width: 19px;
  height: 19px;
}

.search-main-input {
  width: 100%;
  height: 44px;
  padding: 0 110px 0 44px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-subtle);
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.search-main-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--brand-orange);
  box-shadow: 0 0 0 3px rgba(240, 90, 40, 0.16);
  outline: none;
}

.search-clear-btn {
  position: absolute;
  right: 10px;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  background-color: var(--bg-surface-hover);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
}

.search-clear-btn:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

/* Painel de Busca Inteligente e Sugestões de Palavras-Chave */
.smart-keywords-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--text-muted);
}

.smart-kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.smart-kw-chip:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  background-color: var(--brand-orange-light);
}

.smart-search-results-box {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--brand-orange-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.smart-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.smart-result-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.smart-result-item:hover {
  border-color: var(--brand-orange);
  background-color: var(--bg-surface-hover);
  transform: translateX(2px);
}

.relevance-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10.5px;
  font-weight: 800;
  background-color: var(--badge-emerald-bg);
  color: var(--badge-emerald-text);
  border: 1px solid var(--badge-emerald-border);
  white-space: nowrap;
}

.specialty-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.specialty-pills-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  flex: 1;
}

.specialty-pills-scroll::-webkit-scrollbar {
  height: 3px;
}

.filter-pill {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-alt);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.filter-pill:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
  background-color: var(--bg-surface-hover);
}

.filter-pill.active {
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #FFFFFF;
}

.btn-view-all-specs {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-blue-light);
  color: var(--brand-blue-mid);
  border: 1px solid var(--brand-blue-border);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.secondary-filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-muted);
}

.filter-group-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-select {
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
}

/* ==========================================================================
   VISUALIZAÇÃO COMPACTA DE PASTAS E SUBPASTAS (ABA ATUALIZAÇÕES)
   ========================================================================== */
.updates-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.updates-kpi-card {
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.updates-kpi-num {
  font-size: 19px;
  font-weight: 800;
  color: var(--brand-orange);
  line-height: 1.1;
}

.updates-kpi-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.25;
}

/* Acordeão de Pasta Principal (Especialidade ou Ano) */
.folder-accordion {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-orange);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.folder-accordion[open] {
  box-shadow: var(--shadow-sm);
}

.folder-accordion-summary {
  list-style: none;
  padding: 11px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
  background-color: var(--bg-surface);
  transition: background-color var(--transition-fast);
}

.folder-accordion-summary::-webkit-details-marker {
  display: none;
}

.folder-accordion-summary:hover {
  background-color: var(--bg-surface-hover);
}

.folder-accordion[open] > .folder-accordion-summary {
  background-color: var(--bg-surface-alt);
  border-bottom: 1px solid var(--border-subtle);
}

.folder-summary-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.folder-icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-color: var(--brand-orange-light);
  border: 1px solid var(--brand-orange-border);
  color: var(--brand-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

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

.folder-code-tag {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  padding: 2px 7px;
  border-radius: 4px;
}

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

.folder-body-compact {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Subpasta de Tópico Clínico */
.subfolder-block {
  border-left: 2px solid var(--border-default);
  padding-left: 12px;
  margin-left: 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.subfolder-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
}

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

.subfolder-path {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

/* Linha Compacta de Guideline (Ultra-escaneável) */
.guideline-compact-row {
  background-color: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  transition: border-color var(--transition-fast), background-color var(--transition-fast);
}

.guideline-compact-row:hover {
  border-color: var(--border-default);
  background-color: var(--bg-surface-hover);
}

.guideline-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.guideline-row-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 240px;
  flex-wrap: wrap;
}

.year-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  flex-shrink: 0;
}

.year-2026 { background: var(--badge-emerald-bg); color: var(--badge-emerald-text); border: 1px solid var(--badge-emerald-border); }
.year-2025 { background: var(--cat-diretriz-bg); color: var(--cat-diretriz-text); }
.year-2024 { background: var(--cat-revisao-bg); color: var(--cat-revisao-text); }
.year-2023 { background: var(--cat-caso-bg); color: var(--cat-caso-text); }
.year-2022 { background: var(--cat-emtempo-bg); color: var(--cat-emtempo-text); }

.guideline-row-title {
  font-size: 13.8px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1.3;
}

.guideline-row-title:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

.guideline-row-society {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

.guideline-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.btn-compact-action {
  padding: 4px 9px;
  border-radius: var(--radius-xs);
  font-size: 11.5px;
  font-weight: 700;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.btn-compact-action:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.btn-compact-action.primary {
  background-color: var(--brand-orange);
  border-color: var(--brand-orange);
  color: #FFFFFF;
}

.btn-compact-action.primary:hover {
  background-color: var(--brand-orange-hover);
  color: #FFFFFF;
}

.guideline-row-drawer {
  display: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-subtle);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.guideline-row-drawer.open {
  display: block;
}

.superseded-compact-box {
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 4px;
  background-color: var(--brand-orange-light);
  border-left: 3px solid var(--brand-orange);
  font-size: 11.8px;
  color: var(--text-secondary);
}

/* Visualização em Grade de Pastas (Explorador de Arquivos) */
.folder-explorer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.folder-grid-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.folder-grid-card:hover,
.folder-grid-card.active {
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.folder-grid-card.active {
  background-color: var(--brand-orange-light);
}

/* ==========================================================================
   CARTÕES DO DASHBOARD E DEMAIS VISUALIZAÇÕES
   ========================================================================== */
.featured-topic-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--brand-orange);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast);
}

.featured-topic-card:hover {
  box-shadow: var(--shadow-md);
}

.featured-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.card-meta-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.badge-category {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 700;
}

.badge-diretrizes { background: var(--cat-diretriz-bg); color: var(--cat-diretriz-text); }
.badge-artigo { background: var(--cat-artigo-bg); color: var(--cat-artigo-text); }
.badge-sindrome { background: var(--cat-sindrome-bg); color: var(--cat-sindrome-text); }
.badge-revisao { background: var(--cat-revisao-bg); color: var(--cat-revisao-text); }
.badge-caso { background: var(--cat-caso-bg); color: var(--cat-caso-text); }
.badge-emtempo { background: var(--cat-emtempo-bg); color: var(--cat-emtempo-text); }
.badge-comofazer { background: var(--cat-comofazer-bg); color: var(--cat-comofazer-text); }

.badge-edition-tag {
  background-color: var(--brand-blue-dark);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.card-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.featured-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 6px;
  cursor: pointer;
}

.featured-title:hover {
  color: var(--brand-orange);
}

.featured-summary {
  font-size: 13.8px;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
  line-height: 1.55;
}

.topic-bullets-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 5px 14px;
  margin-bottom: var(--space-4);
  padding: 10px 14px;
  background-color: var(--bg-surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.topic-bullets-list li {
  font-size: 12.8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.topic-bullets-list li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--brand-orange);
  flex-shrink: 0;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

.card-reading-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.read-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  background-color: var(--bg-surface-alt);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

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

.btn-primary-orange {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-orange);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color var(--transition-fast);
}

.btn-primary-orange:hover {
  background-color: var(--brand-orange-hover);
}

.btn-secondary-outline {
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.btn-secondary-outline:hover {
  border-color: var(--brand-orange);
  color: var(--brand-orange);
}

.section-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

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

.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.topic-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.topic-card-top {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.topic-card-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  cursor: pointer;
}

.topic-card-title:hover {
  color: var(--brand-orange);
}

.topic-card-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.48;
  margin-bottom: 4px;
}

.topic-card-subtopics {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: var(--space-3);
}

.topic-card-subtopics li {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}

.topic-card-subtopics li::before {
  content: "•";
  color: var(--brand-orange);
  font-weight: bold;
}

/* ==========================================================================
   COLUNA COMPLEMENTAR DIREITA
   ========================================================================== */
.right-sidebar-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  position: static;
}

.widget-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
}

.widget-questoes {
  background: linear-gradient(145deg, #0F2342 0%, #1E3A6D 100%);
  color: #FFFFFF;
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.widget-questoes .widget-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.14);
  color: #FDBA9C;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.widget-questoes h3 {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #FFFFFF;
}

.widget-questoes p {
  font-size: 12.5px;
  color: #CBD5E1;
  line-height: 1.45;
  margin-bottom: var(--space-3);
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

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

.widget-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-orange);
}

.widget-link:hover {
  text-decoration: underline;
}

.destaques-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.destaque-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
}

.destaque-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.destaque-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.destaque-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  transition: color var(--transition-fast);
}

.destaque-item:hover .destaque-title {
  color: var(--brand-orange);
}

.widget-collection {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--brand-orange-light) 100%);
  border: 1px solid var(--brand-orange-border);
}

/* ==========================================================================
   PÁGINA DE DETALHES DO TÓPICO / EDIÇÃO
   ========================================================================== */
.article-detail-layout {
  display: grid;
  grid-template-columns: 245px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.article-toc-sidebar {
  position: sticky;
  top: calc(var(--header-height) + var(--space-4));
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow-y: auto;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toc-heading {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.toc-link {
  display: block;
  padding: 6px 9px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.toc-link:hover, .toc-link.active {
  background-color: var(--brand-orange-light);
  color: var(--brand-orange);
  font-weight: 700;
}

.article-main-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-6) var(--space-8);
  box-shadow: var(--shadow-sm);
}

.audio-player-bar {
  background: linear-gradient(90deg, #0F2342 0%, #1E3A6D 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  border: 1px solid rgba(96, 165, 250, 0.25);
}

.audio-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.audio-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--brand-orange);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(240, 90, 40, 0.45);
}

.audio-progress-wrap {
  flex: 1;
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.audio-progress-track {
  width: 100%;
  height: 6px;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  overflow: hidden;
  cursor: pointer;
}

.audio-progress-fill {
  height: 100%;
  background-color: var(--brand-orange);
  width: 25%;
  transition: width 0.25s ease;
}

.audio-speed-btn {
  padding: 5px 10px;
  border-radius: var(--radius-xs);
  background-color: rgba(255, 255, 255, 0.16);
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}



.audio-minutagem-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.minutagem-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background-color: rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.minutagem-chip:hover {
  background-color: var(--brand-orange);
  color: #FFFFFF;
}

.article-section {
  margin-bottom: var(--space-6);
  scroll-margin-top: 84px;
}

.article-section h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  padding-bottom: 6px;
  border-bottom: 2px solid var(--brand-orange-light);
}

.article-section p {
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-secondary);
  margin-bottom: var(--space-3);
}

.clinical-callout {
  background-color: var(--brand-orange-light);
  border-left: 4px solid var(--brand-orange);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: var(--space-3) 0;
  font-size: 14px;
  color: var(--text-primary);
}

.clinical-table-wrapper {
  overflow-x: auto;
  margin: var(--space-4) 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.clinical-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.clinical-table th {
  background-color: var(--brand-blue-dark);
  color: #FFFFFF;
  text-align: left;
  padding: 9px 13px;
  font-weight: 700;
}

.clinical-table td {
  padding: 9px 13px;
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  vertical-align: top;
}

.clinical-table tr:nth-child(even) td {
  background-color: var(--bg-surface-alt);
}

/* ==========================================================================
   BOTÕES EXPANSÍVEIS / MINIMIZÁVEIS DE REFERÊNCIAS
   ========================================================================== */
.ref-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-accordion {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.ref-accordion[open] {
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-xs);
}

.ref-accordion-summary {
  list-style: none;
  padding: 13px 18px;
  background-color: var(--bg-surface-alt);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 14.5px;
  color: var(--text-primary);
  user-select: none;
  transition: background-color var(--transition-fast);
}

.ref-accordion-summary::-webkit-details-marker {
  display: none;
}

.ref-accordion-summary:hover {
  background-color: var(--bg-surface-hover);
}

.ref-accordion[open] .ref-accordion-summary {
  background-color: var(--brand-orange-light);
  color: var(--brand-orange);
  border-bottom: 1px solid var(--brand-orange-border);
}

.ref-accordion-body {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Modais */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(2, 6, 23, 0.7);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 720px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: var(--space-6);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

/* ==========================================================================
   RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 1180px) {
  .dashboard-container {
    grid-template-columns: minmax(0, 1fr);
  }
  .right-sidebar-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .article-detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .article-toc-sidebar {
    position: static;
    max-height: none;
  }
}

@media (max-width: 860px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: 265px !important;
    box-shadow: var(--shadow-lg);
  }
  body.mobile-nav-open .app-sidebar {
    transform: translateX(0);
  }
  .app-main,
  body.sidebar-collapsed .app-main,
  .app-main-wrapper,
  body.sidebar-collapsed .app-main-wrapper {
    margin-left: 0;
    width: 100%;
  }
  .topics-grid,
  .right-sidebar-col {
    grid-template-columns: minmax(0, 1fr);
  }
  .header-center {
    display: none;
  }
  .dashboard-container {
    padding: var(--space-4);
  }
  .article-main-card {
    padding: var(--space-4);
  }
}

/* ==========================================================================
   ENHANCED PODCAST, CLINICAL MEDIA & LIGHTBOX STYLES (v6)
   ========================================================================== */

/* Podcast View */
.podcast-header-card {
  background: linear-gradient(135deg, #0F2342 0%, #1E3A6D 50%, #2A4365 100%);
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  border: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow: 0 4px 20px rgba(15, 35, 66, 0.15);
}

.podcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-4);
}

.podcast-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-3);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
}

.podcast-card:hover {
  transform: translateY(-2px);
  border-color: var(--brand-orange);
  box-shadow: var(--shadow-md);
}

.podcast-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.podcast-play-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-orange) 0%, #E04D1A 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  cursor: pointer;
  border: none;
  box-shadow: 0 4px 12px rgba(240, 90, 40, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.podcast-play-circle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 16px rgba(240, 90, 40, 0.55);
}

.podcast-topics-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: var(--space-2) 0;
}

.podcast-topic-pill {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-surface-alt);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  gap: 6px;
}

.podcast-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-subtle);
}

/* Topic Tabs: Integral vs Synthesis */
.topic-tabs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--border-subtle);
  margin-bottom: var(--space-5);
  padding-bottom: 2px;
}

.topic-tab-btn {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 700;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -4px;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.topic-tab-btn.active {
  color: var(--brand-orange);
  border-bottom-color: var(--brand-orange);
}

/* 100% Faithful Article Typography */
.article-integral-wrapper {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--text-primary);
}

.article-integral-wrapper h1,
.article-integral-wrapper h2,
.article-integral-wrapper h3 {
  color: var(--text-primary);
  font-weight: 800;
  margin-top: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}

.article-integral-wrapper h2 {
  font-size: 20px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
}

.article-integral-wrapper h3 {
  font-size: 17px;
}

.article-integral-wrapper p {
  margin-bottom: 1.2em;
  color: var(--text-secondary);
}

.article-integral-wrapper ul,
.article-integral-wrapper ol {
  margin: 1em 0 1.4em 1.4em;
  color: var(--text-secondary);
}

.article-integral-wrapper li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

.article-integral-wrapper a {
  color: var(--brand-blue);
  text-decoration: underline;
}

.article-integral-wrapper strong {
  color: var(--text-primary);
}

/* Clinical Media (Tables, Figures, Flowcharts) */
.clinical-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin: var(--space-4) 0 var(--space-6) 0;
}

.clinical-media-card {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
}

.clinical-media-card:hover {
  border-color: var(--brand-blue);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.media-card-header {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 11.5px;
}

@keyframes mediaShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.media-image-container {
  position: relative;
  width: 100%;
  min-height: 220px;
  background: linear-gradient(90deg, var(--bg-surface-alt) 25%, var(--border-subtle) 50%, var(--bg-surface-alt) 75%);
  background-size: 200% 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
}

.media-image-container img {
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.25s ease;
}

.toc-quick-summary-box {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}


.clinical-media-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.25s ease;
}

.media-image-container:hover .clinical-media-img {
  transform: scale(1.04);
}

.media-zoom-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.75);
  color: #FFFFFF;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
  pointer-events: none;
}

.media-caption {
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  flex: 1;
}

/* Lightbox Modal */
.lightbox-modal-content {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  max-width: 1150px;
  width: 95vw;
  max-height: 94vh;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-image-viewport {
  background: #0B1120;
  border-radius: var(--radius-sm);
  padding: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  max-height: 72vh;
  overflow: auto;
}

.lightbox-image-viewport img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
}


/* ==========================================================================
   IN-LINE CLINICAL MEDIA (TABELAS, FLUXOGRAMAS E FIGURAS)
   ========================================================================== */
.inline-clinical-media {
  margin: 28px 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  background-color: var(--bg-surface-alt, #F8FAFC);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.inline-media-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background-color: rgba(15, 35, 66, 0.04);
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 8px;
}

.media-type-badge {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 4px;
}

.badge-tabela .media-type-badge {
  background-color: #E0E7FF;
  color: #3730A3;
}

.badge-fluxograma .media-type-badge {
  background-color: #FEF3C7;
  color: #92400E;
}

.badge-figura .media-type-badge {
  background-color: #ECFDF5;
  color: #065F46;
}

.btn-zoom-media {
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 12px;
  background-color: var(--bg-card, #FFFFFF);
  border: 1px solid var(--border-subtle, #E2E8F0);
  border-radius: 4px;
  color: var(--text-primary, #0F172A);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-zoom-media:hover {
  background-color: var(--brand-orange, #F05A28);
  color: #FFFFFF;
  border-color: var(--brand-orange, #F05A28);
}

.inline-media-img-container {
  padding: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #FFFFFF;
  cursor: zoom-in;
  overflow: hidden;
}

.clinical-inline-img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  transition: transform 0.25s ease;
}

.inline-media-img-container:hover .clinical-inline-img {
  transform: scale(1.015);
}

.inline-media-caption {
  padding: 12px 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary, #475569);
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-alt, #F8FAFC);
}

.inline-media-caption strong {
  color: var(--text-primary, #0F172A);
}

.edition-integral-topic {
  scroll-margin-top: 24px;
}

.edition-integral-topic h2 {
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.edition-integral-topic p {
  margin-bottom: 16px;
  line-height: 1.75;
}

.edition-integral-topic h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

.edition-integral-topic ul, .edition-integral-topic ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.edition-integral-topic li {
  margin-bottom: 6px;
  line-height: 1.65;
}

/* ==========================================================================
   EDITORIAL TYPOGRAPHY & BRAND STYLING (GUIA TDC OFFICIAL ORANGE HIGHLIGHTS)
   ========================================================================== */
.article-integral-wrapper,
.edition-integral-topic {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.82;
  color: var(--text-secondary);
}

.article-integral-wrapper h2,
.edition-integral-topic h2 {
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.015em;
  line-height: 1.35;
  margin-top: 2.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-left: 4px solid var(--brand-orange);
  padding-left: 12px;
  color: var(--text-primary);
}

.article-integral-wrapper h3,
.edition-integral-topic h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 1.6rem;
  margin-bottom: 0.7rem;
  color: var(--text-primary);
}

.article-integral-wrapper h4,
.edition-integral-topic h4 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.article-integral-wrapper p,
.edition-integral-topic p {
  margin-bottom: 1.25rem;
  font-size: 16px;
  line-height: 1.82;
  color: var(--text-secondary);
}

.article-integral-wrapper strong,
.edition-integral-topic strong {
  font-weight: 700;
  color: var(--text-primary);
}

.article-integral-wrapper ul,
.article-integral-wrapper ol,
.edition-integral-topic ul,
.edition-integral-topic ol {
  margin-bottom: 1.3rem;
  padding-left: 1.6rem;
}

.article-integral-wrapper li,
.edition-integral-topic li {
  margin-bottom: 0.55rem;
  line-height: 1.75;
  color: var(--text-secondary);
}

.article-integral-wrapper li::marker,
.edition-integral-topic li::marker {
  color: var(--brand-orange);
  font-weight: bold;
}

/* Clinical Callouts (Official TdC Orange Styling) */
.clinical-callout {
  margin: 1.8rem 0;
  padding: 16px 20px;
  background-color: rgba(240, 90, 40, 0.05);
  border-left: 4px solid var(--brand-orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(240, 90, 40, 0.05);
}

[data-theme="dark"] .clinical-callout {
  background-color: rgba(240, 90, 40, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.callout-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-orange);
  margin-bottom: 8px;
}

/* ==========================================================================
   IN-LINE CLINICAL LINKS & INDEXED REFERENCES (PUBMED, DOI, INTERNAL)
   ========================================================================== */
.clinical-refs-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 3px;
  vertical-align: baseline;
}

.clinical-inline-ref {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 650;
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  text-decoration: none;
  line-height: 1.5;
  vertical-align: middle;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.pubmed-ref {
  background-color: var(--brand-blue-light, #EFF6FF);
  color: var(--brand-blue-mid, #2563EB);
  border: 1px solid var(--brand-blue-border, #BFDBFE);
}

.pubmed-ref:hover {
  background-color: #DBEAFE;
  color: #1E40AF;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(37, 99, 235, 0.18);
}

[data-theme="dark"] .pubmed-ref {
  background-color: rgba(37, 99, 235, 0.16);
  color: #93C5FD;
  border-color: rgba(147, 197, 253, 0.3);
}

[data-theme="dark"] .pubmed-ref:hover {
  background-color: rgba(37, 99, 235, 0.28);
  color: #BFDBFE;
}

.doi-ref {
  background-color: var(--brand-orange-light, #FFF3EE);
  color: var(--brand-orange, #F05A28);
  border: 1px solid var(--brand-orange-border, #FDBA9C);
}

.doi-ref:hover {
  background-color: var(--brand-orange);
  color: #FFFFFF;
  border-color: var(--brand-orange);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(240, 90, 40, 0.22);
}

[data-theme="dark"] .doi-ref {
  background-color: rgba(240, 90, 40, 0.15);
  color: #FF8A65;
  border-color: rgba(240, 90, 40, 0.35);
}

[data-theme="dark"] .doi-ref:hover {
  background-color: var(--brand-orange);
  color: #FFFFFF;
}

/* Table Jump Links */
.clinical-table-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-xs);
  background-color: rgba(240, 90, 40, 0.08);
  color: var(--brand-orange);
  border: 1px solid rgba(240, 90, 40, 0.3);
  text-decoration: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  vertical-align: middle;
}

.clinical-table-jump-link:hover {
  background-color: var(--brand-orange);
  color: #FFFFFF;
  border-color: var(--brand-orange);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(240, 90, 40, 0.25);
}

.clinical-table-jump-link .jump-arrow {
  font-size: 11px;
  font-weight: 800;
}

/* Internal & Glossary Links */
.clinical-internal-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 650;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  background-color: rgba(30, 58, 109, 0.07);
  color: var(--brand-blue, #1E3A6D);
  border: 1px solid rgba(30, 58, 109, 0.2);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.clinical-internal-link:hover {
  background-color: var(--brand-blue);
  color: #FFFFFF;
}

[data-theme="dark"] .clinical-internal-link {
  background-color: rgba(147, 197, 253, 0.12);
  color: #93C5FD;
  border-color: rgba(147, 197, 253, 0.3);
}

.clinical-glossary-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brand-orange);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.clinical-glossary-link:hover {
  color: var(--brand-orange-hover);
  text-decoration-style: solid;
}

/* Table Pulse Flash Animation */
@keyframes tableHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 90, 40, 0.85);
    border-color: var(--brand-orange);
  }
  50% {
    box-shadow: 0 0 0 12px rgba(240, 90, 40, 0);
    border-color: var(--brand-orange);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(240, 90, 40, 0);
  }
}

.media-highlight-flash {
  animation: tableHighlightPulse 2s cubic-bezier(0, 0, 0.2, 1);
  border-color: var(--brand-orange) !important;
}

/* References Section at Bottom of Edition */
.edition-references-section {
  margin-top: 48px;
  padding-top: 36px;
  border-top: 2px dashed var(--border-default);
}

.edition-references-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.edition-references-header h2 {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  border-left: none !important;
  padding-left: 0 !important;
}

.ref-accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
  background-color: var(--bg-surface);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.ref-accordion[open] {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-default);
}

.ref-accordion-summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  background-color: var(--bg-surface-alt);
  color: var(--text-primary);
  transition: background-color var(--transition-fast);
}

.ref-accordion-summary:hover {
  background-color: var(--bg-surface-hover);
}

.ref-accordion-summary::-webkit-details-marker {
  display: none;
}

.ref-accordion-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ref-accordion-icon {
  font-size: 16px;
  transition: transform 0.2s ease;
}

.ref-accordion[open] .ref-accordion-icon {
  transform: rotate(90deg);
}

.ref-accordion-content {
  padding: 14px 18px;
  border-top: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
}

.ref-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.ref-item-row:last-child {
  border-bottom: none;
}

.ref-item-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  line-height: 1.4;
}

.ref-item-title:hover {
  color: var(--brand-orange);
  text-decoration: underline;
}

.ref-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}


/* ==========================================================================
   ESTILOS DE IMPRESSÃO E EXPORTAÇÃO EM PDF CLÍNICO PROFISSIONAL
   ========================================================================== */
@media print {
  /* 1. Ocultar todos os controles, navegação, áudio e barras laterais */
  .app-header,
  .app-sidebar,
  .article-toc-sidebar,
  .audio-player-bar,
  .btn-primary-orange,
  .btn-secondary-outline,
  .header-Edition-pill,
  .header-quick-search,
  .header-right,
  .sidebar-toggle-btn,
  .media-zoom-hint,
  .modal-backdrop,
  .specialty-pills-scroll,
  .updates-kpi-strip,
  .updates-toolbar,
  #back-to-feed-btn,
  #back-to-updates-btn,
  #download-topic-pdf-btn,
  #download-edition-pdf-btn,
  #btn-expand-all-refs,
  #btn-collapse-all-refs,
  .search-main-input,
  input[type="search"] {
    display: none !important;
  }

  /* 2. Reset de cor e fundo para impressão limpa em alta legibilidade */
  html, body {
    background: #FFFFFF !important;
    color: #111827 !important;
    font-size: 11pt !important;
    line-height: 1.6 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif !important;
  }

  .app-shell,
  .app-body,
  .app-main,
  .dashboard-container,
  .article-detail-layout,
  .article-main-card {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  /* 3. Cabeçalho de publicação em PDF */
  .article-main-card h1 {
    font-size: 20pt !important;
    color: #0F172A !important;
    margin-bottom: 8pt !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .card-meta-badges {
    margin-bottom: 8pt !important;
    display: flex !important;
    gap: 6pt !important;
    flex-wrap: wrap !important;
  }

  .badge-edition-tag, .badge-category, .relevance-pill {
    border: 1pt solid #94A3B8 !important;
    color: #0F172A !important;
    background: #F1F5F9 !important;
    font-size: 9pt !important;
    padding: 2pt 6pt !important;
  }

  /* 4. Tipografia do Texto Integral */
  .article-integral-wrapper {
    font-size: 11pt !important;
    line-height: 1.65 !important;
    color: #1F2937 !important;
  }

  .article-integral-wrapper h2 {
    font-size: 15pt !important;
    font-weight: 800 !important;
    color: #0F172A !important;
    margin-top: 20pt !important;
    margin-bottom: 8pt !important;
    border-bottom: 1.5pt solid #CBD5E1 !important;
    padding-bottom: 4pt !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .article-integral-wrapper h3 {
    font-size: 12.5pt !important;
    font-weight: 700 !important;
    color: #1E293B !important;
    margin-top: 14pt !important;
    margin-bottom: 6pt !important;
    page-break-after: avoid !important;
    break-after: avoid !important;
  }

  .article-integral-wrapper p {
    margin-bottom: 8pt !important;
    text-align: justify !important;
    orphans: 3 !important;
    widows: 3 !important;
  }

  .article-integral-wrapper ul,
  .article-integral-wrapper ol {
    margin: 8pt 0 10pt 18pt !important;
  }

  .clinical-callout {
    background: #FFF7ED !important;
    border-left: 3pt solid #EA580C !important;
    color: #9A3412 !important;
    padding: 8pt 12pt !important;
    margin: 10pt 0 !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* 5. Mídias Clínicas, Tabelas e Figuras */
  .clinical-media-grid {
    display: block !important;
    margin-top: 14pt !important;
  }

  .clinical-media-card {
    display: block !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    border: 1pt solid #CBD5E1 !important;
    border-radius: 4pt !important;
    margin-bottom: 18pt !important;
    background: #FFFFFF !important;
    box-shadow: none !important;
  }

  .media-card-header {
    background: #F8FAFC !important;
    border-bottom: 1pt solid #E2E8F0 !important;
    padding: 6pt 10pt !important;
    font-size: 9.5pt !important;
  }

  .media-image-container {
    background: #FFFFFF !important;
    min-height: auto !important;
    padding: 8pt !important;
  }

  .clinical-media-img {
    max-height: 480pt !important;
    max-width: 100% !important;
    width: auto !important;
    display: block !important;
    margin: 0 auto !important;
  }

  .media-caption {
    font-size: 9.5pt !important;
    color: #334155 !important;
    padding: 6pt 10pt !important;
    background: #F8FAFC !important;
    border-top: 1pt solid #E2E8F0 !important;
    line-height: 1.4 !important;
  }

  /* 6. Referências Bibliográficas */
  .references-container {
    margin-top: 18pt !important;
    page-break-inside: auto !important;
  }

  .ref-accordion {
    display: block !important;
    border: 1pt solid #E2E8F0 !important;
    margin-bottom: 12pt !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .ref-accordion-summary {
    background: #F1F5F9 !important;
    padding: 6pt 10pt !important;
    font-size: 10.5pt !important;
    font-weight: 700 !important;
    border-bottom: 1pt solid #CBD5E1 !important;
  }

  .ref-accordion-body {
    padding: 8pt 10pt !important;
    display: block !important;
  }

  /* 7. Configurações de Página A4 */
  @page {
    margin: 1.5cm;
    size: A4 portrait;
  }
}
/* ==========================================================================
   PERFORMANCE & FLUIDITY OPTIMIZATIONS
   ========================================================================== */
html {
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Skip layout calculation of offscreen elements for buttery-smooth 60fps scrolling */
.guideline-compact-row,
.podcast-card,
.clinical-media-card,
.folder-grid-card,
.featured-topic-card,
.edition-integral-topic,
.destaque-item {
  content-visibility: auto;
  contain-intrinsic-size: auto 120px;
}

/* GPU-accelerated rendering for fast scrolling */
.article-main-card,
.modal-card,
.edition-card-header,
.podcast-header-card {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Ultra-smooth transitions */
.btn-nav,
.nav-item,
.guideline-compact-row,
.podcast-card,
.folder-grid-card {
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* App Loading Screen */
#app-loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: var(--bg-app, #F3F5F8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

#app-loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid rgba(240, 90, 40, 0.2);
  border-top-color: #F05A28;
  border-radius: 50%;
  animation: loader-spin 0.8s linear infinite;
}

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

.loader-text {
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #1E3A6D;
  letter-spacing: -0.01em;
}
