/* ==========================================================================
   Dra. Maria Cortês Ferreira — Utilitários de Saúde
   ========================================================================== */

:root {
  --bg: #f4f8f6;
  --bg-2: #e7f1ec;
  --ink: #1c2b27;
  --ink-soft: #4a5b56;
  --ink-mute: #77877f;
  --line: rgba(11, 61, 54, 0.12);
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.92);
  --surface-border: rgba(255, 255, 255, 0.9);

  --teal: #006d4c;
  --teal-2: #00a676;
  --teal-soft: #d7f0e6;
  --coral: #e2572f;
  --coral-soft: #fbe1d7;
  --violet: #0b3d36;
  --violet-soft: #dbe9e5;
  --sun: #ecab2e;
  --sun-soft: #fbedd0;
  --danger: #c2413a;
  --danger-soft: #fde4e1;

  --blob-1: #a9e4cf;
  --blob-2: #c9dfd6;
  --blob-3: #7fbfa8;
  --blob-4: #ffd9a3;

  --shadow-sm: 0 1px 2px rgba(23, 36, 46, 0.06), 0 2px 8px rgba(23, 36, 46, 0.05);
  --shadow: 0 10px 30px -10px rgba(23, 36, 46, 0.18), 0 2px 6px rgba(23, 36, 46, 0.05);
  --shadow-lg: 0 30px 60px -20px rgba(15, 80, 74, 0.35), 0 8px 20px -8px rgba(23, 36, 46, 0.12);

  --radius: 22px;
  --radius-sm: 14px;
  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a1512;
    --bg-2: #0e1c18;
    --ink: #eaf4f0;
    --ink-soft: #b3c8c1;
    --ink-mute: #7f9791;
    --line: rgba(234, 244, 240, 0.1);
    --surface: rgba(20, 39, 34, 0.55);
    --surface-strong: rgba(22, 43, 38, 0.85);
    --surface-border: rgba(255, 255, 255, 0.08);
    --teal: #2fcf9a;
    --teal-2: #00a676;
    --teal-soft: rgba(47, 207, 154, 0.14);
    --coral: #ff8f6b;
    --coral-soft: rgba(255, 143, 107, 0.14);
    --violet: #6fb3a4;
    --violet-soft: rgba(111, 179, 164, 0.15);
    --sun: #ffc861;
    --sun-soft: rgba(255, 200, 97, 0.14);
    --danger: #ff8a80;
    --danger-soft: rgba(255, 138, 128, 0.14);
    --blob-1: #0f5c4a;
    --blob-2: #1f4b3d;
    --blob-3: #0b3d36;
    --blob-4: #5c4413;
    --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

:root[data-theme='dark'] {
  --bg: #0a1512;
  --bg-2: #0e1c18;
  --ink: #eaf4f0;
  --ink-soft: #b3c8c1;
  --ink-mute: #7f9791;
  --line: rgba(234, 244, 240, 0.1);
  --surface: rgba(20, 39, 34, 0.55);
  --surface-strong: rgba(22, 43, 38, 0.85);
  --surface-border: rgba(255, 255, 255, 0.08);
  --teal: #2fcf9a;
  --teal-2: #00a676;
  --teal-soft: rgba(47, 207, 154, 0.14);
  --coral: #ff8f6b;
  --coral-soft: rgba(255, 143, 107, 0.14);
  --violet: #6fb3a4;
  --violet-soft: rgba(111, 179, 164, 0.15);
  --sun: #ffc861;
  --sun-soft: rgba(255, 200, 97, 0.14);
  --danger: #ff8a80;
  --danger-soft: rgba(255, 138, 128, 0.14);
  --blob-1: #0f5c4a;
  --blob-2: #1f4b3d;
  --blob-3: #0b3d36;
  --blob-4: #5c4413;
  --shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 30px 60px -20px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

/* ---------- Base ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}

a {
  color: inherit;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 8px;
}

[hidden] {
  display: none !important;
}

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

/* ---------- Animated backdrop ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  width: 46vmax;
  height: 46vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.7;
  animation: drift 26s ease-in-out infinite alternate;
}

.blob:nth-child(1) { background: var(--blob-1); top: -18vmax; left: -12vmax; }
.blob:nth-child(2) { background: var(--blob-2); top: 10vh; right: -20vmax; animation-duration: 32s; animation-delay: -6s; }
.blob:nth-child(3) { background: var(--blob-3); bottom: -22vmax; left: 20vw; animation-duration: 36s; animation-delay: -12s; }
.blob:nth-child(4) { background: var(--blob-4); bottom: 10vh; left: -18vmax; width: 30vmax; height: 30vmax; animation-duration: 29s; animation-delay: -3s; }

@keyframes drift {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(6vw, 4vh) scale(1.08) rotate(20deg); }
  100% { transform: translate(-4vw, 8vh) scale(0.95) rotate(-10deg); }
}

.grain {
  position: absolute;
  inset: -50%;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Layout ---------- */

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 14px 0;
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border-bottom: 1px solid var(--line);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--teal-2), var(--teal) 55%, var(--violet));
  box-shadow: 0 8px 20px -8px var(--teal);
  color: #fff;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--ink-mute);
  letter-spacing: 0.02em;
}

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

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.3s var(--spring), background 0.3s;
}

.icon-btn:hover {
  transform: rotate(-15deg) scale(1.06);
  background: var(--surface-strong);
}

.theme-toggle .moon { display: none; }
:root[data-theme='dark'] .theme-toggle .sun { display: none; }
:root[data-theme='dark'] .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .theme-toggle .sun { display: none; }
  :root:not([data-theme='light']) .theme-toggle .moon { display: block; }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: transform 0.3s var(--spring), background 0.3s;
}

.back-link:hover {
  transform: translateX(-3px);
  background: var(--surface-strong);
}

main {
  padding: 48px 0 80px;
}

.site-footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  color: var(--ink-mute);
  font-size: 0.85rem;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
}

/* ---------- Typography ---------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-sm);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.eyebrow .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-2);
  box-shadow: 0 0 0 0 var(--teal-2);
  animation: pulse 2.4s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--teal-2) 60%, transparent); }
  70% { box-shadow: 0 0 0 10px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  margin-top: 20px;
}

.display em {
  font-style: italic;
  font-weight: 500;
  background: linear-gradient(100deg, var(--teal) 10%, var(--violet) 55%, var(--coral) 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: 0.06em;
}

.lead {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--ink-soft);
  max-width: 60ch;
  margin: 20px 0 0;
  text-wrap: pretty;
}

/* ---------- Hero (home) ---------- */

.hero {
  padding: 24px 0 56px;
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-art {
  position: relative;
  aspect-ratio: 1;
  max-width: 420px;
  justify-self: end;
  width: 100%;
}

.orb {
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), transparent 40%),
    conic-gradient(from 200deg, var(--teal-2), var(--violet), var(--coral), var(--sun), var(--teal-2));
  filter: saturate(1.1);
  animation: spin 30s linear infinite;
  box-shadow: var(--shadow-lg);
}

.orb::after {
  content: '';
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: var(--bg);
  opacity: 0.88;
}

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

.float-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 10px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  font-weight: 600;
  font-size: 0.9rem;
  animation: bob 6s ease-in-out infinite;
  white-space: nowrap;
}

.float-chip .ico {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.float-chip.c1 { top: 10%; left: -4%; }
.float-chip.c2 { top: 44%; right: -6%; animation-delay: -2s; }
.float-chip.c3 { bottom: 10%; left: 6%; animation-delay: -4s; }

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

.hero-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-center .big {
  font-family: var(--font-display);
  font-size: clamp(3rem, 8vw, 5rem);
  font-style: italic;
  line-height: 1;
  background: linear-gradient(135deg, var(--teal), var(--violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-center small {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* ---------- Section head ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
}

.tools-count {
  font-family: var(--font-body);
  font-size: 0.5em;
  font-weight: 700;
  color: var(--ink-mute);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

/* ---------- Ferramentas: pesquisa e filtros ---------- */

.tools-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 22px;
}

.tools-search {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 260px;
  min-width: 220px;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink-mute);
  transition: border-color 0.25s;
}

.tools-search:focus-within {
  border-color: var(--teal);
  color: var(--ink);
}

.tools-search input {
  flex: 1;
  border: 0;
  background: none;
  font: inherit;
  color: var(--ink);
  min-width: 0;
}

.tools-search input:focus {
  outline: none;
}

.tools-search input::-webkit-search-cancel-button {
  cursor: pointer;
}

.tools-toolbar .tabbar {
  margin-bottom: 0;
  flex: 2 1 480px;
}

.tools-vazio {
  padding: 20px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--line);
  color: var(--ink-mute);
  text-align: center;
  margin-bottom: 20px;
}

/* Cada categoria ocupa uma célula da grelha; categorias com várias
   ferramentas visíveis ocupam a linha inteira (subgrid), para que as de uma
   só ferramenta fiquem lado a lado em vez de uma por linha. */
.tools-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.tools-section > .tool {
  flex: 1;
}

.tools-section.multi {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: 20px;
}

.tools-section-title {
  grid-column: 1 / -1;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin: 0;
}

.tools-section.multi > .tools-section-title {
  margin-bottom: -10px;
}

/* ---------- Tool cards ---------- */

.tools {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.tool {
  --tint: var(--teal);
  --tint-soft: var(--teal-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  text-decoration: none;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), opacity 0.4s;
}

.tool::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(420px circle at var(--mx, 80%) var(--my, 0%), var(--tint-soft), transparent 55%);
  opacity: 0.9;
  transition: opacity 0.4s;
}

a.tool:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.tool.featured {
  min-height: 260px;
  background:
    linear-gradient(135deg, color-mix(in srgb, #006d4c 92%, #000) 0%, #00a676 50%, color-mix(in srgb, #0b3d36 80%, #00a676) 100%);
  color: #fff;
  border-color: transparent;
}

.tool.featured::before {
  background: radial-gradient(500px circle at var(--mx, 80%) var(--my, 0%), rgba(255, 255, 255, 0.28), transparent 55%);
}

.tool.featured .tool-desc,
.tool.featured .tag {
  color: rgba(255, 255, 255, 0.88);
}

.tool.featured .tag {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
}

.tool.featured .tool-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.tool.featured .tool-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.tool-deco {
  position: absolute;
  right: -20px;
  bottom: -30px;
  width: 260px;
  opacity: 0.95;
  transform: rotate(-28deg);
  transition: transform 0.7s var(--spring);
  pointer-events: none;
}

a.tool:hover .tool-deco {
  transform: rotate(-20deg) translate(-10px, -8px);
}

.tool-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--tint-soft);
  color: var(--tint);
  font-size: 1.5rem;
}

.tool-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.tool-desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 44ch;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  background: var(--surface-strong);
}

.go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
}

.go svg {
  transition: transform 0.4s var(--spring);
}

a.tool:hover .go svg {
  transform: translateX(5px);
}

.tint-coral { --tint: var(--coral); --tint-soft: var(--coral-soft); }
.tint-violet { --tint: var(--violet); --tint-soft: var(--violet-soft); }
.tint-sun { --tint: color-mix(in srgb, var(--sun) 70%, var(--ink)); --tint-soft: var(--sun-soft); }

/* ---------- About strip ---------- */

.about {
  margin-top: 72px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: center;
  padding: 32px;
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 30px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-style: italic;
  color: #fff;
  background: linear-gradient(135deg, var(--coral), var(--violet));
  box-shadow: 0 16px 30px -12px var(--coral);
  transform: rotate(-6deg);
}

.avatar-foto {
  display: block;
  object-fit: cover;
  background: var(--surface);
}

.about h2 {
  font-size: 1.6rem;
}

.about p {
  margin: 8px 0 0;
  color: var(--ink-soft);
  max-width: 70ch;
}

.about-facts {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-facts li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.about-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-weight: 700;
  color: var(--teal);
  text-decoration: none;
}

.about-link svg {
  transition: transform 0.35s var(--spring);
}

.about-link:hover svg {
  transform: translate(3px, -3px);
}

/* ---------- Reveal on scroll ---------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ==========================================================================
   Calculadora de doses
   ========================================================================== */

.page-hero {
  margin-bottom: 36px;
}

.page-hero .display {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
}

.calc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  padding: 28px;
}

.step {
  display: grid;
  gap: 14px;
}

.step + .step {
  margin-top: 30px;
  padding-top: 26px;
  border-top: 1px dashed var(--line);
}

.step-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.step-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.85rem;
  background: var(--ink);
  color: var(--bg);
  flex: none;
}

fieldset.step {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

fieldset.step + .step,
.step + fieldset.step {
  padding-top: 26px;
}

fieldset.step legend {
  padding: 0;
  margin-bottom: 14px;
}

fieldset.step legend + .step-hint {
  margin-top: -14px;
}

.notices {
  display: grid;
  gap: 10px;
}

.notices:empty {
  display: none;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s var(--spring), box-shadow 0.2s, border-color 0.2s;
}

.action-btn:hover {
  transform: translateY(-1px);
  border-color: var(--teal);
  box-shadow: 0 10px 20px -14px var(--teal);
}

.action-btn svg {
  flex-shrink: 0;
}

.print-url {
  display: none;
}

@media print {
  .page-hero,
  .panel:not(.result),
  .info-grid,
  .disclaimer,
  .site-footer,
  .result-actions,
  .backdrop {
    display: none !important;
  }

  .site-header {
    display: block !important;
    position: static;
    padding: 0 0 12px;
    margin-bottom: 16px;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: 1px solid #ccc;
    color: #000;
  }

  .site-header .header-actions {
    display: none !important;
  }

  .brand-mark {
    box-shadow: none;
  }

  .brand-sub {
    color: #555;
  }

  .print-url {
    display: block;
    font-size: 0.75rem;
    color: #555;
    margin-top: 2px;
  }

  .result {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

.motivo {
  margin: 12px 0 0;
  font-weight: 600;
}

.step-hint {
  margin: -6px 0 0 42px;
  color: var(--ink-mute);
  font-size: 0.88rem;
}

/* Weight input */

.weight {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 4px;
}

.stepper {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s var(--spring), background 0.2s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.stepper:hover { background: var(--teal-soft); }
.stepper:active { transform: scale(0.9); }

.weight-field {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.weight-field input {
  width: 4.2ch;
  border: 0;
  background: transparent;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.4rem, 10vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  padding: 0;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.weight-field input::-webkit-outer-spin-button,
.weight-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.weight-field input:focus {
  outline: none;
}

.weight-field:focus-within {
  border-radius: 12px;
  box-shadow: 0 3px 0 0 var(--teal);
}

.weight-field .unit {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink-mute);
}

.slider {
  --pct: 20%;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--teal-2), var(--teal)) 0 / var(--pct) 100% no-repeat,
    var(--line);
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--teal);
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--teal) 60%, transparent);
  transition: transform 0.25s var(--spring);
}

