:root {
  color-scheme: light;
  /* Fundo único estilo Kindle (papel) — sem manchas brancas */
  --bg: #f2efe8;
  --bg-soft: #f2efe8;
  --bg-elevated: #faf8f3;
  --ink: #0f1111;
  --ink-soft: #232f3e;
  --muted: #565959;
  --line: #ddd6c8;
  --accent: #e47911;
  --accent-deep: #c45500;
  --accent-soft: #fff1e0;
  --paper: #f2efe8;
  --shadow-cover: 0 1px 2px rgba(15, 17, 17, 0.08), 0 8px 20px rgba(15, 17, 17, 0.1);
  --font-ui: "Sora", "Segoe UI", sans-serif;
  --font-display: "Fraunces", Georgia, "Bookerly", serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --topbar-h: 56px;
  --bottom-nav-h: 64px;
  --touch: 44px;
  /* Pilha do leitor: página embaixo, dock (Ouvir/Mentora/Mais) logo acima */
  --reader-ctrl-h: 58px;
  --reader-dock-h: 58px;
  --reader-chrome-gap: 8px;
  --reader-bottom-pad: 8px;
  --reader-bottom-stack: calc(
    var(--reader-bottom-pad) + var(--reader-ctrl-h) + var(--reader-chrome-gap) + var(--reader-dock-h) + var(--safe-bottom) + 12px
  );
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
}

/* Celular/tablet: nunca usar layout “desktop largo” */
html.is-phone-app .app {
  max-width: 100vw;
}
html.is-phone-app .reader-view {
  width: 100%;
  max-width: 100vw;
}

/*
 * Celular deitado (app wrapper / sem lock nativo):
 * mantém a interface em modo vertical, preenchendo a tela deitada.
 */
html.is-phone-app.is-phone-landscape,
html.is-phone-app.is-phone-landscape body {
  overflow: hidden !important;
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
}

html.is-phone-app.is-phone-landscape .app {
  position: fixed;
  z-index: 1;
  /* Lado curto × lado longo da tela física (= UI vertical preenchendo o deitado) */
  width: 100vh;
  height: 100vw;
  width: 100dvh;
  height: 100dvw;
  max-width: none;
  max-height: none;
  overflow: hidden;
  background: var(--bg);
}

/* PDF não pode “estourar” a largura lógica no celular deitado */
html.is-phone-app.is-phone-landscape .page-frame {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  box-sizing: border-box;
}

html.is-phone-app.is-phone-landscape .page-stack {
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

html.is-phone-app.is-phone-landscape .page-stack canvas {
  max-width: 100% !important;
  height: auto !important;
}

/* Aparelho girado ~90° */
html.is-phone-app.is-phone-landscape.orient-90 .app {
  top: 100%;
  left: 0;
  transform: rotate(-90deg);
  transform-origin: left top;
}

/* Aparelho girado ~270° */
html.is-phone-app.is-phone-landscape.orient-270 .app {
  top: 0;
  left: 100%;
  transform: rotate(90deg);
  transform-origin: left top;
}

html.is-phone-app.is-phone-landscape .library-view,
html.is-phone-app.is-phone-landscape .reader-view {
  width: 100%;
  height: 100%;
  max-width: none;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-weight: 500;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.library-view {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom));
}

/* ——— Bottom nav (Kindle-like) ——— */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  min-height: calc(var(--bottom-nav-h) + var(--safe-bottom));
  padding: 6px 4px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: rgba(242, 239, 232, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.app[data-view="reader"] .bottom-nav {
  display: none;
}

.bottom-nav-item {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  min-height: 48px;
  padding: 4px 6px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
}

.bottom-nav-item.active {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.bottom-nav-item:hover {
  color: var(--ink);
}

/* Busca some até tocar na aba Busca (no celular) */
@media (max-width: 900px) {
  body:not(.tab-search) .shelf-toolbar {
    display: none;
  }

  body.tab-search .continue-strip,
  body.tab-reading .continue-strip,
  body.tab-study .continue-strip,
  body.tab-guides .continue-strip {
    display: none;
  }
}

body.tab-study .bookshelf-section,
body.tab-study .series-bar,
body.tab-study .trail-panel {
  display: none !important;
}

body.tab-study .study-panel {
  display: block;
}

body.tab-guides .bookshelf-section,
body.tab-guides .series-bar,
body.tab-guides .trail-panel,
body.tab-guides .study-panel {
  display: none !important;
}

body.tab-guides .guides-panel {
  display: block;
}

.guides-panel {
  display: none;
  padding: 8px 0 calc(var(--bottom-nav-h) + var(--safe-bottom) + 28px);
}

.guides-panel-inner {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
}

.guides-head h2 {
  margin: 4px 0 6px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.guides-head p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.guides-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.guides-tab {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
}

.guides-tab.active {
  border-color: rgba(196, 85, 0, 0.35);
  background: #fff4e8;
  color: #c45500;
}

.guides-pane.hidden {
  display: none !important;
}

.timeline-list {
  display: grid;
  gap: 12px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.timeline-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.timeline-when {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c45500;
}

.timeline-item strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.guides-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 0 14px;
  margin-bottom: 12px;
  font: inherit;
  font-weight: 600;
  background: #fff;
  box-sizing: border-box;
}

.glossary-list {
  display: grid;
  gap: 10px;
}

.glossary-card {
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.95);
}

.glossary-card strong {
  display: block;
  font-size: 16px;
  margin-bottom: 4px;
}

.glossary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.weekly-review {
  display: grid;
  gap: 16px;
}

.weekly-block h3 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 20px;
}

.weekly-block p.lead {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.weekly-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.95);
  margin-bottom: 8px;
  text-align: left;
  width: 100%;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.weekly-item strong {
  display: block;
  font-size: 14px;
}

.weekly-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.weekly-empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.study-rec-item {
  align-items: flex-start;
}

.study-rec-detail {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0.88;
}

.study-rec-meta {
  display: block;
  margin-top: 4px;
}

.study-rec-cta {
  flex: 0 0 auto;
  margin-top: 2px;
  color: #c45500;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.study-rec-item:disabled {
  opacity: 0.7;
  cursor: default;
}

.checklist-body {
  display: grid;
  gap: 8px;
  overflow: auto;
  min-height: 0;
  flex: 1 1 auto;
}

.checklist-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.95);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.checklist-item input {
  margin-top: 2px;
}

.checklist-item.is-done {
  opacity: 0.62;
  text-decoration: line-through;
}

.checklist-area {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c45500;
  margin-bottom: 2px;
  text-decoration: none;
}

@media (max-width: 700px) {
  .timeline-item {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

button,
input,
select,
a {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.app[data-view="library"] .reader-view {
  display: none;
}

.app[data-view="reader"] .library-view {
  display: none;
}

.app[data-view="reader"] .reader-view {
  display: flex;
  flex-direction: column;
}

/* ——— Top bar ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  flex: 0 0 auto;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #07111f url("assets/icon-ai-192.png?v=257") center / cover no-repeat;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.account-admin-link-wrap {
  margin: 14px 0 0;
  text-align: center;
}

.account-admin-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.top-nav::-webkit-scrollbar {
  display: none;
}

.nav-link {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 12px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color 160ms ease, border-color 160ms ease;
}

.nav-link:hover {
  color: var(--ink);
}

.nav-link.active {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

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

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease;
}

.icon-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}

.icon-btn svg {
  display: block;
}

.text-btn {
  min-height: 36px;
  padding: 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: color 160ms ease;
}

.text-btn:hover {
  color: var(--ink);
}

.text-btn.accent {
  color: var(--accent-deep);
}

.text-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

/* ——— Intro strip (Kindle-like) ——— */
.intro {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.intro-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 36px 24px 32px;
}

.intro-item {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  align-items: start;
}

.intro-icon {
  width: 48px;
  height: 48px;
  color: var(--accent);
}

.intro-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.intro-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  max-width: 36ch;
}

/* ——— Toolbar ——— */
.shelf-toolbar {
  background: var(--bg);
  border-bottom: 0;
}

.shelf-toolbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
}

.search-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  display: grid;
  place-items: center;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 72px 0 42px;
  background: var(--bg-elevated);
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-box input::placeholder {
  color: #9a9a9a;
}

.search-box input:focus {
  border-color: #c9c5be;
  box-shadow: 0 0 0 3px rgba(228, 121, 17, 0.12);
}

.search-hint {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--muted);
  padding: 3px 6px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--ink);
}

.sort-control select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink-soft);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
}

.shelf-meta {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px 14px;
}

.shelf-count,
.shelf-filter {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.shelf-count strong {
  color: var(--ink);
  font-weight: 700;
}

.status-filters {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 24px 12px;
  scrollbar-width: none;
}

.status-filters::-webkit-scrollbar {
  display: none;
}

.status-filter {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.status-filter:hover {
  color: var(--ink);
  border-color: #cfcbc4;
}

.status-filter.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.collection-row {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 0 24px 16px;
  scrollbar-width: none;
}

.collection-row::-webkit-scrollbar {
  display: none;
}

.collection-card {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: min(280px, 78vw);
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: inherit;
  padding: 12px 14px;
  text-align: left;
  transition: border-color 160ms ease, transform 180ms ease;
}

.collection-card:hover {
  border-color: #cfcbc4;
  transform: translateY(-1px);
}

.collection-card.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.collection-card .eyebrow {
  margin: 0;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.collection-card strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.collection-card span {
  color: var(--muted);
  font-size: 12px;
}

/* ——— Bookshelf grid ——— */
.bookshelf-section {
  flex: 1 1 auto;
  background: var(--bg);
  min-height: 0;
  padding-bottom: calc(48px + var(--safe-bottom));
}

.bookshelf-section-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px 0;
}

.shelf-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.shelf-heading-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.series-bar {
  position: sticky;
  top: var(--topbar-h, 56px);
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.series-bar.hidden {
  display: none !important;
}

.series-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
  border: 0;
  background: transparent;
  color: var(--accent-deep);
  font-size: 15px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.series-back-btn:hover {
  background: var(--accent-soft);
}

.series-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.series-subtitle.hidden {
  display: none;
}

body.in-series .continue-strip,
body.in-series .shelf-toolbar {
  display: none;
}

body.in-series .bookshelf-section.hidden {
  display: none !important;
}

/* ——— Trilha de estudo ——— */
.trail-panel {
  position: relative;
  flex: 1 1 auto;
  background: var(--bg);
  /* Espaço para menu inferior + botão Zap */
  padding: 8px 0 calc(var(--bottom-nav-h) + var(--safe-bottom) + 88px);
}

.trail-panel.hidden {
  display: none !important;
}

/* Mesmo Zap do leitor — acima do menu inferior da biblioteca */
.trail-zap-btn {
  position: fixed;
  right: max(16px, var(--safe-right, 0px));
  bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 14px);
  z-index: 55;
  width: 58px;
  height: 58px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.trail-panel.hidden .trail-zap-btn {
  display: none !important;
}
.trail-zap-btn .wa-dock-icon,
.trail-zap-btn .mentor-icon {
  width: 58px;
  height: 58px;
  display: block;
  border-radius: 50%;
}
.trail-zap-btn:active {
  transform: scale(0.96);
}
.trail-zap-btn.has-unread {
  box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.28), 0 8px 22px rgba(0, 0, 0, 0.22);
}
.trail-zap-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid #fff;
}
.trail-zap-badge.hidden {
  display: none !important;
}

.trail-panel-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 16px 0;
  display: grid;
  gap: 16px;
}

.trail-head {
  display: grid;
  gap: 8px;
}

.trail-kicker {
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.trail-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.trail-progress-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.trail-bar {
  height: 8px;
  border-radius: 999px;
  background: #ddd6c8;
  overflow: hidden;
}

.trail-bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #e47911, #c45500);
  transition: width 220ms ease;
}

#trailPercent {
  font-size: 14px;
  font-weight: 800;
  color: var(--accent-deep);
}

.trail-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.trail-continue {
  min-height: 48px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(196, 85, 0, 0.22);
}

.trail-continue.hidden {
  display: none !important;
}

.trail-continue:hover {
  background: var(--accent-deep);
}

.trail-checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.trail-step-btn {
  width: 100%;
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-elevated);
  text-align: left;
  color: inherit;
}

.trail-step.is-current .trail-step-btn {
  border-color: #e0b07a;
  box-shadow: 0 0 0 3px rgba(228, 121, 17, 0.12);
}

.trail-step.is-done .trail-step-btn {
  background: #f4f7f0;
}

.trail-check {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e8e2d6;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
}

.trail-step.is-done .trail-check {
  background: #2f6b3a;
  color: #fff;
}

.trail-step.is-current:not(.is-done) .trail-check {
  background: var(--accent);
  color: #fff;
}

.trail-step-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.trail-step-body strong {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.trail-step-body span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.trail-step-pct {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.next-module-btn {
  margin-left: 4px;
  white-space: nowrap;
}

/* Faixa de prova: na pilha do chrome (acima do dock), sem cobrir a apostila */
.reader-view {
  --trail-banner-h: 0px;
  --trail-banner-gap: 0px;
}

.reader-view.has-trail-banner {
  --trail-banner-h: 104px;
  --trail-banner-gap: 8px;
}

.trail-next-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(
    var(--reader-bottom-pad) + var(--reader-ctrl-h) + var(--reader-chrome-gap) + var(--reader-dock-h) + var(--reader-chrome-gap) + var(--safe-bottom)
  );
  z-index: 29;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 72px;
  max-height: 140px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.trail-next-banner.hidden {
  display: none !important;
}

/* Em tela cheia, só some a faixa genérica — a de prova liberada continua visível. */
.reader-view.chrome-hidden .trail-next-banner:not(.is-exam-offer),
.reader-view.immersive .trail-next-banner:not(.is-exam-offer) {
  display: none !important;
}

.reader-view.chrome-hidden.has-trail-banner:not(.has-exam-banner),
.reader-view.immersive.has-trail-banner:not(.has-exam-banner) {
  --trail-banner-h: 0px;
  --trail-banner-gap: 0px;
}

.reader-view.chrome-hidden .trail-next-banner.is-exam-offer,
.reader-view.immersive .trail-next-banner.is-exam-offer,
.reader-view.has-exam-banner .trail-next-banner.is-exam-offer {
  display: flex !important;
  z-index: 40;
}

.trail-next-banner strong {
  display: block;
  font-size: 14px;
}

.trail-next-banner p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.trail-next-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.quiz-dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: min(88vh, 760px);
  padding: 0;
  overflow: hidden;
}

.quiz-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 760px);
  padding: 16px 18px 18px;
}

.quiz-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.quiz-kicker {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.quiz-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.quiz-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.quiz-body {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: 14px;
  padding-right: 2px;
}

.quiz-q {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 12px;
}

.quiz-q:first-child {
  border-top: 0;
  padding-top: 0;
}

.quiz-q-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

.quiz-options {
  display: grid;
  gap: 6px;
}

.quiz-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.9);
  cursor: pointer;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 600;
}

.quiz-option:hover {
  border-color: rgba(0, 0, 0, 0.16);
}

