/* ============================================================
   JÁ FOI HOJE? DISBIOSE — identidade visual
   ------------------------------------------------------------
   Irmão do "já foi hoje?": mesma família tipográfica (Poppins +
   Space Grotesk), mesmo creme, mesmo raio de 20px, mesma coluna
   estreita. O que muda é o acento — petróleo em vez de âmbar —
   para os dois ícones não se confundirem na tela do celular.

   Tema: o app segue o sistema do aparelho (claro/escuro). Todas
   as cores saem de tokens; nenhuma cor é declarada só dentro do
   bloco escuro, senão o tema claro ficaria sem ela.
   ============================================================ */

:root {
  --cream:#FAF7F0;
  --surface:#FFFFFF;
  --sand:#F1EADC;
  --sand-2:#E7DFCE;
  --line:#EAE1D1;
  --ink:#2E2118;
  --muted:#5A4B3C;
  --faint:#8C7E6D;

  --teal:#1F6F6B;
  --teal-deep:#155451;
  --teal-soft:#DDEDEB;
  --teal-line:#B9D8D4;

  --amber:#C8871B;
  --amber-soft:#FBEBD2;
  --red:#A03A2B;
  --red-soft:#F8E4DF;
  --green:#3F7D5A;
  --green-soft:#E3F0E8;

  /* Bristo mantém a própria paleta entre os dois apps — ele é o mesmo
     personagem, não um elemento de tema. Só clareia no fundo escuro. */
  --bristo-body:#8A5A2B;
  --bristo-line:#734825;
  --bristo-blush:#E8A33D;
  --bristo-olho:#FFFDF8;
  --bristo-tinta:#2E2118;

  --btn-ink:#FFFFFF;   /* texto sobre o acento sólido */

  --shadow:0 2px 12px rgba(46,33,24,.07);
  --shadow-up:0 8px 26px rgba(46,33,24,.13);
  --radius:20px;
  --font-display:"Poppins", ui-sans-serif, system-ui, sans-serif;
  --font-ui:"Space Grotesk", ui-sans-serif, system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --cream:#171310;
    --surface:#211B16;
    --sand:#2A231C;
    --sand-2:#332A21;
    --line:#3A3026;
    --ink:#F0E9DC;
    --muted:#C2B6A4;
    --faint:#8E8272;

    --teal:#6FBDB4;
    --teal-deep:#8FD3CA;
    --teal-soft:#1B302E;
    --teal-line:#2C4B47;

    --amber:#E0AC55;
    --amber-soft:#33270F;
    --red:#E08872;
    --red-soft:#38211B;
    --green:#7FBE9A;
    --green-soft:#1C2E24;

    --bristo-body:#A9743C;
    --bristo-line:#8A5A2B;
    --bristo-blush:#E8A33D;
    --bristo-olho:#FFFDF8;
    --bristo-tinta:#241A12;

    --btn-ink:#0F1F1D;

    --shadow:0 2px 12px rgba(0,0,0,.35);
    --shadow-up:0 8px 26px rgba(0,0,0,.45);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body.com-abas { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
  letter-spacing: -.02em;
  text-wrap: balance;
}
p { margin: 0; }
a { color: var(--teal-deep); }
button { font-family: var(--font-ui); }
:focus-visible { outline: 2.5px solid var(--teal); outline-offset: 2px; border-radius: 6px; }

.hidden { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  padding: 0 !important; border: 0 !important; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.view { max-width: 480px; margin: 0 auto; padding: 22px 18px 40px; }
.stack > * + * { margin-top: 14px; }

/* ============================================================
   Bristo
   ============================================================ */
.bristo { width: 100%; height: 100%; display: block; overflow: visible; }
.bristo-corpo { transform-origin: 60px 104px; animation: bristo-bob 3.4s ease-in-out infinite; }
.bristo-olhos { transform-origin: 60px 78px; animation: bristo-blink 5.5s ease-in-out infinite; }
.bristo-faisca { transform-box: fill-box; transform-origin: center; animation: bristo-sparkle 1.8s ease-in-out infinite; }
.bristo-faisca.b { animation-delay: .6s; }
.bristo-faisca.c { animation-duration: 2.2s; animation-delay: .3s; }
.bristo-braco { transform-origin: 14px 92px; animation: bristo-wave 1.4s ease-in-out infinite; }
.bristo-z1 { animation: bristo-zzz 2.6s ease-out infinite; }
.bristo-z2 { animation: bristo-zzz 2.6s ease-out infinite .9s; }

@keyframes bristo-bob { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-4px) rotate(-1.5deg); } }
@keyframes bristo-blink { 0%,92%,100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes bristo-sparkle { 0%,100% { opacity: 0; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes bristo-zzz { 0% { opacity: 0; transform: translate(0,0) scale(.8); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(10px,-22px) scale(1.1); } }
@keyframes bristo-wave { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(18deg); } }

.bristo-hero { width: 112px; height: 116px; margin: 0 auto 10px; }
.bristo-sono { width: 118px; height: 122px; margin: 0 auto 4px; }
.bristo-festa { width: 150px; height: 155px; margin: 0 auto 8px; }
.bristo-fala {
  display: flex; align-items: center; gap: 13px;
  background: var(--sand); border: 1.5px solid var(--line);
  border-radius: 18px; padding: 13px 16px;
}
.bristo-fala .mini { width: 52px; height: 54px; flex: none; }
.bristo-fala p { font-size: .88rem; color: var(--muted); line-height: 1.45; }
.bristo-fala p b { color: var(--ink); font-weight: 600; }

/* ============================================================
   Cabeçalhos
   ============================================================ */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.back {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--muted);
  width: 38px; height: 38px; border-radius: 12px; font-size: 17px; cursor: pointer;
  flex: none; display: flex; align-items: center; justify-content: center;
}
.back:hover { border-color: var(--teal-line); color: var(--teal-deep); }
.topbar-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; }
.topbar-sub { font-size: .78rem; color: var(--faint); letter-spacing: .04em; text-transform: uppercase; }