.slider::-webkit-slider-thumb:hover { transform: scale(1.15); }

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  border: 6px solid var(--teal);
  box-shadow: 0 4px 14px -2px color-mix(in srgb, var(--teal) 60%, transparent);
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-mute);
  margin-top: -4px;
}

/* Medicine choice */

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choices-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice label {
  --c: var(--teal);
  --c-soft: var(--teal-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
  height: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--surface-strong);
  cursor: pointer;
  transition: border-color 0.3s, transform 0.35s var(--spring), box-shadow 0.3s, background 0.3s;
}

.choice.ibu label {
  --c: var(--coral);
  --c-soft: var(--coral-soft);
}

.choice label:hover {
  transform: translateY(-2px);
}

.choice input:checked + label {
  border-color: var(--c);
  background: linear-gradient(160deg, var(--c-soft), var(--surface-strong) 70%);
  box-shadow: 0 12px 24px -14px var(--c);
}

.choice input:focus-visible + label {
  outline: 3px solid var(--c);
  outline-offset: 3px;
}

.choice .pill {
  width: 42px;
  height: 20px;
  border-radius: 999px;
  margin-bottom: 8px;
  background: linear-gradient(90deg, var(--c) 50%, var(--surface) 50%);
  border: 2px solid var(--c);
  transform: rotate(-20deg);
  transition: transform 0.6s var(--spring);
}

.choice input:checked + label .pill {
  transform: rotate(160deg);
}

.choice .name {
  font-weight: 700;
  font-size: 1.05rem;
}

.choice .brands {
  font-size: 0.8rem;
  color: var(--ink-mute);
  line-height: 1.35;
}

/* Concentration chips */

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

.chip {
  position: relative;
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip label {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px solid var(--line);
  background: var(--surface-strong);
  cursor: pointer;
  line-height: 1.3;
  transition: border-color 0.25s, background 0.25s, transform 0.3s var(--spring);
}

.chip label:hover { transform: translateY(-2px); }

.chip label strong {
  font-size: 1.05rem;
}

.chip label span {
  font-size: 0.78rem;
  color: var(--ink-mute);
}

.chip input:checked + label {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.chip input:checked + label span {
  color: color-mix(in srgb, var(--bg) 75%, transparent);
}

.chip input:focus-visible + label {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
}

.custom-conc {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 16px;
  border-radius: 14px;
  border: 2px dashed var(--line);
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.custom-conc input {
  width: 5.5ch;
  border: 0;
  border-radius: 10px;
  padding: 8px;
  background: var(--surface-strong);
  text-align: center;
  font-weight: 700;
}

/* Result */

.result {
  position: sticky;
  top: 96px;
  overflow: hidden;
  isolation: isolate;
  padding: 0;
}

.result-head {
  --c: var(--teal);
  padding: 28px 28px 22px;
  color: #fff;
  background:
    radial-gradient(600px circle at 100% 0%, rgba(255, 255, 255, 0.25), transparent 50%),
    linear-gradient(135deg, color-mix(in srgb, var(--c) 85%, #000), var(--c));
  transition: background 0.6s var(--ease);
  position: relative;
}

.result[data-med='ibuprofeno'] .result-head {
  --c: var(--coral);
}

:root[data-theme='dark'] .result-head {
  color: #0b1317;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .result-head {
    color: #0b1317;
  }
}

.result-kicker {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.85;
}

.dose-line {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 6px;
}

.dose-big {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(3.8rem, 11vw, 5.6rem);
  line-height: 1;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}

.dose-big .u {
  font-size: 0.4em;
  letter-spacing: 0;
  margin-left: 4px;
  opacity: 0.9;
}

.dose-every {
  font-size: 1.15rem;
  font-weight: 600;
}

.dose-sub {
  margin-top: 8px;
  font-size: 0.95rem;
  opacity: 0.9;
}

.result-body {
  padding: 24px 28px 28px;
  display: grid;
  gap: 22px;
}

.syringes {
  display: grid;
  gap: 16px;
}

.syringe-wrap {
  display: grid;
  gap: 6px;
}

.syringe-cap {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-mute);
}

.syringe {
  width: 100%;
  height: auto;
  overflow: visible;
}

.syringe .barrel { fill: var(--surface-strong); stroke: var(--ink-soft); }
.syringe .tick { stroke: var(--ink-soft); }
.syringe .tick-label { fill: var(--ink-mute); font: 600 9px var(--font-body); }
.syringe .plunger { fill: var(--ink-soft); }
.syringe .plunger-rod { fill: color-mix(in srgb, var(--ink-soft) 55%, transparent); }
.syringe .plunger-group {
  transition: transform 1s var(--ease);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.stat {
  padding: 14px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.stat .k {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.stat .v {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.stat .v small {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-mute);
}

.schedule h3 {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule h3 input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--surface-strong);
  font-weight: 600;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  position: relative;
}

.timeline::before {
  content: '';
  position: absolute;
  top: 17px;
  left: 12%;
  right: 12%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--line) 0 6px, transparent 6px 12px);
  z-index: 0;
}

.timeline li {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 6px;
  font-size: 0.85rem;
  text-align: center;
}

.timeline .node {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.8rem;
  background: var(--surface-strong);
  border: 2px solid var(--line);
}

.timeline li:first-child .node {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.result[data-med='ibuprofeno'] .timeline li:first-child .node {
  background: var(--coral);
  border-color: var(--coral);
}

.timeline time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.timeline .day {
  font-size: 0.7rem;
  color: var(--ink-mute);
  margin-top: -6px;
}

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  background: var(--sun-soft);
  color: var(--ink);
}

.notice.danger {
  background: var(--danger-soft);
}

.notice .ni {
  flex: none;
  font-size: 1.1rem;
  line-height: 1.3;
}

.notice p {
  margin: 0;
}

.empty {
  padding: 48px 28px;
  text-align: center;
  color: var(--ink-soft);
}

.empty .big-emoji {
  font-size: 3rem;
  animation: bob 4s ease-in-out infinite;
}

.info-grid {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.info-card h3 {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.info-card p,
.info-card li {
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.info-card ul {
  margin: 0;
  padding-left: 18px;
}

.info-card .info-ico {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.disclaimer {
  margin-top: 28px;
  padding: 18px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-mute);
  background: var(--surface);
}

.pop {
  animation: pop 0.55s var(--spring);
}

@keyframes pop {
  0% { transform: scale(0.94); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   Sobre
   ========================================================================== */

.profile-hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: center;
  padding-bottom: 24px;
}

.profile-hero .about-facts {
  margin-top: 24px;
}

.profile-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--teal-2), var(--teal) 55%, var(--violet));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 10px 24px -10px var(--teal);
  transition: transform 0.3s var(--spring), box-shadow 0.3s;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -12px var(--teal);
}

.profile-card {
  justify-self: end;
  width: 100%;
  max-width: 360px;
  display: grid;
  justify-items: center;
  gap: 28px;
  padding: 36px 28px 28px;
  border-radius: calc(var(--radius) + 6px);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.avatar-lg {
  width: 140px;
  height: 140px;
  border-radius: 42px;
  font-size: 3.4rem;
}

.profile-stats {
  width: 100%;
  margin: 0;
  display: grid;
  gap: 10px;
}

.profile-stats div {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.profile-stats dt {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--teal);
  min-width: 3.2ch;
}

.profile-stats dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
}

.profile-section {
  margin-top: 72px;
}

.profile-section .about-link {
  margin-top: 0;
}

.section-intro {
  margin: -12px 0 24px;
  color: var(--ink-soft);
  max-width: 70ch;
}

.profile-section + .section-intro {
  margin: 32px 0 0;
}

.journey {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  counter-reset: passo;
}

.journey li {
  position: relative;
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.journey li::after {
  counter-increment: passo;
  content: counter(passo, decimal-leading-zero);
  position: absolute;
  top: 20px;
  right: 22px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-mute);
}

.journey-ico {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  background: var(--teal-soft);
}

.journey li:nth-child(2) .journey-ico { background: var(--sun-soft); }
.journey li:nth-child(3) .journey-ico { background: var(--violet-soft); }
.journey li:nth-child(4) .journey-ico { background: var(--coral-soft); }

.journey h3 {
  font-size: 1.2rem;
}

.journey p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 0.93rem;
}

.pubs {
  display: grid;
  gap: 20px;
}

.pub {
  display: grid;
  gap: 10px;
  padding: 28px 28px 28px 32px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
  text-decoration: none;
}

.pub::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: var(--tint, var(--teal));
}

a.pub {
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

a.pub:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pub-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--ink-mute);
  font-weight: 600;
}

.pub-type {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint-soft, var(--teal-soft));
  color: var(--tint, var(--teal));
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pub-title {
  font-size: clamp(1.2rem, 2.4vw, 1.5rem);
  line-height: 1.2;
  max-width: 60ch;
}

.pub-venue,
.pub-desc,
.pub-authors {
  margin: 0;
}

.pub-venue {
  font-weight: 600;
  color: var(--ink-soft);
}

.pub-desc {
  color: var(--ink-soft);
  max-width: 75ch;
}

.pub-authors {
  font-size: 0.85rem;
  color: var(--ink-mute);
  max-width: 90ch;
}

.pub-authors strong {
  color: var(--ink);
}

.pub .about-link {
  margin-top: 6px;
  overflow-wrap: anywhere;
}

/* ---------- IMC / ASC ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.imc-result[data-categoria='baixo-peso'] .result-head,
.imc-result[data-categoria='excesso-peso'] .result-head {
  --c: var(--sun);
}

.imc-result[data-categoria='obesidade-1'] .result-head,
.imc-result[data-categoria='obesidade-2'] .result-head {
  --c: var(--coral);
}

.imc-result[data-categoria='obesidade-3'] .result-head {
  --c: var(--danger);
}

/* ---------- Data provável de parto ---------- */

.date-field {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
}

.date-field:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.idade-eco {
  display: flex;
  gap: 12px;
}

.idade-eco-campo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink-mute);
}

.idade-eco-campo input {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
}

.idade-eco-campo input:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.dpp-data {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  text-transform: capitalize;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
  .hero-art {
    justify-self: center;
    max-width: 340px;
  }
  .calc {
    grid-template-columns: minmax(0, 1fr);
  }
  .result {
    position: relative;
    top: 0;
  }
  .info-grid {
    grid-template-columns: 1fr;
  }
  .profile-hero {
    grid-template-columns: 1fr;
  }
  .profile-card {
    justify-self: stretch;
    max-width: none;
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 24px;
  }
  .avatar-lg {
    width: 96px;
    height: 96px;
    border-radius: 30px;
    font-size: 2.2rem;
  }
  .journey {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  main {
    padding-top: 28px;
  }
  .tool-deco {
    width: 180px;
    opacity: 0.35;
  }
  .panel,
  .about {
    padding: 22px;
  }
  .result {
    padding: 0;
  }
  .result-head,
  .result-body {
    padding-inline: 22px;
  }
  .about {
    grid-template-columns: 1fr;
  }
  .profile-card {
    grid-template-columns: 1fr;
  }
  .journey {
    grid-template-columns: 1fr;
  }
  .pub {
    padding: 22px 22px 22px 26px;
  }
  .brand-sub {
    display: none;
  }
  .choices {
    grid-template-columns: 1fr;
  }
  .stats {
    grid-template-columns: 1fr 1fr;
  }
  /* Um número ímpar de cartões: o último ocupa a linha toda (sem criar colunas a mais). */
  .stats .stat:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
  .timeline li {
    font-size: 0.78rem;
  }
  .float-chip {
    font-size: 0.8rem;
  }
  .float-chip.c1 { left: -2%; }
  .float-chip.c2 { right: -2%; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Componentes partilhados: calculadoras clínicas com pontuação ---------- */

.tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tabbtn {
  padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, color 0.25s, transform 0.3s var(--spring);
}

.tabbtn:hover { transform: translateY(-2px); }

.tabbtn[aria-selected='true'] {
  border-color: var(--teal);
  background: linear-gradient(160deg, var(--teal-soft), var(--surface-strong) 70%);
  color: var(--teal);
}

.tabbtn:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.checklist {
  display: grid;
  gap: 10px;
}

.check-item {
  position: relative;
}

.check-item input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.check-item label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 2px solid var(--line);
  background: var(--surface-strong);
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, transform 0.3s var(--spring);
}

.check-item label:hover { transform: translateY(-2px); }

.check-item .box {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--surface);
  flex: none;
  display: grid;
  place-items: center;
  transition: border-color 0.25s, background 0.25s;
}

.check-item .box svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.25s var(--spring);
}

.check-item input:checked + label .box {
  border-color: var(--teal);
  background: var(--teal);
}

.check-item input:checked + label .box svg { opacity: 1; transform: scale(1); }

