/**
 * app.css
 * Identidade visual e estilos para o Jw Estudo.
 * Focado no tema escuro do Android, excelente contraste e leitura confortável.
 */

/* Fonte local NotoSans — registrada sem espaço para uso consistente no APK */
@font-face {
  font-family: "NotoSans";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../assets/fonts/NotoSans-400.woff2") format("woff2"),
       url("../assets/fonts/NotoSans-400.woff") format("woff");
}

@font-face {
  font-family: "NotoSans";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("../assets/fonts/NotoSans-700.woff2") format("woff2"),
       url("../assets/fonts/NotoSans-700.woff") format("woff");
}

/* Reset básico e variáveis de cores */
:root {
  --bg-main: #101010;
  --bg-header: #2B2B2B;
  --bg-card: #1B1B1B;
  --border-discreet: #505050;
  --text-main: #F4F4F4;
  --text-sec: #BDBDBD;
  --text-ref: #AFC8F8;
  --color-primary: #007060; /* Verde-petróleo */
  --color-accent: #C9ACEB;  /* Lilás */
  
  /* Cores de marcação/highlight */
  --hl-yellow: rgba(247, 213, 72, 0.42);
  --hl-green: rgba(113, 201, 137, 0.38);
  --hl-blue: rgba(105, 183, 241, 0.38);
  --hl-purple: rgba(184, 154, 247, 0.40);
  --hl-pink: rgba(244, 143, 177, 0.38);
  --hl-orange: rgba(244, 162, 97, 0.40);
  --swatch-yellow: #F7D548;
  --swatch-green: #71C989;
  --swatch-blue: #69B7F1;
  --swatch-purple: #B89AF7;
  --swatch-pink: #F48FB1;
  --swatch-orange: #F4A261;
  
  --transition-speed: 180ms;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent; /* Remove feedback azul de toque no Android/iOS */
}

body, input, textarea, button {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-size: 16px;
  line-height: 1.6;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  user-select: none;
  /* Impede que o Android WebView ajuste automaticamente o tamanho do texto */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Estrutura principal do Cordova / SPA */
.app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Telas individuais */
.screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-main);
  transition: transform var(--transition-speed) ease-in-out, opacity var(--transition-speed) ease-in-out;
  z-index: 10;
}

.screen.hidden {
  transform: translateX(100%);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

/* Cabeçalhos Fixos */
.startup-state {
  width: min(420px, calc(100% - 40px));
  margin: 32px auto;
  color: #d8dddd;
  text-align: center;
}

.startup-progress-track {
  height: 3px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 3px;
  background: #3b4040;
}

.startup-progress-track span {
  display: block;
  width: 36%;
  height: 100%;
  background: #00a88f;
  animation: startup-progress 1.1s ease-in-out infinite alternate;
}

.startup-state--error .startup-progress-track { display: none; }
.startup-state-detail { color: #bfc6c6; line-height: 1.45; }
.startup-retry {
  min-height: 42px;
  margin-top: 10px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  background: #087e6d;
  color: #fff;
  font: inherit;
  font-weight: 700;
}

@keyframes startup-progress {
  from { transform: translateX(-15%); }
  to { transform: translateX(180%); }
}

.header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-discreet);
  /* padding-top = apenas safe-area (status bar), sem extra acima do conteúdo */
  padding: 0 12px;
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: calc(56px + env(safe-area-inset-top, 0px));
  flex-shrink: 0;
}

/*
 * No Android, a WebView da tela de leitura já começa abaixo da status bar.
 * Evita somar novamente a safe area e mantém o conteúdo centralizado,
 * com o mesmo respiro visual acima e abaixo.
 */
#tela-leitura > .header {
  padding-top: 0;
  min-height: 56px;
}

.header-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.header-title {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-size: 21px;
  line-height: 27px;
  font-weight: 600;
  color: #F2F2F2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-subtitle {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-size: 16px;
  line-height: 21px;
  font-weight: 400;
  color: #B8B8B8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

/* Área de Rolagem do Conteúdo */
.content-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* Botões base */
.btn-icon {
  background: transparent;
  border: none;
  color: var(--color-accent);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color var(--transition-speed) ease;
  flex-shrink: 0;
}

.btn-icon:active {
  background-color: rgba(255, 255, 255, 0.1);
}

.btn-icon svg {
  width: 24px;
  height: 24px;
  /* fill e stroke são definidos por cada SVG individualmente */
}

.btn-back svg {
  width: 18px;
  height: 18px;
}

/* Estilo para botão desativado */
.btn-icon.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-icon.disabled:active {
  background-color: transparent;
}

.btn-icon-decorative {
  opacity: 1;
  cursor: default;
  pointer-events: none;
}

/* ==========================================================================
   TELA 1: ESTUDOS INSTALADOS
   ========================================================================== */
.estudo-secao-wrapper {
  margin: 20px 16px;
}

.secao-titulo-inicial {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-sec);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
}

/* Lista de estudos */
.estudos-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.estudo-item, .extra-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color var(--transition-speed) ease, background-color var(--transition-speed) ease;
  min-height: 76px;
}

.estudo-item:active, .extra-item:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.estudo-item.destacado {
  border-left: 4px solid var(--color-primary);
  background-color: rgba(0, 133, 118, 0.03);
}

.estudo-item-capa {
  width: 42px;
  height: 56px;
  border-radius: 4px;
  overflow: hidden;
  background-color: #2b2b2b;
  flex-shrink: 0;
  border: 1px solid var(--border-discreet);
}

.estudo-item-capa svg {
  width: 100%;
  height: 100%;
  display: block;
}

.estudo-item-info, .extra-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0; /* Permite truncamento correto de texto flex */
}

.estudo-item-semana-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.estudo-item-semana {
  font-size: 11px;
  color: var(--color-primary); /* Semana em destaque verde-petróleo */
  font-weight: bold;
}

