/* Rim 3D — interface. Tema escuro de propósito: o modelo 3D aparece melhor sobre fundo escuro e o vídeo fica com cara de documentário. */
:root {
  --fundo-1: #060a13;
  --fundo-2: #0d1526;
  --fundo-3: #16213a;
  --painel: rgba(11, 17, 31, 0.93);
  --painel-forte: rgba(13, 20, 37, 0.97);
  --borda: rgba(148, 163, 184, 0.16);
  --borda-forte: rgba(148, 163, 184, 0.32);
  --texto: #e8edf5;
  --texto-2: #a3b0c5;
  --texto-3: #6f7d95;
  --acento: #ff8a5c;
  --acento-2: #ffb08f;
  --acento-fundo: rgba(255, 138, 92, 0.14);
  --azul: #6cb6ff;
  --verde: #4ade80;
  --amarelo: #facc15;
  --laranja: #fb923c;
  --vermelho: #f87171;
  --vinho: #be123c;
  --raio: 14px;
  --sombra: 0 10px 40px rgba(0, 0, 0, 0.45);
  --fonte: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --topo: 64px;
  --painel-largura: 380px;
  --ferr-largura: 236px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font-family: var(--fonte);
  color: var(--texto);
  background: radial-gradient(120% 95% at 50% 40%, #1f2633 0%, #12161f 45%, #07090d 100%);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.5;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

#app { position: fixed; inset: 0; }
body[data-fundo="lavanda"] { background: radial-gradient(120% 95% at 50% 38%, #c6cbff 0%, #a4acff 42%, #868ff0 100%); }
body[data-fundo="lavanda"] #topo { background: linear-gradient(180deg, rgba(48, 52, 128, 0.55), rgba(48, 52, 128, 0.18) 70%, rgba(48, 52, 128, 0)); }
body[data-fundo="lavanda"] .rot-linha { background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 3px rgba(20, 20, 60, 0.55); }
body[data-fundo="lavanda"] #carregando { background: #9aa3ff; }
body[data-fundo="lavanda"] #carregando p { color: #1d2050; }
#palco { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
#palco.apontando { cursor: pointer; }

/* ---------- Topo ---------- */
#topo {
  position: absolute; top: 0; left: 0; right: 0; height: var(--topo);
  display: flex; align-items: center; gap: 18px; padding: 0 16px;
  background: linear-gradient(180deg, rgba(6, 10, 19, 0.92), rgba(6, 10, 19, 0.55) 70%, rgba(6, 10, 19, 0));
  z-index: 20;
}
.marca { display: flex; align-items: center; gap: 10px; min-width: 0; }
.marca svg { width: 30px; height: 30px; fill: #a8452f; filter: drop-shadow(0 0 10px rgba(168, 69, 47, 0.6)); flex: none; }
.marca h1 { margin: 0; font-size: 18px; letter-spacing: 0.2px; font-weight: 700; }
.marca p { margin: 0; font-size: 11.5px; color: var(--texto-2); letter-spacing: 0.3px; }
#abas { display: flex; gap: 4px; margin: 0 auto; background: rgba(15, 23, 42, 0.7); border: 1px solid var(--borda); padding: 4px; border-radius: 999px; }
#abas button {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  color: var(--texto-2); font-size: 14px; font-weight: 600; white-space: nowrap; transition: background .2s, color .2s;
}
#abas button b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; margin-right: 6px; background: rgba(148, 163, 184, 0.16); color: var(--texto-2); }
#abas button:hover { color: var(--texto); }
#abas button[aria-selected="true"] { background: var(--acento); color: #1b0d06; }
#abas button[aria-selected="true"] b { background: rgba(27, 13, 6, 0.18); color: #1b0d06; }
.acoes { display: flex; gap: 8px; align-items: center; }

.bt {
  border: 1px solid var(--borda-forte); background: rgba(15, 23, 42, 0.7); color: var(--texto);
  padding: 8px 14px; border-radius: 10px; cursor: pointer; font-size: 13.5px; font-weight: 600; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .1s;
}
.bt:hover { background: rgba(30, 41, 59, 0.9); border-color: var(--acento); }
.bt:active { transform: translateY(1px); }
.bt.primario { background: var(--acento); border-color: var(--acento); color: #1b0d06; }
.bt.primario:hover { background: var(--acento-2); }
.bt.icone { padding: 7px; display: inline-grid; place-items: center; }
.bt.icone svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bt:focus-visible, #abas button:focus-visible, .segmentado button:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

/* ---------- Ferramentas (esquerda) ---------- */
#ferramentas {
  position: absolute; top: calc(var(--topo) + 8px); left: 16px; width: var(--ferr-largura);
  display: flex; flex-direction: column; gap: 10px; z-index: 15; max-height: calc(100% - var(--topo) - 140px); overflow: auto;
  scrollbar-width: thin;
}
.caixa { background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); padding: 12px; -webkit- }
.caixa h3 { margin: 0 0 8px; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px; color: var(--texto-3); font-weight: 700; }
.alternar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 2px; cursor: pointer; font-size: 13.5px; color: var(--texto); user-select: none; }
.alternar input { appearance: none; -webkit-appearance: none; width: 34px; height: 20px; border-radius: 999px; background: rgba(148, 163, 184, 0.3); position: relative; cursor: pointer; flex: none; transition: background .2s; margin: 0; }
.alternar input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: transform .2s; }
.alternar input:checked { background: var(--acento); }
.alternar input:checked::after { transform: translateX(14px); }
.alternar input:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
.vistas-lista { display: flex; flex-wrap: wrap; gap: 6px; }
.vistas-lista button { border: 1px solid var(--borda); background: rgba(30, 41, 59, 0.6); color: var(--texto-2); padding: 5px 10px; border-radius: 999px; cursor: pointer; font-size: 12.5px; }
.vistas-lista button:hover { color: var(--texto); border-color: var(--acento); }