.quiz-option input {
  margin-top: 2px;
}

.quiz-option.is-correct {
  border-color: #1f7a45;
  background: rgba(31, 122, 69, 0.1);
}

.quiz-option.is-wrong {
  border-color: #b42318;
  background: rgba(180, 35, 24, 0.08);
}

.quiz-explain {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.4;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quiz-score {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 700;
}

.quiz-score.hidden {
  display: none !important;
}

.explain-source {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 900px) {
  .next-module-btn {
    width: 100%;
    margin: 4px 0 0;
  }

  .reader-controls:has(.next-module-btn:not(.hidden)) {
    flex-wrap: wrap;
    border-radius: 16px;
  }
}

.shelf-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.shelf-heading > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  flex: 0 0 auto;
  padding-top: 6px;
}

.series-card {
  display: grid;
  gap: 10px;
  text-align: left;
  color: inherit;
  transition: transform 200ms ease;
}

.series-card:hover {
  transform: translateY(-4px);
}

.series-label {
  display: block;
  margin-bottom: 2px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.series-stack {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 2px;
  background: transparent;
  overflow: visible;
}

.series-stack::before,
.series-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: #cfc8bb;
  box-shadow: var(--shadow-cover);
}

.series-stack::before {
  transform: translate(7px, -5px) rotate(2deg);
  opacity: 0.7;
  z-index: 0;
}

.series-stack::after {
  transform: translate(3px, -2px) rotate(1deg);
  opacity: 0.85;
  z-index: 1;
}

.series-stack-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: var(--shadow-cover);
  z-index: 2;
  background: var(--bg-elevated);
}

.series-stack-img:nth-child(n + 2) {
  display: none;
}

.series-stack-fallback {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  height: 100%;
  border-radius: 2px;
  background: #1f2a44;
  color: #f5efe4;
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  box-shadow: var(--shadow-cover);
}

.bookshelf {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 22px 16px;
  outline: none;
  animation: shelfIn 420ms ease both;
}

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

.book-card {
  display: grid;
  gap: 10px;
  color: inherit;
  text-align: left;
  transition: transform 200ms ease;
}

.book-card:hover {
  transform: translateY(-4px);
}

.book-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

.book-cover {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 2px 5px 5px 2px;
  overflow: hidden;
  background: #2a2a2a;
  box-shadow: var(--shadow-cover);
  transform-origin: left center;
  transition: box-shadow 200ms ease, transform 200ms ease;
}

.book-card:hover .book-cover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12), 0 18px 36px rgba(0, 0, 0, 0.16);
}

.book-cover::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 10px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.05) 70%, transparent);
  z-index: 2;
}

.book-cover:not(.has-image)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), transparent 42%);
  pointer-events: none;
  z-index: 1;
}

.cover-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: #ddd9d2;
}

.cover-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px 14px 18px;
  color: #fff;
}

.cover-module {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}

.cover-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(15px, 1.7vw, 18px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.cover-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 600;
  opacity: 0.9;
}

.cover-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 7px;
  border-radius: 2px;
}

.cover-badge.done {
  background: #1f7a4c;
}

.book-badges {
  margin: 4px 0 0 !important;
  color: var(--accent-deep) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

.book-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.book-info p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.book-progress {
  margin-top: 6px;
  height: 3px;
  background: #ddd8d0;
  border-radius: 2px;
  overflow: hidden;
}

.book-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}

.no-results {
  grid-column: 1 / -1;
  padding: 48px 16px;
  color: var(--muted);
  text-align: center;
  font-size: 15px;
  font-weight: 600;
}

mark {
  background: #ffe2b8;
  color: inherit;
  border-radius: 2px;
  padding: 0 2px;
}

/* ——— Continue strip (Kindle-like, uma linha) ——— */
.continue-strip {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.continue-strip.hidden {
  display: none;
}

.continue-card {
  width: min(1280px, 100%);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding: 10px 24px;
  text-align: left;
  color: inherit;
  transition: background 160ms ease;
}

.continue-card:hover {
  background: var(--accent-soft);
}

.continue-label {
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.continue-card strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-card span:last-child {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ——— Reader ——— */
.reader-view {
  --reader-bg: #f3efe8;
  --reader-chrome: rgba(250, 248, 245, 0.96);
  --reader-ink: var(--ink);
  --reader-muted: var(--muted);
  --reader-line: var(--line);
  --reader-control: #fff;
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  background: var(--reader-bg);
  color: var(--reader-ink);
}

/* Impede o mesmo toque que abriu o módulo de acertar Voltar/laterais do leitor */
.reader-view.opening-guard {
  pointer-events: none !important;
}

.reader-view[data-theme="sepia"] {
  --reader-bg: #f0e6d2;
  --reader-chrome: rgba(244, 236, 216, 0.96);
  --reader-ink: #3b2f22;
  --reader-muted: #7a6852;
  --reader-line: #e0d2b8;
  --reader-control: #faf3e6;
}

.reader-view[data-theme="night"] {
  --reader-bg: #121212;
  --reader-chrome: rgba(24, 24, 24, 0.96);
  --reader-ink: #f0f0f0;
  --reader-muted: #a0a0a0;
  --reader-line: #2c2c2c;
  --reader-control: #1c1c1c;
}

.reader-chrome {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 54px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--reader-line);
  background: var(--reader-chrome);
  backdrop-filter: blur(10px);
  transition: transform 220ms ease, opacity 220ms ease;
}

.pdf-search-bar,
.reader-progress,
.reader-controls {
  flex: 0 0 auto;
}

.reader-heading {
  min-width: 0;
}

.reader-kicker {
  margin: 0 0 2px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reader-view[data-theme="night"] .reader-kicker {
  color: #ffb45c;
}

.reader-heading h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(17px, 2.1vw, 22px);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--reader-ink);
}

.reader-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.chrome-btn,
.chrome-btn.primary {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--reader-line);
  border-radius: 4px;
  background: var(--reader-control);
  color: var(--reader-ink);
  text-decoration: none;
  font-size: 13px;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease, opacity 160ms ease;
}

.chrome-btn.primary {
  border-color: var(--accent-deep);
  background: var(--accent);
  color: #fff;
}

.chrome-btn:disabled,
.chrome-btn.disabled {
  pointer-events: none;
  opacity: 0.42;
}

.btn-label-short {
  display: none;
}

.btn-label-long {
  display: inline;
}

.reader-progress {
  height: 3px;
  background: color-mix(in srgb, var(--reader-line) 80%, transparent);
  transition: opacity 220ms ease;
}

.reader-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 180ms ease;
}

.pdf-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--reader-line);
  background: var(--reader-chrome);
}

.pdf-search-bar.hidden {
  display: none;
}

.pdf-search-bar input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--reader-line);
  border-radius: 4px;
  background: var(--reader-control);
  color: var(--reader-ink);
  padding: 0 12px;
  outline: none;
}

#pdfSearchCount {
  color: var(--reader-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.reader-body {
  position: relative;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

.reader-stage {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) 56px;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.page-stack {
  position: relative;
  display: none;
  margin: 0 auto;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.14);
  transform-origin: center center;
  transition: transform 220ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

.page-stack.visible {
  display: block;
}

.page-stack.turn-next {
  transform: perspective(1200px) rotateY(-18deg) translateX(-18px);
  opacity: 0.35;
}

.page-stack.turn-prev {
  transform: perspective(1200px) rotateY(18deg) translateX(18px);
  opacity: 0.35;
}

.page-stack.turn-idle {
  transform: perspective(1200px) rotateY(0) translateX(0);
  opacity: 1;
}

.bookmark-flag {
  position: absolute;
  top: 0;
  right: 18px;
  z-index: 5;
  min-width: 28px;
  padding: 8px 8px 14px;
  background: #c45500;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.bookmark-flag.hidden {
  display: none;
}

.chrome-btn.is-active {
  border-color: #c45500;
  background: #fff4e8;
  color: #c45500;
}

.page-stack canvas,
.page-stack .highlight-layer,
.page-stack .search-layer,
.page-stack .immersion-layer,
.page-stack .textLayer {
  position: absolute;
  left: 0;
  top: 0;
}

.page-stack canvas {
  position: relative;
  display: block;
  max-width: none;
  background: #fff;
  box-shadow: none;
}

.highlight-layer,
.search-layer,
.immersion-layer {
  pointer-events: none;
  z-index: 2;
}

.immersion-layer {
  z-index: 3;
}

.immersion-box {
  position: absolute;
  border-radius: 3px;
  transition: left 80ms linear, top 80ms linear, width 80ms linear, height 80ms linear;
}

.immersion-box.sentence {
  background: rgba(255, 196, 0, 0.22);
  box-shadow: inset 0 0 0 1px rgba(228, 121, 17, 0.28);
}

.immersion-box.word {
  background: rgba(228, 121, 17, 0.45);
  box-shadow: 0 0 0 1px rgba(196, 85, 0, 0.55);
  mix-blend-mode: multiply;
}

.highlight-box {
  position: absolute;
  background: rgba(255, 214, 70, 0.45);
  mix-blend-mode: multiply;
  border-radius: 2px;
}

.highlight-box.has-note {
  outline: 1px solid rgba(196, 120, 0, 0.55);
}

.search-hit {
  position: absolute;
  background: rgba(255, 153, 0, 0.35);
  border-radius: 2px;
}

.search-hit.active {
  background: rgba(255, 90, 0, 0.45);
  outline: 1px solid rgba(196, 80, 0, 0.7);
}

.textLayer {
  z-index: 5;
  opacity: 1;
  line-height: 1;
  overflow: hidden;
  user-select: text;
  -webkit-user-select: text;
  text-align: initial;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  pointer-events: auto;
}

.textLayer span,
.textLayer br {
  color: transparent;
  position: absolute;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  pointer-events: auto;
}

.textLayer .endOfContent {
  display: block;
  position: absolute;
  inset: 0;
  z-index: -1;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
}

.textLayer ::selection {
  background: rgba(0, 100, 255, 0.28);
}

.reader-view.select-mode .page-tap {
  pointer-events: none;
}

.reader-view.select-mode .textLayer {
  z-index: 8;
  outline: 2px solid rgba(228, 121, 17, 0.45);
  outline-offset: -2px;
}

.select-hint {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 40;
  max-width: min(420px, calc(100% - 24px));
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 17, 17, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  pointer-events: none;
}

.select-hint.hidden {
  display: none !important;
}

.pick-text-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: min(80vh, 640px);
  padding: 0;
}

.pick-text-shell {
  display: flex;
  flex-direction: column;
  max-height: min(80vh, 640px);
  padding: 16px 18px 18px;
}

.pick-text-shell h3 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 20px;
}

.pick-text-shell > p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.pick-text-list {
  flex: 1;
  overflow: auto;
  display: grid;
  gap: 8px;
}

.pick-text-item {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.95);
  padding: 10px 12px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  color: inherit;
}

.pick-text-item:hover {
  border-color: rgba(196, 85, 0, 0.45);
  background: #fff4e8;
}

.ask-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: min(88vh, 720px);
  padding: 0;
}

.ask-dialog.mentor-chat-dialog {
  width: min(440px, calc(100vw - 16px));
  height: min(92dvh, 720px);
  max-height: min(92dvh, 720px);
  margin: auto 8px 8px;
  border-radius: 18px 18px 14px 14px;
}

.ask-shell {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 720px);
  padding: 16px 18px 18px;
  gap: 10px;
}

.mentor-chat-shell {
  height: 100%;
  max-height: none;
  padding: 12px 14px 10px;
  gap: 8px;
}

.ask-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ask-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.ask-meta {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.ask-context {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--reader-muted, var(--muted));
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  max-height: 64px;
  overflow: auto;
}

.ask-context.hidden {
  display: none !important;
}

.ask-form {
  display: grid;
  gap: 8px;
}

.ask-form textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  line-height: 1.4;
  color: inherit;
  background: #fff;
  box-sizing: border-box;
}

.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ask-chip {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.95);
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
}

.ask-chip:hover {
  border-color: rgba(196, 85, 0, 0.4);
  background: #fff4e8;
}

.ask-answer {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 252, 247, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.ask-answer.hidden {
  display: none !important;
}

.ask-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.account-dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: min(90dvh, 720px);
  padding: 0;
  overflow: auto;
}

.account-shell {
  padding: 16px 18px 18px;
}

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.account-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

.account-status {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.account-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.account-tab {
  flex: 1;
  min-height: 40px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
}

.account-tab.active {
  border-color: rgba(196, 85, 0, 0.35);
  background: #fff4e8;
  color: #c45500;
}

.account-form {
  display: grid;
  gap: 10px;
}

.account-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.account-field input,
.account-field select {
  min-height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  color: inherit;
  background: #fff;
}

.profile-form {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.profile-form-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--ink);
}