.page-head { margin-bottom: 18px; }
.page-head h2 { font-size: 1.6rem; }
.page-head p { margin-top: 6px; color: var(--muted); font-size: .92rem; }

.brand { text-align: center; padding: 10px 0 24px; }
.brand h1 { font-size: 1.85rem; font-weight: 800; line-height: 1.1; }
.brand h1 em {
  font-style: normal; color: var(--teal-deep); display: block; font-size: 1.15rem;
  font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: 6px;
}
.brand p { color: var(--muted); font-size: .95rem; margin-top: 12px; max-width: 34ch; margin-inline: auto; }

.divider {
  display: flex; align-items: center; gap: 14px; margin: 26px 0 18px;
  color: var(--faint); font-size: .74rem; letter-spacing: .16em;
  text-transform: uppercase; font-weight: 600;
}
.divider::before, .divider::after { content: ""; height: 1.5px; background: var(--line); flex: 1; }

/* ---------- as duas portas da tela inicial ---------- */
.door {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); color: var(--ink);
  transition: transform .08s ease, border-color .15s ease, box-shadow .15s ease;
}
.door:hover { border-color: var(--teal-line); box-shadow: var(--shadow-up); transform: translateY(-2px); }
.door:active { transform: translateY(0); }
.door-top { display: flex; align-items: center; gap: 12px; margin-bottom: 9px; }
.door-icon { width: 42px; height: 42px; border-radius: 14px; flex: none; display: flex; align-items: center; justify-content: center; }
.door-icon svg { width: 24px; height: 24px; }
.door.a .door-icon { background: var(--teal-soft); color: var(--teal-deep); }
.door.b .door-icon { background: var(--amber-soft); color: var(--amber); }
.door h2 { font-size: 1.12rem; }
.door p { color: var(--muted); font-size: .9rem; }
.door-foot {
  margin-top: 14px; padding-top: 12px; border-top: 1.5px dashed var(--line);
  font-size: .82rem; color: var(--faint); display: flex; justify-content: space-between;
  align-items: center; gap: 10px;
}
.door-foot b { color: var(--teal-deep); font-weight: 600; }

/* ============================================================
   Cards e formulários
   ============================================================ */
.card {
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px;
}
.card h3 { font-size: 1rem; margin-bottom: 4px; }
.card .hint { font-size: .85rem; color: var(--faint); margin-bottom: 14px; }
.card .hint:last-child { margin-bottom: 0; }

