/* ==========================================================
   ExtratorLiturgia — Leitor Mobile IP Parque Ipê (CSS)
   Design System Mobile-First, Paleta IPB & Ergonomia Touch
   ========================================================== */

:root {
  --ipb-verde-principal: #005930;
  --ipb-verde-escuro: #004022;
  --ipb-verde-claro: #008749;
  --ipb-verde-suave: #4a7c59;
  --ipb-fundo-creme: #faf8f5;
  --ipb-fundo: #ffffff;
  --ipb-cartao-bg: #ffffff;
  --ipb-texto: #1a202c;
  --ipb-texto-muted: #5a6a60;
  --ipb-borda: rgba(0, 89, 48, 0.12);
  --ipb-sombra: 0 4px 15px rgba(0, 0, 0, 0.05);
  --ipb-sombra-hover: 0 6px 20px rgba(0, 89, 48, 0.10);
  --cv-text: #0f172a;
  --cv-text-muted: #64748b;
  --cv-border: rgba(0, 89, 48, 0.16);
  --leitor-fonte-base: 16px;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
  --cv-alvo-toque: 44px;
  --cv-foco: #005930;
  --z-conteudo: 1;
  --z-sticky: 100;
  --z-cabecalho: 200;
  --z-dock: 300;
  --z-banner: 900;
  --z-sheet: 1000;
  --z-modal: 1100;
  --z-popover: 1200;
  --z-toast: 1300;
}

[data-tema="claro"] {
  --ipb-verde-principal: #005930;
  --ipb-verde-escuro: #004022;
  --ipb-verde-claro: #008749;
  --ipb-verde-suave: #4a7c59;
  --ipb-fundo-creme: #faf8f5;
  --ipb-fundo: #ffffff;
  --ipb-cartao-bg: #ffffff;
  --ipb-texto: #1a202c;
  --ipb-texto-muted: #5a6a60;
  --ipb-borda: rgba(0, 89, 48, 0.12);
  --ipb-sombra: 0 4px 15px rgba(0, 0, 0, 0.05);
  --ipb-sombra-hover: 0 6px 20px rgba(0, 89, 48, 0.10);
  --cv-text: #0f172a;
  --cv-text-muted: #64748b;
  --cv-border: rgba(0, 89, 48, 0.16);
  --cv-foco: #005930;
}

[data-tema="escuro"] {
  --ipb-verde-principal: #007a42;
  --ipb-verde-escuro: #005930;
  --ipb-verde-claro: #10b981;
  --ipb-fundo-creme: #111513;
  --ipb-fundo: #1c221e;
  --ipb-cartao-bg: #1c221e;
  --ipb-texto: #f1f5f3;
  --ipb-texto-muted: #94a39b;
  --ipb-borda: rgba(255, 255, 255, 0.08);
  --ipb-sombra: 0 4px 18px rgba(0, 0, 0, 0.40);
  --ipb-sombra-hover: 0 6px 22px rgba(0, 0, 0, 0.60);
  --cv-text: #f8fafc;
  --cv-text-muted: #94a3b8;
  --cv-border: rgba(255, 255, 255, 0.14);
  --cv-foco: #34d399;
}