.badge-semana {
  background-color: var(--color-accent);
  color: #101010;
  font-size: 9px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}

.estudo-item-titulo {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-main);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.estudo-item-meta {
  font-size: 11px;
  color: var(--text-sec);
  font-weight: 500;
}

.estudo-item-arrow {
  color: var(--text-sec);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.estudo-item-arrow svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
}

/* Conteúdos extras */
.extras-secao {
  margin: 24px 16px;
}

.extra-item-titulo {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-main);
}

.extra-item-desc {
  font-size: 12px;
  color: var(--text-sec);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   TELA 2: LEITURA DO ESTUDO
   ========================================================================== */
.leitura-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px 40px 16px;
}

/* Faixa de data. O acento fica isolado à capa do artigo. */
.faixa-semana {
  background-color: #007060;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: bold;
  letter-spacing: 0.08em;
  margin-bottom: 24px;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  font-family: Arial, "Arial Unicode MS", sans-serif;
}

.study-article-view .faixa-semana {
  background-color: var(--study-accent, #007060);
}

.faixa-texto {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.faixa-pagina {
  font-size: 13px;
  opacity: 0.65;
  color: var(--text-main);
  padding-right: 8px;
}

/* Elementos de Introdução */
.introducao-cantico {
  font-size: 18px;
  line-height: 1.55;
  color: #a6b4e0;
  font-style: normal;
  font-weight: 700;
  font-synthesis: none;
  margin-top: 6px;
  margin-bottom: 24px;
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
}

.cantico-numero {
  color: #a6b4e0;
  font-weight: 700;
}

.cantico-titulo {
  color: #bfbfbf;
  font-weight: 400;
}

/* Título principal — NotoSans 700 bundled, valores exatos da referência */
.leitura-container .titulo-estudo {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 28px;
  line-height: 35px;
  color: #91A9AC;
  font-synthesis: none;
  margin-top: 8px;
  margin-bottom: 26px;
}

.texto-tema-container {
  margin-bottom: 28px;
}

.study-theme {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-size: 16px;
  line-height: 24px;
  font-weight: 400;
  color: #C0C0C0;
}

.study-theme-quote {
  font-style: italic;
}

.study-theme-reference {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: #9FB9E3;
  white-space: nowrap;
}

.leitura-paragrafo a, .bloco-estudo a {
  color: #a6b4e0;
  text-decoration: none;
  font-weight: 600;
}

.leitura-paragrafo a:active, .bloco-estudo a:active {
  opacity: 0.7;
}

.bible-reference {
  color: #8EAFE0;
  cursor: pointer;
}

.objetivo-container {
  border-left: 2px solid #007060;
  padding-left: 16px;
  margin-top: 8px;
  margin-bottom: 32px;
}

.objetivo-label {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-style: normal;
  font-weight: 700;
  font-size: 16px;
  line-height: 24px;
  color: #C0C0C0;
  font-synthesis: none;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.objetivo-texto {
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-style: normal;
  font-weight: 400;
  font-size: 18px;
  color: #C0C0C0;
  line-height: 1.65;
}

/* Fidelidade visual da capa: somente filhos diretos da introdução do artigo. */
.leitura-container.study-article-cover {
  padding-left: 21px;
  padding-right: 21px;
}

.study-article-cover > .introducao-cantico {
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
  margin-top: 8px;
  margin-bottom: 22px;
}

.study-article-cover > .titulo-estudo {
  font-size: 31px;
  line-height: 1.22;
  font-weight: 750;
  margin-top: 6px;
  margin-bottom: 22px;
}

.study-article-cover > .texto-tema-container {
  margin-bottom: 14px;
}

.study-article-cover > .texto-tema-container .study-theme {
  font-size: 18px;
  line-height: 1.5;
  font-weight: 500;
}

.study-article-cover > .texto-tema-container .study-theme-reference {
  font-size: 17px;
  line-height: inherit;
  font-weight: 500;
}

.study-article-cover > .objetivo-container {
  border-left-color: var(--study-accent, #007060);
  padding-left: 18px;
  margin-top: 2px;
  margin-bottom: 34px;
}

.study-article-cover > .objetivo-container .objetivo-label {
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
  margin-bottom: 7px;
}

.study-article-cover > .objetivo-container .objetivo-texto {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 450;
}

@media (max-width: 380px) {
  .leitura-container.study-article-cover {
    padding-left: 19px;
    padding-right: 19px;
  }

  .study-article-cover > .titulo-estudo {
    font-size: 29px;
  }
}

/* Títulos Internos */
.leitura-heading {
  font-size: 27.995px;
  line-height: 34.9938px;
  color: #91A9AC;
  font-weight: 700;
  margin-top: 32px;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-family: "Noto Sans", NotoSans, Arial, "Arial Unicode MS", sans-serif;
}

/* Grupo de Perguntas e Parágrafos */
.bloco-estudo {
  margin-bottom: 24px;
}

.leitura-pergunta {
  font-size: 15px;
  font-weight: 400;
  color: #C0C0C0;
  margin-top: 16px;
  margin-bottom: 8px;
  line-height: 1.4;
  font-family: "Noto Sans", NotoSans, Arial, "Arial Unicode MS", sans-serif;
}

.leitura-paragrafo {
  font-size: 19px;
  line-height: 30px;
  color: #FFFFFF;
  font-weight: 400;
  margin-bottom: 16px;
  font-family: "Noto Sans", NotoSans, Arial, "Arial Unicode MS", sans-serif;
  user-select: text; /* Permite seleção nativa futura */
}

/* Destaques (Highlights) preparados */
/* Caixa editorial DAISY: seletor deliberadamente restrito ao novo bloco. */
.editorial-box-block {
  margin-top: 28px;
  margin-bottom: 32px;
}

.editorial-box {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 18px 16px 20px;
  background: #292929;
  border: 0;
  border-top: 10px solid #755c3a;
  color: #ffffff;
}

.editorial-box__title {
  margin: 0 0 18px;
  color: #91a9ac;
  font-family: "Noto Sans", NotoSans, Arial, "Arial Unicode MS", sans-serif;
  font-size: 30px;
  font-weight: 750;
  line-height: 1.22;
  letter-spacing: 0;
}

.editorial-box__content,
.editorial-box__paragraph,
.editorial-box__item-text {
  color: #ffffff;
  font-family: "Noto Sans", NotoSans, Arial, "Arial Unicode MS", sans-serif;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.52;
}

.editorial-box__paragraph {
  margin: 0 0 16px;
}

.editorial-box__introduction {
  margin-bottom: 20px;
}

.editorial-box__list {
  margin: 0;
  padding-left: 25px;
  color: #ffffff;
  list-style-position: outside;
}

.editorial-box__item {
  margin: 0 0 18px;
  padding-left: 4px;
  color: #ffffff;
}

.editorial-box__item:last-child {
  margin-bottom: 0;
}

.editorial-box__item::marker {
  color: #ffffff;
  font-size: 0.9em;
}

/* Permite rolar o último item completamente acima do botão flutuante. */
#leitura-scroll.content-scroll {
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 380px) {
  .editorial-box__title {
    font-size: 29px;
  }

  .editorial-box__content,
  .editorial-box__paragraph,
  .editorial-box__item-text {
    font-size: 20px;
  }
}

.highlight-green {
  background-color: var(--hl-green);
  color: var(--text-main);
  padding: 0 2px;
  border-radius: 2px;
}

.highlight-yellow {
  background-color: var(--hl-yellow);
  color: var(--text-main);
  padding: 0 2px;
  border-radius: 2px;
}

.highlight-pink {
  background-color: var(--hl-pink);
  color: var(--text-main);
  padding: 0 2px;
  border-radius: 2px;
}

.highlight-blue {
  background-color: var(--hl-blue);
  color: var(--text-main);
  padding: 0 2px;
  border-radius: 2px;
}

.highlight-purple {
  background-color: var(--hl-purple);
  color: var(--text-main);
  padding: 0 2px;
  border-radius: 2px;
}

.highlight-orange {
  background-color: var(--hl-orange);
  color: var(--text-main);
  padding: 0 2px;
  border-radius: 2px;
}

/* Imagens e Legendas */
.leitura-imagem-container {
  margin: 24px 0 8px 0;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  max-width: 100vw;
  overflow: hidden;
  background-color: var(--bg-card);
}

@media(min-width: 600px) {
  .leitura-imagem-container {
    width: 100%;
    left: 0;
    right: 0;
    margin-left: 0;
    margin-right: 0;
    border-radius: 8px;
    border: 1px solid var(--border-discreet);
  }
}

.leitura-imagem {
  width: 100%;
  height: auto;
  display: block;
}

.leitura-legenda {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.4;
  margin-bottom: 24px;
  padding: 0 4px;
  border-left: 2px solid var(--color-primary);
}

/* Cântico final */
.final-song {
  margin-top: 32px;
  margin-bottom: 16px;
  font-size: 18px;
  line-height: 1.55;
}

.final-song-label {
  color: #a6b4e0;
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-weight: 700;
  font-synthesis: none;
}

.final-song-title {
  color: #bfbfbf;
  font-family: "NotoSans", Arial, "Arial Unicode MS", sans-serif;
  font-weight: 400;
}

/* Pergunta de Revisão */
.review-container {
  background-color: var(--bg-card);
  border: 1px solid var(--border-discreet);
  border-radius: 12px;
  padding: 16px;
  margin-top: 40px;
  margin-bottom: 20px;
}

.review-header {
  font-size: 13px;
  font-weight: bold;
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* ==========================================================================
   ÁREA DE COMENTÁRIOS (TEXTAREA ÚNICO E SIMPLIFICADO)
   ========================================================================== */
.comment-box-container {
  margin: 12px 0;
  width: 100%;
}

.comment-textarea {
  width: 100%;
  min-height: 52px;
  background-color: transparent;
  border: 1px solid var(--border-discreet);
  border-radius: 6px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  padding: 12px 14px;
  resize: none;
  outline: none;
  overflow-y: hidden; /* Oculta a barra de rolagem para o auto-resize funcionar limpo */
  transition: border-color var(--transition-speed) ease, background-color var(--transition-speed) ease;
  display: block;
}

/* Estado de foco e preenchido */
.comment-textarea:focus {
  border-color: var(--color-primary);
  background-color: rgba(255, 255, 255, 0.01);
}

.comment-box-container.has-content .comment-textarea {
  border-color: var(--border-discreet);
}

.comment-box-container.has-content .comment-textarea:focus {
  border-color: var(--color-primary);
}

/* Placeholder nativo sutil */
.comment-textarea::placeholder {
  color: var(--border-discreet);
  font-style: italic;
  font-size: 14px;
}


/* ==========================================================================
   BUSCA GLOBAL (MODAL ESCURO)
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: var(--bg-main);
  z-index: 100;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity var(--transition-speed) ease-in-out, transform var(--transition-speed) ease-in-out;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.search-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-discreet);
  padding: 10px 16px;
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
  display: flex;
  align-items: center;
  gap: 12px;
  height: calc(56px + env(safe-area-inset-top, 0px));
}

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

.search-input {
  width: 100%;
  height: 40px;
  background-color: #101010;
  border: 1px solid var(--border-discreet);
  border-radius: 20px;
  color: var(--text-main);
  padding: 0 16px;
  font-size: 15px;
  outline: none;
  transition: border-color var(--transition-speed) ease;
}

.search-input:focus {
  border-color: var(--color-primary);
}

.search-results-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.search-no-results {
  text-align: center;
  color: var(--text-sec);
  margin-top: 40px;
  font-size: 14px;
}

/* Card de Resultado da Busca */
.search-result-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background-color var(--transition-speed) ease;
}

.search-result-item:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.result-title {
  font-size: 11px;
  font-weight: bold;
  color: var(--text-ref);
  text-transform: uppercase;
}

.result-badge {
  font-size: 9px;
  font-weight: bold;
  padding: 2px 6px;
  border-radius: 4px;
  color: #101010;
}

.result-badge.texto { background-color: var(--color-accent); }
.result-badge.pergunta { background-color: var(--color-primary); color: #fff; }
.result-badge.comentario { background-color: #8A783B; color: #fff; }

.result-location {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 4px;
}

.result-snippet {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.4;
}

.result-snippet mark {
  background-color: rgba(0, 133, 118, 0.3);
  color: var(--text-main);
  font-weight: bold;
  border-radius: 2px;
  padding: 0 2px;
}

/* ==========================================================================
   TOAST DISCRETO (SEM ALERTS NATIVOS)
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #2b2b2b;
  color: var(--text-main);
  border: 1px solid var(--border-discreet);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 1000;
  transition: transform var(--transition-speed) ease-in-out, opacity var(--transition-speed) ease-in-out;
  pointer-events: none;
  opacity: 0;
  text-align: center;
  max-width: 85%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-container.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ==========================================================================
   MINI-PLAYER DE ÁUDIO FIXO
   ========================================================================== */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #1E3535;
  border-top: 1px solid var(--color-primary);
  z-index: 200;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%);
  transition: transform 200ms ease;
}

.mini-player.active {
  transform: translateY(0);
}

.mp-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-time {
  font-size: 12px;
  color: var(--text-sec);
  min-width: 36px;
  text-align: right;
}

.mp-bar-wrap {
  flex: 1;
  height: 4px;
  background-color: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.mp-bar {
  height: 100%;
  background-color: var(--color-primary);
  width: 0%;
  transition: width 250ms linear;
}

/* Botão "Ouvir a partir daqui" */
.btn-audio-para {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: 1px solid var(--color-primary);
  border-radius: 14px;
  color: var(--color-primary);
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 4px;
}

.btn-audio-para svg {
  fill: var(--color-primary);
  stroke: none;
}

.btn-audio-para:active {
  background-color: rgba(0,133,118,0.1);
}

/* Destaque do parágrafo em reprodução */
.audio-active {
  background-color: rgba(0, 133, 118, 0.12);
  border-radius: 6px;
  transition: background-color 300ms ease;
}

/* ==========================================================================
   MODAIS DE IMPORTAÇÃO (overlay escuro + sheet)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 300;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-sheet {
  background-color: #1B1B1B;
  border: 1px solid var(--border-discreet);
  border-bottom: none;
  border-radius: 16px 16px 0 0;
  padding: 24px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  max-width: 560px;
}

.modal-sheet--center {
  border-radius: 16px;
  margin: auto;
  margin-bottom: 0;
  text-align: center;
  padding: 32px 24px;
}

.modal-sheet-title {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-main);
  margin-bottom: 16px;
}

.modal-body {
  font-size: 15px;
  color: var(--text-sec);
  line-height: 1.5;
  margin-bottom: 20px;
}

.modal-note {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 12px;
  margin-bottom: 16px;
  font-style: italic;
  line-height: 1.4;
}

.preview-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(80,80,80,0.3);
}

.preview-label {
  font-size: 13px;
  color: var(--text-sec);
}

.preview-value {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-main);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-modal-secondary {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  background: transparent;
  color: var(--text-sec);
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.btn-modal-secondary:active {
  background-color: rgba(255,255,255,0.05);
}

.btn-modal-primary {
  flex: 2;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: var(--color-primary);
  color: #fff;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.btn-modal-primary:active {
  opacity: 0.85;
}

/* Spinner de progresso */
.progress-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0,133,118,0.2);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.progress-text {
  color: var(--text-sec);
  font-size: 14px;
  font-weight: bold;
  text-align: center;
}

/* ===================================================================
   EMPTY STATE — nenhuma edição instalada
   =================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 32px 40px;
  text-align: center;
  gap: 16px;
  min-height: 60vh;
}

.empty-state-icon {
  color: var(--color-primary);
  opacity: 0.7;
  margin-bottom: 8px;
  animation: float 3s ease-in-out infinite;
}

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

.empty-state-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.empty-state-desc {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.7;
  max-width: 280px;
}

.empty-state-desc strong {
  color: var(--text-main);
  font-weight: 700;
}

.btn-empty-import {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 14px 28px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition-speed), transform var(--transition-speed);
  box-shadow: 0 4px 16px rgba(0, 133, 118, 0.3);
}

.btn-empty-import:active {
  opacity: 0.8;
  transform: scale(0.97);
}

/* ==========================================================================
   BARRA DE SEMANA ATUAL (estilo JW Library)
   ========================================================================== */
/* ==========================================================================
   BARRA DE NAVEGAÇÃO DE SEMANA (estilo JW Library)
   ========================================================================== */
.semana-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-sec);
  background-color: transparent;
  border-bottom: 1px solid rgba(80, 80, 80, 0.2);
  margin-bottom: 8px;
}

.semana-nav-btn {
  background: transparent;
  border: none;
  color: var(--text-sec);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color var(--transition-speed);
}

.semana-nav-btn:active {
  background-color: rgba(255, 255, 255, 0.08);
}

.semana-nav-btn.disabled {
  opacity: 0.25;
  cursor: not-allowed;
  pointer-events: none;
}

.semana-nav-btn svg {
  width: 20px;
  height: 20px;
}

.semana-nav-texto {
  font-size: 14px;
  color: #a5b5b8; /* Cor cinza-lilás suave */
  font-weight: 600;
  text-align: center;
  flex: 1;
}

/* Divisória sutil entre seções */
.divider-jw {
  border: none;
  border-top: 1px solid rgba(80, 80, 80, 0.2);
  margin: 16px 16px 8px 16px;
}

/* ==========================================================================
   SEÇÕES DE ESTUDOS E PUBLICAÇÕES
   ========================================================================== */
.secao-edicao {
  margin: 16px 16px 24px;
}

.secao-edicao-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
  border-bottom: none;
  margin-bottom: 4px;
}