.segmentado { display: flex; background: rgba(15, 23, 42, 0.8); border: 1px solid var(--borda); border-radius: 12px; padding: 3px; gap: 3px; }
.segmentado button { flex: 1; border: 0; background: transparent; color: var(--texto-2); padding: 7px 10px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px; white-space: nowrap; }
.segmentado button[aria-pressed="true"] { background: var(--acento); color: #1b0d06; }

#sub-cena { flex-wrap: wrap; }
#sub-cena button { flex: 1 0 40%; }
#lista-farmacos { display: flex; flex-direction: column; gap: 8px; }
.cartao-farmaco {
  text-align: left; border: 1px solid var(--borda); background: var(--painel); border-radius: 12px; padding: 10px 12px; cursor: pointer;
  -webkit- transition: border-color .2s, background .2s;
}
.cartao-farmaco:hover { border-color: var(--borda-forte); }
.cartao-farmaco[aria-pressed="true"] { border-color: var(--acento); background: rgba(40, 22, 16, 0.85); }
.cartao-farmaco strong { display: block; font-size: 14px; }
.cartao-farmaco span { display: block; font-size: 12px; color: var(--texto-2); margin-top: 2px; }
.cartao-farmaco .tipo { display: inline-block; margin-top: 6px; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; padding: 2px 7px; border-radius: 999px; background: rgba(108, 182, 255, 0.14); color: var(--azul); }
.cartao-farmaco .tipo.enzima { background: rgba(250, 204, 21, 0.14); color: var(--amarelo); }
.cartao-farmaco .tipo.receptor { background: rgba(74, 222, 128, 0.14); color: var(--verde); }

/* ---------- Painel (direita) ---------- */
#painel {
  position: absolute; top: calc(var(--topo) + 8px); right: 16px; bottom: 16px; width: var(--painel-largura);
  background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); z-index: 15;
  -webkit- box-shadow: var(--sombra);
  display: flex; flex-direction: column; transition: transform .35s ease, opacity .35s;
}
#painel.recolhido { transform: translateX(calc(100% - 44px)); }
#painel.recolhido #painel-conteudo { opacity: 0; pointer-events: none; }
#painel.recolhido #painel-recolher svg { transform: rotate(180deg); }
#painel-recolher { position: absolute; top: 10px; left: 8px; z-index: 2; border-color: transparent; background: transparent; }
#painel-conteudo { overflow: auto; padding: 16px 18px 22px 18px; padding-left: 48px; flex: 1; scrollbar-width: thin; transition: opacity .25s; }
#painel-conteudo::-webkit-scrollbar { width: 8px; }
#painel-conteudo::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 8px; }
.chip { display: inline-block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; color: var(--acento); background: var(--acento-fundo); padding: 3px 8px; border-radius: 999px; }
.painel-titulo { margin: 8px 0 6px; font-size: 22px; line-height: 1.2; font-weight: 750; letter-spacing: -0.2px; }
.painel-resumo { color: var(--texto); font-size: 15px; margin: 0 0 12px; }
#painel-conteudo p { margin: 0 0 10px; color: var(--texto-2); font-size: 14px; }
#painel-conteudo p strong, #painel-conteudo li strong { color: var(--texto); }
#painel-conteudo ul { margin: 0 0 12px; padding-left: 18px; color: var(--texto-2); font-size: 14px; }
#painel-conteudo li { margin-bottom: 5px; }
#painel-conteudo h4 { margin: 16px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; color: var(--texto-3); }
.destaque-drc { border-left: 3px solid var(--vermelho); background: rgba(248, 113, 113, 0.08); padding: 10px 12px; border-radius: 0 10px 10px 0; margin: 12px 0; }
.destaque-drc h4 { margin-top: 0 !important; color: var(--vermelho) !important; }
.destaque-drc p { color: var(--texto) !important; }
#painel-conteudo p.ajuda { font-size: 12.5px; color: var(--texto-3); margin-top: 14px; }
.painel-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.painel-voltar { background: none; border: 0; color: var(--acento); cursor: pointer; padding: 0; font-size: 13px; font-weight: 600; }
.lista-estruturas { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.lista-estruturas button { border: 1px solid var(--borda); background: rgba(30, 41, 59, 0.55); color: var(--texto-2); padding: 5px 10px; border-radius: 999px; cursor: pointer; font-size: 12.5px; }
.lista-estruturas button:hover { border-color: var(--acento); color: var(--texto); }
details.secao { border: 1px solid var(--borda); border-radius: 12px; margin-bottom: 8px; background: rgba(15, 23, 42, 0.45); }
details.secao summary { cursor: pointer; padding: 10px 12px; font-weight: 650; font-size: 14.5px; list-style: none; display: flex; justify-content: space-between; align-items: center; }
details.secao summary::-webkit-details-marker { display: none; }
details.secao summary::after { content: "+"; color: var(--texto-3); font-size: 18px; }
details.secao[open] summary::after { content: "–"; }
details.secao > div { padding: 0 12px 6px; }
.tabela-estagios { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 6px 0 12px; }
.tabela-estagios td, .tabela-estagios th { padding: 5px 6px; border-bottom: 1px solid var(--borda); text-align: left; color: var(--texto-2); }
.tabela-estagios th { color: var(--texto-3); font-weight: 600; }
.tabela-estagios tr.atual td { color: var(--texto); background: rgba(255, 138, 92, 0.1); }
.tabela-estagios .pill { display: inline-block; min-width: 34px; text-align: center; padding: 1px 6px; border-radius: 6px; font-weight: 700; color: #111; }
.molecula-ficha { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 13px; color: var(--texto-2); margin: 8px 0 12px; }
.molecula-ficha b { color: var(--texto-3); font-weight: 600; }

/* ---------- Estágios (DRC) ---------- */
#estagios {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 16;
  width: min(640px, calc(100% - var(--painel-largura) - var(--ferr-largura) - 80px));
  background: var(--painel); border: 1px solid var(--borda); border-radius: var(--raio); padding: 12px 18px 14px;
  -webkit- box-shadow: var(--sombra);
}
.estagio-cabeca { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.estagio-codigo { font-weight: 800; font-size: 20px; color: var(--acento); }
.estagio-titulo { font-weight: 650; font-size: 15px; }
.estagio-tfg { color: var(--texto-2); font-size: 13px; margin-left: auto; }
.estagio-trilha { position: relative; }
#estagio-slider { width: 100%; appearance: none; -webkit-appearance: none; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #22c55e 0%, #84cc16 22%, #facc15 42%, #fb923c 62%, #ef4444 82%, #9f1239 100%); outline: none; margin: 6px 0 2px; cursor: pointer; }
#estagio-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--fundo-2); box-shadow: 0 0 0 2px rgba(255,255,255,.4), 0 2px 10px rgba(0,0,0,.5); }
#estagio-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--fundo-2); }
#estagio-slider:focus-visible { outline: 2px solid var(--azul); outline-offset: 4px; }
.estagio-marcas { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--texto-3); padding: 2px 0 0; }
.estagio-marcas button { background: none; border: 0; color: inherit; cursor: pointer; padding: 2px 0; flex: 1 1 0; min-width: 0; text-align: center; font-weight: 600; white-space: nowrap; font-size: 11.5px; }
.estagio-marcas button:first-child { text-align: left; }
.estagio-marcas button:last-child { text-align: right; }
.estagio-marcas button.atual { color: var(--texto); }

/* ---------- Legendas ---------- */
#legenda {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 25;
  width: min(860px, calc(100% - 32px)); background: rgba(6, 10, 19, 0.88); border: 1px solid var(--borda-forte);
  border-radius: 16px; box-shadow: var(--sombra); display: flex; align-items: flex-end; gap: 12px; padding: 16px 16px 14px 22px; overflow: hidden;
  -webkit-
}
.legenda-progresso { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: rgba(148, 163, 184, 0.15); }
.legenda-progresso i { display: block; height: 100%; width: 0%; background: var(--acento); }
.legenda-corpo { flex: 1; min-width: 0; }
.legenda-passo { font-size: 11.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--acento); font-weight: 700; }
#legenda h2 { margin: 2px 0 4px; font-size: 21px; line-height: 1.25; }
#legenda p { margin: 0; color: #cfd8e6; font-size: 15.5px; line-height: 1.5; }
.legenda-controles { display: flex; gap: 6px; flex: none; }
#app.tour #estagios { bottom: 160px; }
#app.tour #legenda-fase { bottom: 170px; }