.check-item input:checked + label {
  border-color: var(--teal);
  background: linear-gradient(160deg, var(--teal-soft), var(--surface-strong) 75%);
}

.check-item input:focus-visible + label {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}

.check-item .txt {
  flex: 1;
  line-height: 1.3;
}

.check-item .txt strong {
  display: block;
  font-size: 0.96rem;
}

.check-item .txt small {
  color: var(--ink-mute);
  font-size: 0.8rem;
}

.check-item .pts {
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--ink-mute);
  min-width: 2ch;
  text-align: right;
}

.check-item input:checked + label .pts { color: var(--teal); }

.qitem + .qitem {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--line);
}

.qitem .chips { margin-top: 10px; }

.score-result[data-nivel='baixo'] .result-head { --c: var(--teal); }
.score-result[data-nivel='moderado'] .result-head { --c: var(--sun); }
.score-result[data-nivel='alto'] .result-head { --c: var(--coral); }
.score-result[data-nivel='muito-alto'] .result-head { --c: var(--danger); }

/* Variante compacta: aplica a cor de risco diretamente a um .stat, sem .result-head */
.stat[data-nivel='baixo'] { border-color: var(--teal); }
.stat[data-nivel='moderado'] { border-color: var(--sun); }
.stat[data-nivel='alto'] { border-color: var(--coral); }
.stat[data-nivel='alto'] .v { color: var(--coral); }
.stat[data-nivel='muito-alto'] { border-color: var(--danger); }
.stat[data-nivel='muito-alto'] .v { color: var(--danger); }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field-row > .step {
  min-width: 0;
}

.field-row > .step + .step {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.field-row .weight {
  flex-wrap: wrap;
}

.field-row .weight-field {
  min-width: 0;
}

.field-row .weight-field input {
  min-width: 0;
  width: 3.4ch;
  font-size: clamp(2rem, 6vw, 2.5rem);
}

/* Dois campos lado a lado: botões mais pequenos para caberem numa linha. */
@media (min-width: 641px) {
  .field-row .weight {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .field-row .stepper {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
    flex: none;
  }

  .field-row .weight-field .unit {
    font-size: 0.95rem;
  }
}

@media (max-width: 640px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .field-row > .step + .step {
    margin-top: 30px;
    padding-top: 26px;
    border-top: 1px dashed var(--line);
  }

  .field-row .weight-field input {
    width: 4.2ch;
    font-size: clamp(3.4rem, 10vw, 4.6rem);
  }
}

/* ---------- Contactos SNS ---------- */

.contactos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.contacto-num {
  font-family: 'Fraunces', serif;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 600;
  line-height: 1.1;
  color: var(--tint, var(--teal));
  text-decoration: none;
  white-space: nowrap;
}

.contacto-num:hover {
  text-decoration: underline;
}

/* Agenda: vacinas, rastreios e marcos da gravidez */

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

.agenda-titulo {
  margin: 22px 0 0;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.agenda-item {
  display: grid;
  grid-template-columns: minmax(92px, auto) 1fr auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  background: var(--surface-strong);
  font-size: 0.9rem;
  line-height: 1.4;
}

.agenda-quando {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.agenda-corpo {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.agenda-corpo span {
  color: var(--ink-mute);
  font-size: 0.84rem;
}

.agenda-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--teal);
}

.agenda-etiqueta {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--violet-soft);
  white-space: nowrap;
}

.agenda-item[data-estado='agora'] { border-left-color: var(--teal); background: linear-gradient(160deg, var(--teal-soft), var(--surface-strong) 70%); }
.agenda-item[data-estado='agora'] .agenda-etiqueta { background: var(--teal); color: #fff; }
.agenda-item[data-estado='proxima'] { border-left-color: var(--sun); }
.agenda-item[data-estado='proxima'] .agenda-etiqueta { background: var(--sun-soft); }
.agenda-item[data-estado='passada'] { opacity: 0.62; }
.agenda-item[data-estado='terminado'] { opacity: 0.62; }

@media (max-width: 640px) {
  .agenda-item {
    grid-template-columns: 1fr auto;
  }

  .agenda-corpo {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

/* Mapa de risco KDIGO (G × A) */

.kdigo {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 0.8rem;
  text-align: center;
  margin-top: 14px;
}

.kdigo th {
  font-weight: 700;
  color: var(--ink-mute);
  padding: 4px;
}

.kdigo td {
  padding: 8px 4px;
  border-radius: 8px;
  font-weight: 700;
  border: 2px solid transparent;
}

.kdigo td[data-nivel='baixo'] { background: var(--teal-soft); }
.kdigo td[data-nivel='moderado'] { background: var(--sun-soft); }
.kdigo td[data-nivel='alto'] { background: var(--coral-soft); }
.kdigo td[data-nivel='muito-alto'] { background: var(--danger-soft); }
.kdigo td.atual { border-color: var(--ink); box-shadow: var(--shadow-sm); }

/* Tabela de equivalências (corticosteroides) */

.stats.equiv {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.stat.origem {
  border-color: var(--teal);
  background: linear-gradient(160deg, var(--teal-soft), var(--surface-strong) 75%);
}

.stat .k + .d {
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-top: 4px;
}

@media print {
  .agenda-item[data-estado='passada'],
  .agenda-item[data-estado='terminado'] { opacity: 1; }
}

/* ==========================================================================
   Efeitos partilhados das calculadoras (assets/js/fx.js)
   ========================================================================== */

/* A cor do cabeçalho do resultado passa suavemente de um nível para outro. */
@property --c {
  syntax: '<color>';
  inherits: true;
  initial-value: #006d4c;
}

/* Cor associada a cada nível de risco, herdada pelos gráficos do resultado. */
.result { --nc: var(--teal); --nc-soft: var(--teal-soft); }
[data-nivel='baixo'] { --nc: var(--teal); --nc-soft: var(--teal-soft); }
[data-nivel='moderado'] { --nc: var(--sun); --nc-soft: var(--sun-soft); }
[data-nivel='alto'] { --nc: var(--coral); --nc-soft: var(--coral-soft); }
[data-nivel='muito-alto'] { --nc: var(--danger); --nc-soft: var(--danger-soft); }
[data-nivel='neutro'] { --nc: var(--violet); --nc-soft: var(--violet-soft); }
.result[data-med='ibuprofeno'] { --nc: var(--coral); --nc-soft: var(--coral-soft); }

.result-head {
  isolation: isolate;
  overflow: hidden;
  transition: --c 0.7s var(--ease), background 0.6s var(--ease);
}

/* Aurora lenta atrás do texto do cabeçalho */
.result-head::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 70%;
  aspect-ratio: 1;
  top: -60%;
  left: -20%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.22), transparent);
  animation: fx-aurora 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes fx-aurora {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(60%, 40%) scale(1.25); }
  100% { transform: translate(110%, -10%) scale(0.9); }
}

/* Brilho que atravessa o cabeçalho quando o valor muda */
.result-head::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.28) 48%, transparent 66%);
  transform: translateX(-110%);
  pointer-events: none;
}

.result-head.fx-brilho::after {
  animation: fx-brilho 0.9s var(--ease);
}

@keyframes fx-brilho {
  to { transform: translateX(110%); }
}

/* Anel das pontuações «x / N» */
.result-head.fx-com-anel {
  padding-right: 148px;
}

.fx-anel {
  position: absolute;
  right: 26px;
  top: 50%;
  width: 96px;
  height: 96px;
  transform: translateY(-50%);
  overflow: visible;
}

.fx-anel circle,
.fx-vazio-anel circle {
  fill: none;
  stroke-width: 9;
}

.fx-anel .fx-anel-fundo {
  stroke: currentColor;
  opacity: 0.22;
}

.fx-anel .fx-anel-valor,
.fx-vazio-anel .fx-anel-valor {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transform-box: fill-box;
  transition: stroke-dashoffset 1.1s var(--ease);
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}

.fx-anel-icone {
  fill: none;
  stroke: currentColor;
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fx-anel-icone circle {
  fill: currentColor;
  stroke-width: 5;
}

.fx-anel-icone > * {
  animation: fx-surgir 0.5s var(--spring) both;
  transform-origin: 50% 50%;
  transform-box: view-box;
}

@keyframes fx-surgir {
  from { opacity: 0; transform: scale(0.4); }
}

/* Títulos pequenos dos gráficos */
.fx-titulo {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Escala por faixas */
.fx-escala {
  display: grid;
  gap: 8px;
}

.fx-escala-barra {
  position: relative;
  display: flex;
  gap: 3px;
  height: 14px;
  margin-top: 6px;
}

.fx-faixa {
  border-radius: 4px;
  background: color-mix(in srgb, var(--nc) 26%, transparent);
  transition: background 0.4s, transform 0.4s var(--spring);
}

.fx-faixa:first-child { border-radius: 999px 4px 4px 999px; }
.fx-faixa:last-of-type { border-radius: 4px 999px 999px 4px; }

.fx-faixa.atual {
  background: var(--nc);
  transform: scaleY(1.35);
  box-shadow: 0 6px 16px -8px var(--nc);
}

.fx-marcador {
  position: absolute;
  top: 50%;
  left: 0;
  width: 28px;
  height: 28px;
  margin-left: -14px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 4px solid var(--nc, var(--ink));
  box-shadow: 0 6px 16px -6px rgba(0, 0, 0, 0.35);
  transform: translateY(-50%);
  transition: left 1s var(--spring), border-color 0.4s;
  display: grid;
  place-items: center;
}

.fx-marcador b {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nc, var(--ink));
}

.fx-sem-valor .fx-marcador { opacity: 0; }

.fx-escala-marcas {
  position: relative;
  height: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.fx-escala-marcas span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}

.fx-escala-marcas span:first-child { transform: none; }
.fx-escala-marcas span:last-child { transform: translateX(-100%); }

.fx-escala-legenda {
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fx-escala-legenda li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink-mute);
  transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.4s var(--spring);
}

.fx-escala-legenda li i {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nc);
}

.fx-escala-legenda li.atual {
  color: var(--ink);
  border-color: var(--nc);
  background: color-mix(in srgb, var(--nc) 16%, var(--surface-strong));
  transform: scale(1.05);
}

/* 100 pessoas */
.fx-pessoas {
  display: grid;
  gap: 10px;
}

.fx-pessoas-svg {
  width: 100%;
  height: auto;
}

.fx-pessoas-svg path {
  fill: color-mix(in srgb, var(--ink) 13%, transparent);
  transition: fill 0.35s;
}

.fx-pessoas-svg path.on {
  fill: var(--nc);
  transition-delay: calc(var(--i) * 14ms);
}

.fx-legenda {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.fx-legenda strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.15em;
}

/* Curva normal */
.fx-gauss {
  display: grid;
  gap: 6px;
}

.fx-gauss-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.fx-gauss-svg text {
  fill: var(--ink-mute);
  font: 600 9px var(--font-body);
}

.fx-g-curva { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; }
.fx-g-base, .fx-g-grelha { stroke: var(--line); stroke-width: 1.2; }
.fx-g-normal { fill: color-mix(in srgb, var(--teal-2) 11%, transparent); }
.fx-g-extremo { fill: color-mix(in srgb, var(--coral) 13%, transparent); }
.fx-g-area { fill: color-mix(in srgb, var(--nc) 38%, transparent); }

.fx-g-corte {
  transform-box: fill-box;
  transform-origin: 0 0;
  transform: scaleX(0);
  transition: transform 1.1s var(--ease);
}

.fx-g-marca {
  transition: transform 1.1s var(--ease);
}

.fx-g-marca line { stroke: var(--nc); stroke-width: 2; }
.fx-g-marca circle { fill: var(--nc); stroke: var(--surface-strong); stroke-width: 2; }
.fx-gauss-svg .fx-g-p { fill: var(--ink); font: 700 10px var(--font-body); }
.fx-sem-valor .fx-g-marca { opacity: 0; }

/* Acrónimos que acendem */
.fx-acronimo {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.fx-acronimo span {
  position: relative;
  min-width: 40px;
  height: 50px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink-mute);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
  line-height: 1;
  transition: color 0.3s, background 0.35s, border-color 0.35s, box-shadow 0.35s, transform 0.35s var(--spring);
}

.fx-acronimo span.sep {
  min-width: 0;
  padding: 0 2px;
  border: 0;
  background: none;
}

.fx-acronimo span small {
  font-size: 0.55em;
  margin-left: 1px;
  align-self: end;
  padding-bottom: 12px;
}

.fx-acronimo span.on {
  color: var(--bg);
  border-color: transparent;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.28), transparent 60%), var(--nc);
  box-shadow: 0 12px 22px -12px var(--nc);
  transform: translateY(-3px);
}

.fx-acronimo sup {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font: 700 0.7rem var(--font-body);
  background: var(--ink);
  color: var(--bg);
}

.fx-acronimo sup:empty { display: none; }

.fx-salto { animation: fx-salto 0.55s var(--spring); }

@keyframes fx-salto {
  0% { transform: translateY(0) scale(1); }
  40% { transform: translateY(-8px) scale(1.12); }
  100% { transform: translateY(-3px) scale(1); }
}

/* Questionários: progresso fixo no topo do formulário */
.fx-progresso {
  position: sticky;
  top: 82px;
  z-index: 5;
  display: grid;
  gap: 8px;
  margin: -6px -6px 22px;
  padding: 10px 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.fx-progresso-txt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.fx-progresso-txt strong {
  color: var(--ink);
}

.fx-progresso.completo .fx-progresso-txt strong {
  color: var(--teal);
}

.fx-progresso-barra {
  height: 6px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.fx-progresso-barra span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal-2), var(--teal));
  transition: width 0.6s var(--spring);
}

.fx-progresso.completo .fx-progresso-barra span {
  background: linear-gradient(90deg, var(--teal-2), var(--teal), var(--teal-2)) 0 0 / 200% 100%;
  animation: fx-fluir 2.4s linear infinite;
}