.secao-titulo-edicao {
  font-size: 20px; /* Título grande da seção */
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.secao-extras > .secao-titulo-edicao {
  font-size: 20px;
  color: var(--text-main);
  font-weight: 700;
  padding: 8px 0 12px;
  margin-bottom: 4px;
}

.btn-secao-menu {
  flex-shrink: 0;
  color: var(--text-sec);
}

/* ==========================================================================
   CARD ESTILO JW LIBRARY (SEM FUNDO E SEM BORDA)
   ========================================================================== */
.estudo-card-jw {
  display: flex;
  align-items: center;
  gap: 16px;
  background-color: transparent;
  border: none;
  border-radius: 0;
  padding: 12px 0;
  cursor: pointer;
  transition: opacity 150ms ease;
  width: 100%;
}

.estudo-card-jw:active {
  opacity: 0.7;
}

/* Removemos a borda verde lateral do card atual */
.estudo-card-atual {
  border-left: none;
  padding-left: 0;
}

.card-jw-thumb {
  width: 60px; /* Formato retangular vertical */
  height: 80px;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background-color: #1a1a1a;
  border: 1px solid rgba(80, 80, 80, 0.2);
}

.card-jw-thumb svg,
.card-jw-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-jw-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.card-jw-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.card-jw-semana {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sec);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-jw-titulo {
  font-size: 16px;
  font-weight: 700;
  color: #9FB9E3; /* Cor azul JW Library para o título */
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}

.card-jw-comentarios {
  font-size: 11px;
  color: var(--color-primary);
  font-weight: 600;
}

.card-jw-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.card-jw-action-btn {
  background: transparent;
  border: none;
  color: var(--text-sec);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: background-color var(--transition-speed);
}

.card-jw-action-btn:active {
  background-color: rgba(255, 255, 255, 0.08);
}

.card-jw-action-btn svg {
  width: 22px;
  height: 22px;
}

/* ==========================================================================
   MENU DE CONTEXTO (excluir edição)
   ========================================================================== */
.ctx-menu {
  position: fixed;
  z-index: 500;
  background-color: #2B2B2B;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  overflow: hidden;
  min-width: 180px;
}

.ctx-menu-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: none;
  border: none;
  text-align: left;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: var(--text-main);
}

