/* Material de apoio em ecografia vascular · SBACV-SP Seccional Presidente Prudente
   Folha única para as páginas de /ecografia/ (tela e impressão). */

:root {
  --bg: #f3f2f2;
  --papel: #ffffff;
  --texto: #201e1d;
  --suave: #605d5d;
  --linha: #d7d3d3;
  --tinta: #eae9e9;
  --acento: #ec3013;
  --acento-escuro: #ae1800;
  --acento-claro: #fff2ef;
  --acento-medio: #ffe0d9;
  --campo: #fff1a6;
  --fonte: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 15px;
  line-height: 1.5;
}

a { color: var(--acento-escuro); }
a:hover { color: var(--acento); }

/* ── Barra de ferramentas ─────────────────────────────── */

.barra {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--texto);
  color: #f4f2f1;
}
.barra-in {
  max-width: 900px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.barra .voltar {
  margin-right: auto;
  color: #f4f2f1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
}
.barra .voltar:hover { color: #ff9783; }
.barra button {
  padding: 8px 14px;
  background: transparent;
  border: 1.5px solid rgba(244, 242, 241, 0.55);
  color: #f4f2f1;
  font: 700 12px/1 var(--fonte);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.barra button:hover { border-color: #ff9783; color: #ff9783; }
.barra button:focus-visible { outline: 2px solid #ff9783; outline-offset: 2px; }
.barra #copiar { background: var(--acento); border-color: var(--acento); color: #fff; }
.barra #copiar:hover { background: #dd2b0f; border-color: #dd2b0f; color: #fff; }
.aviso-copia { font-size: 13px; font-weight: 700; color: #ff9783; }
.aviso-copia:empty { display: none; }
.dica {
  flex-basis: 100%;
  font-size: 12px;
  color: #c9c5c3;
}

/* ── Folha ────────────────────────────────────────────── */

.folha {
  max-width: 900px;
  margin: 24px auto;
  padding: 40px 48px 36px;
  background: var(--papel);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
}

.cab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 28px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--acento);
}
.cab .logo { display: block; width: 300px; max-width: 100%; height: auto; }
.inst { display: flex; flex-direction: column; text-align: right; line-height: 1.35; }
.inst-1 { font-size: 13px; font-weight: 700; }
.inst-2 { font-size: 12px; color: var(--suave); }
.inst-3 { margin-top: 2px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--suave); }

/* Edição no navegador */
[contenteditable="true"] { outline: none; }
[contenteditable="true"]:focus { box-shadow: 0 0 0 2px var(--acento-medio); }

/* Campos a preencher */
.v {
  background: var(--campo);
  padding: 0 2px;
  border-radius: 2px;
}

/* ── Máscaras de laudo ────────────────────────────────── */

.ident {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 24px;
  font-size: 13.5px;
}
.ident p { margin: 0 0 3px; }

.titulo-exame {
  margin: 22px 0 18px;
  padding: 10px 0;
  border-top: 1px solid var(--linha);
  border-bottom: 1px solid var(--linha);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.02em;
  text-align: center;
}

.laudo { font-size: 14px; line-height: 1.6; }
.laudo section { margin-bottom: 18px; }
.laudo h2 {
  margin: 0 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--linha);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--acento-escuro);
}
.laudo h3 { margin: 14px 0 4px; font-size: 14px; font-weight: 700; }
.laudo p { margin: 0 0 8px; text-align: justify; hyphens: auto; }
.laudo ul { margin: 0 0 8px; padding-left: 20px; }

.conclusao {
  padding: 12px 16px 6px;
  background: var(--acento-claro);
  border-left: 3px solid var(--acento);
}
.conclusao h2 { border-bottom-color: var(--acento-medio); }

.tab { margin: 8px 0 10px; overflow-x: auto; }
.tab table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.35; }
.tab th, .tab td { padding: 6px 8px; border: 1px solid var(--linha); text-align: center; vertical-align: middle; }
.tab th { background: var(--tinta); font-weight: 700; }
.tab td.esq { text-align: left; }
.tab td.vazio { min-width: 64px; }

.legenda { margin: -4px 0 10px; font-size: 12px; color: var(--suave); }
.obs { font-size: 13px; font-style: italic; color: var(--suave); }

/* Frases alternativas (só na tela) */
.alternativas {
  margin-top: 28px;
  padding: 16px 20px;
  background: #fffbea;
  border: 1px dashed #d9c46a;
  font-size: 14px;
}
.alternativas h2 { margin: 0 0 4px; font-size: 16px; }
.alternativas h3 { margin: 14px 0 4px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--acento-escuro); }
.alternativas ul { margin: 0; padding-left: 20px; }
.alternativas li { margin-bottom: 4px; }
.dica-alt { margin: 0 0 6px; font-size: 12.5px; color: var(--suave); }

/* ── Tabelas de referência ────────────────────────────── */