.profile-form-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.profile-regimes {
  border: 0;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.profile-regimes legend {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.profile-regimes label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.profile-regimes input[type="checkbox"] {
  min-height: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #c45500;
}

.learning-profile-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.learning-profile-grid {
  margin: 0 0 12px;
  display: grid;
  gap: 10px;
}

.learning-profile-grid > div {
  display: grid;
  gap: 2px;
}

.learning-profile-grid dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.learning-profile-grid dd {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.35;
  word-break: break-word;
}

.learning-profile-form {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.account-name-field.hidden {
  display: none !important;
}

.account-error {
  margin: 0;
  color: #b42318;
  font-size: 12px;
  font-weight: 700;
}

.account-error.hidden {
  display: none !important;
}

.account-panel.hidden {
  display: none !important;
}

.account-user {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.account-sync-meta {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.app-build-label {
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

#accountBtn.is-online {
  color: #c45500;
  font-weight: 800;
}

.audio-bar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--reader-line);
  background: rgba(15, 17, 17, 0.92);
  color: #f5f1ea;
  z-index: 45;
}

.audio-bar.hidden {
  display: none;
}

.reader-view.immersive .audio-bar:not(.hidden),
.reader-view.is-compact.immersive .audio-bar:not(.hidden) {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  padding-top: calc(8px + var(--safe-top, env(safe-area-inset-top, 0px)));
}

.audio-icon-btn {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  color: #fff;
  line-height: 0;
}

.audio-icon-btn svg {
  display: block;
}

.audio-toggle {
  background: #00a884;
  color: #fff;
}

.audio-toggle .audio-icon-play {
  display: none;
}

.audio-toggle .audio-icon-pause {
  display: inline-flex;
}

.audio-toggle.is-paused .audio-icon-play {
  display: inline-flex;
  transform: translateX(1px);
}

.audio-toggle.is-paused .audio-icon-pause {
  display: none;
}

.audio-stop {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.audio-rate {
  margin-left: auto;
}

.audio-rate select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  max-width: 88px;
}

.audio-bar #audioEngine,
.audio-bar #audioVoice,
.audio-bar #audioVoiceWrap,
.audio-bar #audioAutoNext,
.audio-autonext {
  display: none !important;
}

.audio-status.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.audio-mode-btn {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(94, 234, 212, 0.45);
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.28);
  color: #99f6e4;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.audio-mode-btn[aria-pressed="true"] {
  background: rgba(45, 212, 191, 0.28);
  border-color: rgba(45, 212, 191, 0.7);
  color: #ecfeff;
}

/* Orion voice scene — visual only */
.voice-scene {
  --voice-navy: #07111f;
  --voice-petrol: #0b2a3a;
  --voice-royal: #1a4f9c;
  --voice-white: #f4f7fb;
  --voice-graphite: #8b95a7;
  --voice-level: 0;
  --voice-stage: min(188px, 40vw);
  --voice-caption-lines: 2;
  --voice-caption-lh: 1.4;
  --voice-caption-size: clamp(0.98rem, 3.3vw, 1.12rem);
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: calc(52px + var(--safe-top, env(safe-area-inset-top, 0px))) 22px
    calc(14px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 55% at 50% 8%, rgba(26, 79, 156, 0.26), transparent 58%),
    radial-gradient(ellipse 70% 40% at 50% 100%, rgba(11, 42, 58, 0.5), transparent 55%),
    linear-gradient(168deg, #050b14 0%, var(--voice-navy) 38%, #0a1828 100%);
  color: var(--voice-white);
  box-sizing: border-box;
}

.voice-scene.hidden {
  display: none;
}

.voice-scene-atmosphere {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 50% 28%, rgba(59, 130, 196, 0.12), transparent 42%);
}

.voice-scene-exit {
  position: absolute;
  top: calc(12px + var(--safe-top, env(safe-area-inset-top, 0px)));
  left: 14px;
  z-index: 2;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.55);
  color: var(--voice-graphite);
  font-size: 13px;
  font-weight: 650;
  backdrop-filter: blur(8px);
}

.voice-scene-tools {
  position: absolute;
  top: calc(12px + var(--safe-top, env(safe-area-inset-top, 0px)));
  left: 88px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: min(520px, calc(100% - 110px));
}

.voice-scene-account,
.voice-scene-install,
.voice-scene-update {
  position: relative;
  top: auto;
  left: auto;
  z-index: auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.45);
  color: var(--voice-graphite);
  font-size: 12px;
  font-weight: 650;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.voice-scene-install {
  border-color: rgba(147, 197, 253, 0.35);
  background: rgba(26, 79, 156, 0.35);
  color: #dbeafe;
  font-weight: 700;
}

.voice-scene-update {
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.55);
}

.voice-scene-build {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 8, 18, 0.35);
  color: rgba(186, 198, 214, 0.92);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.voice-scene-install.hidden {
  display: none !important;
}


/* —— Núcleo Orion (círculo, anel, onda, legenda) —— */
.voice-scene-outline-btn {
  position: absolute;
  top: calc(12px + var(--safe-top, env(safe-area-inset-top, 0px)));
  right: 14px;
  z-index: 2;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.55);
  color: var(--voice-graphite);
  font-size: 13px;
  font-weight: 650;
  backdrop-filter: blur(8px);
}

.voice-scene-outline-btn[aria-expanded="true"] {
  border-color: rgba(147, 197, 253, 0.55);
  color: #f8fafc;
  background: rgba(26, 79, 156, 0.45);
}

.voice-outline-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.voice-outline-panel.hidden {
  display: none;
}

.voice-outline-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: rgba(2, 6, 14, 0.55);
  cursor: pointer;
}

.voice-outline-sheet {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(72vh, 620px);
  display: flex;
  flex-direction: column;
  gap: 0;
  padding:
    18px 18px
    calc(16px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
  border-radius: 22px 22px 0 0;
  background:
    linear-gradient(180deg, rgba(15, 28, 48, 0.98) 0%, rgba(7, 17, 31, 0.98) 100%);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-bottom: 0;
  box-shadow: 0 -18px 48px rgba(0, 0, 0, 0.45);
  color: var(--voice-white);
}

.voice-outline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.voice-outline-kicker {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #93c5fd;
}

.voice-outline-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #f8fafc;
}

.voice-outline-close {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.55);
  color: var(--voice-graphite);
  font-size: 12px;
  font-weight: 650;
}

.voice-outline-module {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.88);
}

.voice-outline-list {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.voice-outline-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 12px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: #e2e8f0;
  cursor: pointer;
}

.voice-outline-item:hover,
.voice-outline-item:focus-visible {
  background: rgba(59, 130, 196, 0.12);
  outline: none;
}

.voice-outline-item.is-current {
  background: rgba(26, 79, 156, 0.28);
}

.voice-outline-item.is-current .voice-outline-item-title {
  color: #f8fafc;
}

.voice-outline-item-num {
  min-width: 1.4em;
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  padding-top: 2px;
}

.voice-outline-item-title {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  color: rgba(226, 232, 240, 0.92);
}

.voice-outline-item-page {
  font-size: 11px;
  font-weight: 650;
  color: var(--voice-graphite);
  white-space: nowrap;
  padding-top: 3px;
}

.voice-outline-empty {
  margin: 8px 4px 0;
  font-size: 13px;
  color: var(--voice-graphite);
  line-height: 1.4;
}

.voice-orion-stage {
  position: relative;
  z-index: 1;
  width: var(--voice-stage);
  height: var(--voice-stage);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  margin-top: 4px;
}

.voice-orion-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  pointer-events: none;
}

.voice-orion-ring-glow {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(59, 130, 196, calc(0.22 + var(--voice-level) * 0.45));
  box-shadow:
    0 0 calc(12px + var(--voice-level) * 28px) rgba(26, 79, 156, calc(0.18 + var(--voice-level) * 0.42)),
    inset 0 0 calc(8px + var(--voice-level) * 16px) rgba(59, 130, 196, calc(0.08 + var(--voice-level) * 0.2));
  transform: scale(calc(1 + var(--voice-level) * 0.045));
  transition: transform 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.voice-orion-ring-arc {
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: conic-gradient(
    from calc(var(--voice-level) * 120deg),
    rgba(59, 130, 196, 0.05),
    rgba(59, 130, 196, calc(0.35 + var(--voice-level) * 0.55)),
    rgba(244, 247, 251, calc(0.15 + var(--voice-level) * 0.35)),
    rgba(26, 79, 156, 0.08),
    rgba(59, 130, 196, 0.05)
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  opacity: calc(0.35 + var(--voice-level) * 0.65);
  animation: voice-ring-rotate 9s linear infinite;
  animation-play-state: paused;
}

.voice-scene[data-speaker="orion"] .voice-orion-ring-arc {
  animation-play-state: running;
}

.voice-scene[data-speaker="user"] .voice-orion-ring-glow {
  border-color: rgba(203, 213, 225, calc(0.25 + var(--voice-level) * 0.4));
  box-shadow: 0 0 calc(10px + var(--voice-level) * 22px) rgba(148, 163, 184, calc(0.16 + var(--voice-level) * 0.35));
}

.voice-orion-avatar-wrap {
  position: relative;
  width: 86%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(244, 247, 251, 0.14);
  background: #0f172a;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.voice-orion-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.voice-orion-identity {
  position: relative;
  z-index: 1;
  width: min(480px, 92vw);
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-top: 14px;
  gap: 6px;
}

.voice-orion-name {
  margin: 0;
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: clamp(1.45rem, 4.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--voice-white);
  line-height: 1.15;
}

.voice-orion-module {
  margin: 0;
  max-width: 100%;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.78);
  line-height: 1.35;
}

.voice-orion-topic {
  margin: 0;
  max-width: 100%;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #93c5fd;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: center;
}

.voice-orion-topic:focus-visible {
  outline: 1px solid rgba(147, 197, 253, 0.55);
  outline-offset: 3px;
  border-radius: 6px;
}

.voice-orion-topic.is-empty {
  color: rgba(139, 149, 167, 0.9);
  cursor: default;
}

.voice-orion-base {
  /* Mantém sr-only: não aparece na UI Orion */
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.voice-wave-canvas,
.voice-eq-canvas {
  position: relative;
  z-index: 1;
  width: min(420px, 84vw);
  height: 56px;
  display: block;
  flex: 0 0 auto;
  margin-top: 14px;
}

.voice-eq-bars {
  display: none;
}

.voice-caption-stack {
  position: relative;
  z-index: 1;
  width: min(540px, 92vw);
  flex: 1 1 auto;
  min-height: 4.8em;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  text-align: center;
  margin: 14px 0 8px;
  padding: 0 4px;
}

.voice-listening-hint {
  margin: 0 0 8px;
  max-width: 100%;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.06em;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-listening-hint.hidden,
.voice-caption.hidden {
  display: none !important;
}

.voice-caption {
  margin: 0;
  width: 100%;
  max-width: 100%;
  max-height: calc(var(--voice-caption-lines) * 1em * var(--voice-caption-lh));
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: var(--voice-caption-size);
  font-weight: 550;
  line-height: var(--voice-caption-lh);
  color: rgba(244, 247, 251, 0.88);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: var(--voice-caption-lines);
  line-clamp: var(--voice-caption-lines);
  text-wrap: balance;
}

.voice-caption-orion .voice-word {
  transition: color 90ms ease, text-shadow 90ms ease;
}

.voice-caption-orion .voice-word.is-active {
  color: #7eb6f0;
  text-shadow: 0 0 18px rgba(59, 130, 196, 0.35);
  font-weight: 700;
}

.voice-caption-orion.is-holding {
  color: rgba(244, 247, 251, 0.72);
}

.voice-caption-user {
  color: #cbd5e1;
  font-size: var(--voice-caption-size);
  font-weight: 500;
  border-left: 2px solid rgba(148, 163, 184, 0.55);
  padding-left: 12px;
  text-align: left;
  box-sizing: border-box;
}

.voice-caption-waiting {
  color: rgba(148, 163, 184, 0.85);
  font-weight: 600;
}

.voice-scene[data-phase="home"] .voice-scene-exit,
.voice-scene[data-phase="home"] .voice-scene-outline-btn,
.voice-scene[data-phase="profiles"] .voice-scene-outline-btn,
.voice-scene[data-phase="picker"] .voice-scene-outline-btn {
  /* Roteiro só na aula */
}

.voice-scene[data-phase="home"] .voice-scene-exit {
  display: none;
}

.voice-scene[data-phase="home"] .voice-scene-tools {
  left: 14px;
}

.voice-scene[data-phase="profiles"] .voice-scene-tools,
.voice-scene[data-phase="picker"] .voice-scene-tools,
.voice-scene[data-phase="modules"] .voice-scene-tools,
.voice-scene[data-phase="lesson"] .voice-scene-tools {
  display: none !important;
}

.voice-scene[data-phase="home"] .voice-scene-outline-btn,
.voice-scene[data-phase="profiles"] .voice-scene-outline-btn,
.voice-scene[data-phase="picker"] .voice-scene-outline-btn,
.voice-scene[data-phase="modules"] .voice-scene-outline-btn,
.voice-scene[data-phase="home"] .voice-scene-actions,
.voice-scene[data-phase="profiles"] .voice-scene-actions,
.voice-scene[data-phase="picker"] .voice-scene-actions,
.voice-scene[data-phase="modules"] .voice-scene-actions,
.voice-scene[data-phase="home"] .voice-progress,
.voice-scene[data-phase="profiles"] .voice-progress,
.voice-scene[data-phase="picker"] .voice-progress,
.voice-scene[data-phase="modules"] .voice-progress,
.voice-scene[data-phase="home"] .voice-eq-bars,
.voice-scene[data-phase="profiles"] .voice-eq-bars,
.voice-scene[data-phase="picker"] .voice-eq-bars,
.voice-scene[data-phase="modules"] .voice-eq-bars {
  display: none !important;
}

.voice-scene[data-phase="home"] .voice-orion-stage,
.voice-scene[data-phase="picker"] .voice-orion-stage,
.voice-scene[data-phase="modules"] .voice-orion-stage {
  --voice-stage: min(160px, 36vw);
  margin-top: 0;
  flex: 0 0 auto;
}

.voice-scene[data-phase="home"] .voice-orion-module {
  display: none;
}

.voice-scene[data-phase="home"] .voice-orion-identity,
.voice-scene[data-phase="picker"] .voice-orion-identity,
.voice-scene[data-phase="modules"] .voice-orion-identity {
  flex: 0 0 auto;
  margin-top: 8px;
}

.voice-scene[data-phase="home"] .voice-wave-canvas,
.voice-scene[data-phase="picker"] .voice-wave-canvas,
.voice-scene[data-phase="modules"] .voice-wave-canvas {
  flex: 0 0 auto;
  width: min(520px, 92vw);
  height: 56px;
  max-height: 56px;
  opacity: 1;
  pointer-events: none;
}

.voice-scene[data-phase="home"] .voice-caption-stack {
  display: flex !important;
  flex: 0 0 auto;
  margin: 6px 0 10px;
  min-height: 3.6em;
  --voice-caption-lines: 3;
  --voice-caption-size: clamp(0.92rem, 3.1vw, 1.05rem);
}

.voice-scene[data-phase="home"] .voice-wave-canvas {
  margin-top: 8px;
  opacity: 1;
  visibility: visible;
}

.voice-home-panel,
.voice-trail-picker,
.voice-module-picker {
  position: relative;
  z-index: 1;
  width: min(100%, 920px);
  flex: 1 1 auto;
  min-height: 0;
  max-height: 42vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  margin-top: auto;
  padding-top: 6px;
  overflow: hidden;
}

.voice-home-panel.hidden,
.voice-trail-picker.hidden,
.voice-module-picker.hidden {
  display: none;
}

/* account/install left handled above */

.voice-scene[data-phase="modules"] .voice-scene-exit {
  display: inline-flex;
}

.voice-persona-rail-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voice-persona-rail-label {
  margin: 0 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.78);
}

.voice-persona-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 18px 18px 22px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.voice-persona-rail::-webkit-scrollbar {
  display: none;
}

.voice-persona-card {
  --persona-scale: 1;
  position: relative;
  flex: 0 0 auto;
  width: min(38vw, 148px);
  aspect-ratio: 2 / 3;
  border: 0;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  scroll-snap-align: center;
  background: #0b1628;
  transform: scale(var(--persona-scale));
  transform-origin: center bottom;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms ease,
    outline-color 160ms ease;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  outline: 2px solid transparent;
}

.voice-persona-card:hover,
.voice-persona-card:focus-visible,
.voice-persona-card.is-focus {
  --persona-scale: 1.08;
  z-index: 3;
  outline-color: rgba(147, 197, 253, 0.65);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(59, 130, 196, 0.35);
}

.voice-persona-card.is-active {
  --persona-scale: 1.1;
  outline-color: rgba(253, 230, 138, 0.7);
}

.voice-persona-card.is-soon {
  cursor: default;
  filter: saturate(0.7) brightness(0.78);
}

.voice-persona-card.is-soon:hover,
.voice-persona-card.is-soon:focus-visible {
  --persona-scale: 1.04;
  outline-color: rgba(148, 163, 184, 0.35);
}

.voice-persona-card-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 18%;
  background-repeat: no-repeat;
  transform: scale(1.02);
  transition: transform 280ms ease;
}

.voice-persona-card:hover .voice-persona-card-media,
.voice-persona-card.is-focus .voice-persona-card-media,
.voice-persona-card.is-active .voice-persona-card-media {
  transform: scale(1.08);
}

.voice-persona-card-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 17, 31, 0.05) 0%, rgba(7, 17, 31, 0.2) 42%, rgba(2, 6, 14, 0.92) 100%);
}