.ctx-menu-item:active {
  background-color: rgba(255,255,255,0.08);
}

.ctx-menu-item--danger {
  color: #FF6B6B;
}

/* ==========================================================================
   SINCRONIZAÇÃO (mantém o mesmo padrão visual dos modais existentes)
   ========================================================================== */
.sync-sheet {
  position: relative;
  max-height: min(92vh, 680px);
  overflow-y: auto;
}

.sync-sheet .hidden {
  display: none !important;
}

.sync-restoring-panel {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--text-sec);
  text-align: center;
}

.sync-restoring-panel .progress-spinner {
  width: 28px;
  height: 28px;
}

.sync-restoring-panel p {
  margin: 0;
}

.sync-intro {
  margin-bottom: 16px;
}

.sync-field {
  display: block;
  margin-bottom: 14px;
}

.sync-field > span {
  display: block;
  color: var(--text-sec);
  font-size: 13px;
  margin-bottom: 6px;
}

.sync-field input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  background: #111;
  color: var(--text-main);
  font: inherit;
  padding: 10px 12px;
  outline: none;
}

.sync-field input:focus {
  border-color: var(--color-accent);
}

.sync-link-button {
  display: block;
  width: 100%;
  margin: 2px 0 12px;
  padding: 8px;
  background: transparent;
  border: 0;
  color: var(--color-accent);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.sync-status {
  min-height: 20px;
  color: var(--text-sec);
  font-size: 13px;
  line-height: 1.45;
  margin: 2px 0 4px;
}

.sync-status--error {
  color: #ff8a8a;
}

.sync-backup-status {
  min-height: 44px;
  padding: 11px 12px;
  margin: 0 0 4px;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-sec);
  font-size: 13px;
  line-height: 1.45;
}