/* Oculta sumariamente botões e banners de instalação de PWA se já estiver rodando instalado */
@media (display-mode: standalone), (display-mode: window-controls-overlay), (display-mode: minimal-ui), (display-mode: fullscreen) {
  #cv-btn-instalar-pwa-header,
  #cv-banner-instalar-pwa,
  .cv-pwa-only-browser {
    display: none !important;
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: var(--leitor-fonte-base, 16px);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-x: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  background-color: var(--ipb-fundo-creme);
  color: var(--ipb-texto);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: calc(80px + var(--safe-bottom));
  overflow-x: hidden;
  overscroll-behavior-x: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* ── SPA Views ─────────────────────────────────────────── */
.cv-view {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  overscroll-behavior-x: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cv-view.active {
  display: block;
  opacity: 1;
  transform: none;
}

/* Blindagem contra marcadores de paginação da folha A4 no site */
.a4-artigo-continua {
  display: none !important;
}

/* ── Cabeçalho Principal (Hub) ─────────────────────────── */
.cv-mobile-header {
  position: relative;
  background: linear-gradient(180deg, var(--ipb-verde-profundo, #003d1e) 0%, var(--ipb-verde-escuro, #004022) 100%);
  color: #ffffff;
  padding: 6px 8px 8px 8px;
  border-bottom-left-radius: 22px;
  border-bottom-right-radius: 22px;
  box-shadow: 0 6px 20px rgba(0, 40, 20, 0.28);
  text-align: center;
}

.cv-header-top-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  width: 100%;
}

.cv-brand-centered {
  position: relative;
  z-index: 1;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  gap: 2px;
  margin: 0;
  width: 100%;
  max-width: 100%;
  padding-top: 2px;
}

.cv-brand-identity-row,
.cv-header-welcome-tag,
.cv-welcome-pill {
  pointer-events: auto;
}

.cv-brand-identity-row {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: clamp(8px, 2.2vw, 12px);
  width: calc(100% - 145px);
  max-width: calc(100% - 145px);
  margin: 0;
  padding: 0 0 0 2px;
  box-sizing: border-box;
}

@media (min-width: 640px) {
  .cv-brand-centered {
    align-items: center;
    text-align: center;
    margin: 0 auto;
    max-width: 800px;
  }
  .cv-brand-identity-row {
    width: auto;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
  }
  .cv-header-titles {
    align-items: center;
    text-align: center;
  }
  .cv-header-church-name,
  .cv-header-church-sub {
    align-items: center;
    text-align: center;
  }
}

.cv-logo-badge {
  background: #ffffff;
  border-radius: 14px;
  padding: 3.5px;
  width: clamp(54px, 13vw, 68px);
  height: clamp(54px, 13vw, 68px);
  min-width: clamp(54px, 13vw, 68px);
  min-height: clamp(54px, 13vw, 68px);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  border: 1.5px solid rgba(255, 255, 255, 0.50);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: transform var(--transition-fast);
}

.cv-logo-badge:active {
  transform: scale(0.97);
}

.cv-header-logo {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.cv-header-titles {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}

.cv-header-church-name {
  font-family: var(--font-display);
  font-size: clamp(0.80rem, 2.5vw, 1.12rem);
  font-weight: 850;
  letter-spacing: 0.2px;
  line-height: 1.14;
  color: #ffffff;
  text-align: left;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  -webkit-font-smoothing: antialiased;
}

.cv-header-church-name span {
  display: block;
  white-space: nowrap;
}

.cv-header-church-sub {
  font-size: clamp(0.62rem, 1.9vw, 0.78rem);
  color: rgba(255, 255, 255, 0.94);
  margin-top: 2px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: left;
  line-height: 1.18;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 100%;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  -webkit-font-smoothing: antialiased;
}

.cv-header-church-sub span {
  display: block;
  white-space: nowrap;
}

.cv-btn-admin-gear {
  position: absolute;
  right: 0;
  top: 2px;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.15);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.cv-btn-admin-gear:hover, .cv-btn-admin-gear:active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: rotate(35deg);
}

.cv-date-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  margin-bottom: 12px;
  width: 100%;
}

.cv-btn-nav-edicao {
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.40);
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.cv-btn-nav-edicao:active {
  transform: scale(0.92);
  background: rgba(255, 255, 255, 0.38);
}

.cv-date-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cv-date-badge {
  background: rgba(255, 255, 255, 0.16);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

.cv-edicao-badge {
  background: #ffffff;
  color: var(--ipb-verde-escuro);
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.cv-header-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  width: 100%;
  margin-top: 6px;
}

.cv-header-action-btn {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.cv-header-action-btn:hover,
.cv-header-action-btn:active {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(0.96);
}

/* Linha Superior do Cabeçalho: Bloco de Ações no Canto Superior Direito */
.cv-header-top-bar {
  position: absolute !important;
  top: 6px;
  right: 8px;
  z-index: 500;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  pointer-events: auto;
}

.cv-header-actions-right-stack,
.cv-header-top-right-group {
  position: relative;
  z-index: 501;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  pointer-events: auto;
}

.cv-header-top-corner-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: auto;
}

.cv-btn-top-corner-action,
.cv-btn-boletins-right,
.cv-btn-painel-admin-top,
.cv-btn-importador-top,
#cv-btn-importador-top {
  position: relative;
  z-index: 502;
  pointer-events: auto !important;
  cursor: pointer !important;
}

@media (max-width: 380px) {
  .cv-header-top-corner-actions {
    gap: 3px;
  }
  .cv-btn-top-corner-action {
    width: 27px;
    height: 27px;
    min-width: 27px;
    min-height: 27px;
  }
  .cv-btn-boletins-right {
    font-size: 0.65rem;
    padding: 3px 7px;
  }
  .cv-btn-admin-unified,
  .cv-btn-painel-admin-top,
  .cv-btn-importador-top,
  #cv-btn-painel-admin-top,
  #cv-btn-importador-top {
    font-size: 0.64rem !important;
    padding: 0 6px !important;
    height: 25px !important;
    min-height: 25px !important;
    max-height: 25px !important;
  }
  .cv-brand-identity-row {
    width: calc(100% - 118px);
    gap: 6px;
  }
  .cv-logo-badge {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    border-radius: 9px;
    padding: 2px;
  }
  .cv-header-church-name {
    font-size: 0.68rem;
    line-height: 1.15;
  }
  .cv-header-church-sub {
    font-size: 0.52rem;
  }
}

.cv-header-fonte-pill {
  height: 30px !important;
  min-height: 30px !important;
  background: rgba(255, 255, 255, 0.16) !important;
  border: 1px solid rgba(255, 255, 255, 0.32) !important;
  border-radius: 999px !important;
  padding: 0 4px !important;
  gap: 1px !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.cv-header-fonte-pill .cv-btn-fonte-step {
  background: transparent !important;
  border: none !important;
  color: #ffffff !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  padding: 2px 5px !important;
  border-radius: 6px !important;
  width: auto !important;
  min-width: 20px !important;
  height: 22px !important;
  cursor: pointer !important;
  line-height: 1 !important;
  transition: background 0.15s ease !important;
}

.cv-header-fonte-pill .cv-btn-fonte-step:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

@media (max-width: 380px) {
  .cv-header-fonte-pill {
    height: 27px !important;
    min-height: 27px !important;
    padding: 0 2px !important;
  }
  .cv-header-fonte-pill .cv-btn-fonte-step {
    font-size: 0.68rem !important;
    padding: 1px 3px !important;
    min-width: 17px !important;
    height: 20px !important;
  }
}

.cv-btn-boletins-right {
  background: rgba(255, 255, 255, 0.20);
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.cv-btn-boletins-right:hover,
.cv-btn-boletins-right:active {
  background: rgba(255, 255, 255, 0.32);
  transform: scale(0.96);
}

/* Toolbar de Ações Administrativas no Cabeçalho (Compacta e Alinhada à Direita) */
.cv-admin-header-toolbar {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 3px;
  z-index: 502;
  pointer-events: auto;
  max-width: 100%;
  overflow: visible;
}

.cv-admin-header-toolbar::-webkit-scrollbar {
  display: none;
}

/* Botões Administrativos em Tamanho Único, Fundo Único e Cor de Letra Única Harmoniosa */
.cv-btn-admin-unified,
.cv-btn-painel-admin-top,
.cv-btn-importador-top,
#cv-btn-painel-admin-top,
#cv-btn-importador-top {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  color: #f8fafc !important;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  padding: 0 9px !important;
  height: 30px !important;
  min-height: 30px !important;
  max-height: 30px !important;
  border-radius: 999px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  transition: all var(--transition-fast) !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  letter-spacing: 0.01em !important;
  flex-shrink: 0 !important;
}

.cv-btn-admin-unified:hover,
.cv-btn-admin-unified:active,
#cv-btn-painel-admin-top:hover,
#cv-btn-painel-admin-top:active,
#cv-btn-importador-top:hover,
#cv-btn-importador-top:active {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: rgba(255, 255, 255, 0.38) !important;
  color: #ffffff !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28) !important;
}

.cv-auth-admin-active {
  border-color: rgba(250, 204, 21, 0.8) !important;
  background: rgba(250, 204, 21, 0.25) !important;
  color: #fde047 !important;
  box-shadow: 0 0 8px rgba(250, 204, 21, 0.35) !important;
}

.cv-btn-top-corner-action,
.cv-btn-ajuda-top-corner {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #ffffff;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
  border-radius: 50%;
  font-size: 0.88rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.20);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 0;
  box-sizing: border-box;
  line-height: 1;
}

.cv-btn-top-corner-action:hover,
.cv-btn-top-corner-action:active,
.cv-btn-ajuda-top-corner:hover,
.cv-btn-ajuda-top-corner:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}