.progress { margin-bottom: 18px; }
.progress-bar { height: 6px; background: var(--sand); border-radius: 99px; overflow: hidden; }
.progress-bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; transition: width .25s ease; }
.progress-meta {
  display: flex; justify-content: space-between; font-size: .76rem; color: var(--faint);
  margin-top: 7px; letter-spacing: .05em; text-transform: uppercase; font-weight: 600;
}

/* ---------- likert ---------- */
.sym { padding: 15px 0; border-top: 1.5px solid var(--line); }
.sym:first-child { border-top: none; padding-top: 2px; }
.sym-q { font-size: .95rem; font-weight: 500; margin-bottom: 10px; display: block; }
.likert { display: grid; grid-template-columns: repeat(5,1fr); gap: 5px; }
.likert label {
  border: 1.5px solid var(--line); background: var(--sand); border-radius: 11px;
  padding: 9px 2px 7px; text-align: center; cursor: pointer; color: var(--faint);
  font-size: .66rem; line-height: 1.25; font-weight: 600;
}
.likert label span { display: block; font-family: var(--font-display); font-size: .95rem; color: var(--muted); margin-bottom: 2px; }
.likert input { position: absolute; opacity: 0; pointer-events: none; }
.likert label:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-deep); }
.likert label:has(input:checked) span { color: var(--teal-deep); }

/* ---------- pílulas ---------- */
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pills label {
  border: 1.5px solid var(--line); background: var(--sand); border-radius: 99px;
  padding: 8px 14px; font-size: .88rem; cursor: pointer; color: var(--muted);
}
.pills input { position: absolute; opacity: 0; pointer-events: none; }
.pills label:has(input:checked) {
  background: var(--teal); border-color: var(--teal); color: var(--btn-ink); font-weight: 600;
}
.q-block { margin-top: 18px; }
.q-block:first-child { margin-top: 0; }
.q-block > label.q { display: block; font-size: .95rem; font-weight: 500; margin-bottom: 9px; }

/* ---------- listas de marcar ---------- */
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.checks li label {
  display: flex; align-items: flex-start; gap: 11px; padding: 11px; border-radius: 12px;
  cursor: pointer; font-size: .91rem; line-height: 1.4; border: 1.5px solid transparent;
}
.checks input { accent-color: var(--teal); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.checks li label:hover { background: var(--sand); }
.checks.risk li label:has(input:checked) { background: var(--amber-soft); border-color: var(--amber); }
.checks.alarm input { accent-color: var(--red); }
.checks.alarm li label:has(input:checked) { background: var(--red-soft); border-color: var(--red); }
.checks.calm li label:has(input:checked) { background: var(--teal-soft); border-color: var(--teal-line); }
.group-label {
  font-size: .72rem; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 700; color: var(--faint); margin: 20px 0 8px;
}
.group-label:first-child { margin-top: 0; }

/* ---------- Bristol ---------- */
.bristol { display: grid; grid-template-columns: repeat(auto-fit,minmax(96px,1fr)); gap: 8px; }
.bristol label {
  border: 1.5px solid var(--line); background: var(--sand); border-radius: 14px;
  padding: 11px 7px 10px; text-align: center; cursor: pointer;
}
.bristol input { position: absolute; opacity: 0; pointer-events: none; }
.bristol svg { width: 56px; height: 32px; display: block; margin: 0 auto 7px; color: var(--muted); }
.bristol .t { font-family: var(--font-display); font-size: .8rem; font-weight: 700; color: var(--ink); }
.bristol .d { font-size: .66rem; color: var(--faint); line-height: 1.3; margin-top: 2px; }
.bristol label:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); }
.bristol label:has(input:checked) svg { color: var(--teal-deep); }
.bristol label:has(input:checked) .t { color: var(--teal-deep); }