@keyframes fx-fluir {
  to { background-position: -200% 0; }
}

.fx-p-ir {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 0;
  background: var(--teal);
  color: var(--bg);
  font: 700 0.78rem var(--font-body);
  cursor: pointer;
  animation: fx-surgir 0.4s var(--spring);
}

@media (min-width: 901px) {
  .fx-p-ir { display: none; }
}

/* Perguntas já respondidas */
.qitem .step-num {
  position: relative;
  transition: background 0.35s, color 0.35s, transform 0.4s var(--spring);
}

.qitem.fx-respondida .step-num {
  background: var(--teal);
  color: var(--bg);
}

.qitem .step-num::after {
  content: '';
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--surface-strong);
  background: var(--teal-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 8px no-repeat;
  transform: scale(0);
  transition: transform 0.35s var(--spring);
}

.qitem.fx-respondida .step-num::after {
  transform: scale(1);
}

/* Estado vazio: anel com as perguntas respondidas */
.fx-vazio-anel {
  position: relative;
  width: 116px;
  height: 116px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.fx-vazio-anel svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.fx-vazio-anel .fx-anel-fundo {
  stroke: var(--line);
}

.fx-vazio-anel .fx-anel-valor {
  stroke: var(--teal-2);
  stroke-width: 7;
  filter: none;
}

.fx-vazio-anel circle.fx-anel-fundo {
  stroke-width: 7;
}

.fx-faltam {
  margin: 6px 0 0;
  font-size: 0.85rem;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.fx-faltam:empty { display: none; }

/* Pontos por pergunta */
.fx-barras {
  display: grid;
  gap: 10px;
}

.fx-barras-grelha {
  display: grid;
  grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr));
  gap: 5px;
  height: 92px;
}

.fx-barra {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 4px;
  min-width: 0;
  cursor: default;
}

.fx-barra > span {
  position: relative;
  border-radius: 7px;
  background: color-mix(in srgb, var(--nc) 10%, transparent);
  overflow: hidden;
}

.fx-barra i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--h, 0%);
  border-radius: 7px;
  background: linear-gradient(to top, var(--nc), color-mix(in srgb, var(--nc) 55%, #fff));
  transition: height 0.7s var(--spring);
}

.fx-barra.vazia > span {
  background: repeating-linear-gradient(135deg, var(--line) 0 4px, transparent 4px 8px);
}

.fx-barra b {
  font-size: 0.66rem;
  font-weight: 700;
  text-align: center;
  color: var(--ink-mute);
  font-variant-numeric: tabular-nums;
}

.fx-barra:hover b { color: var(--ink); }

.fx-entrar .fx-barra i {
  animation: fx-crescer 0.9s var(--spring) both;
  animation-delay: calc(var(--k) * 45ms);
}

@keyframes fx-crescer {
  from { height: 0; }
}

/* Escolhas e caixas: pequeno salto ao escolher */
.chip input:checked + label,
.choice input:checked + label {
  animation: fx-escolha 0.45s var(--spring);
}

.check-item input:checked + label .box,
.check-item input:checked + label .pts {
  animation: fx-escolha 0.45s var(--spring);
}

@keyframes fx-escolha {
  0% { transform: scale(0.94); }
  55% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.check-item input:checked + label .pts {
  display: inline-block;
}

/* Brilho que segue o rato nos painéis */
.panel {
  background-image: radial-gradient(520px circle at var(--mx, 50%) var(--my, -400px), color-mix(in srgb, var(--teal-2) 8%, transparent), transparent 60%);
}

/* Separadores: o painel escolhido entra a deslizar */
.calc[data-painel] {
  animation: fx-subir 0.55s var(--ease);
}

.tabbtn[aria-selected='true'] {
  box-shadow: 0 10px 22px -14px var(--teal);
}

/* O corpo do resultado aparece em cascata */
.result-body > * {
  animation: fx-subir 0.6s var(--ease) both;
}

.result-body > :nth-child(2) { animation-delay: 60ms; }
.result-body > :nth-child(3) { animation-delay: 120ms; }
.result-body > :nth-child(4) { animation-delay: 180ms; }
.result-body > :nth-child(5) { animation-delay: 240ms; }
.result-body > :nth-child(n + 6) { animation-delay: 300ms; }

@keyframes fx-subir {
  from { opacity: 0; transform: translateY(14px); }
}

/* Ilustrações próprias de cada calculadora */
.fx-ilustracao {
  display: grid;
  gap: 10px;
}

@media (max-width: 640px) {
  .result-head.fx-com-anel {
    padding-right: 104px;
  }

  .fx-anel {
    right: 18px;
    width: 72px;
    height: 72px;
  }

  /* Em ecrãs estreitos as letras encolhem para caberem numa só linha. */
  .fx-acronimo {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .fx-acronimo span {
    flex: 0 1 38px;
    min-width: 24px;
    height: 42px;
    padding: 0 3px;
    border-radius: 10px;
    font-size: 1.15rem;
  }

  .fx-acronimo span.sep {
    flex: none;
  }

  .fx-progresso {
    top: 74px;
  }
}

@media print {
  .fx-progresso,
  .fx-p-ir {
    display: none !important;
  }

  .result,
  .result * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .result-body > *,
  .result-head::before,
  .result-head::after {
    animation: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .result-body > *,
  .calc[data-painel],
  .result-head::before {
    animation: none !important;
  }

  .fx-pessoas-svg path.on,
  .fx-entrar .fx-barra i {
    transition-delay: 0s !important;
    animation-delay: 0s !important;
  }
}

/* Corticosteroides: medidor da duração de ação e entrada dos cartões */
.stats.equiv .stat {
  animation: fx-subir 0.5s var(--ease) both;
  animation-delay: calc(var(--k, 0) * 35ms);
}

.stats.equiv .stat .d {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
}

.ct-dur {
  display: inline-flex;
  gap: 2px;
}

.ct-dur i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--line);
  transition: background 0.3s;
}

.ct-dur[data-n='1'] i:nth-child(-n + 1),
.ct-dur[data-n='2'] i:nth-child(-n + 2),
.ct-dur[data-n='3'] i:nth-child(-n + 3) {
  background: var(--teal-2);
}

/* Crescimento: curva da OMS com o ponto da criança */
.cg-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.cg-svg text {
  font: 600 8.5px var(--font-body);
  fill: var(--ink-mute);
}

.cg-grelha {
  stroke: var(--line);
  stroke-width: 1;
}

.cg-faixa-3 { fill: color-mix(in srgb, var(--sun) 13%, transparent); }
.cg-faixa-2 { fill: color-mix(in srgb, var(--teal-2) 14%, transparent); }

.cg-linha {
  fill: none;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: cg-tracar 1.4s var(--ease) forwards;
}

.cg-linha[data-z='0'] { stroke: var(--teal); stroke-width: 2.2; }
.cg-linha[data-z='2'], .cg-linha[data-z='-2'] { stroke: var(--coral); animation-delay: 0.12s; }
.cg-linha[data-z='3'], .cg-linha[data-z='-3'] { stroke: var(--ink-mute); animation-delay: 0.24s; }

@keyframes cg-tracar {
  to { stroke-dashoffset: 0; }
}

.cg-svg .cg-z { font-weight: 700; }
.cg-svg .cg-z[data-z='0'] { fill: var(--teal); }
.cg-svg .cg-z[data-z='2'], .cg-svg .cg-z[data-z='-2'] { fill: var(--coral); }

.cg-guia-v line,
.cg-guia-h line {
  stroke: var(--nc);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.55;
}

.cg-ponto,
.cg-guia-v,
.cg-guia-h {
  transition: transform 0.8s var(--spring);
}

.cg-bola {
  fill: var(--nc);
  stroke: var(--surface-strong);
  stroke-width: 2.5;
  filter: drop-shadow(0 3px 6px color-mix(in srgb, var(--nc) 60%, transparent));
}

.cg-onda {
  fill: none;
  stroke: var(--nc);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: cg-onda 2s ease-out infinite;
}

@keyframes cg-onda {
  from { transform: scale(1); opacity: 0.8; }
  to { transform: scale(3.2); opacity: 0; }
}

.cg-svg .cg-valor {
  fill: var(--ink);
  font-weight: 700;
  font-size: 9.5px;
  paint-order: stroke;
  stroke: var(--surface-strong);
  stroke-width: 3px;
}

.cg-sem-ponto .cg-ponto,
.cg-sem-ponto .cg-guia-v,
.cg-sem-ponto .cg-guia-h {
  opacity: 0;
}

.cg-fora .cg-bola {
  stroke-dasharray: 2 2;
}

@media (prefers-reduced-motion: reduce) {
  .cg-linha { animation: none; stroke-dashoffset: 0; }
  .cg-onda { animation: none; opacity: 0; }
}

/* Crescimento: linha do tempo da idade corrigida */
.ic-linha {
  display: grid;
  gap: 8px;
}

.ic-pista {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 4px 0 26px;
}

.ic-barra {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  font-size: 0.82rem;
}

.ic-barra span {
  padding-left: 8px;
  color: var(--ink-mute);
  font-weight: 600;
}

.ic-barra b {
  position: absolute;
  top: 0;
  right: 0;
  font-weight: 700;
}

.ic-barra::after {
  content: '';
  height: 12px;
  border-radius: 999px;
  transition: width 0.9s var(--spring), margin-left 0.9s var(--spring);
}

.ic-cron::after {
  width: var(--hoje, 100%);
  background: linear-gradient(90deg, var(--violet), color-mix(in srgb, var(--violet) 60%, var(--teal-2)));
}

.ic-corr::after {
  margin-left: var(--prem, 0%);
  width: max(0%, calc(var(--hoje, 100%) - var(--prem, 0%)));
  background: linear-gradient(90deg, var(--teal-2), var(--teal));
  box-shadow: 0 6px 14px -8px var(--teal);
}

.ic-marca {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: var(--x);
  border-left: 1.5px dashed color-mix(in srgb, var(--ink) 25%, transparent);
  transition: left 0.9s var(--spring);
}

.ic-marca em {
  position: absolute;
  bottom: -20px;
  left: 0;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-mute);
  white-space: nowrap;
}

.ic-marca-nasc { --x: 0%; }
.ic-marca-nasc em { transform: none; }
.ic-marca-termo { --x: var(--prem, 0%); }
.ic-marca-termo em { color: var(--teal); }
.ic-marca-hoje { --x: var(--hoje, 100%); }
.ic-marca-hoje em { transform: translateX(-100%); color: var(--ink); }
.sem-correcao .ic-marca-termo { display: none; }
.antes-termo .ic-marca-hoje em { transform: translateX(-50%); }
.antes-termo .ic-marca-termo em { transform: translateX(-100%); }

/* Crescimento: pai, mãe e altura-alvo à escala */
.aa-figuras svg {
  width: 100%;
  height: auto;
  max-height: 260px;
  overflow: visible;
}

.aa-fig {
  transform: translateX(var(--x));
}

.aa-corpo {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scale(0);
  transition: transform 1s var(--spring);
}

.aa-fig[data-fig='pai'] .aa-corpo { fill: color-mix(in srgb, var(--violet) 70%, var(--surface-strong)); }
.aa-fig[data-fig='mae'] .aa-corpo { fill: color-mix(in srgb, var(--coral) 70%, var(--surface-strong)); transition-delay: 0.08s; }
.aa-fig[data-fig='alvo'] .aa-corpo { fill: var(--teal); transition-delay: 0.16s; filter: drop-shadow(0 6px 10px color-mix(in srgb, var(--teal) 45%, transparent)); }

.aa-figuras text {
  font: 700 10px var(--font-body);
  fill: var(--ink);
}

.aa-figuras .aa-nome {
  font-weight: 600;
  fill: var(--ink-mute);
}

.aa-alt {
  transition: transform 1s var(--spring);
}

.aa-chao {
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
}

.aa-faixa {
  fill: color-mix(in srgb, var(--teal-2) 16%, transparent);
  stroke: color-mix(in srgb, var(--teal-2) 45%, transparent);
  stroke-dasharray: 3 3;
}

.aa-linha-alvo {
  stroke: var(--teal);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
}

/* Resultados em texto (datas, classificações) no lugar do número grande */
.dose-big.fx-longo {
  font-size: clamp(2.1rem, 5.5vw, 3rem);
  letter-spacing: -0.03em;
  line-height: 1.05;
}

/* Data provável de parto: a gravidez em 42 semanas */
.dpp-data {
  text-transform: none;
}

.gv {
  display: grid;
  gap: 8px;
  --hoje: 0%;
}

.gv-pista {
  position: relative;
  display: flex;
  gap: 3px;
  height: 34px;
  margin-top: 30px;
}

.gv-tri {
  position: relative;
  border-radius: 8px;
  background: color-mix(in srgb, var(--teal-2) 12%, transparent);
  overflow: hidden;
}

.gv-tri:nth-child(2) { background: color-mix(in srgb, var(--sun) 16%, transparent); }
.gv-tri:nth-child(3) { background: color-mix(in srgb, var(--coral) 13%, transparent); }
.gv-tri:first-child { border-radius: 999px 8px 8px 999px; }
.gv-tri:nth-child(3) { border-radius: 8px 999px 999px 8px; }

.gv-tri span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink-soft);
  white-space: nowrap;
  z-index: 2;
}

.gv-feito {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--hoje);
  border-radius: 999px 6px 6px 999px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--teal-2) 55%, transparent), color-mix(in srgb, var(--coral) 45%, transparent));
  mix-blend-mode: multiply;
  transition: width 1.2s var(--ease);
  animation: gv-encher 1.4s var(--ease);
}

:root[data-theme='dark'] .gv-feito { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .gv-feito { mix-blend-mode: screen; }
}

@keyframes gv-encher {
  from { width: 0; }
}