.voice-persona-card-copy {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.voice-persona-card-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #93c5fd;
}

.voice-persona-card-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  color: #f8fafc;
}

.voice-persona-card-meta {
  font-size: 11px;
  font-weight: 650;
  color: rgba(203, 213, 225, 0.86);
}

@media (min-width: 720px) {
  .voice-persona-card {
    width: 168px;
  }
  .voice-persona-card:hover,
  .voice-persona-card:focus-visible,
  .voice-persona-card.is-focus {
    --persona-scale: 1.1;
  }
  .voice-persona-card.is-active {
    --persona-scale: 1.12;
  }
}

.voice-trail-picker {
  position: relative;
  z-index: 1;
  width: min(520px, 94vw);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.voice-trail-picker.hidden {
  display: none;
}

.voice-trail-picker-lead {
  margin: 0;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--voice-graphite);
  letter-spacing: 0.02em;
}

.voice-module-picker-lead,
.voice-trail-picker-lead {
  margin: 0 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(191, 219, 254, 0.78);
}

.voice-module-list,
.voice-trail-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.voice-trail-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 12px;
  width: 100%;
  text-align: left;
  padding: 14px 14px 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  background: rgba(7, 17, 31, 0.55);
  color: #e2e8f0;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.voice-trail-item:hover,
.voice-trail-item:focus-visible {
  border-color: rgba(147, 197, 253, 0.45);
  background: rgba(26, 79, 156, 0.28);
  outline: none;
}

.voice-trail-item-name {
  grid-column: 1 / 2;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  color: #f8fafc;
}

.voice-trail-item-cta {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
  align-self: center;
  font-size: 12px;
  font-weight: 700;
  color: #93c5fd;
  white-space: nowrap;
}

.voice-trail-item-meta {
  grid-column: 1 / 2;
  font-size: 12px;
  font-weight: 600;
  color: var(--voice-graphite);
}

.voice-trail-item-bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.voice-trail-item-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(26, 79, 156, 0.9), rgba(96, 165, 250, 0.95));
}

.voice-trail-empty {
  margin: 12px 8px;
  text-align: center;
  font-size: 13px;
  color: var(--voice-graphite);
  line-height: 1.4;
}


.voice-scene-actions {
  position: relative;
  z-index: 1;
  width: min(520px, 92vw);
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}

.voice-scene-actions .voice-scene-btn {
  min-width: 132px;
}

.voice-scene-btn {
  min-height: 42px;
  min-width: 112px;
  padding: 0 16px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.62);
  color: #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  flex: 0 0 auto;
}

.voice-scene-btn.primary {
  border-color: rgba(59, 130, 196, 0.55);
  background: linear-gradient(135deg, rgba(26, 79, 156, 0.55), rgba(11, 42, 58, 0.7));
  color: #f8fafc;
}

.voice-scene-btn:active {
  transform: scale(0.98);
}

.voice-progress {
  position: relative;
  z-index: 1;
  width: min(520px, 92vw);
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.voice-progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
}

.voice-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(59, 130, 196, 0.85), rgba(125, 182, 240, 0.95));
  transition: width 220ms ease;
}

.voice-progress-label {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  color: rgba(139, 149, 167, 0.9);
  white-space: nowrap;
  min-width: 3.2em;
  text-align: right;
}

@keyframes voice-ring-rotate {
  to { transform: rotate(360deg); }
}

@media (max-height: 700px) {
  .voice-scene {
    --voice-stage: min(150px, 34vw);
    padding-top: calc(46px + var(--safe-top, env(safe-area-inset-top, 0px)));
  }
  .voice-orion-identity { margin-top: 10px; }
  .voice-wave-canvas, .voice-eq-canvas { margin-top: 12px; height: 48px; }
  .voice-caption-stack { margin: 12px 0 4px; }
}

@media (max-height: 620px) {
  .voice-scene {
    --voice-stage: min(124px, 28vw);
  }
  .voice-orion-module,
  .voice-orion-topic {
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }
}

@media (max-width: 380px) {
  .voice-scene { padding-left: 14px; padding-right: 14px; }
}