.titulo-pagina { margin-bottom: 8px; }
.sobre {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--acento-escuro);
}
.titulo-pagina h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.titulo-pagina p { margin: 0; max-width: 62ch; color: var(--suave); }

.ref { font-size: 14.5px; }
.ref h2 {
  margin: 30px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--texto);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}
.ref h3 { margin: 18px 0 8px; font-size: 15px; font-weight: 700; }
.ref p { margin: 0 0 10px; }
.lista { margin: 0 0 12px; padding-left: 20px; }
.lista li { margin-bottom: 3px; }

.ref table { width: 100%; margin: 4px 0 8px; border-collapse: collapse; font-size: 13.5px; line-height: 1.4; }
.ref th, .ref td { padding: 7px 10px; border-bottom: 1px solid var(--linha); text-align: left; vertical-align: top; }
.ref thead th {
  background: var(--tinta);
  border-bottom: 1.5px solid var(--texto);
  font-size: 12.5px;
  font-weight: 700;
}
.ref td svg { vertical-align: middle; margin-right: 6px; }
.ref small { color: var(--suave); }
table.num td, table.num th { font-variant-numeric: tabular-nums; }
.ref td.esq { font-weight: 700; background: #faf9f9; }

.rolagem { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.rolagem table { min-width: 560px; }

/* Faixas de percentil (EMI): P75 e P90 destacados como limiar de risco */
td.p75 { background: var(--acento-claro); }
td.p90 { background: var(--acento-medio); }

.fonte { margin: 0 0 14px; font-size: 12px; color: var(--suave); }
.fonte::before { content: "Fonte: "; font-weight: 700; }
.fonte.sem-rotulo::before { content: none; }

.nota {
  padding: 10px 14px;
  background: #f8f7f7;
  border-left: 3px solid var(--linha);
  font-size: 13.5px;
  color: #444141;
}

figure { margin: 12px 0 16px; }
figure svg { display: block; max-width: 100%; height: auto; }
figcaption { margin-top: 6px; font-size: 12px; color: var(--suave); }

/* ── Referências e rodapé ─────────────────────────────── */

.referencias { margin-top: 32px; padding-top: 12px; border-top: 1px solid var(--linha); font-size: 12.5px; color: #444141; }
.referencias h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--texto); }
.referencias ol { margin: 0; padding-left: 20px; }
.referencias li { margin-bottom: 5px; overflow-wrap: anywhere; }

.rodape {
  max-width: 900px;
  margin: 0 auto 32px;
  padding: 0 16px;
  text-align: center;
  font-size: 12px;
  color: var(--suave);
}
.filete { display: block; width: 40px; height: 3px; margin: 0 auto 10px; background: var(--acento); }

/* ── Índice (/ecografia/) ─────────────────────────────── */

.indice h2 {
  margin: 30px 0 4px;
  font-size: 20px;
  font-weight: 800;
}
.curadoria {
  margin: 20px 0 6px;
  padding: 12px 16px;
  background: var(--acento-claro);
  border-left: 3px solid var(--acento);
  font-size: 14px;
}
.curadoria p { margin: 0; }
.curadoria p + p { margin-top: 2px; }
.curadoria a { font-weight: 700; overflow-wrap: anywhere; }
.indice .intro-secao { margin: 0 0 14px; font-size: 14px; color: var(--suave); }
.grupo { margin: 18px 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--acento-escuro); }
.links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: 6px;
}
.links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 100%;
  padding: 10px 12px;
  border: 1px solid var(--linha);
  color: var(--texto);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
}
.links a::after { content: "→"; flex: none; color: var(--suave); }
.links a:hover { border-color: var(--acento); color: var(--acento-escuro); }
.links a:hover::after { color: var(--acento); }

/* ── Telas estreitas ──────────────────────────────────── */

@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .folha { margin: 0; padding: 22px 16px 28px; box-shadow: none; }
  .cab { flex-direction: column; align-items: flex-start; }
  .cab .logo { width: 240px; }
  .inst { text-align: left; }
  .ident { grid-template-columns: 1fr; }
  .laudo p { text-align: left; }
  .rodape { margin-top: 20px; }
}

/* ── Impressão ────────────────────────────────────────── */

@page { size: A4; margin: 14mm 14mm 16mm; }

@media print {
  body { background: #fff; font-size: 12.5px; }
  .barra, .nao-imprimir, .rodape { display: none !important; }
  .folha { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .cab .logo { width: 240px; }
  .v { background: none; padding: 0; }
  [contenteditable="true"]:focus { box-shadow: none; }
  .laudo { font-size: 12.5px; }
  .conclusao { background: none; border-left: 2px solid var(--acento); }
  .rolagem, .tab { overflow: visible; }
  .rolagem table { min-width: 0; }
  table, figure, tr { break-inside: avoid; }
  h2, h3 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