.gv-marco {
  position: absolute;
  bottom: -5px;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 2px solid var(--ink-mute);
  z-index: 3;
}

.gv-marco[data-estado='passada'] { background: var(--ink-mute); }
.gv-marco[data-estado='agora'] {
  border-color: var(--teal);
  background: var(--teal);
  animation: pulse 2s infinite;
}

.gv-dpp {
  position: absolute;
  top: -6px;
  bottom: -6px;
  width: 0;
  border-left: 2px dashed var(--coral);
  z-index: 3;
}

.gv-dpp em {
  position: absolute;
  top: -16px;
  left: 0;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.66rem;
  font-weight: 800;
  color: var(--coral);
}

.gv-hoje {
  position: absolute;
  left: var(--hoje);
  top: -30px;
  bottom: -2px;
  z-index: 4;
  transition: left 1.2s var(--ease);
  animation: gv-andar 1.4s var(--ease);
}

@keyframes gv-andar {
  from { left: 0; }
}

.gv-hoje::before {
  content: '';
  position: absolute;
  top: 22px;
  bottom: 0;
  left: -1px;
  width: 2px;
  background: var(--ink);
  border-radius: 2px;
}

.gv-hoje b {
  position: absolute;
  bottom: -6px;
  left: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink);
  border: 3px solid var(--surface-strong);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 40%, transparent);
  animation: pulse 2.4s infinite;
}

.gv-hoje span {
  position: absolute;
  top: 0;
  left: 0;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.gv-escala {
  position: relative;
  height: 14px;
  margin-top: 6px;
  font-size: 0.66rem;
  font-weight: 600;
  color: var(--ink-mute);
}

.gv-escala span {
  position: absolute;
  transform: translateX(-50%);
}

.gv-escala span:first-child { transform: none; }
.gv-escala span:last-child { transform: translateX(-70%); }

.gv-tamanho {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--ink-soft);
}

.gv-emoji {
  font-size: 1.8rem;
  line-height: 1;
  animation: bob 4s ease-in-out infinite;
}
.gv[data-lado='inicio'] .gv-hoje span { transform: translateX(-10px); }
.gv[data-lado='fim'] .gv-hoje span { transform: translateX(calc(-100% + 10px)); }

/* Mapa KDIGO: a célula atual salta e pulsa */
.kdigo td {
  transition: background 0.3s, border-color 0.3s, transform 0.4s var(--spring);
}

.kdigo td.atual {
  transform: scale(1.12);
  animation: kdigo-atual 2.2s ease-in-out infinite;
  color: var(--ink);
}

@keyframes kdigo-atual {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ink) 35%, transparent); }
  50% { box-shadow: 0 0 0 6px transparent; }
}

/* Degraus (níveis em escada) */
.fx-degraus {
  display: grid;
  gap: 10px;
}

.fx-degraus-grelha {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  align-items: end;
  gap: 5px;
  height: 96px;
}

.fx-degraus-grelha > span {
  position: relative;
  height: var(--h);
  border-radius: 8px 8px 4px 4px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  display: grid;
  align-items: end;
  justify-items: center;
  padding-bottom: 5px;
  transition: background 0.35s, transform 0.45s var(--spring), box-shadow 0.35s;
  transition-delay: calc(var(--k) * 35ms);
}

.fx-degraus-grelha b {
  font-size: 0.72rem;
  color: var(--ink-mute);
}

.fx-degraus-grelha > span.on {
  background: color-mix(in srgb, var(--nc) 30%, transparent);
}

.fx-degraus-grelha > span.atual {
  background: linear-gradient(to top, var(--nc), color-mix(in srgb, var(--nc) 60%, #fff));
  box-shadow: 0 10px 20px -10px var(--nc);
  transform: translateY(-4px);
}

.fx-degraus-grelha > span.atual b {
  color: var(--bg);
}

/* 100 pessoas: quando «acesas» significa uma coisa boa (sobrevivência) */
.fx-pessoas[data-tom='bom'] .fx-pessoas-svg path.on {
  fill: var(--teal-2);
}

/* Aumento de peso na gravidez: corredor recomendado */
.gp-corredor {
  fill: color-mix(in srgb, var(--teal-2) 18%, transparent);
  animation: fx-surgir-suave 0.9s var(--ease);
}

.gp-borda {
  fill: none;
  stroke: var(--teal);
  stroke-width: 1.6;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: cg-tracar 1.3s var(--ease) forwards;
}

.gp-tri {
  fill: color-mix(in srgb, var(--ink) 4%, transparent);
}

.gp-svg .gp-alvo {
  fill: var(--teal);
  font-weight: 700;
}

@keyframes fx-surgir-suave {
  from { opacity: 0; }
}

/* Ícones contados (maços-ano, bebidas-padrão) */
.fx-icones {
  display: grid;
  gap: 10px;
}

.fx-icones-grelha {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(22px, 1fr));
  gap: 6px 4px;
  align-items: center;
}

.fx-ic svg {
  width: 100%;
  height: auto;
  max-width: 24px;
  margin-inline: auto;
}

.fx-ic svg .b { fill: color-mix(in srgb, var(--ink) 9%, transparent); }
.fx-ic svg .f,
.fx-ic svg .c { fill: color-mix(in srgb, var(--ink) 6%, transparent); }
.fx-ic.alem svg .b { fill: color-mix(in srgb, var(--danger) 10%, transparent); }

.fx-ic svg * {
  transition: fill 0.3s;
}

.fx-ic.on svg .b { fill: var(--sun); transition-delay: calc(var(--k) * 18ms); }
.fx-ic.on svg .f { fill: color-mix(in srgb, var(--sun) 55%, #fff); transition-delay: calc(var(--k) * 18ms); }
.fx-ic.on svg .c { fill: color-mix(in srgb, var(--ink) 25%, var(--surface-strong)); transition-delay: calc(var(--k) * 18ms); }
.fx-ic.on.alem svg .b { fill: var(--danger); }
.fx-ic.on.alem svg .f { fill: color-mix(in srgb, var(--danger) 55%, #fff); }

.fx-ic.on {
  animation: fx-ic-cair 0.5s var(--spring) both;
  animation-delay: calc(var(--k) * 18ms);
}

@keyframes fx-ic-cair {
  from { transform: translateY(-8px) scale(0.6); opacity: 0; }
}

.fx-ic-mais {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--danger);
  white-space: nowrap;
}

.fx-ic-mais:empty { display: none; }

.fx-icones-chave {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.76rem;
  color: var(--ink-mute);
}

.fx-icones-chave li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fx-icones-chave i {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  background: var(--sun);
}

.fx-icones-chave li.alem i { background: var(--danger); }

@media (prefers-reduced-motion: reduce) {
  .fx-ic.on { animation: none; }
  .fx-ic.on svg * { transition-delay: 0s !important; }
}

/* Laboratório: composição do colesterol */
.lab-comp {
  display: grid;
  gap: 10px;
}

.lab-comp-barra {
  display: flex;
  gap: 3px;
  height: 34px;
}

.lab-comp-barra span {
  flex: 1 1 0;
  min-width: 6px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--bg);
  font-size: 0.78rem;
  font-weight: 700;
  transition: flex-grow 0.9s var(--spring);
  animation: fx-surgir-suave 0.8s var(--ease);
}

.lab-comp-barra span:first-child { border-radius: 999px 6px 6px 999px; }
.lab-comp-barra span:last-child { border-radius: 6px 999px 999px 6px; }

.lab-ldl { --lc: var(--coral); }
.lab-hdl { --lc: var(--teal-2); }
.lab-vldl { --lc: var(--sun); }
.lab-comp-barra span { background: linear-gradient(160deg, color-mix(in srgb, var(--lc) 70%, #fff), var(--lc)); }

.lab-comp-legenda {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.lab-comp-legenda li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lab-comp-legenda i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--lc);
}

.lab-comp-legenda strong {
  color: var(--ink);
}

/* Laboratório: medido → corrigido */
.lab-regua {
  position: relative;
  height: 14px;
  margin: 44px 0 26px;
  border-radius: 999px;
  background: var(--line);
}

.lab-ref {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--teal-2) 45%, transparent);
}

.lab-ref em {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-style: normal;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--teal);
  white-space: nowrap;
}

.lab-seta {
  position: absolute;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  background: repeating-linear-gradient(90deg, var(--ink) 0 5px, transparent 5px 9px);
  transition: left 0.9s var(--spring), right 0.9s var(--spring);
}

.lab-pino {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.9s var(--spring);
}

.lab-pino::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid var(--ink-mute);
  background: var(--surface-strong);
}

.lab-corrigido::before {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 18%, transparent);
}

.lab-comparacao[data-dentro='sim'] .lab-corrigido::before {
  border-color: var(--teal);
  background: var(--teal);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 22%, transparent);
}

.lab-comparacao[data-dentro='nao'] .lab-corrigido::before {
  border-color: var(--coral);
  background: var(--coral);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--coral) 22%, transparent);
}

.lab-pino b,
.lab-pino em {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-style: normal;
}

.lab-pino b {
  bottom: 24px;
  font-size: 0.85rem;
  font-weight: 800;
}

.lab-pino em {
  bottom: 40px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.lab-regua-ext {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--ink-mute);
  margin-top: -18px;
}

/* Laboratório: régua dupla HbA1c ↔ eAG */
.lab-dupla {
  position: relative;
  height: 74px;
  margin: 30px 8px 0;
}

.lab-dupla-barra {
  position: absolute;
  left: 0;
  right: 0;
  top: 30px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-2), var(--sun) 40%, var(--coral) 70%, var(--danger));
  opacity: 0.8;
}

.lab-dupla > span {
  position: absolute;
  top: 12px;
  bottom: 12px;
  width: 0;
  border-left: 1px solid color-mix(in srgb, var(--ink) 18%, transparent);
}

.lab-dupla > span i,
.lab-dupla > span u {
  position: absolute;
  left: 0;
  transform: translateX(-50%);
  font-size: 0.66rem;
  font-weight: 700;
  font-style: normal;
  text-decoration: none;
  white-space: nowrap;
}

.lab-dupla > span i { top: -14px; color: var(--ink-soft); }
.lab-dupla > span u { bottom: -14px; color: var(--ink-mute); }
.lab-dupla > span:nth-of-type(even) i,
.lab-dupla > span:nth-of-type(even) u { opacity: 0; }

.lab-dupla-pino {
  position: absolute;
  top: 35px;
  width: 0;
  transition: left 0.9s var(--spring);
}

.lab-dupla-pino::before {
  content: '';
  position: absolute;
  left: -11px;
  top: -11px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 5px solid var(--ink);
  box-shadow: var(--shadow-sm);
}

.lab-dupla-pino b {
  position: absolute;
  bottom: 18px;
  left: 0;
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.74rem;
  white-space: nowrap;
}

.lab-dupla-eixos {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

/* Laboratório: garrafas de água */
.lab-garrafas {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.lab-garrafas::after {
  content: attr(data-mais);
  font-weight: 800;
  color: var(--ink-soft);
}

.lab-garrafa svg {
  width: 30px;
  height: auto;
  overflow: visible;
}

.g-vidro {
  fill: color-mix(in srgb, var(--teal-2) 8%, transparent);
  stroke: color-mix(in srgb, var(--ink) 35%, transparent);
  stroke-width: 1.2;
}

.g-agua {
  fill: color-mix(in srgb, #3aa7e0 75%, var(--teal-2));
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scaleY(var(--nivel, 0));
  transition: transform 1s var(--spring);
  transition-delay: calc(var(--k) * 70ms);
}
.lab-comparacao.juntos .lab-medido b,
.lab-comparacao.juntos .lab-medido em { opacity: 0; }
.lab-pino b, .lab-pino em { transition: opacity 0.3s; }

/* Pediatria: soro a pingar e composição da regra 4-2-1 */
.hs-soro {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  align-items: center;
  --gota: 1.4s;
  --cheio: 0.5;
}

.hs-svg {
  width: 100%;
  height: auto;
}

.hs-gancho { fill: var(--ink-mute); }
.hs-saco { fill: color-mix(in srgb, var(--surface-strong) 70%, transparent); stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: 2; }
.hs-liquido,
.hs-onda { fill: color-mix(in srgb, #3aa7e0 70%, var(--teal-2)); opacity: 0.85; }

.hs-liquido {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  transform: scaleY(calc(0.25 + var(--cheio) * 0.7));
  transition: transform 1s var(--spring);
}

.hs-onda {
  transform: translateY(calc(78px - 94px * (0.25 + var(--cheio) * 0.7)));
  transition: transform 1s var(--spring);
  animation: hs-ondular 3s ease-in-out infinite alternate;
}

@keyframes hs-ondular {
  to { d: path('M20 30q10 5 20 0t20 0t20 0t20 0v8H20z'); }
}

.hs-escala { stroke: color-mix(in srgb, var(--ink) 35%, transparent); stroke-width: 1.5; }
.hs-camara { fill: color-mix(in srgb, var(--surface-strong) 60%, transparent); stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: 1.5; }
.hs-tubo { fill: none; stroke: color-mix(in srgb, var(--ink) 28%, transparent); stroke-width: 3; stroke-linecap: round; }

.hs-gota {
  fill: color-mix(in srgb, #3aa7e0 80%, var(--teal-2));
  animation: hs-pingar var(--gota) ease-in infinite;
}

@keyframes hs-pingar {
  0% { transform: translateY(0) scale(0.3); opacity: 0; }
  25% { transform: translateY(0) scale(1); opacity: 1; }
  80% { transform: translateY(15px) scale(1); opacity: 1; }
  100% { transform: translateY(16px) scale(1.4, 0.4); opacity: 0; }
}

.hs-comp {
  display: grid;
  gap: 10px;
}

.hs-comp-barra {
  display: flex;
  gap: 3px;
  height: 22px;
}

.hs-comp-barra span {
  flex: 1 1 0;
  border-radius: 6px;
  transition: flex-grow 0.9s var(--spring);
}

.hs-c1 { --hc: var(--teal); }
.hs-c2 { --hc: var(--teal-2); }
.hs-c3 { --hc: var(--sun); }
.hs-comp-barra span { background: var(--hc); }
.hs-comp-barra span:first-child { border-radius: 999px 6px 6px 999px; }

.hs-comp-legenda {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--ink-mute);
}

.hs-comp-legenda li {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.3s;
}

.hs-comp-legenda li.zero { opacity: 0.4; }

.hs-comp-legenda i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--hc);
}

.hs-comp-legenda strong {
  margin-left: auto;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

@media (max-width: 420px) {
  .hs-soro { grid-template-columns: 90px 1fr; gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .hs-gota, .hs-onda { animation: none; }
}

/* Plano de rastreios: janelas de idade de cada rastreio */
.pr-linha {
  display: grid;
  --hoje: 50%;
}

.pr-l {
  display: grid;
  grid-template-columns: minmax(96px, 36%) 1fr;
  align-items: center;
  gap: 10px;
  animation: fx-subir 0.5s var(--ease) both;
  animation-delay: calc(var(--k, 0) * 40ms);
}

.pr-l-nome {
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink-soft);
  padding: 4px 0;
}

.pr-l-pista {
  position: relative;
  align-self: stretch;
  min-height: 26px;
}

/* A linha «hoje» atravessa todas as pistas */
.pr-l-pista::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--hoje);
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  opacity: 0.75;
  transition: left 0.8s var(--spring);
}

.pr-l-barra {
  position: absolute;
  top: 50%;
  height: 14px;
  margin-top: -7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--violet) 22%, transparent);
  border: 1.5px dashed color-mix(in srgb, var(--violet) 60%, transparent);
  transform-origin: left center;
  animation: pr-crescer 0.9s var(--spring) both;
  animation-delay: calc(var(--k, 0) * 40ms + 0.1s);
}