/* Orion: trilhas/módulos usam o mesmo rail das personalidades */
.voice-trail-picker .voice-persona-rail-wrap,
.voice-module-picker .voice-persona-rail-wrap {
  width: 100%;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.voice-trail-empty {
  margin: 18px;
  text-align: left;
  font-size: 13px;
  color: var(--voice-graphite);
  line-height: 1.4;
  flex: 0 0 auto;
}

.voice-scene[data-phase="picker"] .voice-caption-stack,
.voice-scene[data-phase="modules"] .voice-caption-stack {
  display: flex !important;
  flex: 0 0 auto;
  margin: 6px 0 10px;
  min-height: 3.2em;
  --voice-caption-lines: 3;
}

.voice-scene[data-phase="picker"] .voice-wave-canvas,
.voice-scene[data-phase="modules"] .voice-wave-canvas {
  margin-top: 8px;
  opacity: 1;
  visibility: visible;
}
.reader-view.voice-only-mode .reader-chrome,
.reader-view.voice-only-mode .reader-controls,
.reader-view.voice-only-mode .reader-progress,
.reader-view.voice-only-mode .reader-tools-dock,
.reader-view.voice-only-mode .pdf-search-bar,
.reader-view.voice-only-mode .audio-bar,
.reader-view.voice-only-mode .reader-stage,
.reader-view.voice-only-mode .trail-next-banner,
.reader-view.voice-only-mode .selection-toolbar,
.reader-view.voice-only-mode .notes-panel {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.reader-view.voice-only-mode .voice-scene {
  display: flex !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

/* Aula: s? o n?cleo Orion (sem trilhas/m?dulos/ferramentas). */
.voice-scene[data-phase="lesson"] .voice-home-panel,
.voice-scene[data-phase="lesson"] .voice-trail-picker,
.voice-scene[data-phase="lesson"] .voice-module-picker {
  display: none !important;
}

.chrome-btn.is-listening {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.selection-toolbar {
  position: absolute;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 4px;
  border: 1px solid var(--reader-line);
  border-radius: 6px;
  background: var(--reader-control);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.selection-toolbar.hidden {
  display: none;
}

.selection-toolbar button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 4px;
  background: transparent;
  color: var(--reader-ink);
  font-size: 13px;
  font-weight: 700;
}

.selection-toolbar button:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.notes-panel {
  width: min(320px, 86vw);
  border-left: 1px solid var(--reader-line);
  background: var(--reader-chrome);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.notes-panel.hidden {
  display: none;
}

.notes-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--reader-line);
}

.notes-list {
  overflow: auto;
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
}

.note-item {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--reader-line);
  border-radius: 4px;
  background: var(--reader-control);
  color: inherit;
  text-align: left;
}

.note-item:hover {
  border-color: var(--accent);
}

.note-item .note-meta {
  color: var(--reader-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.note-item .note-excerpt {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.note-item .note-body {
  color: var(--reader-muted);
  font-size: 13px;
  line-height: 1.4;
}

.note-item .note-actions {
  display: flex;
  gap: 8px;
}

.note-item .note-actions button {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
}

.notes-empty {
  color: var(--reader-muted);
  font-size: 13px;
  padding: 18px 8px;
  text-align: center;
  line-height: 1.45;
}

.note-dialog {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  width: min(440px, calc(100vw - 32px));
  background: #fff;
  color: var(--ink);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.note-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.note-dialog form {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.note-dialog h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
}

.note-quote {
  margin: 0;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.4;
}

.note-dialog textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  resize: vertical;
  outline: none;
}

.note-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.card-dialog-hint {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.card-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.card-mode {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.card-mode.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.card-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.card-field textarea,
.card-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  resize: vertical;
  outline: none;
}

.card-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.study-panel {
  display: none;
  padding: 8px 16px calc(var(--bottom-nav-h) + var(--safe-bottom) + 28px);
}

.study-panel-inner {
  width: min(720px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.study-kicker {
  display: block;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.study-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 36px);
  line-height: 1.1;
}

.study-lead {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  max-width: 46ch;
}

.study-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.study-stats > div {
  display: grid;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.study-stats strong {
  font-size: 22px;
  line-height: 1;
}

.study-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.study-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.study-start {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.study-start:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.study-filter select {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}

.study-review {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.study-review.hidden {
  display: none;
}

.study-review-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.study-card {
  display: grid;
  gap: 12px;
  min-height: 160px;
  padding: 18px 16px;
  border-radius: 12px;
  background: linear-gradient(165deg, #fffdf8 0%, #f3efe6 100%);
  border: 1px solid var(--line);
}

.study-card-source {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.study-card-front {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(20px, 4vw, 26px);
  line-height: 1.25;
  white-space: pre-wrap;
}

.study-card-back-label {
  margin: 0 0 4px;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.study-card-back {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.study-card-back-wrap.hidden {
  display: none;
}

.study-reveal {
  min-height: 46px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

.study-grade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.study-grade.hidden {
  display: none;
}

.study-grade button {
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 800;
  font-size: 13px;
}

.study-grade button[data-grade="again"] { color: #b42318; }
.study-grade button[data-grade="hard"] { color: #9a6700; }
.study-grade button[data-grade="good"] { color: #1f6b3a; }

.study-exit {
  justify-self: start;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.study-list {
  display: grid;
  gap: 8px;
}

.study-item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  text-align: left;
}

.study-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.study-item-front {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
}

.study-item-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.study-item-actions button {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 800;
}

.study-empty {
  padding: 28px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 560px) {
  .bottom-nav-item {
    font-size: 11px;
    font-weight: 700;
    padding: 6px 2px;
    min-height: var(--touch);
    gap: 4px;
  }

  .bottom-nav-item svg {
    width: 22px;
    height: 22px;
  }

  .trail-step-btn {
    grid-template-columns: 40px 1fr;
    gap: 10px;
    padding: 14px 12px;
    min-height: 64px;
    border-radius: 14px;
  }

  .trail-step-pct {
    grid-column: 2;
    justify-self: start;
    margin-top: -2px;
    font-size: 12px;
    color: var(--accent-deep);
  }

  .trail-step-body strong {
    font-size: 15px;
  }

  .trail-continue {
    min-height: 48px;
    border-radius: 14px;
    font-size: 15px;
  }

  .series-back-btn {
    min-height: var(--touch);
    padding: 10px 4px;
  }

  .study-stats {
    grid-template-columns: 1fr;
  }

  .study-grade {
    grid-template-columns: 1fr;
  }

  .bookshelf-section,
  .guides-panel,
  .study-panel {
    padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 24px);
  }
}

.page-tap {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.page-tap:disabled {
  cursor: default;
}

.page-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 16px;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

#pdfCanvas {
  max-width: none;
  background: #fff;
}

.reader-view[data-theme="night"] .page-stack {
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
}

.reader-view[data-theme="night"] .highlight-box {
  mix-blend-mode: screen;
  background: rgba(255, 214, 70, 0.35);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  padding: 28px;
  text-align: center;
  color: var(--reader-muted);
}

.empty-state strong {
  color: var(--reader-ink);
  font-size: 18px;
  font-weight: 700;
}

.empty-state span {
  max-width: 34ch;
  font-size: 14px;
  line-height: 1.45;
}

.fallback .chrome-btn {
  margin-top: 8px;
}

.resume-toast {
  position: absolute;
  left: 50%;
  /* Acima da pilha dock + controles — nunca por baixo dos botões */
  bottom: calc(var(--reader-bottom-stack) + 8px);
  z-index: 25;
  transform: translateX(-50%);
  max-width: min(90vw, 420px);
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  pointer-events: none;
}

/* FAB de chat removido — aviso de mensagem fica no ícone Professora do dock */

.welcome-reply-chips.is-hidden {
  display: none;
}

.reader-controls {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 58px;
  padding: 8px 12px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--reader-line);
  background: var(--reader-chrome);
  transition: transform 220ms ease, opacity 220ms ease;
}

.desktop-only {
  display: inline-flex;
}

.ctrl-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--reader-line);
  border-radius: 4px;
  background: var(--reader-control);
  color: var(--reader-ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
}

.ctrl-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--reader-muted);
  font-size: 13px;
  font-weight: 650;
}

.page-jump input {
  width: 64px;
  min-height: 36px;
  border: 1px solid var(--reader-line);
  border-radius: 4px;
  background: var(--reader-control);
  color: var(--reader-ink);
  text-align: center;
  font-weight: 700;
  outline: none;
}

.page-percent,
.reading-eta {
  min-width: 44px;
  color: var(--reader-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.reading-eta {
  min-width: 110px;
  color: var(--accent-deep);
}

.notes-tabs {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
  border-bottom: 1px solid var(--reader-line);
}

.notes-tab {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--reader-muted);
  font-size: 12px;
  font-weight: 700;
}

.notes-tab.active {
  border-color: var(--reader-line);
  background: var(--reader-control);
  color: var(--reader-ink);
}

.note-item.is-bookmark {
  border-color: rgba(196, 85, 0, 0.35);
  background: color-mix(in srgb, #fff4e8 70%, var(--reader-control));
}

.dict-popover {
  position: absolute;
  z-index: 14;
  width: min(300px, calc(100% - 24px));
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--reader-line);
  border-radius: 8px;
  background: var(--reader-control);
  color: var(--reader-ink);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.dict-popover.hidden {
  display: none;
}

.dict-popover header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dict-popover strong {
  font-family: var(--font-display);
  font-size: 20px;
}

.dict-body {
  color: var(--reader-muted);
  font-size: 13px;
  line-height: 1.45;
  max-height: 160px;
  overflow: auto;
}

.dict-more {
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.dict-more.hidden {
  display: none;
}

.explain-popover {
  position: fixed;
  z-index: 80;
  left: 12px;
  top: 12px;
  width: min(420px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(72dvh, calc(100dvh - 24px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  box-sizing: border-box;
}

.explain-popover.hidden {
  display: none;
}

.explain-popover header,
.explain-popover .explain-source,
.explain-popover .explain-quote,
.explain-popover .explain-terms,
.explain-popover .explain-actions {
  flex: 0 0 auto;
}

.explain-popover .dict-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  color: var(--reader-ink);
  white-space: pre-wrap;
  overscroll-behavior: contain;
}

.explain-quote {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--reader-muted);
  font-size: 12px;
  line-height: 1.4;
  max-height: 64px;
  overflow: auto;
}

.explain-terms {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 56px;
  overflow: auto;
}

.explain-terms:empty {
  display: none;
}

.explain-term-chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(228, 121, 17, 0.14);
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.explain-actions {
  display: flex;
  gap: 8px;
  padding-top: 2px;
}

@media (max-width: 900px) {
  .explain-popover {
    width: min(100vw - 20px, 420px);
    max-height: min(68dvh, calc(100dvh - 20px - env(safe-area-inset-bottom, 0px)));
  }
}

.explain-actions button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.ctrl-sep {
  width: 1px;
  height: 24px;
  background: var(--reader-line);
  margin: 0 4px;
}

.reader-view.chrome-hidden .reader-chrome,
.reader-view.chrome-hidden .reader-controls,
.reader-view.chrome-hidden .reader-progress,
.reader-view.chrome-hidden .pdf-search-bar {
  opacity: 0;
  pointer-events: none;
}

.reader-view.chrome-hidden .reader-chrome {
  transform: translateY(-100%);
}

.reader-view.chrome-hidden .reader-controls {
  transform: translateY(100%);
}

@media (max-width: 900px) {
  .reader-body {
    grid-template-columns: 1fr;
  }

  .notes-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 25;
    box-shadow: -12px 0 30px rgba(0, 0, 0, 0.18);
  }

  .topbar-inner {
    padding: 0 14px;
    gap: 12px;
  }

  .top-nav {
    display: none;
  }

  .intro-inner {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 28px 14px 24px;
  }

  .shelf-toolbar-inner,
  .shelf-meta,
  .status-filters,
  .collection-row,
  .bookshelf-section-inner {
    padding-left: 14px;
    padding-right: 14px;
  }

  .reading-eta {
    width: auto;
    max-width: 9.5em;
    min-width: 0;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-hint {
    display: none;
  }

  .search-box input {
    padding-right: 12px;
  }

  .bookshelf {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px 10px;
  }

  .continue-card {
    padding-left: 14px;
    padding-right: 14px;
  }

  .desktop-only {
    display: none !important;
  }

  .reader-view {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-height: 100dvh;
    background: #f4f1ea;
  }

  .reader-chrome {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "back actions"
      "heading heading";
    gap: 6px 8px;
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
    background: rgba(244, 241, 234, 0.96);
    overflow: hidden;
  }

  .reader-chrome .chrome-back {
    grid-area: back;
    padding: 0 10px;
  }

  .reader-heading {
    grid-area: heading;
    min-width: 0;
  }

  .reader-heading .reader-kicker {
    display: none;
  }

  .reader-heading h1 {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
  }

  .reader-actions {
    grid-area: actions;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
    justify-content: flex-end;
    min-width: 0;
    max-width: 100%;
  }

  .reader-actions .chrome-btn,
  .reader-chrome .chrome-back {
    flex: 0 0 auto;
    min-width: var(--touch);
    min-height: var(--touch);
    padding: 0 10px;
    font-size: 15px;
  }

  .btn-label-long {
    display: none;
  }

  .btn-label-short {
    display: inline;
  }

  #fullScreenPdf .btn-label-short {
    font-size: 12px;
    font-weight: 700;
  }

  .reader-body {
    flex: 1 1 auto;
    min-height: 0;
  }

  .reader-stage {
    display: block;
    width: 100%;
    height: 100%;
  }

  .page-frame {
    position: absolute;
    inset: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    background: #f4f1ea;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .page-stack {
    margin: 0 auto;
    max-width: 100%;
    box-shadow: none;
  }

  .page-stack canvas {
    max-width: none;
  }

  .page-tap {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 4;
    width: 22%;
    min-width: 48px;
  }

  .page-tap.prev { left: 0; }
  .page-tap.next { right: 0; }

  .reader-controls .ctrl-sep,
  .reader-controls #zoomIn,
  .reader-controls #zoomOut {
    display: none;
  }

  .reading-eta {
    min-width: 0;
    font-size: 12px;
  }

  /* Kindle-like immersive: só o PDF, tela cheia */
  .reader-view.immersive .reader-chrome,
  .reader-view.immersive .pdf-search-bar,
  .reader-view.immersive .reader-controls,
  .reader-view.immersive .reader-progress {
    display: none !important;
  }

  .reader-view.immersive .audio-bar:not(.hidden) {
    display: flex !important;
    position: sticky;
    top: 0;
  }

  .reader-view.immersive .reader-body {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    z-index: 40;
  }

  .reader-view.immersive .page-frame {
    background: #fff;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

/* Compact class (set by JS) — full-bleed even if viewport width media query mismatches */
.reader-view.is-compact .reader-stage {
  display: block;
  grid-template-columns: none;
  width: 100%;
  height: 100%;
}

.reader-view.is-compact .page-frame {
  position: absolute;
  inset: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  background: #f4f1ea;
  overflow-x: hidden;
  overflow-y: auto;
  touch-action: pan-y;
}

.reader-view.is-compact .page-stack {
  margin: 0;
  max-width: 100%;
  box-shadow: none;
}

.reader-view.is-compact .page-stack canvas {
  max-width: none;
}

.reader-view.is-compact .page-tap {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 4;
  width: 18%;
  min-width: 40px;
  max-width: 72px;
}

.reader-view.is-compact .page-tap.prev { left: 0; }
.reader-view.is-compact .page-tap.next { right: 0; }

/* Em tela cheia: faixas laterais mais estreitas; centro = menu */
.reader-view.is-compact.immersive .page-tap {
  width: 12%;
  min-width: 36px;
  max-width: 56px;
  z-index: 42;
}

.immersive-menu-btn {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 90;
  min-height: 44px;
  padding: 10px 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 17, 17, 0.88);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.immersive-menu-btn.hidden {
  display: none !important;
}

.immersive-menu-btn:active {
  transform: translateX(-50%) scale(0.97);
}

.reader-view.is-compact.immersive .reader-chrome,
.reader-view.is-compact.immersive .pdf-search-bar,
.reader-view.is-compact.immersive .reader-controls,
.reader-view.is-compact.immersive .reader-progress,
.reader-view.is-compact.immersive .reader-tools-dock {
  display: none !important;
}

.reader-view.is-compact.immersive .audio-bar:not(.hidden) {
  display: flex !important;
}

.reader-view.is-compact.immersive .reader-body {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 40;
}

.reader-view.is-compact.immersive .page-frame {
  background: #fff;
  overflow-x: hidden;
  overflow-y: auto;
  justify-content: flex-start;
}

.reader-view.is-compact.immersive .page-stack {
  width: 100% !important;
  max-width: 100%;
  margin-left: auto !important;
  margin-right: auto !important;
  flex: 0 0 auto;
}

.reader-view.is-compact .reader-chrome {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "back actions"
    "heading heading";
  gap: 6px 8px;
  overflow: hidden;
}

.reader-view.is-compact .reader-chrome .chrome-back {
  grid-area: back;
}

.reader-view.is-compact .reader-heading {
  grid-area: heading;
}

.reader-view.is-compact .reader-heading .reader-kicker {
  display: none;
}

.reader-view.is-compact .reader-actions {
  grid-area: actions;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  justify-content: flex-end;
}

/* Ferramentas secundárias: só via Mentora / Mais */
.tool-via-more,
.desktop-reader-tool {
  display: none !important;
}

/* Dock fixo: Prova · Ouvir · Professora (acima da troca de página) */
.reader-tools-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(
    var(--reader-bottom-pad) + var(--reader-ctrl-h) + var(--reader-chrome-gap) + var(--safe-bottom)
  );
  z-index: 27;
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: auto;
  max-width: 380px;
  min-height: var(--reader-dock-h);
  margin: 0 auto;
  padding: 4px 4px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.reader-view:not(.hidden) .reader-tools-dock {
  display: grid;
}

.reader-view.chrome-hidden .reader-tools-dock,
.reader-view.immersive .reader-tools-dock {
  display: none !important;
}

/* Troca de página fica na base — uma linha só */
.reader-view:not(.hidden) .reader-controls {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(var(--reader-bottom-pad) + var(--safe-bottom));
  z-index: 28;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--reader-ctrl-h);
  height: var(--reader-ctrl-h);
  max-height: var(--reader-ctrl-h);
  padding: 6px 10px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 18px;
  background: rgba(255, 252, 247, 0.97);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.reader-view:not(.hidden) .reader-controls .reading-eta {
  width: auto;
  max-width: 9em;
  min-width: 0;
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-view:not(.hidden) .reader-controls .next-module-btn {
  display: none !important;
}

.dock-tool {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--touch);
  padding: 4px 2px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.1;
  cursor: pointer;
}

.dock-tool:disabled {
  opacity: 0.45;
  cursor: default;
}

.dock-tool:not(:disabled):active {
  background: #fff4e8;
  color: #c45500;
}

.dock-tool.has-exam {
  color: #c45500;
  background: rgba(228, 121, 17, 0.12);
}

.dock-tool-more {
  background: rgba(228, 121, 17, 0.12);
  color: #c45500;
}

.dock-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
  opacity: 0.92;
}

.dock-tool-label {
  display: block;
  white-space: nowrap;
}

.dock-tool-badge {
  position: absolute;
  top: 2px;
  right: max(6px, 12%);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #25d366;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(255, 252, 247, 0.95);
  pointer-events: none;
}

.dock-tool-badge.hidden {
  display: none !important;
}

.dock-tool.mentor-trigger.has-unread {
  animation: dock-mentor-pulse 1.6s ease-in-out 2;
}

.dock-tool.mentor-trigger #mentorChatBadge:not(.hidden) {
  background: #25d366;
  color: #fff;
  font-weight: 800;
}

@keyframes dock-mentor-pulse {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 0 4px rgba(228, 121, 17, 0.22);
  }
}

.mentor-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
}

.mentor-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em;
}

.dock-tool.mentor-trigger {
  position: relative;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}

.dock-tool.mentor-trigger .mentor-icon {
  width: 20px;
  height: 20px;
  vertical-align: 0;
  opacity: 0.92;
}

.mentor-icon-head {
  width: 1.05em;
  height: 1.05em;
  opacity: 0.85;
}

.reader-more-sheet {
  width: min(480px, calc(100vw - 16px));
  max-height: min(80dvh, 640px);
  margin: auto 8px 8px;
  padding: 0;
  border: 0;
  border-radius: 18px 18px 14px 14px;
  background: #fffaf4;
  color: var(--ink);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.22);
}

.reader-more-sheet::backdrop {
  background: rgba(15, 17, 17, 0.45);
}

.reader-more-shell {
  padding: 16px 16px 18px;
}

.reader-more-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.reader-more-head h3 {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
}

.reader-more-list {
  display: grid;
  gap: 8px;
  max-height: min(60dvh, 480px);
  overflow: auto;
}

.reader-more-item {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.95);
  color: inherit;
  cursor: pointer;
}

.reader-more-item strong {
  font-size: 15px;
  font-weight: 800;
}

.reader-more-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.reader-more-item:active {
  border-color: rgba(196, 85, 0, 0.35);
  background: #fff4e8;
}

/* Celular/tablet estreito: sem tela cheia no Mais */
@media (max-width: 900px) {
  .reader-more-item.more-desktop-only,
  .reader-more-item[data-tool="immersive"] {
    display: none !important;
  }
}

.reader-view.is-compact .reader-controls {
  left: 10px;
  right: 10px;
  bottom: calc(var(--reader-bottom-pad) + var(--safe-bottom));
  min-height: var(--reader-ctrl-h);
  height: var(--reader-ctrl-h);
  max-height: var(--reader-ctrl-h);
  padding: 6px 10px;
  border-radius: 18px;
}

.reader-view.is-compact .reader-controls .ctrl-btn,
.reader-view.is-compact .reader-controls .page-jump input {
  min-width: var(--touch);
  min-height: var(--touch);
}

/* Espaço reservado = dock + controles + faixa de prova (quando visível) + safe area */
.reader-view:not(.hidden) .page-frame {
  padding-bottom: calc(
    var(--reader-bottom-stack) + var(--trail-banner-h) + var(--trail-banner-gap)
  );
}

.reader-view.is-compact .page-tap {
  width: 14%;
  min-width: 36px;
  max-width: 52px;
}

.reader-view.is-compact .btn-label-long {
  display: none;
}

.reader-view.is-compact .btn-label-short {
  display: inline;
}

.reader-view.is-compact .reader-actions .chrome-btn {
  min-width: var(--touch);
  min-height: var(--touch);
  padding: 0 10px;
  font-size: 15px;
}

/* Mentora: folha inferior no celular */
@media (max-width: 720px) {
  .ask-dialog.mentor-chat-dialog {
    width: 100%;
    max-width: 100%;
    height: min(88dvh, 720px);
    max-height: min(88dvh, 720px);
    margin: 0;
    margin-top: auto;
    border-radius: 20px 20px 0 0;
    border: 0;
  }

  .mentor-chat-shell {
    padding: 10px 14px calc(10px + var(--safe-bottom));
  }

  .mentor-chat-title h3 {
    font-size: 20px;
  }

  .mentor-level-tab {
    min-height: 36px;
    padding: 6px 10px;
    font-size: 12px;
  }

  .mentor-chat-composer .chrome-btn {
    min-height: var(--touch);
  }

  .ask-disclaimer,
  .mentor-chat-disclaimer {
    font-size: 11px;
  }

  .reader-more-sheet {
    width: 100%;
    max-width: 100%;
    margin: 0;
    margin-top: auto;
    border-radius: 20px 20px 0 0;
    max-height: min(85dvh, 640px);
    padding-bottom: var(--safe-bottom);
  }

  .reader-more-item {
    min-height: 56px;
    padding: 14px 16px;
  }
}

@media (max-width: 900px) {
  .bookshelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 14px;
  }

  .shelf-heading h2 {
    font-size: 22px;
  }

  .brand-name {
    font-size: 22px;
  }

  .shelf-toolbar-inner,
  .continue-card,
  .bookshelf-section-inner {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.mentor-chat-head {
  align-items: center;
  flex-shrink: 0;
}

.mentor-chat-title h3 {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.mentor-chat-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mentor-new-chat-btn {
  border: 0;
  background: transparent;
  color: var(--muted, #6b7280);
  font: inherit;
  font-size: 0.72rem;
  line-height: 1.2;
  padding: 4px 6px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  max-width: 10.5rem;
}

.mentor-new-chat-btn:hover {
  color: var(--ink, #111);
}

.mentor-new-chat-btn.hidden {
  display: none;
}

.mentor-chat-head {
  align-items: center;
}

.ask-disclaimer {
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  opacity: 0.85;
}

.ask-disclaimer.hidden {
  display: none;
}

.mentor-chat-disclaimer {
  flex-shrink: 0;
  order: 5;
}

.mentor-level-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.05);
}

.mentor-level-tab {
  border: 0;
  border-radius: 999px;
  padding: 5px 8px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.mentor-level-tab.active {
  background: #fff;
  color: #c45500;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mentor-chat-thread {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  margin: 0;
  padding: 4px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.mentor-chat-empty {
  margin: auto 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  padding: 24px 12px;
}

.mentor-name-gate {
  order: 1;
  margin: 0 0 10px;
  padding: 12px 12px 14px;
  border: 1px solid rgba(196, 85, 0, 0.22);
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8f0 0%, #fff1e4 100%);
}

.mentor-name-gate.hidden {
  display: none !important;
}

.mentor-name-gate-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 800;
}

.mentor-name-gate-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.mentor-name-gate-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.mentor-name-gate-row input {
  flex: 1;
  min-height: 44px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  background: #fff;
}

.mentor-home {
  display: grid;
  gap: 12px;
  flex-shrink: 0;
  order: 2;
  margin: 0 0 4px;
}

.mentor-home.is-hidden {
  display: none !important;
}

.mentor-home-block {
  display: grid;
  gap: 6px;
}

.mentor-home-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mentor-module-lock-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.mentor-home-block.is-locked .mentor-shortcut {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.15);
}

.mentor-home-block.is-locked .mentor-shortcut:active {
  transform: none;
}

.mentor-exam-offers .mentor-exam-btn {
  text-align: left;
  padding: 12px 14px;
  border: 1px solid rgba(16, 185, 129, 0.35);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0.04));
}

.mentor-exam-offers .mentor-exam-btn strong {
  display: block;
  font-size: 0.95rem;
}

.mentor-exam-offers .mentor-exam-btn span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--muted, #6b7280);
}

.mentor-exam-offers .mentor-exam-btn.hidden {
  display: none !important;
}

.mentor-shortcuts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.mentor-shortcuts-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mentor-shortcuts-1 {
  grid-template-columns: 1fr;
}

.mentor-shortcuts-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mentor-home-block .mentor-shortcuts-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mentor-shortcuts-4 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-insights-body {
  display: grid;
  gap: 10px;
  max-height: min(55dvh, 420px);
  overflow: auto;
  padding: 2px 0 8px;
}

.page-insight-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff6eb 100%);
  overflow: hidden;
}

.page-insight-toggle {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.page-insight-toggle strong {
  font-size: 14px;
  font-weight: 800;
}

.page-insight-toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}

.page-insight-detail {
  padding: 0 14px 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.page-insight-detail.hidden {
  display: none;
}

.page-insight-snippet {
  margin: 10px 0 8px;
  color: #8a5a2b;
  font-size: 13px;
  font-weight: 600;
  font-style: italic;
  line-height: 1.4;
}

.page-insight-explain {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
}

.page-insight-card.is-open {
  border-color: rgba(196, 85, 0, 0.28);
}

.page-term-badge {
  margin-left: 6px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.mentor-shortcut {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  background: linear-gradient(180deg, #fffdf9 0%, #fff6eb 100%);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.mentor-shortcut strong {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.mentor-shortcut:active {
  border-color: rgba(196, 85, 0, 0.35);
  background: #fff4e8;
}

.mentor-shortcuts.is-hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .mentor-shortcuts-3 {
    grid-template-columns: 1fr;
  }
}

.mentor-chat-chips {
  flex-shrink: 0;
  order: 3;
}

.mentor-chat-chips.is-hidden,
.ask-chips.is-hidden {
  display: none !important;
}

@media (max-width: 420px) {
  .mentor-shortcuts:not(.mentor-shortcuts-4) {
    grid-template-columns: 1fr;
  }

  .mentor-shortcuts:not(.mentor-shortcuts-4) .mentor-shortcut {
    min-height: 0;
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 11px 12px;
  }
}

.mentor-chat-composer {
  flex-shrink: 0;
  order: 4;
  gap: 6px;
  padding-top: 4px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.mentor-chat-composer textarea {
  min-height: 44px;
  max-height: 96px;
  resize: none;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 500;
}

.mentor-chat-send-row {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ask-thread {
  display: grid;
  gap: 8px;
  overflow: auto;
  margin: 0;
}

.ask-bubble {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 252, 247, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.06);
  max-width: 92%;
}

.ask-bubble.user {
  align-self: flex-end;
  background: rgba(228, 121, 17, 0.12);
  border-color: rgba(196, 85, 0, 0.18);
}

.ask-bubble.mentor {
  align-self: flex-start;
}

.ask-bubble.streaming p::after {
  content: "▍";
  animation: mentor-blink 1s step-end infinite;
}

@keyframes mentor-blink {
  50% { opacity: 0; }
}

.ask-bubble span {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.ask-bubble p {
  margin: 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
  font-weight: 500;
}

.quiz-coach {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff4e8;
  border: 1px solid rgba(196, 85, 0, 0.2);
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
}

.quiz-coach.hidden {
  display: none;
}

.quiz-coach strong {
  display: block;
  margin-bottom: 6px;
  color: #c45500;
}

.weekly-mentor {
  background: rgba(228, 121, 17, 0.08);
  border-radius: 14px;
  padding: 12px 14px;
}

/* —— Conversas Professora estilo WhatsApp —— */
.dock-tool.wa-dock .wa-dock-icon {
  width: 28px;
  height: 28px;
  opacity: 1;
}

.dock-tool.wa-dock.has-unread {
  animation: dock-wa-pulse 1.5s ease-in-out 2;
}

@keyframes dock-wa-pulse {
  0%,
  100% {
    box-shadow: none;
  }
  50% {
    box-shadow: 0 0 0 4px rgba(37, 211, 102, 0.28);
  }
}

.ask-dialog.wa-chat-dialog {
  --wa-bg: #0b141a;
  --wa-panel: #111b21;
  --wa-header: #1f2c34;
  --wa-surface: #202c33;
  --wa-bubble-in: #202c33;
  --wa-bubble-out: #005c4b;
  --wa-text: #e9edef;
  --wa-text-secondary: #8696a0;
  --wa-accent: #00a884;
  --wa-unread: #25d366;
  --wa-composer: #1d282f;
  width: min(420px, calc(100vw - 12px));
  height: min(94dvh, 760px);
  max-height: min(94dvh, 760px);
  margin: auto 6px 6px;
  border: 0;
  border-radius: 14px;
  background: var(--wa-bg);
  color: var(--wa-text);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}

@media (max-width: 560px) {
  .ask-dialog.wa-chat-dialog {
    width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
}

.ask-dialog.wa-chat-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

/* Lista de conversas (estilo WhatsApp escuro) */
.wa-contacts-dialog .wa-contacts-shell {
  display: flex;
  flex-direction: column;
  background: var(--wa-bg);
}
.wa-contacts-dialog .wa-contacts-head {
  background: var(--wa-bg);
  min-height: 64px;
  padding: 10px 8px 8px 16px;
  box-shadow: none;
  justify-content: space-between;
}
.wa-contacts-brand {
  min-width: 0;
  flex: 1;
}
.wa-contacts-brand h3 {
  margin: 0;
  color: #e9edef;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.wa-contacts-brand .wa-status {
  margin: 3px 0 0;
  color: #8696a0;
  font-size: 13px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 78vw;
}
.wa-contacts-close {
  color: #aebac1;
  width: 40px;
  height: 40px;
}
.wa-contacts-doc-banner {
  display: none !important;
}
.wa-contacts-search-wrap {
  padding: 4px 14px 10px;
  background: var(--wa-bg);
}
.wa-contacts-search {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: #242b31;
  color: #8696a0;
}
.wa-contacts-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e9edef;
  font: inherit;
  font-size: 15px;
  padding: 10px 0;
}
.wa-contacts-search input::placeholder {
  color: #8696a0;
}
.wa-contacts-filters {
  display: flex;
  gap: 8px;
  padding: 0 14px 10px;
  background: var(--wa-bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.wa-contacts-filters::-webkit-scrollbar {
  display: none;
}
.wa-filter-chip {
  flex-shrink: 0;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: #242b31;
  color: #d1d7db;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.wa-filter-chip.is-active {
  background: #0a332c;
  color: #25d366;
  font-weight: 600;
}
.wa-filter-chip:active {
  opacity: 0.88;
}
.wa-contacts-empty {
  margin: 0;
  padding: 28px 22px;
  color: var(--wa-text-secondary);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: center;
}
.wa-contacts-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--wa-bg);
}
.wa-contact-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: 100%;
  padding: 11px 16px 12px;
  border: 0;
  border-bottom: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  position: relative;
}
.wa-contact-row::after {
  content: "";
  position: absolute;
  left: 70px;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(134, 150, 160, 0.14);
}
.wa-contact-row:hover,
.wa-contact-row:focus-visible {
  background: #111b21;
  outline: none;
}
.wa-contact-row:active {
  background: #182229;
}
.wa-contact-row .wa-avatar {
  width: 52px;
  height: 52px;
}
.wa-contact-row .wa-avatar-face {
  width: 52px;
  height: 52px;
}
.wa-contact-main {
  min-width: 0;
}
.wa-contact-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.wa-contact-name {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  color: #e9edef;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-contact-time {
  flex-shrink: 0;
  font-size: 12px;
  color: #8696a0;
  font-weight: 400;
}
.wa-contact-time.has-unread {
  color: #25d366;
  font-weight: 500;
}
.wa-contact-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}
.wa-contact-preview {
  margin: 0;
  font-size: 14px;
  color: #8696a0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-weight: 400;
}
.wa-contact-preview.has-unread {
  color: #d1d7db;
  font-weight: 400;
}
/* Como no WhatsApp: “digitando…” / “gravando áudio…” na lista de conversas. */
.wa-contact-preview.is-live {
  color: #25d366;
  font-weight: 500;
}
.wa-contact-unread {
  flex-shrink: 0;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #25d366;
  color: #111b21;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.wa-contact-unread.hidden {
  display: none;
}
.wa-contact-mute {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1;
  opacity: 0.72;
}
/* Zap original: sem anel colorido por contato — só avatar + bolinha online. */
.wa-avatar.is-gemini,
.wa-avatar.is-gemini-pages,
.wa-avatar.is-gemini-provas,
.wa-avatar.is-gemini-duvidas {
  box-shadow: none;
}
.wa-avatar.is-gemini .wa-online-dot,
.wa-avatar.is-gemini-pages .wa-online-dot,
.wa-avatar.is-gemini-provas .wa-online-dot,
.wa-avatar.is-gemini-duvidas .wa-online-dot {
  background: #25d366;
}
.ask-dialog.wa-chat-dialog[data-zap-contact="gemini_pages"] .wa-chat-head,
.ask-dialog.wa-chat-dialog[data-zap-contact="gemini_provas"] .wa-chat-head,
.ask-dialog.wa-chat-dialog[data-zap-contact="gemini_duvidas"] .wa-chat-head,
.ask-dialog.wa-chat-dialog[data-zap-contact="gemini"] .wa-chat-head,
.ask-dialog.wa-chat-dialog[data-zap-contact="gpt"] .wa-chat-head {
  background: var(--wa-header);
}

.wa-chat-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
  padding: 0;
  gap: 0;
  background: var(--wa-bg);
  overflow: hidden;
}

.wa-chat-head {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #1f2c34;
  color: #e9edef;
  border-bottom: 0;
  min-height: 60px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 30;
}
/* Lista de conversas: título + X na mesma linha (como WhatsApp). */
.wa-contacts-dialog.wa-chat-dialog .wa-contacts-head.wa-chat-head {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  padding: 10px 8px 8px 16px;
  background: var(--wa-bg);
  box-shadow: none;
}
.wa-contacts-dialog .wa-contacts-head .wa-contacts-close {
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
}
.wa-chat-head-main {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: 60px;
  padding: 4px 4px 4px 2px;
  width: 100%;
}
.ask-dialog.wa-chat-dialog.is-searching .wa-chat-head-main {
  display: none !important;
}
.ask-dialog.wa-chat-dialog:not(.wa-contacts-dialog) .wa-chat-head {
  background: #1f2c34;
}
/* Busca no lugar do cabeçalho (como no Zap). */
.wa-chat-search-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 60px;
  padding: 4px 4px 4px 2px;
  width: 100%;
  background: #1f2c34;
}
.wa-chat-search-bar.hidden {
  display: none !important;
}
.wa-chat-search-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  margin: 0 2px;
  border-radius: 8px;
  background: #2a3942;
  color: #8696a0;
}
.wa-chat-search-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #e9edef;
  font: inherit;
  font-size: 16px;
  padding: 8px 0;
}
.wa-chat-search-field input::placeholder {
  color: #8696a0;
}
.wa-chat-search-count {
  flex-shrink: 0;
  min-width: 2.6rem;
  padding: 0 2px;
  text-align: center;
  color: #8696a0;
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ask-dialog.wa-chat-dialog.is-searching .wa-chat-thread .ask-bubble.wa-msg:not(.is-search-hit) {
  opacity: 0.42;
}
.ask-bubble.wa-msg.is-search-hit {
  opacity: 1 !important;
  box-shadow: 0 0 0 1px rgba(255, 213, 106, 0.35);
}
.ask-bubble.wa-msg.is-search-current {
  opacity: 1 !important;
  box-shadow: 0 0 0 2px rgba(255, 213, 106, 0.85);
}
.ask-bubble.wa-msg.mentor.is-search-current {
  background: #2a3942;
}
.ask-bubble.wa-msg.user.is-search-current {
  background: #02675a;
}
.mentor-chat-tools {
  display: flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  margin-left: 2px;
  padding-right: 2px;
}

.wa-back {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aebac1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

.wa-back:active {
  background: rgba(255, 255, 255, 0.12);
}

.wa-chat-peer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 4px 6px 4px 2px;
  margin: 0;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
}
.wa-chat-peer:active {
  background: rgba(255, 255, 255, 0.06);
}

.wa-avatar {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #dfe5e7;
  flex-shrink: 0;
  line-height: 1;
}

.wa-avatar-face {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  background: #cfd8dc;
}

.wa-online-dot {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #25d366;
  border: 2px solid var(--wa-header, #1f2c34);
}

.wa-chat-head .mentor-chat-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}
.wa-chat-head .wa-peer-name,
.wa-chat-head .mentor-chat-title h3 {
  margin: 0;
  color: #e9edef;
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.wa-status {
  margin: 0;
  color: #8696a0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
  display: block;
}

/* Como no WhatsApp: digitando… / gravando áudio… em destaque sob o nome. */
.wa-status.wa-status--live {
  color: #25d366;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Bolha de presença no fim da conversa (além do cabeçalho). */
.ask-bubble.wa-presence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(72%, 280px);
}
.ask-bubble.wa-presence .wa-presence-label {
  font-size: 13px;
  color: #8696a0;
  font-style: italic;
}
.ask-bubble.wa-presence.is-recording .wa-presence-label {
  color: #25d366;
  font-style: normal;
  font-weight: 500;
}

.wa-chat-menu {
  position: relative;
  flex-shrink: 0;
}

.wa-chat-menu.hidden {
  display: none !important;
}

.wa-menu-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #aebac1;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

.wa-menu-btn:active,
.wa-chat-menu.is-open .wa-menu-btn {
  background: rgba(255, 255, 255, 0.12);
}

.wa-chat-menu-panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 190px;
  padding: 6px 0;
  border-radius: 10px;
  background: #233138;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  z-index: 5;
}

.wa-chat-menu-panel.hidden {
  display: none !important;
}

.wa-chat-menu-item {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 12px 16px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #e9edef;
  cursor: pointer;
}

.wa-chat-menu-item:active {
  background: rgba(255, 255, 255, 0.06);
}

.wa-chat-menu-item.danger {
  color: #ea0038;
}

.wa-chat-thread,
.ask-thread.wa-chat-thread,
.mentor-chat-thread.wa-chat-thread {
  /* Flex (não grid): senão align-self não cola esquerda/direita como no Zap */
  display: flex !important;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  gap: 2px;
  padding: 6px 7px 10px;
  background-color: #0b141a;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260' viewBox='0 0 260 260'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='0.045' stroke-width='1'%3E%3Cpath d='M20 40c20-10 40 10 30 30M70 90c12-18 40-8 36 14M140 36c18 8 14 34-6 34M200 80c16-14 40 0 28 22M40 160c22-6 34 20 16 32M110 190c14-16 42-4 34 18M180 150c20-10 38 12 22 28M230 200c-18 8-14 34 6 30'/%3E%3Ccircle cx='50' cy='70' r='3'/%3E%3Ccircle cx='170' cy='60' r='3'/%3E%3Ccircle cx='95' cy='210' r='3'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 260px 260px;
}

.wa-day-pill {
  align-self: center;
  margin: 10px 0 8px;
  z-index: 1;
}

.wa-day-pill span {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 7.5px;
  background: #1d282f;
  color: #8696a0;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 1px 1.5px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.01em;
}

/* Faixa “N mensagens não lidas” — como no Zap */
.wa-unread-sep {
  align-self: stretch;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px -7px;
  padding: 0;
  position: relative;
  min-height: 30px;
  background: rgba(0, 168, 132, 0.12);
  border-top: 1px solid rgba(0, 168, 132, 0.18);
  border-bottom: 1px solid rgba(0, 168, 132, 0.18);
}

.wa-unread-sep::before {
  display: none;
}

.wa-unread-sep span {
  position: relative;
  z-index: 1;
  display: inline-block;
  padding: 6px 14px;
  border-radius: 0;
  background: transparent;
  color: #00a884;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: none;
  border: 0;
  text-transform: lowercase;
}

.ask-bubble.wa-msg {
  position: relative;
}

.ask-bubble.mentor.is-unread {
  box-shadow: 0 0 0 1.5px rgba(52, 183, 241, 0.45);
}

.ask-bubble.mentor.is-unread > p {
  font-weight: 600;
}

.wa-unread-pip {
  position: absolute;
  top: 10px;
  left: -3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #53bdeb;
  border: 2px solid #0b141a;
  box-shadow: 0 0 0 1px rgba(83, 189, 235, 0.35);
  z-index: 2;
  pointer-events: none;
}

.ask-bubble.wa-audio.is-unheard .wa-unread-pip {
  top: 18px;
}

.wa-empty-wrap {
  margin: auto 0;
  display: flex;
  justify-content: center;
  padding: 20px 8px;
}

.wa-empty {
  color: #d1d7db;
  background: #182229;
  border-radius: 8px;
  padding: 10px 14px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  text-align: center;
  font-size: 13.5px;
  font-weight: 500;
  max-width: 320px;
}

.ask-bubble.wa-msg {
  position: relative;
  width: fit-content;
  max-width: min(78%, 340px);
  padding: 6px 7px 19px 9px;
  border: 0;
  border-radius: 7.5px;
  box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.45);
  font-family: inherit;
  box-sizing: border-box;
}

.ask-bubble.wa-msg::before {
  content: "";
  position: absolute;
  top: 0;
  width: 8px;
  height: 13px;
  background: inherit;
  filter: drop-shadow(0 1px 0.2px rgba(0, 0, 0, 0.2));
}

.ask-bubble.wa-msg.mentor {
  align-self: flex-start;
  justify-self: start;
  margin-right: auto;
  margin-left: 4px;
  background: #202c33;
  border-top-left-radius: 0;
  color: #e9edef;
}

.ask-bubble.wa-msg.mentor::before {
  left: -6px;
  clip-path: polygon(100% 0, 0 0, 100% 100%);
}

.ask-bubble.wa-msg.user {
  align-self: flex-end;
  justify-self: end;
  margin-left: auto;
  margin-right: 4px;
  background: #005c4b;
  border-top-right-radius: 0;
  color: #e9edef;
}

.ask-bubble.wa-msg.user::before {
  right: -6px;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.ask-bubble.wa-msg > p {
  margin: 0;
  font-size: 14.2px;
  line-height: 1.35;
  font-weight: 400;
  color: #e9edef;
  white-space: pre-wrap;
  word-break: break-word;
  padding-right: 52px;
  min-width: 48px;
}
.ask-bubble.wa-msg.wa-media > p,
.ask-bubble.wa-msg.wa-audio > p {
  padding-right: 4px;
  min-width: 0;
}

.ask-bubble.wa-msg .wa-meta {
  position: absolute;
  right: 7px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: rgba(233, 237, 239, 0.6);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1;
}

.ask-bubble.wa-msg .wa-meta time {
  font-size: 11px;
  color: inherit;
}

.wa-ticks {
  font-size: 13px;
  letter-spacing: -2.5px;
  color: rgba(233, 237, 239, 0.55);
  line-height: 1;
  margin-top: 1px;
  font-weight: 600;
}

.wa-ticks.is-read {
  color: #53bdeb;
}

.ask-bubble.wa-typing {
  padding: 12px 16px 10px;
  min-width: 62px;
}

.wa-typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 14px;
}

.wa-typing-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #9aa3a7;
  animation: wa-typing 1.2s ease-in-out infinite;
}

.wa-typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.wa-typing-dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes wa-typing {
  0%,
  80%,
  100% { transform: translateY(0); opacity: 0.45; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.ask-bubble.wa-audio {
  --wa-progress: 0%;
  width: min(86%, 340px);
  min-width: 240px;
  max-width: min(88%, 360px);
  padding: 8px 10px 20px;
}

/* Anula .ask-bubble span { color muted / uppercase } que deixava o ▶ preto */
.ask-bubble.wa-audio span {
  display: inline;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  text-transform: none;
  color: inherit;
}

.wa-audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Bolinha play/pause verde — igual ao Zap */
.wa-audio-play {
  position: relative;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  overflow: hidden;
}

.wa-audio-play:active {
  transform: scale(0.96);
}

.ask-bubble.wa-audio.is-loading .wa-audio-play {
  opacity: 0.92;
}

.ask-bubble.wa-audio.is-loading .wa-audio-icon.is-loading svg {
  animation: wa-audio-spin 0.85s linear infinite;
}

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

.ask-bubble.wa-audio.is-unheard .wa-audio-play {
  box-shadow: 0 0 0 2px rgba(52, 183, 241, 0.55);
}

.ask-bubble.wa-audio .wa-audio-icon,
.wa-audio-icon {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  line-height: 0;
  width: 100%;
  height: 100%;
  margin: 0 !important;
  color: #fff !important;
  text-transform: none !important;
}

.wa-audio-icon svg {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0;
}

.wa-audio-icon.is-play svg {
  transform: translateX(2px);
}

.wa-audio-main {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  display: grid;
  gap: 4px;
  padding-top: 2px;
}

.wa-audio-scrub-wrap {
  width: 100%;
  display: grid;
  gap: 5px;
  cursor: pointer;
  touch-action: none;
}

.wa-audio-scrub {
  position: relative;
  width: 100%;
  height: 36px;
  display: flex;
  align-items: center;
}

.wa-audio-wave {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.5px;
  height: 32px;
  min-width: 0;
}

.wa-audio-wave i {
  display: block;
  flex: 1 1 0;
  max-width: 3.5px;
  min-width: 2px;
  border-radius: 2px;
  background: #c5ccd1;
  height: var(--h, 40%);
  transform-origin: center;
  transition: background 0.05s linear;
}

.ask-bubble.wa-audio.mentor .wa-audio-wave i.is-played {
  background: #00a884;
}

.ask-bubble.wa-audio.user .wa-audio-wave i {
  background: rgba(0, 0, 0, 0.18);
}

.ask-bubble.wa-audio.user .wa-audio-wave i.is-played {
  background: #008069;
}

/* Bolinha do scrub sobre a onda */
.wa-audio-thumb {
  position: absolute;
  top: 50%;
  left: var(--wa-progress, 0%);
  width: 14px;
  height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #00a884;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transform: translateY(-50%) scale(1);
  opacity: 1;
  pointer-events: none;
  z-index: 3;
}

.ask-bubble.wa-audio.user .wa-audio-thumb {
  background: #008069;
}

/* Barra de progresso explícita embaixo da onda (bem visível) */
.wa-audio-progress-line {
  position: relative;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.wa-audio-progress-fill {
  display: block;
  height: 100%;
  width: var(--wa-progress, 0%);
  border-radius: inherit;
  background: #00a884;
  transition: width 0.05s linear;
}

.ask-bubble.wa-audio.user .wa-audio-progress-line {
  background: rgba(0, 0, 0, 0.14);
}

.ask-bubble.wa-audio.user .wa-audio-progress-fill {
  background: #008069;
}

.ask-bubble.wa-audio.is-unheard .wa-audio-wave i:not(.is-played) {
  background: #b9c4ca;
}

.wa-audio-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 16px;
  margin-top: 0;
}

.wa-audio-time {
  display: inline-block !important;
  font-size: 11px !important;
  font-weight: 500 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: #667781 !important;
  font-variant-numeric: tabular-nums;
  min-width: 2.2em;
  margin: 0 !important;
}

.wa-audio-speed {
  border: 0;
  background: transparent;
  color: #008069;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 0 0;
  margin: 0;
  cursor: pointer;
  min-width: 2.4em;
  text-align: right;
  text-transform: none;
  letter-spacing: 0;
}

.ask-bubble.wa-audio.user .wa-audio-speed {
  color: #027a55;
}

.ask-bubble.wa-audio.is-playing .wa-audio-time {
  color: #008069;
}

.ask-bubble.wa-audio.is-playing .wa-audio-speed {
  color: #008069;
}

.wa-audio-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  padding-top: 2px;
}

.wa-audio-transcript-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  border: 0;
  background: transparent;
  color: #027eb5;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 0;
  cursor: pointer;
  line-height: 1.2;
}

.wa-audio-transcript-toggle svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.wa-audio-transcript-toggle:active {
  opacity: 0.7;
}

.wa-audio-transcript {
  margin: 6px 0 14px;
  padding: 8px 8px 6px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 0;
  font-size: 13.5px !important;
  line-height: 1.4 !important;
  color: #e9edef !important;
  white-space: pre-wrap;
}

.wa-audio-transcript.is-collapsed {
  display: none;
}

.wa-audio-transcript.is-empty {
  color: #667781 !important;
  font-style: italic;
}

.ask-form.wa-composer,
.mentor-chat-composer.wa-composer {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 5px 6px calc(6px + var(--safe-bottom, 0px));
  background: #1d282f;
  border-top: 0;
  order: 4;
  position: relative;
  z-index: 20;
}

.wa-composer-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: flex-end;
  gap: 0;
  min-height: 42px;
  border-radius: 21px;
  background: #2a3942;
  padding: 0 6px 0 2px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.wa-attach-btn {
  width: 40px;
  height: 44px;
  border: 0;
  background: transparent;
  color: #8696a0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transform: rotate(45deg);
}

.wa-attach-btn:active,
.wa-attach-btn[aria-expanded="true"] {
  color: #00a884;
}
.wa-attach-btn.hidden {
  display: none !important;
}

.wa-composer-main textarea,
.wa-composer textarea {
  flex: 1;
  min-height: 42px;
  max-height: 120px;
  margin: 0;
  border: 0;
  border-radius: 21px;
  background: transparent;
  padding: 11px 8px 11px 2px;
  font-size: 15.5px;
  font-weight: 400;
  line-height: 1.3;
  color: #e9edef;
  box-shadow: none;
  outline: none;
  resize: none;
}

/* Mantém compat se o textarea ficar fora do wrap. */
.wa-composer > textarea {
  background: #1f2c34;
  padding: 12px 16px;
}

.wa-composer textarea::placeholder {
  color: #8696a0;
}

.wa-send-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.wa-send-btn,
.wa-mic-btn {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #00a884;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: none;
  flex-shrink: 0;
}

.wa-send-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

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

.wa-mic-btn.hidden,
.wa-send-btn.hidden {
  display: none !important;
}

.wa-composer.is-recording .wa-composer-main,
.wa-composer.is-recording textarea,
.wa-composer.is-recording .wa-send-row,
.wa-composer.is-recording .wa-attach-btn {
  display: none !important;
}

.wa-voice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 2px;
}

.wa-voice-bar.hidden {
  display: none !important;
}

.wa-voice-cancel {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #ea0038;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.wa-voice-timer {
  min-width: 3.2em;
  color: #ea0038;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wa-voice-pulse {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 22px;
  flex: 1;
  min-width: 0;
}

.wa-voice-pulse i {
  width: 3px;
  height: 40%;
  border-radius: 2px;
  background: #ea0038;
  animation: wa-wave 0.8s ease-in-out infinite;
}

.wa-voice-pulse i:nth-child(2) { height: 70%; animation-delay: 0.08s; }
.wa-voice-pulse i:nth-child(3) { height: 100%; animation-delay: 0.16s; }
.wa-voice-pulse i:nth-child(4) { height: 60%; animation-delay: 0.24s; }
.wa-voice-pulse i:nth-child(5) { height: 85%; animation-delay: 0.32s; }

.wa-voice-hint {
  color: #8696a0;
  font-size: 13px;
  white-space: nowrap;
}

.wa-voice-send {
  flex-shrink: 0;
}

.ask-bubble.wa-msg.user.wa-audio {
  background: #005c4b;
}

.ask-bubble.wa-msg.user.wa-audio .wa-audio-transcript-toggle {
  color: #aebac1;
}

.ask-bubble.wa-msg.user.wa-audio .wa-audio-transcript {
  background: rgba(0, 0, 0, 0.18);
  color: #e9edef !important;
}

.wa-chat-shell .mentor-home,
.wa-chat-shell .mentor-name-gate {
  margin: 0;
  padding: 8px 10px;
  background: transparent;
  color: #e9edef;
}
.wa-chat-shell .mentor-name-gate-title {
  color: #e9edef;
}
.wa-chat-shell .mentor-name-gate-hint {
  color: #8696a0;
}
.wa-chat-shell .mentor-name-gate-row input {
  background: #1d282f;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e9edef;
}

.wa-chat-shell .ask-chips,
.wa-chat-shell .welcome-reply-chips {
  margin: 0;
  padding: 4px 8px 8px;
  background: transparent;
  gap: 6px;
  flex-wrap: wrap;
}

.wa-chat-shell .ask-chip {
  border: 1px solid #00a884;
  background: #1d282f;
  color: #00a884;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: none;
}

.wa-chat-shell .ask-chip:active {
  background: #0a332c;
}

.gemini-lesson-rail {
  margin: 0;
  padding: 6px 10px 8px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gemini-lesson-rail.hidden {
  display: none !important;
}

.gemini-lesson-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding: 0 2px;
}

.gemini-lesson-rail-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #8696a0;
}

.gemini-lesson-next {
  border: 0;
  background: transparent;
  color: #00a884;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 6px;
  cursor: pointer;
}

.gemini-lesson-next.hidden {
  display: none !important;
}

.gemini-lesson-chips .ask-chip.is-heard {
  opacity: 0.55;
  border-color: #3b4a54;
  color: #8696a0;
}

.gemini-lesson-chips .ask-chip[data-page-point] {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  line-height: 1.25;
  border-radius: 14px;
}

/* Bloco da apostila no Apoio da página (não mistura PDFs) */
.wa-pdf-block-sep {
  display: flex;
  justify-content: center;
  margin: 8px 0 4px;
}
.wa-pdf-block-sep span {
  max-width: min(92%, 300px);
  padding: 5px 11px;
  border-radius: 7.5px;
  background: #1d282f;
  color: #8696a0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
}

/* Menu apagar mensagem (estilo Zap) */
.wa-msg-sheet {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.wa-msg-sheet.hidden {
  display: none;
}
.wa-msg-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(11, 20, 26, 0.45);
  cursor: pointer;
}
.wa-msg-sheet-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  margin: 0 10px 12px;
  background: #233138;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}
.wa-msg-sheet-preview {
  margin: 0;
  padding: 14px 16px 10px;
  font-size: 0.82rem;
  color: #8696a0;
  line-height: 1.35;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.wa-msg-sheet-item {
  display: block;
  width: 100%;
  border: 0;
  background: #233138;
  padding: 14px 16px;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e9edef;
  cursor: pointer;
}
.wa-msg-sheet-item + .wa-msg-sheet-item {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.wa-msg-sheet-item.danger {
  color: #ea0038;
}
.wa-msg-sheet-item:active {
  background: rgba(255, 255, 255, 0.06);
}
.ask-bubble.wa-msg.is-msg-selected {
  outline: 2px solid rgba(0, 168, 132, 0.65);
  outline-offset: 1px;
}

/* Pontos da página dentro da conversa (Apoio da página) */
.wa-page-points-card {
  max-width: min(94%, 360px);
  padding: 8px 10px 8px;
}
.wa-page-points-card.is-current-page {
  box-shadow: inset 0 0 0 1px rgba(0, 168, 132, 0.45);
}
.wa-page-points-card.is-collapsed {
  padding-bottom: 6px;
}
.wa-page-points-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px 8px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 2px 0;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
.wa-page-points-title {
  margin: 0;
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
}
.wa-page-points-progress {
  font-size: 0.72rem;
  font-weight: 600;
  color: #8696a0;
  white-space: nowrap;
}
.wa-page-points-progress.is-done {
  color: #25d366;
}
.wa-page-points-chevron {
  color: #8696a0;
  font-size: 0.75rem;
}
.wa-page-points-hint {
  margin: 6px 0 8px;
  font-size: 0.76rem;
  color: #8696a0;
  line-height: 1.25;
}
.wa-page-point-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wa-page-point-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wa-page-point-block.has-audio {
  padding-bottom: 2px;
}
.wa-page-point {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #1d282f;
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.3;
  color: #e9edef;
  cursor: pointer;
  transition: opacity 0.2s ease, filter 0.2s ease, border-color 0.2s ease;
}
.wa-page-point-num {
  flex: 0 0 auto;
  min-width: 1.4em;
  font-size: 0.72rem;
  font-weight: 700;
  color: #25d366;
  line-height: 1.45;
}
.wa-page-point-audio {
  margin: 0 0 0 4px;
  padding-left: 8px;
  border-left: 2px solid #00a884;
}
.wa-page-point-audio .ask-bubble.wa-audio {
  max-width: 100%;
  margin: 0;
  box-shadow: none;
}
.wa-page-full-audio {
  margin-top: 6px;
  border-left-color: #1e8e3e;
}
.wa-page-point-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 0 4px;
  padding: 6px 8px;
  border-left: 2px solid #f9ab00;
  font-size: 0.78rem;
  color: #8696a0;
}
.wa-page-point-loading-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f9ab00;
  animation: wa-page-point-pulse 1s ease-in-out infinite;
}
@keyframes wa-page-point-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}
.wa-page-point:active {
  transform: scale(0.99);
}
.wa-page-point-mark {
  flex: 0 0 auto;
  width: 1.1em;
  color: #25d366;
  font-size: 0.8rem;
  line-height: 1.35;
}
.wa-page-point-text {
  flex: 1 1 auto;
}
.wa-page-point.is-heard {
  opacity: 0.48;
  filter: grayscale(0.35);
  border-color: rgba(255, 255, 255, 0.1);
  color: #8696a0;
}
.wa-page-point.is-heard .wa-page-point-mark,
.wa-page-point.is-heard .wa-page-point-num {
  color: #8696a0;
}
.wa-page-point.is-loading {
  border-color: #f9ab00;
}
.wa-page-points-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.wa-page-point-next,
.wa-page-point-full {
  width: 100%;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
  padding: 4px 2px;
  cursor: pointer;
}
.wa-page-point-next {
  color: #53bdeb;
}
.wa-page-point-next.is-pulse {
  animation: wa-page-point-pulse 0.9s ease-in-out 2;
}
.wa-page-point-full {
  color: #00a884;
}
.wa-page-point-next:active,
.wa-page-point-full:active {
  opacity: 0.7;
}
.wa-page-points-done {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 600;
  color: #25d366;
}

/* Zap: sem faixa de disclaimer no rodapé (quebra a ilusão). */
.wa-chat-shell .mentor-chat-disclaimer,
.wa-chat-shell .mentor-chat-disclaimer:not(:empty),
.ask-dialog.wa-chat-dialog #askDisclaimer {
  display: none !important;
}