.cv-btn-top-corner-action svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cv-qmark-icon {
  font-family: inherit;
  font-weight: 800;
  font-size: 0.90rem;
  line-height: 1;
}

/* Seletor de Turno Manhã / Noite */
.cv-culto-selector {
  display: flex;
  background: rgba(0, 0, 0, 0.20);
  padding: 4px;
  border-radius: 24px;
  gap: 4px;
  max-width: 320px;
  margin: 0 auto;
}

.cv-turno-pill {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.80);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cv-turno-pill.active {
  background: #ffffff;
  color: var(--ipb-verde-escuro);
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ── Container Principal ───────────────────────────────── */
.cv-mobile-main {
  padding: 18px 16px calc(36px + var(--safe-bottom)) 16px;
  max-width: 540px;
  margin: 0 auto;
}

.cv-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--ipb-texto-muted);
  letter-spacing: 1px;
  margin-bottom: 10px;
  margin-left: 4px;
}

/* ── Cartões ───────────────────────────────────────────── */
.cv-card {
  background: var(--ipb-cartao-bg);
  border: 1px solid var(--ipb-borda);
  border-radius: 16px;
  box-shadow: var(--ipb-sombra);
  margin-bottom: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cv-card-interactive {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  gap: 14px;
  cursor: pointer;
}

.cv-card-interactive:active {
  transform: scale(0.985);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cv-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--transition-fast, 0.15s ease);
}