.pr-l-barra.aberto {
  -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent);
  mask-image: linear-gradient(90deg, #000 70%, transparent);
}

.pr-l[data-estado='agora'] .pr-l-barra {
  background: linear-gradient(90deg, var(--teal-2), var(--teal));
  border: 0;
  box-shadow: 0 6px 14px -8px var(--teal);
}

.pr-l[data-estado='agora'] .pr-l-nome {
  color: var(--ink);
  font-weight: 700;
}

.pr-l[data-estado='terminado'] {
  opacity: 0.5;
}

.pr-l[data-estado='terminado'] .pr-l-barra {
  background: color-mix(in srgb, var(--ink) 12%, transparent);
  border: 0;
}

.pr-l-barra em {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
  color: var(--ink-soft);
}

.pr-l[data-estado='agora'] .pr-l-barra em {
  color: var(--bg);
}

@keyframes pr-crescer {
  from { transform: scaleX(0); }
}

.pr-eixo .pr-l-pista {
  min-height: 34px;
}

.pr-eixo .pr-l-pista::after {
  bottom: 18px;
}

.pr-eixo b {
  position: absolute;
  bottom: 0;
  transform: translateX(-50%);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--ink-mute);
}

.pr-eixo b:first-child { transform: none; }
.pr-eixo b:nth-last-of-type(1) { transform: translateX(-100%); }

.pr-hoje {
  position: absolute;
  top: 0;
  left: var(--hoje);
  transform: translateX(-50%);
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.68rem;
  white-space: nowrap;
  transition: left 0.8s var(--spring);
}

/* Queimados: corpo com as regiões da regra dos 9 */
.qu-corpo svg {
  width: 100%;
  max-width: 360px;
  height: auto;
  margin-inline: auto;
  display: block;
}

.qu-regiao {
  cursor: pointer;
}

.qu-regiao > :not(text):not(title) {
  fill: color-mix(in srgb, var(--ink) 10%, var(--surface-strong));
  stroke: var(--surface-strong);
  stroke-width: 2;
  transition: fill 0.35s, filter 0.35s;
}

.qu-regiao.realce > :not(text):not(title) {
  fill: color-mix(in srgb, var(--coral) 28%, var(--surface-strong));
}

.qu-regiao.queimada > :not(text):not(title) {
  fill: url(#qu-fogo);
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--coral) 55%, transparent));
  animation: qu-arder 2.4s ease-in-out infinite alternate;
}

@keyframes qu-arder {
  to { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--sun) 70%, transparent)); }
}

.qu-regiao text {
  font: 800 9px var(--font-body);
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: middle;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.qu-regiao.queimada text,
.qu-regiao.realce text {
  opacity: 1;
}

.qu-regiao.realce:not(.queimada) text {
  fill: var(--ink);
}

.qu-vista {
  font: 700 10px var(--font-body);
  fill: var(--ink-mute);
  text-anchor: middle;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  .qu-regiao.queimada > :not(text):not(title) { animation: none; }
}

/* Urgência: traçado de ECG com o QT assinalado */
.qtc-ecg svg {
  width: 100%;
  height: auto;
  border-radius: 10px;
  overflow: hidden;
}

.qtc-ecg .ecg-papel {
  fill: color-mix(in srgb, var(--coral) 5%, var(--surface-strong));
}

.qtc-ecg pattern path {
  stroke: color-mix(in srgb, var(--coral) 22%, transparent);
  stroke-width: 0.6;
}

.ecg-qt {
  fill: color-mix(in srgb, var(--nc) 18%, transparent);
  stroke: color-mix(in srgb, var(--nc) 60%, transparent);
  stroke-dasharray: 3 3;
  transition: width 0.6s var(--spring);
}

.ecg-linha {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: cg-tracar 1.6s linear forwards;
}

.ecg-seta {
  fill: none;
  stroke: var(--nc);
  stroke-width: 1.6;
  stroke-linecap: round;
}

.qtc-ecg text {
  font: 800 9px var(--font-body);
  fill: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .ecg-linha { animation: none; stroke-dashoffset: 0; }
}

/* Urgência: regras de Ottawa — cartões de decisão com ícone */
[id^='ot-stat-'] {
  display: grid;
  grid-template-columns: 46px 1fr;
  column-gap: 14px;
  align-items: center;
  padding: 16px;
  transition: border-color 0.3s, background 0.3s;
}

[id^='ot-stat-']::before {
  content: '';
  grid-row: span 2;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--teal-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300a676' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 22px no-repeat;
}

[id^='ot-stat-'][data-nivel='alto'] {
  background: linear-gradient(160deg, var(--coral-soft), var(--surface-strong) 70%);
}

[id^='ot-stat-'][data-nivel='alto']::before {
  background: var(--coral-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e2572f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Cpath d='M12 6v12M8.5 8.5h7M8 11.5h8M8.5 14.5h7'/%3E%3C/svg%3E") center / 24px no-repeat;
  animation: fx-salto 0.55s var(--spring);
}

/* Vacinas: marcos do PNV em cartões */
.vm-grelha {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
}

.vm {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 6px;
  padding: 10px 6px 8px;
  border-radius: 14px;
  border: 1.5px dashed var(--line);
  background: var(--surface-strong);
  text-align: center;
  animation: fx-subir 0.45s var(--ease) both;
  animation-delay: calc(var(--k, 0) * 30ms);
}

.vm b {
  font-size: 0.74rem;
  line-height: 1.15;
}

.vm-doses {
  display: flex;
  gap: 3px;
}

.vm-doses i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ink) 22%, transparent);
}

.vm em {
  min-height: 1em;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.vm[data-estado='passada'] {
  opacity: 0.55;
  border-style: solid;
}

.vm[data-estado='proxima'] {
  border: 1.5px solid var(--sun);
  background: linear-gradient(160deg, var(--sun-soft), var(--surface-strong) 75%);
}

.vm[data-estado='proxima'] .vm-doses i { background: var(--sun); }

.vm[data-estado='agora'] {
  border: 1.5px solid var(--teal);
  background: linear-gradient(160deg, var(--teal-soft), var(--surface-strong) 75%);
}

.vm[data-estado='agora'] .vm-doses i { background: var(--teal); }
.vm[data-estado='agora'] em { color: var(--teal); }

.vm-proxima {
  transform: translateY(-3px);
  box-shadow: 0 12px 22px -14px var(--teal);
}

.vm-proxima::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 17px;
  border: 2px solid color-mix(in srgb, var(--teal-2) 45%, transparent);
  animation: vm-pulso 2.2s ease-out infinite;
}

@keyframes vm-pulso {
  from { opacity: 1; transform: scale(0.96); }
  to { opacity: 0; transform: scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .vm-proxima::after { animation: none; }
}

/* Peso ideal e ajustado na mesma régua */
.pi-pista {
  position: relative;
  height: 12px;
  margin: 46px 0 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-soft), var(--sun-soft), var(--coral-soft));
}

.pi-pino {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.9s var(--spring);
}

.pi-pino::before {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 4px solid var(--pc);
  background: var(--surface-strong);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pc) 20%, transparent);
}

.pi-ideal { --pc: var(--teal); }
.pi-ajustado { --pc: var(--sun); }
.pi-real { --pc: var(--ink); }

.pi-pino b,
.pi-pino em {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-style: normal;
}

.pi-pino b {
  bottom: 24px;
  font-size: 0.82rem;
  font-weight: 800;
}

.pi-pino em {
  bottom: 40px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pc);
}

/* Com os pesos muito próximos, o ajustado mostra o rótulo por baixo da régua */
.pi-junto .pi-ajustado b { bottom: auto; top: 22px; }
.pi-junto .pi-ajustado em { bottom: auto; top: 38px; }
.pi-regua.pi-junto { padding-bottom: 26px; }

/* Ao saltar para o resultado, o cabeçalho fixo não o tapa */
.result {
  scroll-margin-top: 88px;
}

/* Telemóveis: os campos com botões −/+ cabem numa linha mesmo com unidades compridas */
@media (max-width: 480px) {
  .weight {
    gap: 10px;
  }

  .weight .stepper {
    width: 44px;
    height: 44px;
    flex: none;
  }

  .weight-field {
    min-width: 0;
  }

  .weight-field input,
  .field-row .weight-field input {
    font-size: clamp(2.4rem, 11vw, 3.4rem);
  }

  /* Unidades compridas (mL/min/1,73m²) passam para duas linhas em vez de alargar a página. */
  .weight-field .unit {
    font-size: 1rem;
    line-height: 1.1;
    max-width: 5.5em;
    overflow-wrap: anywhere;
  }
}