/* Menu anexar (estilo Zap) */
.wa-attach-sheet {
  position: absolute;
  inset: 0;
  z-index: 45;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}
.wa-attach-sheet.hidden {
  display: none !important;
}
.wa-attach-sheet-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  pointer-events: auto;
}
.wa-attach-sheet-panel {
  position: relative;
  z-index: 1;
  width: calc(100% - 16px);
  margin: 0 8px 62px;
  padding: 18px 12px 14px;
  border-radius: 16px;
  background: #1f2c34;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  pointer-events: auto;
}
.wa-attach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px 6px;
}
.wa-attach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #d1d7db;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 2px;
}
.wa-attach-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.wa-attach-icon.is-doc { background: #7f66ff; }
.wa-attach-icon.is-camera { background: #ff2e74; }
.wa-attach-icon.is-gallery { background: #bf59cf; }
.wa-attach-icon.is-video { background: #ff3b30; }
.wa-attach-item:active .wa-attach-icon {
  transform: scale(0.96);
}

/* Bolhas de mídia (foto / vídeo / arquivo) */
.ask-bubble.wa-msg.wa-media {
  padding: 4px 4px 18px;
  max-width: min(78%, 280px);
  overflow: hidden;
}
.ask-bubble.wa-msg.wa-media .wa-media-body {
  display: block;
  border-radius: 6px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
}
.ask-bubble.wa-msg.wa-media img,
.ask-bubble.wa-msg.wa-media video {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: cover;
  background: #0b141a;
}
.ask-bubble.wa-msg.wa-media .wa-media-caption {
  margin: 6px 4px 0;
  font-size: 14px;
  line-height: 1.35;
  color: #e9edef;
  white-space: pre-wrap;
}
.ask-bubble.wa-msg.wa-media .wa-media-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-width: 200px;
}
.ask-bubble.wa-msg.wa-media .wa-media-file-ico {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #7f66ff;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ask-bubble.wa-msg.wa-media .wa-media-file-name {
  font-size: 14px;
  font-weight: 600;
  color: #e9edef;
  word-break: break-word;
}
.ask-bubble.wa-msg.wa-media .wa-media-file-meta {
  font-size: 12px;
  color: rgba(233, 237, 239, 0.55);
  margin-top: 2px;
}

/* Gravador de vídeo in-app */
.wa-video-rec {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: #000;
  display: flex;
  flex-direction: column;
}
.wa-video-rec.hidden {
  display: none !important;
}
.wa-video-rec-preview {
  flex: 1;
  min-height: 0;
  width: 100%;
  object-fit: cover;
  background: #000;
}
.wa-video-rec-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px calc(14px + var(--safe-bottom, 0px));
  background: #0b141a;
}
.wa-video-rec-cancel,
.wa-video-rec-send {
  border: 0;
  background: transparent;
  color: #e9edef;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  min-width: 72px;
}
.wa-video-rec-send {
  color: #25d366;
}
.wa-video-rec-send.hidden {
  display: none !important;
}
.wa-video-rec-timer {
  color: #ea0038;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.wa-video-rec-toggle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #ea0038;
  color: #ea0038;
  font-size: 0;
  cursor: pointer;
}
.wa-video-rec-toggle.is-recording {
  background: #fff;
  border-radius: 12px;
  width: 36px;
  height: 36px;
}

/* Preview de mídia antes de enviar */
.wa-media-preview {
  position: absolute;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  background: #0b141a;
}
.wa-media-preview.hidden { display: none !important; }
.wa-media-preview-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 10px;
  background: #1f2c34;
  color: #e9edef;
  font-weight: 600;
}
.wa-media-preview-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: auto;
}
.wa-media-preview-body img,
.wa-media-preview-body video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  background: #000;
}
.wa-media-preview-body .wa-media-file {
  width: min(100%, 320px);
  background: #1f2c34;
  border-radius: 12px;
}
.wa-media-preview-form {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 10px calc(12px + var(--safe-bottom, 0px));
  background: #0b141a;
}
.wa-media-preview-form input {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 24px;
  background: #1f2c34;
  color: #e9edef;
  padding: 0 16px;
  font: inherit;
  outline: 0;
}