.cv-icon-badge-green { background: rgba(0, 89, 48, 0.10); color: var(--ipb-verde-principal); }
.cv-icon-badge-amber { background: rgba(217, 119, 6, 0.12); color: #d97706; }
.cv-icon-badge-blue { background: rgba(2, 132, 199, 0.12); color: #0284c7; }
.cv-icon-badge-purple { background: rgba(147, 51, 234, 0.12); color: #9333ea; }
.cv-icon-badge-teal { background: rgba(13, 148, 136, 0.12); color: #0d9488; }

[data-tema="escuro"] .cv-icon-badge-green { background: rgba(16, 185, 129, 0.16); color: #10b981; }
[data-tema="escuro"] .cv-icon-badge-amber { background: rgba(245, 158, 11, 0.18); color: #fbbf24; }
[data-tema="escuro"] .cv-icon-badge-blue { background: rgba(56, 189, 248, 0.18); color: #38bdf8; }
[data-tema="escuro"] .cv-icon-badge-purple { background: rgba(192, 132, 252, 0.18); color: #c084fc; }
[data-tema="escuro"] .cv-icon-badge-teal { background: rgba(45, 212, 191, 0.18); color: #2dd4bf; }

.cv-card-content {
  flex: 1;
  min-width: 0;
}

.cv-card-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--ipb-texto);
  line-height: 1.3;
}

.cv-card-desc {
  font-size: 0.82rem;
  color: var(--ipb-texto-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-card-subdesc {
  font-size: 0.75rem;
  color: var(--ipb-texto-muted);
  margin-top: 3px;
}

.cv-badge-audio {
  display: inline-block;
  background: rgba(245, 158, 11, 0.12);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.30);
  padding: 2px 7px;
  border-radius: 8px;
  font-weight: 700;
}

[data-tema="escuro"] .cv-badge-audio {
  background: rgba(245, 158, 11, 0.20);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.38);
}

.cv-card-arrow {
  font-size: 1.4rem;
  color: var(--ipb-texto-muted);
  font-weight: 300;
}

/* ── Cabeçalho Secundário das Sub-telas ─────────────────── */
/* ── Cabeçalho Secundário das Sub-telas ─────────────────── */
.cv-sub-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: var(--ipb-cartao-bg);
  border-bottom: 1px solid var(--ipb-borda);
  padding: 8px 12px;
  min-height: 48px;
  backdrop-filter: blur(10px);
}

.cv-btn-voltar {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--ipb-verde-principal);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.cv-sub-title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ipb-texto);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  z-index: 1;
}

.cv-sub-title span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cv-header-actions-right {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
}

.cv-btn-fechar-topo {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.05);
  border: none;
  color: var(--ipb-texto);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

[data-tema="escuro"] .cv-btn-fechar-topo {
  background: rgba(255, 255, 255, 0.10);
}

.cv-btn-audio-pill {
  background: var(--ipb-verde-principal);
  color: #ffffff;
  border: none;
  border-radius: 18px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.cv-sub-header-shortcut {
  background: rgba(0, 89, 48, 0.08);
  border: 1px solid rgba(0, 89, 48, 0.22);
  color: var(--ipb-verde-principal);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.cv-sub-header-shortcut:hover {
  background: rgba(0, 89, 48, 0.16);
}

[data-tema="escuro"] .cv-sub-header-shortcut {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

[data-tema="escuro"] .cv-sub-header-shortcut:hover {
  background: rgba(255, 255, 255, 0.20);
}

.cv-btn-acervo-top-hub {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cv-btn-acervo-top-hub:hover {
  background: rgba(255, 255, 255, 0.28);
}

.cv-btn-config-meta {
  background: rgba(0, 89, 48, 0.08);
  border: 1px solid rgba(0, 89, 48, 0.20);
  color: var(--ipb-verde-principal);
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--transition-fast);
}

.cv-btn-config-meta:active {
  transform: scale(0.96);
  background: rgba(0, 89, 48, 0.16);
}

[data-tema="escuro"] .cv-btn-config-meta {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.30);
  color: #10b981;
}

.cv-sub-main {
  padding: 16px 16px calc(36px + var(--safe-bottom)) 16px;
  max-width: 580px;
  margin: 0 auto;
}

/* ==========================================================
   ACESSIBILIDADE: FOCO VISÍVEL REFINADO
   ========================================================== */
:focus-visible {
  outline: 2px solid var(--cv-foco) !important;
  outline-offset: 2px !important;
}

button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--cv-foco) !important;
  outline-offset: 2px !important;
}

/* Campos de entrada com borda fina e elegante no foco (sem outline grosso) */
input:focus-visible,
input:focus,
textarea:focus-visible,
textarea:focus,
select:focus-visible,
select:focus {
  outline: none !important;
  border-color: var(--cv-foco) !important;
  box-shadow: 0 0 0 1px var(--cv-foco) !important;
}

/* ==========================================================
   SKELETONS DE CARREGAMENTO SUAVE (WP-17)
   ========================================================== */
.cv-skel {
  background: linear-gradient(90deg, rgba(226, 232, 240, 0.6) 25%, rgba(241, 245, 249, 0.9) 50%, rgba(226, 232, 240, 0.6) 75%);
  background-size: 200% 100%;
  animation: cvShimmer 1.5s infinite ease-in-out;
  border-radius: 6px;
  display: block;
}

.cv-skel-line {
  height: 14px;
  margin-bottom: 8px;
  border-radius: 4px;
}

.cv-skel-title {
  height: 22px;
  width: 70%;
  margin-bottom: 12px;
}

.cv-skel-block {
  min-height: 80px;
  border-radius: 10px;
}

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

[data-tema="escuro"] .cv-skel,
html[data-tema="escuro"] .cv-skel,
[data-theme="dark"] .cv-skel {
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.7) 25%, rgba(51, 65, 85, 0.9) 50%, rgba(30, 41, 59, 0.7) 75%);
  background-size: 200% 100%;
}

/* ==========================================================
   RESPONSIVIDADE: REDUÇÃO DE MOVIMENTO (WP-21)
   ========================================================== */
@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;
  }

  .cv-skel {
    animation: none !important;
  }
}