/* ---------- contador de evacuações ---------- */
.stepper {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  background: var(--sand); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px;
}
.stepper button {
  width: 52px; height: 52px; border-radius: 16px; border: 1.5px solid var(--teal-line);
  background: var(--surface); color: var(--teal-deep); font-size: 1.6rem; font-weight: 600;
  cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.stepper button:hover { background: var(--teal-soft); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper .val {
  font-family: var(--font-display); font-size: 2.6rem; font-weight: 800;
  min-width: 72px; text-align: center; line-height: 1; color: var(--ink);
}
.stepper .val small {
  display: block; font-family: var(--font-ui); font-size: .7rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-top: 5px;
}

/* ---------- deslizante ---------- */
.slider-row { display: flex; align-items: center; gap: 14px; }
input[type=range] { flex: 1; accent-color: var(--teal); height: 24px; }
.slider-row output {
  font-family: var(--font-display); font-weight: 800; font-size: 1.7rem;
  width: 46px; text-align: center; color: var(--teal-deep);
}
.slider-ends { display: flex; justify-content: space-between; font-size: .72rem; color: var(--faint); margin-top: 2px; }

/* ---------- campos ---------- */
textarea {
  width: 100%; min-height: 110px; resize: vertical; padding: 12px 13px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--sand);
  color: var(--ink); font-family: var(--font-ui); font-size: .94rem; line-height: 1.5;
}
textarea::placeholder, input::placeholder { color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select {
  width: 100%; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: 14px;
  background: var(--sand); color: var(--ink); font-family: var(--font-ui); font-size: .94rem;
}
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: .88rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field-hint { font-size: .8rem; color: var(--faint); margin-top: 5px; }
.codigo-input { text-align: center; font-size: 1.5rem; letter-spacing: .3em; font-weight: 700; }

.consent {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px;
  background: var(--sand); border: 1.5px solid var(--line); border-radius: 14px;
  font-size: .87rem; line-height: 1.45; color: var(--muted); cursor: pointer;
}
.consent input { accent-color: var(--teal); width: 18px; height: 18px; margin-top: 2px; flex: none; }
.consent b { color: var(--ink); }

.form-error { color: var(--red); font-size: .87rem; margin: 8px 0 0; min-height: 1.2em; }

/* ============================================================
   Botões
   ============================================================ */
.btn {
  font-size: 1rem; font-weight: 600; border: none; border-radius: 15px;
  padding: 14px 20px; cursor: pointer; transition: transform .06s ease, background .15s ease;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--teal); color: var(--btn-ink); }
.btn-primary:hover:not(:disabled) { background: var(--teal-deep); }
.btn-ghost { background: var(--surface); color: var(--muted); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--teal-line); color: var(--teal-deep); }
.btn-zap { background: #25D366; color: #04310F; }
.btn-zap:hover { background: #1FB855; }
.btn-block { width: 100%; }
.btn-big { padding: 16px 20px; font-size: 1.05rem; }
.nav-row { display: flex; gap: 10px; margin-top: 18px; }
.nav-row .btn { flex: 1; }
.nav-row .btn.narrow { flex: 0 0 auto; padding-inline: 18px; }
.linklike {
  background: none; border: none; color: var(--teal-deep); font-size: .88rem;
  text-decoration: underline; cursor: pointer; padding: 4px; font-weight: 500;
}

/* ============================================================
   Alarme
   ============================================================ */
.alarm-banner {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--red-soft); border: 1.5px solid var(--red); border-radius: 16px;
  padding: 15px 16px; color: var(--red); font-size: .9rem; line-height: 1.45;
}
.alarm-banner strong { display: block; font-family: var(--font-display); font-size: .98rem; margin-bottom: 3px; }
.alarm-banner svg { width: 22px; height: 22px; flex: none; margin-top: 1px; }

/* ============================================================
   Resultado da triagem — medidor contínuo
   Sem faixas nomeadas e sem ponto de corte: não existe escore
   validado para SIBO/IMO/SIFO, então o que se lê é a POSIÇÃO ao
   longo de um contínuo, não um rótulo de risco.
   ============================================================ */
.meter-head { text-align: center; padding: 4px 0 2px; }
.meter-label { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--faint); }
.meter-lead {
  font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.4;
  margin-top: 9px; color: var(--muted); text-wrap: balance; max-width: 32ch; margin-inline: auto;
}
.meter { position: relative; height: 22px; margin: 26px 0 0; }
.meter-track {
  position: absolute; left: 0; right: 0; top: 3px; height: 16px; border-radius: 99px;
  border: 1.5px solid var(--line);
  background: linear-gradient(90deg, var(--sand-2) 0%, var(--teal-line) 48%, var(--teal) 100%);
}
.meter-ticks { position: absolute; left: 0; right: 0; top: 3px; height: 16px; display: flex; justify-content: space-between; padding: 0 8px; }
.meter-ticks i { width: 1.5px; height: 16px; background: var(--surface); opacity: .55; }
.meter-pin { position: absolute; top: 0; width: 22px; height: 22px; margin-left: -11px; transition: left .6s cubic-bezier(.22,1,.36,1); }
.meter-pin .dot {
  display: block; width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); border: 4px solid var(--teal-deep); box-shadow: 0 2px 9px rgba(46,33,24,.3);
}
.meter-ends { display: flex; justify-content: space-between; font-size: .78rem; color: var(--faint); font-weight: 600; margin-top: 11px; }
.meter-note { font-size: .79rem; color: var(--faint); text-align: center; margin-top: 14px; line-height: 1.5; }