/* Dicas dentro do próprio título da pergunta (CAT): podem partir palavras em ecrãs muito estreitos */
.step-label > .step-hint {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   Página inicial: ilustrações animadas no canto de alguns cartões
   (no mesmo espírito da seringa da calculadora de doses)
   ========================================================================== */

.tool-deco.mini {
  right: 12px;
  bottom: 10px;
  width: 124px;
  z-index: -1;
  color: var(--tint);
  opacity: 0.55;
  transform: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
  transition: opacity 0.4s, transform 0.6s var(--spring);
}

a.tool:hover .tool-deco.mini {
  opacity: 1;
  transform: translateY(-4px) scale(1.06);
}

.tool-deco.mini .d-fraco {
  opacity: 0.35;
  stroke-width: 2;
}

.tool-deco.mini * {
  transform-box: fill-box;
  transform-origin: center;
}

/* Crescimento: a curva desenha-se e o ponto sobe por ela */
.deco-curva .d-linha {
  stroke-width: 3.5;
  stroke-dasharray: 1;
  animation: deco-tracar 5s var(--ease) infinite;
}

.deco-curva .d-ponto {
  fill: currentColor;
  stroke: none;
  offset-path: path('M12 74C40 69 62 47 112 30');
  offset-distance: 100%;
  offset-rotate: 0deg;
  transform-box: view-box;
  transform-origin: 0 0;
  animation: deco-subir 5s var(--ease) infinite;
}

@supports not (offset-path: path('M0 0')) {
  .deco-curva .d-ponto { display: none; }
}

@keyframes deco-tracar {
  0% { stroke-dashoffset: 1; opacity: 1; }
  45%, 85% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

@keyframes deco-subir {
  0% { offset-distance: 0%; opacity: 1; }
  45%, 85% { offset-distance: 100%; opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* Risco cardiovascular: o coração bate e o traçado atravessa-o */
.deco-coracao .d-coracao {
  animation: deco-bater 1.6s ease-in-out infinite;
}

.deco-coracao .d-linha {
  stroke-width: 2.5;
  stroke-dasharray: 1;
  animation: deco-tracar 3.2s linear infinite;
}

@keyframes deco-bater {
  0%, 45%, 100% { transform: scale(1); }
  12% { transform: scale(1.12); }
  25% { transform: scale(0.98); }
  34% { transform: scale(1.07); }
}

/* Urgência: um monitor com o pulso a correr */
.deco-ecg .d-linha {
  stroke-width: 3.5;
  stroke-dasharray: 0.28 0.72;
  animation: deco-varrer 2.2s linear infinite;
}

@keyframes deco-varrer {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

/* Sono: a lua embala-se e os «z» sobem */
.deco-lua .d-lua {
  fill: color-mix(in srgb, currentColor 18%, transparent);
  animation: deco-embalar 6s ease-in-out infinite;
  transform-origin: 30% 70%;
}

.deco-lua .d-z {
  fill: currentColor;
  stroke: none;
  font: italic 600 16px var(--font-display);
  opacity: 0;
  animation: deco-z 3.6s ease-out infinite;
}

.deco-lua .d-z:nth-of-type(2) { animation-delay: 0.6s; font-size: 13px; }
.deco-lua .d-z:nth-of-type(3) { animation-delay: 1.2s; font-size: 10px; }

@keyframes deco-embalar {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

@keyframes deco-z {
  0% { opacity: 0; transform: translate(0, 6px); }
  25% { opacity: 1; }
  70% { opacity: 0.8; }
  100% { opacity: 0; transform: translate(6px, -10px); }
}

/* Respiratório: os pulmões enchem e esvaziam */
.deco-pulmoes .d-respirar {
  animation: deco-respirar 4.5s ease-in-out infinite;
}

.deco-pulmoes .d-respirar path + path {
  fill: color-mix(in srgb, currentColor 14%, transparent);
}

@keyframes deco-respirar {
  0%, 100% { transform: scale(0.93); }
  50% { transform: scale(1.05); }
}

/* Laboratório: bolhas a subir no tubo de ensaio */
.deco-tubo .d-liquido {
  fill: color-mix(in srgb, currentColor 30%, transparent);
  stroke: none;
}

.deco-tubo .d-bolha {
  fill: currentColor;
  stroke: none;
  opacity: 0;
  animation: deco-bolha 2.8s ease-in infinite;
}

.deco-tubo .d-bolha:nth-of-type(2) { animation-delay: 0.9s; }
.deco-tubo .d-bolha:nth-of-type(3) { animation-delay: 1.8s; }

@keyframes deco-bolha {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  20% { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-46px) scale(1.2); }
}

/* IMC: a balança procura o equilíbrio */
.deco-balanca .d-braco {
  transform-box: view-box;
  transform-origin: 60px 24px;
  animation: deco-pesar 4s ease-in-out infinite;
}

.deco-balanca .d-cheio {
  fill: currentColor;
  stroke: none;
}

@keyframes deco-pesar {
  0%, 100% { transform: rotate(-7deg); }
  50% { transform: rotate(7deg); }
}

/* Fluidos: uma gota cai e faz ondas */
.deco-gota .d-gota {
  fill: color-mix(in srgb, currentColor 22%, transparent);
  animation: deco-cair 2.6s cubic-bezier(0.55, 0, 1, 0.45) infinite;
}

.deco-gota .d-onda {
  stroke-width: 2;
  opacity: 0;
  animation: deco-onda 2.6s ease-out infinite;
}

.deco-gota .d-onda2 { animation-delay: 0.25s; }

@keyframes deco-cair {
  0% { transform: translateY(-8px) scale(0.7); opacity: 0; }
  15% { opacity: 1; transform: translateY(0) scale(1); }
  60% { transform: translateY(30px) scale(1, 1.1); opacity: 1; }
  66%, 100% { transform: translateY(34px) scale(1.3, 0.4); opacity: 0; }
}

@keyframes deco-onda {
  0%, 60% { opacity: 0; transform: scale(0.2); }
  66% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.1); }
}

@media (max-width: 640px) {
  .tool-deco.mini {
    width: 96px;
    opacity: 0.4;
  }
}

/* Sem animações: cada ilustração fica parada no seu estado natural. */
@media (prefers-reduced-motion: reduce) {
  .tool-deco.mini * {
    animation: none !important;
  }

  .deco-lua .d-z,
  .deco-tubo .d-bolha {
    opacity: 0.8;
  }

  .deco-gota .d-onda {
    opacity: 0;
  }
}

/* Cartões em destaque (os que têm ilustração animada): o mesmo tratamento do
   cartão da calculadora de doses — fundo em gradiente, texto e ilustração a branco —
   mas no tamanho normal e com a cor de cada cartão (verde ou coral). As cores são
   fixas para o texto branco se ler também no tema escuro. */
.tool.destaque {
  background: linear-gradient(135deg, color-mix(in srgb, #006d4c 92%, #000) 0%, #00a676 50%, color-mix(in srgb, #0b3d36 80%, #00a676) 100%);
  color: #fff;
  border-color: transparent;
}

.tool.destaque.tint-coral {
  background: linear-gradient(135deg, #a8391c 0%, #d4502a 50%, #e27a3c 100%);
}

.tool.destaque::before {
  background: radial-gradient(500px circle at var(--mx, 80%) var(--my, 0%), rgba(255, 255, 255, 0.26), transparent 55%);
}

.tool.destaque .tool-desc,
.tool.destaque .tag {
  color: rgba(255, 255, 255, 0.88);
}

.tool.destaque .tag {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.25);
}

.tool.destaque .tool-icon {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.tool.destaque .tool-deco.mini {
  color: #fff;
  opacity: 0.7;
}

a.tool.destaque:hover .tool-deco.mini {
  opacity: 1;
}

/* ==========================================================================
   Navegação principal (Doenças · Ferramentas · SNS · Sobre)
   ========================================================================== */

.site-nav {
  display: flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.site-nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.25s, color 0.25s;
}

.site-nav a:hover {
  background: var(--surface-strong);
  color: var(--ink);
}

.site-nav a[aria-current='page'] {
  background: var(--teal-soft);
  color: var(--teal);
  box-shadow: inset 0 0 0 1.5px var(--teal);
}

@media (max-width: 760px) {
  .site-header .wrap:has(.site-nav) {
    flex-wrap: wrap;
    row-gap: 10px;
  }
  .header-actions:has(.site-nav) {
    width: 100%;
  }
  .site-nav {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav a {
    flex: 1;
    text-align: center;
    padding: 7px 10px;
    font-size: 0.85rem;
  }
}

@media print {
  .site-nav { display: none !important; }
}

/* ==========================================================================
   Doenças: grelha de cartões e página de cada doença com separadores por idade
   ========================================================================== */

:root {
  --il-traco: #24413a;
  --il-cor: #12a578;
  --il-suave: #d3f1e4;
}

.com-doenca #doencas-inicio,
.com-doenca #doencas {
  display: none;
}

.tool-alias {
  display: block;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  opacity: 0.85;
}

.doencas-nota {
  margin: 32px 0 0;
  text-align: center;
  color: var(--ink-mute);
}

.doencas-nota a {
  color: var(--teal);
  font-weight: 700;
}

.doenca {
  --tint: var(--teal);
  --tint-soft: var(--teal-soft);
}

.doenca.tint-coral {
  --tint: var(--coral);
  --tint-soft: var(--coral-soft);
  --il-cor: #ee7046;
  --il-suave: #fde2d6;
}

.doenca-voltar {
  margin-bottom: 26px;
}

.doenca-cab {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 36px;
  align-items: center;
  margin-bottom: 30px;
}

.doenca-cab .display {
  font-size: clamp(2.3rem, 5.5vw, 3.9rem);
  outline: none;
}

.doenca-cab .display em {
  display: block;
  font-size: 0.5em;
  color: var(--tint);
}

.doenca-cab .lead {
  margin-bottom: 0;
}

.doenca-cab-arte {
  border-radius: 30px;
  padding: 18px 22px;
  background: radial-gradient(circle at 30% 20%, #fff, var(--il-suave) 80%);
  box-shadow: var(--shadow-lg);
  animation: doenca-entrar 0.7s var(--spring) both;
}

.doenca-escolha {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.idade-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.idade-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 18px;
  border: 2px solid var(--line);
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, transform 0.3s var(--spring);
}

.idade-tab:hover {
  transform: translateY(-2px);
}

.idade-tab:focus-visible {
  outline: 3px solid var(--tint);
  outline-offset: 2px;
}

.idade-tab[aria-selected='true'] {
  border-color: var(--tint);
  background: linear-gradient(160deg, var(--tint-soft), var(--surface-strong) 75%);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.idade-emoji {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--tint-soft);
  font-size: 1.4rem;
  transition: transform 0.4s var(--spring);
}

.idade-tab[aria-selected='true'] .idade-emoji {
  transform: scale(1.1) rotate(-6deg);
}

.idade-txt {
  min-width: 0;
  line-height: 1.2;
}

.idade-txt strong {
  display: block;
  font-size: 0.95rem;
  color: var(--ink);
}

.idade-txt small {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-mute);
  white-space: nowrap;
}

.doenca-painel {
  padding: 30px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.doenca-painel:focus-visible {
  outline: 3px solid var(--tint);
  outline-offset: 3px;
}

.doenca-painel > * {
  margin: 0;
  animation: doenca-entrar 0.5s var(--ease) both;
}

.doenca-painel > * + * {
  margin-top: 26px;
}

@keyframes doenca-entrar {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

.doenca-intro {
  max-width: 68ch;
  font-size: 1.15rem;
  line-height: 1.6;
  color: var(--ink);
}

.figuras {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 18px;
}

.figura {
  margin: 0;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  animation: doenca-entrar 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 80ms);
  transition: transform 0.4s var(--spring), box-shadow 0.4s;
}

.figura:hover {
  transform: translateY(-4px) rotate(-0.4deg);
  box-shadow: var(--shadow);
}

.figura-arte {
  padding: 14px 16px 8px;
  background: linear-gradient(160deg, var(--il-suave), #fbfdfc 88%);
}

.figura figcaption {
  padding: 12px 16px 16px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

:root[data-theme='dark'] .figura-arte,
:root[data-theme='dark'] .doenca-cab-arte {
  filter: brightness(0.92) saturate(0.95);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .figura-arte,
  :root:not([data-theme='light']) .doenca-cab-arte {
    filter: brightness(0.92) saturate(0.95);
  }
}

.doenca-pais {
  padding: 14px 18px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  background: var(--surface-strong);
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.doenca-seccoes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.doenca-seccao {
  padding: 22px;
  border-radius: 18px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  animation: doenca-entrar 0.55s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 70ms + 120ms);
}

.doenca-seccao h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.doenca-seccao-ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--tint-soft);
  font-size: 1.15rem;
}

.doenca-seccao p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.6;
}

.doenca-seccao ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.doenca-seccao p + ul {
  margin-top: 10px;
}

.doenca-seccao li {
  color: var(--ink-soft);
  line-height: 1.5;
}

.doenca-seccao li + li {
  margin-top: 5px;
}

.doenca-seccao li::marker {
  color: var(--tint);
}

.doenca-curiosidade {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--sun-soft);
  border: 1px dashed color-mix(in srgb, var(--sun) 60%, transparent);
}

.doenca-curiosidade-ico {
  font-size: 1.8rem;
  line-height: 1;
  animation: deco-bater 2.4s ease-in-out infinite;
}

.doenca-curiosidade strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.doenca-curiosidade p {
  margin: 4px 0 0;
  color: var(--ink-soft);
}

.doenca-mitos h3 {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.mito {
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.mito + .mito {
  margin-top: 10px;
}

.mito-q {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.mito-a {
  margin: 8px 0 0;
  color: var(--ink-soft);
}

.mito-tag {
  display: inline-block;
  margin-right: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  vertical-align: 2px;
}

.mito-tag.facto {
  background: var(--teal-soft);
  color: var(--teal);
}

.doenca-alerta {
  padding: 20px 22px;
  border-radius: 18px;
  background: var(--danger-soft);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
}

.doenca-alerta h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: var(--danger);
}

.doenca-alerta ul {
  margin: 0;
  padding-left: 20px;
}

.doenca-alerta li {
  color: var(--ink);
  line-height: 1.5;
}

.doenca-alerta li + li {
  margin-top: 4px;
}

.doenca-ligacoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
}

.doenca .disclaimer {
  margin-top: 22px;
}

/* Cada idade tem o seu ritmo: mais imagem para os pequenos, mais texto para
   os adultos, letra maior para os séniores. */
.grupo-3-5 .figuras {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.grupo-3-5 .figura-arte {
  padding: 22px 22px 12px;
}

.grupo-3-5 .figura figcaption {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  text-align: center;
  letter-spacing: -0.01em;
}

.grupo-5-12 .figura figcaption {
  font-size: 1.05rem;
  text-align: center;
}

.grupo-5-12 .doenca-seccao:nth-child(4n + 1) { background: color-mix(in srgb, var(--teal-soft) 55%, var(--surface-strong)); }
.grupo-5-12 .doenca-seccao:nth-child(4n + 2) { background: color-mix(in srgb, var(--sun-soft) 70%, var(--surface-strong)); }
.grupo-5-12 .doenca-seccao:nth-child(4n + 3) { background: color-mix(in srgb, var(--coral-soft) 60%, var(--surface-strong)); }
.grupo-5-12 .doenca-seccao:nth-child(4n + 4) { background: color-mix(in srgb, var(--violet-soft) 70%, var(--surface-strong)); }

.grupo-13-17 .figuras,
.grupo-18-65 .figuras {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grupo-13-17 .figura figcaption {
  font-size: 0.95rem;
}

.grupo-18-65 .figura-arte {
  padding: 10px 14px 4px;
}

.grupo-18-65 .figura figcaption {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.grupo-65mais {
  font-size: 1.1rem;
}

.grupo-65mais .figuras {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grupo-65mais .figura figcaption {
  font-size: 1.15rem;
}

.grupo-65mais .doenca-intro {
  font-size: 1.25rem;
}

.grupo-65mais .doenca-seccao h3 {
  font-size: 1.3rem;
}

.grupo-65mais .doenca-seccao p,
.grupo-65mais .doenca-seccao li,
.grupo-65mais .doenca-alerta li {
  font-size: 1.1rem;
  line-height: 1.7;
}

@media (max-width: 900px) {
  .doenca-cab {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .doenca-cab-arte {
    max-width: 380px;
  }
  .idade-tabs {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 4px 2px 8px;
    margin-inline: -2px;
    scrollbar-width: thin;
  }
  .idade-tab {
    scroll-snap-align: start;
  }
}

@media (max-width: 640px) {
  .doenca-painel {
    padding: 20px;
  }
  .grupo-13-17 .figuras,
  .grupo-18-65 .figuras {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .grupo-65mais .figuras {
    grid-template-columns: 1fr;
  }
  .doenca-seccoes {
    grid-template-columns: 1fr;
  }
  .grupo-3-5 .figura figcaption {
    font-size: 1.15rem;
  }
}

@media print {
  .doenca-voltar,
  .idade-tabs,
  .doenca-escolha {
    display: none !important;
  }
  .doenca-painel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}

/* ---------- Ilustrações dos cartões de doenças ---------- */

.tool-deco.mini .d-cheio {
  fill: currentColor;
  stroke: none;
}

.tool-deco.mini .d-cheio-suave {
  fill: color-mix(in srgb, currentColor 22%, transparent);
}

/* Cancro da mama: o laço embala-se */
.deco-laco .d-laco {
  transform-origin: 50% 8%;
  animation: deco-embalar 4s ease-in-out infinite;
}

/* Hipertensão: o ponteiro do manómetro sobe e oscila */
.deco-manometro .d-ponteiro {
  stroke-width: 3.5;
  transform-box: view-box;
  transform-origin: 60px 72px;
  animation: deco-ponteiro 3.4s var(--ease) infinite;
}

@keyframes deco-ponteiro {
  0%, 100% { transform: rotate(-60deg); }
  45% { transform: rotate(48deg); }
  55% { transform: rotate(36deg); }
  65% { transform: rotate(42deg); }
}

/* Artroses: o joelho dobra e estica */
.deco-joelho .d-osso {
  stroke-width: 7;
}

.deco-joelho .d-perna {
  transform-box: view-box;
  transform-origin: 66px 28px;
  animation: deco-chutar 3s ease-in-out infinite;
}

@keyframes deco-chutar {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-58deg); }
}

/* Depressão: chove debaixo da nuvem, mas o sol continua a rodar */
.deco-nuvem .d-raios {
  transform-box: view-box;
  transform-origin: 92px 28px;
  animation: spin 10s linear infinite;
}

.deco-nuvem .d-chuva {
  animation: deco-chuva 1.6s linear infinite;
}

.deco-nuvem .d-chuva2 { animation-delay: -0.55s; }
.deco-nuvem .d-chuva3 { animation-delay: -1.1s; }

@keyframes deco-chuva {
  0% { transform: translateY(-4px); opacity: 0; }
  30% { opacity: 1; }
  100% { transform: translateY(10px); opacity: 0; }
}

/* Dislipidemia: os glóbulos passam pelo aperto da artéria */
.deco-arteria .d-glob {
  animation: deco-fluxo 3s linear infinite;
}

.deco-arteria .d-glob2 { animation-delay: -1s; }
.deco-arteria .d-glob3 { animation-delay: -2s; }

@keyframes deco-fluxo {
  0% { transform: translateX(0); opacity: 0; }
  10%, 90% { opacity: 1; }
  100% { transform: translateX(92px); opacity: 0; }
}

/* Amiotrofia: o bíceps cresce e encolhe */
.deco-braco .d-membro {
  stroke-width: 9;
}

.deco-braco .d-biceps {
  transform-origin: 50% 100%;
  animation: deco-flexao 2.4s ease-in-out infinite;
}

@keyframes deco-flexao {
  0%, 100% { transform: scale(0.55); }
  50% { transform: scale(1.1); }
}

/* Pneumonia: os pulmões respiram e um micróbio anda por perto */
.deco-pulmoes .d-germe {
  animation: deco-germe 3s ease-in-out infinite;
}

@keyframes deco-germe {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(-4px, 5px) rotate(45deg); }
}

/* ---------- Ilustrações animadas (SVG) das páginas de doenças ---------- */

.il {
  display: block;
  width: 100%;
  height: auto;
  fill: none;
  stroke: var(--il-traco);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  overflow: visible;
}

.il [class*='an-'] {
  transform-box: fill-box;
  transform-origin: center;
}

.il .rv {
  transform-box: view-box;
}

.il .fino { stroke-width: 2; }
.il .grosso { stroke-width: 4; }
.il .muito-grosso { stroke-width: 6; }
.il .fraco { opacity: 0.45; }
.il .sem { stroke: none; }
.il .c-nada { fill: none; }

.il .c-cor { fill: var(--il-cor); }
.il .c-suave { fill: var(--il-suave); }
.il .c-branco { fill: #fff; }
.il .c-tinta { fill: var(--il-traco); }
.il .c-pele { fill: #f5c9a6; }
.il .c-pele2 { fill: #c1855e; }
.il .c-cabelo { fill: #4a3020; }
.il .c-cabelo-b { fill: #d5d9de; }
.il .c-bochecha { fill: #f28b82; opacity: 0.45; }
.il .c-coral { fill: #ef6f4c; }
.il .c-coral-s { fill: #fbd5c7; }
.il .c-sol { fill: #f6bf3c; }
.il .c-sol-s { fill: #fde7b0; }
.il .c-verde { fill: #57b86a; }
.il .c-azul { fill: #4fb3e0; }
.il .c-azul-s { fill: #c3e6f6; }
.il .c-vermelho { fill: #e04b4b; }
.il .c-vermelho-e { fill: #b83232; }
.il .c-laranja { fill: #f39a3d; }
.il .c-rosa { fill: #f27aa6; }
.il .c-nuvem { fill: #e1e8ec; }
.il .c-vidro { fill: rgba(255, 255, 255, 0.5); }

.il .t-cor { stroke: var(--il-cor); }
.il .t-coral { stroke: #ef6f4c; }
.il .t-sol { stroke: #f6bf3c; }
.il .t-verde { stroke: #57b86a; }
.il .t-azul { stroke: #4fb3e0; }
.il .t-branco { stroke: #fff; }
.il .t-cabelo { stroke: #4a3020; }
.il .c-madeira-t { stroke: #9a6b43; }

.il text {
  stroke: none;
  fill: var(--il-traco);
  text-anchor: middle;
}

.il .il-txt { font: 700 11px var(--font-body); }
.il .il-num { font: 700 22px var(--font-body); }
.il .il-z { font: italic 600 22px var(--font-display); fill: var(--il-cor); }

.il .an-bater { animation: deco-bater 1.6s ease-in-out infinite; }
.il .an-respirar { animation: deco-respirar 4.5s ease-in-out infinite; }
.il .an-embalar { animation: deco-embalar 6s ease-in-out infinite; }
.il .an-flutuar { animation: il-flutuar 3.2s ease-in-out infinite alternate; }
.il .an-flutuar-x { animation: il-flutuar-x 5s ease-in-out infinite alternate; }
.il .an-balancar { animation: il-balancar 3.6s ease-in-out infinite alternate; }
.il .an-pulsar { animation: il-pulsar 2.4s ease-in-out infinite; }
.il .an-piscar { animation: il-piscar 2.4s ease-in-out infinite; }
.il .an-piscar-lento { animation: il-piscar-lento 4s ease-in-out infinite; }
.il .an-girar { animation: spin 8s linear infinite; }
.il .an-girar-lento { animation: spin 4s linear infinite; }
.il .an-cair { animation: il-cair 2.2s ease-in infinite; }
.il .an-subir { animation: il-subir 3s ease-out infinite; }
.il .an-fluir { animation: il-fluir 10s linear infinite; }
.il .an-impulso { animation: il-impulso 1s linear infinite; }
.il .an-deslizar { animation: il-deslizar 4.5s linear infinite; }
.il .an-saltar { animation: il-saltar 1.2s ease-in-out infinite; }
.il .an-acenar { animation: il-acenar 1.1s ease-in-out infinite alternate; }
.il .an-espalhar { animation: il-espalhar 1.6s ease-out infinite; }
.il .an-esfregar-v { animation: il-esfregar-v 0.6s ease-in-out infinite alternate; }
.il .an-dobrar { animation: il-dobrar 3s ease-in-out infinite alternate; }
.il .an-ponteiro { animation: il-ponteiro 3.4s var(--ease) infinite; }
.il .an-mercurio { animation: il-mercurio 3.2s ease-in-out infinite alternate; }
.il .an-nivel { animation: il-nivel 4s ease-in-out infinite alternate; }
.il .an-ondular { animation: il-ondular 2.4s linear infinite; }
.il .an-bracada { animation: il-bracada 1.6s ease-in-out infinite alternate; }
.il .an-crescer { animation: il-crescer 2.6s ease-in-out infinite alternate; }
.il .an-brotar { animation: il-brotar 3.2s ease-out infinite; transform-origin: 50% 100%; }
.il .an-chave { animation: il-chave 2.4s ease-in-out infinite alternate; }
.il .an-entrar { animation: il-entrar 3s ease-in infinite; }
.il .an-gotejar { animation: il-gotejar 2.4s ease-in infinite; transform-origin: 50% 0; }
.il .an-apertar { animation: il-apertar 2.4s ease-in-out infinite alternate; }
.il .an-lupa { animation: il-lupa 4s ease-in-out infinite alternate; }
.il .an-passo { animation: il-passo 1.4s ease-in-out infinite alternate; }
.il .an-levantar { animation: il-levantar 1.8s ease-in-out infinite alternate; }
.il .an-z { animation: deco-z 3.6s ease-out infinite; }
.il .an-pulsar-onda { animation: il-onda 1.8s ease-out infinite; }
.il .inv { animation-direction: alternate-reverse; }
.il .an-ondular.inv { animation-direction: reverse; }

/* Atrasos negativos (depois dos «animation:», que os repõem a zero): cada
   elemento começa já a meio do ciclo, sem esperas. */
.il .d1 { animation-delay: -0.6s; }
.il .d2 { animation-delay: -1.2s; }
.il .d3 { animation-delay: -1.8s; }
.il .d4 { animation-delay: -2.4s; }
.il .d5 { animation-delay: -3s; }

/* Os glóbulos e o açúcar a correr no vaso ficam espaçados ao longo do ciclo. */
.il .an-deslizar.d1 { animation-delay: -0.75s; }
.il .an-deslizar.d2 { animation-delay: -1.5s; }
.il .an-deslizar.d3 { animation-delay: -2.25s; }
.il .an-deslizar.d4 { animation-delay: -3s; }
.il .an-deslizar.d5 { animation-delay: -3.75s; }

@keyframes il-flutuar { from { transform: translateY(0); } to { transform: translateY(-7px); } }
@keyframes il-flutuar-x { from { transform: translateX(-6px); } to { transform: translateX(6px); } }
@keyframes il-balancar { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }
@keyframes il-pulsar { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes il-piscar { 0%, 100% { opacity: 0.25; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1); } }
@keyframes il-piscar-lento { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes il-cair {
  0% { transform: translateY(-6px); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateY(26px); opacity: 0; }
}
@keyframes il-subir {
  0% { transform: translateY(0) scale(0.7); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-34px) scale(1.1); opacity: 0; }
}
@keyframes il-fluir { to { stroke-dashoffset: -308; } }
@keyframes il-impulso { to { stroke-dashoffset: -30; } }
@keyframes il-deslizar {
  0% { transform: translateX(-110px); opacity: 0; }
  10%, 90% { opacity: 1; }
  100% { transform: translateX(110px); opacity: 0; }
}
@keyframes il-saltar {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.04, 0.96); }
  45%, 55% { transform: translateY(-14px) scale(1, 1); }
  85% { transform: translateY(0) scale(1.03, 0.97); }
}
@keyframes il-acenar { from { transform: rotate(-16deg); } to { transform: rotate(18deg); } }
@keyframes il-espalhar {
  0% { transform: translate(0, 0) scale(0.6); opacity: 1; }
  100% { transform: translate(36px, -4px) scale(1.25); opacity: 0; }
}
@keyframes il-esfregar-v { from { transform: translateY(-5px); } to { transform: translateY(5px); } }
@keyframes il-dobrar { 0%, 15% { transform: rotate(0deg); } 85%, 100% { transform: rotate(-58deg); } }
@keyframes il-ponteiro {
  0%, 100% { transform: rotate(-62deg); }
  45% { transform: rotate(52deg); }
  55% { transform: rotate(38deg); }
  65% { transform: rotate(46deg); }
}
@keyframes il-mercurio { from { transform: scaleY(0.35); } to { transform: scaleY(1); } }
@keyframes il-nivel { from { transform: scaleY(1); } to { transform: scaleY(0.55); } }
@keyframes il-ondular { from { transform: translateX(0); } to { transform: translateX(-30px); } }
@keyframes il-bracada { from { transform: rotate(-35deg); } to { transform: rotate(40deg); } }
@keyframes il-crescer { from { transform: scale(0.62); } to { transform: scale(1.06); } }
@keyframes il-brotar {
  0% { transform: scaleY(0); opacity: 0; }
  50%, 90% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}
@keyframes il-chave { from { transform: translateX(0); } to { transform: translateX(14px); } }
@keyframes il-entrar {
  0% { transform: translate(0, 0) scale(1); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(60px, 0) scale(0.6); opacity: 0; }
}
@keyframes il-gotejar {
  0% { transform: translateY(0) scale(0.2); opacity: 0; }
  30%, 60% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(18px) scale(1); opacity: 0; }
}
@keyframes il-apertar { from { transform: translateY(0); } to { transform: translateY(9px); } }
@keyframes il-lupa { from { transform: translate(-26px, 8px); } to { transform: translate(26px, -8px); } }
@keyframes il-passo { from { transform: translateY(0) rotate(-1.5deg); } to { transform: translateY(-3px) rotate(1.5deg); } }
@keyframes il-levantar { 0%, 10% { transform: rotate(0deg); } 90%, 100% { transform: rotate(-80deg); } }
@keyframes il-onda {
  0% { opacity: 0; transform: scale(0.85); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: scale(1.12); }
}

/* Sem animações: cada ilustração fica parada no seu estado natural. */
@media (prefers-reduced-motion: reduce) {
  .il *,
  .doenca-curiosidade-ico {
    animation: none !important;
  }
  .il .an-deslizar.d1 { transform: translateX(-70px); }
  .il .an-deslizar.d2 { transform: translateX(-35px); }
  .il .an-deslizar.d3 { transform: translateX(35px); }
  .il .an-deslizar.d4 { transform: translateX(70px); }
  .il .an-espalhar.d1 { transform: translateX(12px); }
  .il .an-espalhar.d2 { transform: translateX(24px); }
}