.sync-backup-status--success {
  color: #9de5ce;
  border-color: rgba(0, 133, 118, 0.55);
}

.sync-backup-status--error {
  color: #ffb0b0;
  border-color: rgba(255, 112, 112, 0.45);
}

.sync-sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-sec);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.sync-sheet-close:hover,
.sync-sheet-close:focus-visible {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

#sync-connected-panel > .modal-sheet-title {
  padding-right: 36px;
}

.sync-primary-action {
  margin-top: 4px;
}

.sync-edition-details {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-discreet);
}

.sync-edition-details summary {
  color: var(--text-sec);
  font-size: 13px;
  cursor: pointer;
}

.sync-edition-details[open] summary {
  margin-bottom: 10px;
  color: var(--text-main);
}

.sync-edition-details-content .modal-note {
  margin-bottom: 0;
}

.sync-account {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-discreet);
}

.sync-account h3 {
  margin: 0 0 8px;
  color: var(--text-main);
  font-size: 14px;
}

.sync-account .modal-note {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.sync-account #btn-sync-logout {
  width: 100%;
  margin-top: 8px;
}

.sync-conflict-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.sync-conflict-actions button {
  width: 100%;
}

.sync-subtitle,
.sync-history h3 {
  margin: 14px 0 8px;
  color: var(--text-main);
  font-size: 14px;
}

.sync-history {
  margin-top: 14px;
  padding-top: 2px;
  border-top: 1px solid var(--border-discreet);
}

.sync-history .modal-note {
  margin: 0 0 8px;
}