.domains { display: flex; flex-direction: column; gap: 11px; margin-top: 6px; }
.domain { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.domain .dn { font-size: .88rem; color: var(--ink); }
.domain .dv { font-family: var(--font-display); font-weight: 700; font-size: .88rem; color: var(--teal-deep); white-space: nowrap; }
.domain .dbar { grid-column: 1/-1; height: 7px; background: var(--sand); border-radius: 99px; overflow: hidden; }
.domain .dbar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.domain .dsub { grid-column: 1/-1; font-size: .78rem; color: var(--faint); }

.findings { display: flex; flex-direction: column; gap: 10px; }
.finding {
  border-left: 4px solid var(--teal); background: var(--teal-soft);
  border-radius: 0 14px 14px 0; padding: 13px 15px; font-size: .9rem; line-height: 1.45; color: var(--ink);
}
.finding.warn { border-color: var(--amber); background: var(--amber-soft); }
.finding.bad { border-color: var(--red); background: var(--red-soft); }
.finding b { font-family: var(--font-display); display: block; margin-bottom: 3px; font-size: .94rem; }

.disclaimer {
  background: var(--sand); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 14px 16px; font-size: .85rem; color: var(--muted); line-height: 1.5;
}
.disclaimer strong { color: var(--ink); }

/* ---------- convite a agendar ---------- */
.cta-card {
  background: var(--teal-soft); border: 1.5px solid var(--teal-line);
  border-radius: var(--radius); padding: 20px; text-align: center;
}
.cta-card h3 { font-size: 1.1rem; color: var(--teal-deep); }
.cta-card p { font-size: .9rem; color: var(--muted); margin: 8px auto 16px; max-width: 34ch; }

/* ============================================================
   Diário e histórico
   ============================================================ */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chips label {
  border: 1.5px solid var(--line); background: var(--sand); border-radius: 99px;
  padding: 9px 14px; font-size: .87rem; cursor: pointer; color: var(--muted);
}
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips label:has(input:checked) { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-deep); font-weight: 600; }
.chips label.alarme:has(input:checked) { background: var(--red-soft); border-color: var(--red); color: var(--red); }

.hist-strip { display: flex; gap: 4px; align-items: flex-end; height: 76px; margin: 6px 0 4px; }
.hist-strip .col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 3px; min-width: 0; }
.hist-strip .col i { display: block; background: var(--teal); border-radius: 3px 3px 0 0; min-height: 3px; }
.hist-strip .col i.empty { background: var(--sand-2); height: 3px; }
.hist-strip .col span { font-size: .6rem; color: var(--faint); text-align: center; overflow: hidden; }