/* Responder */
.wa-chat-shell .wa-composer,
.wa-chat-shell .wa-reply-bar,
.wa-chat-shell .wa-select-bar,
.wa-chat-shell .ask-chips,
.wa-chat-shell .gemini-lesson-rail,
.wa-chat-shell .mentor-home,
.wa-chat-shell .mentor-name-gate {
  flex-shrink: 0;
}
.wa-reply-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 6px 12px;
  background: #1f2c34;
  border-left: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  order: 3;
  position: relative;
}
.wa-reply-bar::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 4px;
  border-radius: 4px;
  background: #00a884;
}
.wa-reply-bar-main {
  padding-left: 10px;
}
.wa-reply-bar.hidden { display: none !important; }
.wa-reply-bar .wa-reply-bar-main { flex: 1; min-width: 0; }
.wa-reply-bar-label {
  display: block;
  color: #00a884;
  font-size: 12px;
  font-weight: 700;
}
.wa-reply-bar-text {
  display: block;
  color: #8696a0;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wa-reply-bar-close {
  border: 0;
  background: transparent;
  color: #8696a0;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.wa-quote {
  margin: 0 0 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 3px solid #06cf9c;
}
.ask-bubble.wa-msg.user .wa-quote { border-left-color: #53bdeb; }
.wa-quote-who {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #06cf9c;
  margin-bottom: 2px;
}
.ask-bubble.wa-msg.user .wa-quote-who { color: #53bdeb; }
.wa-quote-text {
  display: block;
  font-size: 13px;
  color: rgba(233, 237, 239, 0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Seleção múltipla */
.wa-select-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #1f2c34;
  color: #e9edef;
  order: 3;
}
.wa-select-bar.hidden { display: none !important; }
.wa-select-cancel,
.wa-select-delete {
  border: 0;
  background: transparent;
  color: #e9edef;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.wa-select-delete { color: #ea0038; }
.wa-select-count { flex: 1; font-size: 14px; font-weight: 600; }
.ask-dialog.wa-chat-dialog.is-selecting .wa-composer,
.ask-dialog.wa-chat-dialog.is-selecting .wa-reply-bar {
  display: none !important;
}
.ask-bubble.wa-msg.is-checked {
  outline: 2px solid rgba(0, 168, 132, 0.7);
  outline-offset: 1px;
}
.wa-select-tick {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #8696a0;
  background: transparent;
  z-index: 3;
  box-sizing: border-box;
}
.ask-bubble.wa-msg.user .wa-select-tick {
  left: auto;
  right: -22px;
}
.ask-bubble.wa-msg.is-checked .wa-select-tick {
  background: #00a884;
  border-color: #00a884;
  box-shadow: inset 0 0 0 3px #0b141a;
}
.ask-dialog.wa-chat-dialog.is-selecting .wa-chat-thread {
  padding-left: 28px;
  padding-right: 28px;
}

/* Reações */
.wa-msg-react-row {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  padding: 10px 8px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.wa-react-emoji {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: #182229;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.wa-react-emoji:active { transform: scale(0.94); }
.wa-reactions {
  position: absolute;
  left: 8px;
  bottom: -10px;
  display: inline-flex;
  gap: 2px;
  margin: 0;
  padding: 2px 5px;
  border-radius: 999px;
  background: #1f2c34;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  line-height: 1.2;
  z-index: 2;
}
.ask-bubble.wa-msg.user .wa-reactions {
  left: auto;
  right: 8px;
}
.ask-bubble.wa-msg.has-reaction {
  margin-bottom: 12px;
}
.wa-msg-info-body {
  padding: 4px 16px 12px;
  color: #d1d7db;
  font-size: 13.5px;
  line-height: 1.45;
}
.wa-msg-info-body p { margin: 0 0 8px; }

/* Áudio: cancelar / travar */
.wa-voice-lock-hint {
  color: #8696a0;
  font-size: 12px;
  white-space: nowrap;
}
.wa-voice-bar.is-slide-cancel {
  background: rgba(234, 0, 56, 0.12);
}
.wa-voice-bar.is-slide-cancel .wa-voice-hint,
.wa-voice-bar.is-slide-cancel .wa-voice-timer {
  color: #ea0038;
}
.wa-voice-bar.is-locked .wa-voice-lock-hint {
  color: #25d366;
  font-weight: 700;
}
.wa-voice-bar.is-locked .wa-voice-hint {
  color: #25d366;
}
.ask-bubble.wa-msg.is-swipe-reply {
  transform: translateX(28px);
  transition: transform 0.12s ease;
}

@media (max-width: 720px) {
  .ask-dialog.wa-chat-dialog {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Painel Instalar / tela inicial */
.install-help-dialog {
  max-width: min(92vw, 420px);
  border: 0;
  border-radius: 18px;
  padding: 0;
}
.install-help-dialog::backdrop {
  background: rgba(20, 24, 28, 0.55);
}
.install-help-shell {
  padding: 22px 20px 18px;
}
.install-help-shell h3 {
  margin: 0 0 8px;
  font-size: 1.25rem;
}
.install-help-browser {
  margin: 0 0 12px;
  font-weight: 700;
  color: #0b6b58;
}
.install-help-steps {
  margin: 0 0 12px;
  padding-left: 1.2em;
  color: #333;
  line-height: 1.45;
}
.install-help-steps li {
  margin: 0.45em 0;
}
.install-help-note {
  margin: 0 0 14px;
  font-size: 13px;
  color: #667;
}

.install-help-actions { flex-wrap: wrap; gap: 8px; }
.install-help-actions .chrome-btn { text-decoration: none; text-align: center; }