.sync-history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sync-history-item {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.sync-history-item:hover,
.sync-history-item:focus-visible {
  border-color: var(--color-accent);
}

.sync-history-item:disabled {
  cursor: wait;
  opacity: 0.65;
}

.sync-history-item strong,
.sync-history-item span {
  display: block;
}

.sync-history-item strong {
  margin-bottom: 3px;
  font-size: 13px;
}

.sync-history-item span {
  color: var(--text-sec);
  font-size: 12px;
}

.sync-global-progress {
  position: fixed;
  z-index: 1200;
  top: 72px;
  left: 50%;
  width: min(420px, calc(100vw - 28px));
  padding: 12px 14px;
  transform: translateX(-50%);
  border: 1px solid var(--border-discreet);
  border-radius: 10px;
  background: #1d1d1d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: var(--text-main);
  font-size: 13px;
}

.sync-global-progress.hidden,
.sync-global-progress[hidden] {
  display: none !important;
}

.sync-global-progress-track {
  position: relative;
  height: 4px;
  margin-top: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 133, 118, 0.18);
}

.sync-global-progress-track span {
  position: absolute;
  inset: 0 auto 0 -35%;
  width: 35%;
  border-radius: inherit;
  background: var(--color-primary);
  animation: sync-progress-slide 1.1s ease-in-out infinite;
}

@keyframes sync-progress-slide {
  from { left: -35%; }
  to { left: 100%; }
}

/* Modal de IA */
.ai-card {
  background-color: #161618;
  border: 1px solid rgba(80, 80, 80, 0.35);
  border-radius: 20px;
  overflow: hidden;
  width: 100%;
  margin-bottom: 16px;
}

.ai-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(80, 80, 80, 0.2);
  color: var(--text-sec);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.ai-card-sparkle {
  color: var(--color-accent);
}

.ai-modal-list {
  display: flex;
  flex-direction: column;
}

.ai-modal-item {
  display: flex;
  align-items: center;
  padding: 16px;
  background-color: transparent;
  cursor: pointer;
  transition: background-color var(--transition-speed);
  border-bottom: 1px solid rgba(80, 80, 80, 0.2);
}

.ai-modal-item:last-of-type {
  border-bottom: none;
}

.ai-modal-item:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.ai-modal-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-right: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  background-color: transparent;
}

.ai-modal-logo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ai-modal-text {
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

.ai-modal-item-company {
  font-size: 12px;
  color: var(--text-sec);
}

.ai-modal-arrow {
  color: var(--text-sec);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.7;
}

.ai-modal-arrow svg {
  width: 18px;
  height: 18px;
}

.ai-card-footer {
  padding: 14px 16px;
  font-size: 12px;
  color: var(--text-sec);
  text-align: center;
  background-color: rgba(255, 255, 255, 0.01);
  border-top: 1px solid rgba(80, 80, 80, 0.2);
  line-height: 1.45;
}

.ai-modal-close-btn {
  width: 100%;
  padding: 14px;
  background-color: #222224;
  border: 1px solid rgba(80, 80, 80, 0.2);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.ai-modal-close-btn:active {
  background-color: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   MODAL: IMPORTAR RESPOSTA DA IA
   ========================================================================== */
.ai-import-sheet {
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.ai-json-textarea {
  width: 100%;
  min-height: 140px;
  max-height: 260px;
  background-color: #101010;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  color: var(--text-main);
  font-family: "Courier New", Courier, monospace;
  font-size: 12px;
  line-height: 1.5;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  display: block;
  margin-bottom: 12px;
  transition: border-color var(--transition-speed);
}

.ai-json-textarea:focus {
  border-color: var(--color-primary);
}

.ai-json-textarea::placeholder {
  color: var(--border-discreet);
  font-style: italic;
}

.ai-import-file-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
}

.ai-import-file-actions .btn-modal-secondary {
  flex: 1;
  font-size: 13px;
  padding: 10px 8px;
}

/* ==========================================================================
   MODAL: PRÉVIA DA IMPORTAÇÃO DA IA
   ========================================================================== */
.ai-preview-sheet {
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ai-preview-content {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 12px;
}

.ai-preview-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
  border: 1px solid rgba(80,80,80,0.3);
  border-radius: 8px;
  overflow: hidden;
}

.ai-preview-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 14px;
  border-bottom: 1px solid rgba(80,80,80,0.2);
}

.ai-preview-stat-row:last-child {
  border-bottom: none;
}

.ai-preview-stat-label {
  font-size: 13px;
  color: var(--text-sec);
}

.ai-preview-stat-value {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-main);
}

.ai-preview-stat-value.warn {
  color: #ffaa33;
}

.ai-preview-warnings {
  background-color: rgba(255, 170, 51, 0.08);
  border: 1px solid rgba(255, 170, 51, 0.3);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 14px;
}

.ai-preview-warnings-title {
  font-size: 12px;
  font-weight: bold;
  color: #ffaa33;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ai-preview-warning-item {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.5;
  margin-bottom: 2px;
}

.ai-preview-answers-title {
  font-size: 13px;
  font-weight: bold;
  color: var(--text-sec);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.ai-preview-replace-note {
  font-size: 12px;
  color: #ffaa33;
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.4;
}

.ai-preview-answers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-preview-answer-item {
  background-color: var(--bg-card);
  border: 1px solid rgba(80,80,80,0.25);
  border-radius: 8px;
  padding: 10px 12px;
}

.ai-preview-answer-qid {
  font-size: 11px;
  font-weight: bold;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ai-preview-answer-direct {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.4;
}

.ai-preview-answer-additional {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.4;
  font-style: italic;
}

/* ==========================================================================
   MODAL: ADICIONAR NOVA EDIÇÃO
   ========================================================================== */
.add-edition-sheet {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 92vh;
  overflow-y: auto;
}

.add-edition-option {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 0;
  border-radius: 10px;
  transition: background-color 150ms ease;
}

.add-edition-option--highlight {
  background-color: rgba(0, 133, 118, 0.08);
  border: 1px solid rgba(0, 133, 118, 0.35);
  padding: 14px;
  border-radius: 10px;
}

.add-edition-option-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  background-color: rgba(0, 133, 118, 0.1);
  border-radius: 10px;
}

.add-edition-option-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding-top: 2px;
}

.add-edition-option-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.add-edition-option-desc {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.4;
}

.btn-add-edition {
  flex-shrink: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  background: transparent;
  color: var(--text-sec);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--transition-speed), border-color var(--transition-speed);
}