.hist-day { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 15px; background: var(--surface); }
.hist-day-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.hist-day-top .d { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.hist-day-top .n { font-size: .82rem; color: var(--faint); }
.hist-day .s { font-size: .84rem; color: var(--muted); line-height: 1.45; }
.hist-day .obs {
  font-size: .84rem; color: var(--ink); background: var(--sand);
  border-radius: 11px; padding: 9px 11px; margin-top: 8px; white-space: pre-wrap;
}
.empty-state { text-align: center; color: var(--faint); font-size: .9rem; padding: 26px 10px; white-space: pre-line; }

.streak {
  display: flex; align-items: center; gap: 12px; background: var(--amber-soft);
  border: 1.5px solid var(--amber); border-radius: 16px; padding: 13px 16px;
}
.streak .n { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; color: var(--amber); line-height: 1; }
.streak .l { font-size: .85rem; color: var(--muted); }

/* ============================================================
   Visão da médica (dentro do resultado) e painel
   ============================================================ */
.doc-toggle {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: transparent; border: 1.5px dashed var(--line); border-radius: 14px;
  padding: 12px; font-size: .85rem; color: var(--faint); cursor: pointer; font-weight: 600;
}
.doc-toggle:hover { border-color: var(--teal-line); color: var(--teal-deep); }
.doc { font-size: .9rem; line-height: 1.55; }
.doc .kv { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: .87rem; padding: 11px 0; border-top: 1.5px solid var(--line); }
.doc .kv:first-of-type { border-top: none; }
.doc .kv b { font-family: var(--font-display); color: var(--teal-deep); text-align: right; }
.doc h4 { font-family: var(--font-display); font-size: .92rem; margin: 20px 0 8px; }
.doc ol { padding-left: 20px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.doc ol li { font-size: .87rem; color: var(--muted); }
.doc ol li b { color: var(--ink); }
.cite {
  font-family: var(--font-ui); font-size: .62rem; font-weight: 700; color: var(--teal-deep);
  vertical-align: super; background: var(--teal-soft); border-radius: 4px; padding: 1px 4px; margin-left: 2px;
}
.refs { list-style: none; padding: 0; margin: 0; counter-reset: r; }
.refs li {
  font-size: .8rem; color: var(--muted); padding: 11px 0 11px 30px;
  border-top: 1.5px solid var(--line); position: relative; line-height: 1.45;
}
.refs li:first-child { border-top: none; }
.refs li::before {
  content: counter(r); counter-increment: r; position: absolute; left: 0; top: 11px;
  width: 21px; height: 21px; border-radius: 6px; background: var(--teal-soft); color: var(--teal-deep);
  font-size: .68rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.refs a { color: var(--teal-deep); word-break: break-all; font-size: .72rem; }

/* ---------- painel da médica ---------- */
.paciente {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 14px 15px; color: var(--ink);
}
.paciente:hover { border-color: var(--teal-line); }
.paciente .av {
  width: 40px; height: 40px; border-radius: 12px; flex: none; background: var(--teal-soft);
  color: var(--teal-deep); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem;
}
.paciente .nm { font-family: var(--font-display); font-weight: 700; font-size: .95rem; }
.paciente .meta { font-size: .8rem; color: var(--faint); margin-top: 2px; }
.paciente .tag {
  margin-left: auto; flex: none; font-size: .7rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 4px 9px; border-radius: 99px;
  background: var(--sand); color: var(--faint);
}
.paciente .tag.alerta { background: var(--red-soft); color: var(--red); }
.paciente .tag.ativo { background: var(--green-soft); color: var(--green); }

.tabs-doc { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs-doc button {
  flex: 1; padding: 10px 8px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: .85rem; font-weight: 600; cursor: pointer;
}
.tabs-doc button[aria-selected="true"] { background: var(--teal-soft); border-color: var(--teal); color: var(--teal-deep); }

/* ============================================================
   Abas de baixo
   ============================================================ */
.abas {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--surface); border-top: 1.5px solid var(--line);
  padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
}
.abas button {
  flex: 1; background: none; border: none; cursor: pointer; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--faint); font-size: .68rem; font-weight: 600;
}
.abas button svg { width: 23px; height: 23px; }
.abas button[aria-current="page"] { color: var(--teal-deep); }

/* ============================================================
   Avisos flutuantes
   ============================================================ */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 60;
  background: var(--ink); color: var(--cream); padding: 12px 20px; border-radius: 99px;
  font-size: .88rem; font-weight: 600; box-shadow: var(--shadow-up);
  opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .2s ease;
  max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.loading {
  position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cream) 82%, transparent);
}
.loading i {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3.5px solid var(--teal-line); border-top-color: var(--teal);
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.aviso-config {
  background: var(--red-soft); border: 1.5px solid var(--red); color: var(--red);
  border-radius: 16px; padding: 14px 16px; font-size: .88rem; line-height: 1.45; margin-bottom: 16px;
}

footer.appfoot { text-align: center; color: var(--faint); font-size: .76rem; padding: 28px 6px 4px; line-height: 1.6; }

/* ============================================================
   Preferências e impressão
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .noprint, .abas, .toast, .loading { display: none !important; }
  body { background: #fff; color: #000; padding-bottom: 0; }
  .view { max-width: 100%; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; border-color: #ccc; }
  .bristo-fala { break-inside: avoid; }
}