#legenda-fase {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 16;
  width: min(700px, calc(100% - var(--painel-largura) - var(--ferr-largura) - 80px));
  background: var(--painel-forte); border: 1px solid var(--borda); border-radius: var(--raio); padding: 10px 14px 12px; box-shadow: var(--sombra);
}
.fase-topo { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fase-topo .segmentado { flex: none; }
.fase-pontos { display: flex; gap: 6px; flex: 1; }
.fase-pontos button { flex: 1; height: 6px; border-radius: 6px; border: 0; background: rgba(148, 163, 184, 0.25); cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.fase-pontos button i { position: absolute; inset: 0; width: 0; background: var(--acento); }
.fase-pontos button.feito i { width: 100%; }
#fase-texto { margin: 0; font-size: 15px; color: var(--texto); min-height: 45px; }

/* ---------- Rótulos 3D ---------- */
#rotulos { position: absolute; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
#app.sem-rotulos #rotulos { display: none; }
.rot { position: absolute; left: 0; top: 0; will-change: transform; transition: opacity .25s; }
.rot.escondido { display: none; }
.rot.ocluido { opacity: 0.18; }
.rot-linha { position: absolute; left: 0; top: 0; height: 1.5px; background: rgba(232, 237, 245, 0.75); transform-origin: 0 50%; box-shadow: 0 0 3px rgba(0,0,0,.6); }
.rot-ponto { position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.45); }
.rot-txt {
  position: absolute; left: 0; top: 0; pointer-events: auto; cursor: pointer; white-space: nowrap;
  font-size: 13px; font-weight: 650; color: #fff; padding: 4px 9px; border-radius: 8px;
  background: rgba(8, 12, 22, 0.78); border: 1px solid rgba(255, 255, 255, 0.18); box-shadow: 0 2px 10px rgba(0,0,0,.4);
  transition: background .2s, border-color .2s;
}
.rot-txt:hover, .rot.ativo .rot-txt { background: var(--acento); color: #1b0d06; border-color: var(--acento); }
.rot.ativo .rot-ponto { background: var(--acento); }
.rot.menor .rot-txt { font-size: 11.5px; padding: 3px 7px; font-weight: 600; }
.rot.titulo .rot-txt { font-size: 15px; padding: 6px 12px; background: rgba(8, 12, 22, 0.86); }
.rot.alerta .rot-txt { border-color: rgba(248, 113, 113, 0.7); }
.rot.sem-linha .rot-linha, .rot.sem-linha .rot-ponto { display: none; }

#dica { position: absolute; z-index: 30; pointer-events: none; background: rgba(6, 10, 19, 0.92); border: 1px solid var(--borda-forte); color: var(--texto); padding: 5px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; transform: translate(14px, 14px); }

/* ---------- Carregando / erro ---------- */
#carregando { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 14px; background: var(--fundo-1); z-index: 50; transition: opacity .6s; }
#carregando.sumindo { opacity: 0; pointer-events: none; }
#carregando p { color: var(--texto-2); margin: 0; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid rgba(255, 138, 92, 0.2); border-top-color: var(--acento); animation: gira 0.9s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
#erro-webgl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 24px; z-index: 60; background: var(--fundo-1); }

/* ---------- Diálogo do trabalho ---------- */
#dlg-trabalho { width: min(860px, calc(100% - 32px)); max-height: calc(100% - 48px); padding: 0; border: 1px solid var(--borda-forte); border-radius: 16px; background: #0b1120; color: var(--texto); box-shadow: var(--sombra); }
#dlg-trabalho::backdrop { background: rgba(2, 6, 14, 0.7); }
.dlg-barra { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: #0b1120; border-bottom: 1px solid var(--borda); z-index: 1; }
.dlg-barra > span { font-weight: 700; }
.dlg-barra > div { display: flex; gap: 8px; }
.folha { background: #fff; color: #111; margin: 18px; padding: 48px 56px; border-radius: 4px; font-family: "Times New Roman", Times, serif; font-size: 15px; line-height: 1.5; }
.folha h2 { text-align: center; font-size: 16px; text-transform: uppercase; margin: 0 0 18px; font-family: Arial, Helvetica, sans-serif; font-weight: 700; line-height: 1.35; }
.folha .autores { text-align: center; margin: 0 0 22px; font-family: Arial, Helvetica, sans-serif; font-size: 14px; }
.folha .autores [contenteditable] { outline: 1px dashed #bbb; padding: 2px 6px; border-radius: 3px; min-width: 200px; display: inline-block; }
.folha .autores [contenteditable]:empty::before { content: attr(data-placeholder); color: #999; }
.folha h3 { font-family: Arial, Helvetica, sans-serif; font-size: 14px; margin: 18px 0 8px; text-transform: uppercase; }
.folha p { text-align: justify; margin: 0 0 8px; font-family: Arial, Helvetica, sans-serif; font-size: 13.5px; }
.folha .resumo-bloco b { text-transform: uppercase; }
.folha .palavras { margin-top: 10px; }
.folha ol.refs { padding-left: 0; list-style: none; font-family: Arial, Helvetica, sans-serif; font-size: 13px; }
.folha ol.refs li { margin-bottom: 10px; text-align: left; }

/* ---------- Modo apresentação (gravação) ---------- */
#app.apresentacao #topo, #app.apresentacao #ferramentas, #app.apresentacao #painel { opacity: 0; pointer-events: none; transform: none; }
#app.apresentacao #topo { transition: opacity .3s; }
#app.apresentacao #estagios { bottom: 18px; width: min(560px, calc(100% - 32px)); }
#app.apresentacao.tour #estagios { bottom: 168px; }
#app.apresentacao #legenda-fase { width: min(760px, calc(100% - 32px)); }
#sair-apresentacao { position: absolute; top: 12px; right: 12px; z-index: 40; opacity: 0; transition: opacity .3s; }
#app.apresentacao #sair-apresentacao:hover, #app.apresentacao #sair-apresentacao:focus-visible { opacity: 1; }

#creditos { position: absolute; left: 16px; bottom: 6px; margin: 0; font-size: 10.5px; color: rgba(200, 210, 225, 0.45); z-index: 12; pointer-events: none; max-width: 40%; line-height: 1.3; }
#app.apresentacao #creditos { opacity: 0.6; }
@media (max-width: 960px) { #creditos { display: none; } }

/* ---------- Cartões de abertura/encerramento do tour (vídeo) ---------- */
#cartao { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; padding: 24px; pointer-events: none;
  background: radial-gradient(90% 80% at 50% 50%, rgba(6, 8, 12, 0.55) 0%, rgba(6, 8, 12, 0.88) 70%); opacity: 0; transition: opacity .7s ease; }
#cartao.visivel { opacity: 1; }
.cartao-conteudo { max-width: 920px; text-align: center; transform: translateY(10px); transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
#cartao.visivel .cartao-conteudo { transform: none; }
.cartao-sobre { margin: 0 0 14px; font-size: 14px; letter-spacing: 3px; text-transform: uppercase; color: var(--acento); font-weight: 700; }
#cartao h1 { margin: 0 0 16px; font-size: clamp(28px, 4.2vw, 54px); line-height: 1.12; font-weight: 800; letter-spacing: -0.5px; color: #fff; text-wrap: balance; }
.cartao-sub { margin: 0 auto 22px; max-width: 720px; font-size: clamp(15px, 1.6vw, 20px); color: #cdd6e4; line-height: 1.45; }
.cartao-autores { margin: 0; font-size: clamp(14px, 1.4vw, 18px); color: #fff; font-weight: 600; }
.cartao-creditos { margin: 22px 0 0; font-size: 12.5px; color: rgba(205, 214, 228, 0.7); }

/* ---------- Telas menores ---------- */
@media (max-width: 1180px) {
  :root { --painel-largura: 330px; --ferr-largura: 210px; }
  #abas button { padding: 8px 11px; font-size: 13px; }
  .marca p { display: none; }
}
@media (max-width: 960px) {
  :root { --topo: 104px; }
  #topo { flex-wrap: wrap; height: auto; padding: 8px 12px; gap: 8px; }
  #abas { order: 3; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .acoes { margin-left: auto; }
  #bt-trabalho { display: none; }
  #ferramentas { left: 12px; width: 190px; max-height: 38%; }
  #painel { top: auto; left: 12px; right: 12px; width: auto; height: 38%; bottom: 12px; }
  #painel.recolhido { transform: translateY(calc(100% - 46px)); }
  #painel.recolhido #painel-recolher svg { transform: rotate(-90deg); }
  #painel-recolher svg { transform: rotate(90deg); }
  #estagios, #legenda-fase { width: calc(100% - 24px); bottom: calc(38% + 22px); }
  #legenda { bottom: calc(38% + 22px); }
}
@media (max-width: 560px) {
  body { font-size: 14px; }
  .marca h1 { font-size: 16px; }
  #abas button { padding: 7px 10px; }
  #abas button b { display: none; }
  #ferramentas { width: 160px; }
  #legenda h2 { font-size: 17px; }
  #legenda p { font-size: 14px; }
  .folha { margin: 8px; padding: 22px 18px; }
}

/* ---------- Impressão: só a folha do resumo ---------- */
@media print {
  html, body { overflow: visible; height: auto; background: #fff; }
  #app { position: static; }
  #app > *:not(#dlg-trabalho) { display: none !important; }
  #dlg-trabalho { display: block !important; position: static; width: auto; max-height: none; border: 0; box-shadow: none; background: #fff; }
  .dlg-barra { display: none; }
  .folha { margin: 0; padding: 0; }
  .folha .autores [contenteditable] { outline: none; }
}


/* ---------- Movimento da interface (entradas suaves) ---------- */
@keyframes entrar { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes surgir { from { opacity: 0; } to { opacity: 1; } }
#painel-conteudo > * { animation: entrar .38s cubic-bezier(.2,.7,.2,1) both; }
#painel-conteudo > *:nth-child(2) { animation-delay: .03s; }
#painel-conteudo > *:nth-child(3) { animation-delay: .06s; }
#painel-conteudo > *:nth-child(4) { animation-delay: .09s; }
#painel-conteudo > *:nth-child(n+5) { animation-delay: .12s; }
#opcoes .caixa, #vistas .caixa, #lista-farmacos > *, #sub-cena { animation: entrar .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes entrar-centro { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
#estagios:not([hidden]), #legenda-fase:not([hidden]), #legenda:not([hidden]) { animation: entrar-centro .4s cubic-bezier(.2,.7,.2,1) both; }
#fase-texto { animation: surgir .35s ease both; }
.cartao-farmaco { transition: border-color .2s, background .2s, transform .15s; }
.cartao-farmaco:hover { transform: translateX(3px); }
#abas button { transition: background .25s, color .25s, transform .15s; }
#abas button:active { transform: scale(.97); }
.vistas-lista button { transition: border-color .2s, color .2s, background .2s; }
.vistas-lista button:active { background: var(--acento); color: #1b0d06; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