.btn-add-edition:active {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-add-edition.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-add-edition--primary {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.btn-add-edition--primary:active {
  opacity: 0.85;
  background-color: var(--color-primary);
}

.add-edition-option--highlight .btn-add-edition--primary {
  box-shadow: 0 0 0 2px rgba(0, 133, 118, 0.5);
}

.add-edition-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-sec);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 0;
  position: relative;
}

.add-edition-divider::before,
.add-edition-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 38%;
  height: 1px;
  background-color: rgba(80, 80, 80, 0.3);
}

.add-edition-divider::before { left: 0; }
.add-edition-divider::after  { right: 0; }

/* ==========================================================================
   MODAL: CATÁLOGO DE EDIÇÕES
   ========================================================================== */
.add-edition-catalog-header {
  margin-bottom: 10px;
}

.add-edition-catalog-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 3px;
}

.add-edition-catalog-desc {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.4;
}

.edition-catalog-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 4px;
}

.edition-catalog-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-discreet);
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease;
  min-height: 44px;
  outline: none;
}

.edition-catalog-card:active {
  background-color: rgba(255, 255, 255, 0.04);
}

.edition-catalog-card:focus-visible {
  box-shadow: 0 0 0 2px var(--color-primary);
}

.edition-catalog-card--current {
  border-color: var(--color-primary);
  background-color: rgba(0, 133, 118, 0.06);
}

.edition-catalog-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.edition-catalog-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.edition-catalog-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.edition-catalog-badge--current {
  background-color: var(--color-primary);
  color: #fff;
}

.edition-catalog-badge--installed {
  color: var(--color-accent);
  border: 1px solid currentColor;
  background-color: rgba(201, 172, 235, 0.08);
}

.edition-catalog-period {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}

.edition-catalog-dates {
  font-size: 11px;
  color: var(--color-primary);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.edition-catalog-label {
  font-size: 11px;
  color: var(--text-sec);
}

.edition-catalog-arrow {
  flex-shrink: 0;
  color: var(--text-sec);
  opacity: 0.5;
  display: flex;
  align-items: center;
}

.btn-view-all-editions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  color: var(--text-sec);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  min-height: 44px;
  transition: background-color 120ms ease;
}

.btn-view-all-editions:active {
  background-color: rgba(255, 255, 255, 0.04);
}

/* ─── Floating toolbar de seleção de texto (estudo) ─────────── */
.jw-float-toolbar {
  position: fixed;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 4px;
  background: #1e1e24; /* Fundo escuro premium */
  border: 1px solid rgba(80, 80, 80, 0.4);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(6px) scale(0.93); /* Efeito suave de entrada */
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  max-width: calc(100vw - 16px);
}

/* Exibição com animação suave */
.jw-float-toolbar.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Caret (seta) apontando para o texto selecionado */
.jw-float-toolbar.active::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #1e1e24; /* Mesma cor do background da barra */
}

/* Botões do Menu */
.jw-float-toolbar .dft-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.jw-float-toolbar .dft-btn:active {
  background: rgba(255,255,255,0.12);
}

.jw-float-toolbar .dft-btn svg {
  width: 16px;
  height: 16px;
}

/* Botões de Cores (Círculos coloridos) */
.jw-float-toolbar .dft-color {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.25);
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.jw-float-toolbar .dft-color:active {
  border-color: #ffffff;
  transform: scale(1.15);
}

/* Cores específicas */
.jw-float-toolbar .dft-color-yellow { background-color: var(--swatch-yellow); }
.jw-float-toolbar .dft-color-green  { background-color: var(--swatch-green); }
.jw-float-toolbar .dft-color-blue   { background-color: var(--swatch-blue); }
.jw-float-toolbar .dft-color-purple { background-color: var(--swatch-purple); }
.jw-float-toolbar .dft-color-pink   { background-color: var(--swatch-pink); }
.jw-float-toolbar .dft-color-orange { background-color: var(--swatch-orange); }

/* Separadores Verticais */
.jw-float-toolbar .dft-sep {
  width: 1px;
  height: 20px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
  margin: 0 4px;
}

/* Destaque para o botão Copiar e Deletar */
.jw-float-toolbar .dft-copy { color: #60a5fa; }
.jw-float-toolbar .dft-trash { color: #f87171; }
.jw-float-toolbar .dft-search { color: #a78bfa; }
.jw-float-toolbar .dft-note { color: #34d399; }

/* Aparência compacta inspirada na barra de seleção do JW Library */
.jw-float-toolbar {
  gap: 0;
  width: 278px;
  height: 46px;
  padding: 0 5px;
  box-sizing: border-box;
  background: #4a4a4a;
  border: none;
  border-radius: 2px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.5);
}

.dft-normal-actions {
  display: flex;
  align-items: center;
  width: 100%;
  height: 44px;
}

.jw-float-toolbar.active::after {
  border-top-color: #4a4a4a;
}

.jw-float-toolbar .dft-btn {
  width: 44px;
  height: 44px;
  border-radius: 0;
  color: #f3f3f3;
}

.jw-float-toolbar .dft-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.jw-float-toolbar .dft-palette {
  width: 48px;
}

.dft-palette-circles {
  position: relative;
  display: block;
  width: 35px;
  height: 25px;
}

.dft-palette-circles i {
  position: absolute;
  top: 2px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.35);
}

.dft-palette-circles i:nth-child(1) { left: 12px; background: #df4c91; }
.dft-palette-circles i:nth-child(2) { left: 6px; background: #49b9ba; }
.dft-palette-circles i:nth-child(3) { left: 0; background: #f2d62e; }

.dft-color-options {
  display: none;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  height: 44px;
  padding: 0 3px;
  box-sizing: border-box;
}

.jw-float-toolbar.palette-open .dft-color-options {
  display: flex;
}

.jw-float-toolbar.palette-open .dft-normal-actions {
  display: none;
}

.jw-float-toolbar .dft-color {
  position: relative;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: 1px solid rgba(255,255,255,0.82);
  outline: none;
}

.jw-float-toolbar .dft-color.is-selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.22);
}

.jw-float-toolbar .dft-color.is-selected::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #171717;
  font: 800 17px/1 Arial, sans-serif;
  text-shadow: 0 1px rgba(255,255,255,0.45);
}

.jw-float-toolbar .dft-copy,
.jw-float-toolbar .dft-trash,
.jw-float-toolbar .dft-search,
.jw-float-toolbar .dft-note {
  color: #f3f3f3;
}

/* Botão flutuante do Diamante */
.fab-diamond {
  position: absolute;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--color-accent);
  color: #101010;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 99;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.fab-diamond:active {
  transform: scale(0.92);
  background-color: #bfa0e3;
}

.fab-bible-arrow {
  width: 27px;
  height: 27px;
  transform: rotate(180deg);
}

.bible-hidden {
  display: none;
}

.bible-reader {
  display: none;
  flex: 1;
  min-height: 0;
  background: #101010;
  flex-direction: column;
}

.bible-reader.active {
  display: flex;
}

.bible-reader-toolbar {
  height: 56px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: #181818;
  border-bottom: 1px solid #292929;
}

.bible-reader-back {
  margin-left: 4px;
  color: var(--color-accent);
}

.bible-reader-back span {
  font-size: 36px;
  line-height: 1;
}

.bible-reader-heading {
  flex: 1;
  text-align: center;
  padding-right: 48px;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.bible-reader-heading span {
  font-size: 14px;
}

.bible-reader-heading strong {
  font-size: 12px;
  font-weight: 400;
}

.bible-translation-row {
  height: 50px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  background: #050505;
  border-bottom: 1px solid #242424;
}

.bible-translation-cover {
  width: 52px;
  height: 50px;
  flex: 0 0 52px;
  display: block;
  object-fit: cover;
}

.bible-translation-name {
  flex: 1;
  padding-left: 10px;
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.bible-translation-name strong {
  font-size: 16px;
  font-weight: 400;
}

.bible-translation-name span {
  font-size: 12px;
}

.bible-translation-chevron {
  font-size: 32px;
  padding: 0 12px;
}

.bible-reader-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 23px 90px;
  -webkit-overflow-scrolling: touch;
}

.bible-reader-content {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.45;
  color: #fff;
  overflow-wrap: break-word;
}

.bible-verse {
  display: inline;
}

.bible-verse-first {
  font-family: inherit;
  font-size: 0.95em;
  font-weight: 700;
  margin-right: 3px;
}

.bible-verse-number {
  font-family: inherit;
  font-size: 0.58em;
  font-weight: 700;
  line-height: 0;
  vertical-align: super;
  margin: 0 3px 0 5px;
}

.bible-inline-note {
  font-size: 0.58em;
  font-weight: 700;
  line-height: 0;
  vertical-align: super;
}

.bible-personalize {
  display: block;
  width: 60%;
  max-width: 360px;
  height: 40px;
  margin: 34px auto 0;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: #8e8e8e;
  color: #161616;
  font-family: "NotoSans", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  text-align: center;
  cursor: default;
}

@media (max-width: 380px) {
  .bible-reader-scroll {
    padding-right: 20px;
    padding-left: 20px;
  }

  .bible-reader-content {
    font-size: 19.5px;
  }

  .bible-personalize {
    width: 64%;
  }
}

/* ==========================================================================
   MODAL: SELECIONAR PERGUNTAS PARA PREPARAR COM IA
   ========================================================================== */
.ai-qsel-sheet {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.ai-qsel-help {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.5;
  margin-bottom: 14px;
}

.ai-qsel-tools {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.ai-qsel-tool-btn {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border-discreet);
  border-radius: 8px;
  background: transparent;
  color: var(--text-sec);
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.ai-qsel-tool-btn:active {
  background-color: rgba(255, 255, 255, 0.06);
}

.ai-qsel-list {
  flex: 1;
  min-height: 120px;
  overflow-y: auto;
  border: 1px solid rgba(80, 80, 80, 0.3);
  border-radius: 10px;
  background-color: rgba(255, 255, 255, 0.015);
}

.ai-qsel-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px;
  border-bottom: 1px solid rgba(80, 80, 80, 0.2);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.ai-qsel-item:last-child {
  border-bottom: none;
}

.ai-qsel-item:active {
  background-color: rgba(255, 255, 255, 0.05);
}

/* Checkbox nativo escondido; visual customizado no .ai-qsel-box */
.ai-qsel-check {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.ai-qsel-box {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border: 2px solid var(--border-discreet);
  border-radius: 5px;
  position: relative;
  transition: border-color var(--transition-speed), background-color var(--transition-speed);
}

.ai-qsel-check:checked + .ai-qsel-box {
  border-color: var(--color-primary);
  background-color: var(--color-primary);
}

.ai-qsel-check:checked + .ai-qsel-box::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.ai-qsel-item-text {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-main);
}

.ai-qsel-item--review .ai-qsel-item-text {
  color: var(--color-accent);
}

.ai-qsel-count {
  font-size: 12px;
  color: var(--text-sec);
  text-align: center;
  margin-top: 10px;
}

.btn-modal-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
