:root {
  --qc-ink: #17352b;
  --qc-ink-soft: #557066;
  --qc-primary: #126548;
  --qc-primary-dark: #0d4e39;
  --qc-primary-soft: #e9f5ef;
  --qc-accent: #bd7a28;
  --qc-surface: #ffffff;
  --qc-surface-soft: #f5faf7;
  --qc-line: #dce9e1;
  --qc-shadow-sm: 0 4px 18px rgba(20, 63, 47, .07);
  --qc-shadow-md: 0 14px 42px rgba(20, 63, 47, .11);
}

html {
  background: #f4f8f6;
}

body {
  color: var(--qc-ink);
  background:
    radial-gradient(circle at 8% -5%, rgba(208, 235, 220, .5), transparent 30rem),
    linear-gradient(180deg, #f8fbf9 0%, #f4f8f6 48%, #f7faf8 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.006em;
}

#root {
  color: var(--qc-ink);
}

header {
  background: rgba(255, 255, 255, .92) !important;
  border-bottom: 1px solid rgba(197, 219, 208, .8) !important;
  box-shadow: 0 2px 18px rgba(25, 67, 51, .06) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

header nav a,
header nav a:hover {
  color: #31584a !important;
  font-weight: 650;
  text-decoration: none !important;
  transition: color .2s ease, background-color .2s ease;
}

header nav a:hover,
header nav a[aria-current="page"] {
  color: var(--qc-primary) !important;
}

main {
  isolation: isolate;
}

h1, h2, h3, h4 {
  color: #143e30;
  letter-spacing: -0.03em;
}

p, label, li {
  color: inherit;
}

button,
[role="button"],
a[class*="bg-"],
button[class*="bg-"] {
  border-radius: 12px;
  font-weight: 700;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}

button:hover,
[role="button"]:hover,
a[class*="bg-"]:hover,
button[class*="bg-"]:hover {
  transform: translateY(-1px);
}

button:active,
[role="button"]:active,
a[class*="bg-"]:active,
button[class*="bg-"]:active {
  transform: translateY(0);
}

button[class*="bg-primary"],
button[class*="bg-emerald"],
button[class*="bg-green"],
a[class*="bg-primary"],
a[class*="bg-emerald"],
a[class*="bg-green"] {
  color: #fff !important;
  background: linear-gradient(135deg, #167052 0%, #0c5a40 100%) !important;
  box-shadow: 0 8px 18px rgba(13, 93, 64, .18);
}

button[class*="bg-primary"]:hover,
button[class*="bg-emerald"]:hover,
button[class*="bg-green"]:hover,
a[class*="bg-primary"]:hover,
a[class*="bg-emerald"]:hover,
a[class*="bg-green"]:hover {
  background: linear-gradient(135deg, #0f6045 0%, #084d37 100%) !important;
  box-shadow: 0 11px 23px rgba(13, 93, 64, .24);
}

input,
select,
textarea {
  color: var(--qc-ink) !important;
  background: rgba(255, 255, 255, .96) !important;
  border-color: #cfe0d6 !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 1px rgba(13, 63, 42, .03) inset;
}

input::placeholder,
textarea::placeholder {
  color: #80948a;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4aab82 !important;
  box-shadow: 0 0 0 4px rgba(74, 171, 130, .15) !important;
  outline: none;
}

[class*="rounded-xl"],
[class*="rounded-2xl"],
[class*="rounded-3xl"] {
  border-radius: 18px;
}

[class*="border-gray"],
[class*="border-slate"],
[class*="border-green"],
[class*="border-emerald"] {
  border-color: var(--qc-line) !important;
}

[class*="shadow-sm"],
[class*="shadow-md"],
[class*="shadow-lg"] {
  box-shadow: var(--qc-shadow-sm) !important;
}

[class*="bg-white"],
[class*="bg-card"] {
  background-color: rgba(255, 255, 255, .96) !important;
}

[class*="text-gray-"],
[class*="text-slate-"],
[class*="text-muted"] {
  color: var(--qc-ink-soft) !important;
}

[class*="text-green-"],
[class*="text-emerald-"] {
  color: var(--qc-primary) !important;
}

/* Cards and interactive panels gain a quiet hierarchy without changing their layout. */
[class*="rounded-"][class*="border"] {
  box-shadow: var(--qc-shadow-sm);
}

[class*="rounded-"][class*="border"]:hover {
  border-color: #b6d4c4 !important;
}

[role="alert"],
[role="status"] {
  border-radius: 14px;
}

hr {
  border-color: var(--qc-line);
}

/* Editorial server-side view. */
.seo-fallback {
  color: var(--qc-ink) !important;
  background: transparent !important;
}

.seo-header {
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--qc-line) !important;
  border-radius: 18px;
  box-shadow: var(--qc-shadow-sm);
  padding-inline: clamp(14px, 2vw, 24px) !important;
}

.seo-brand {
  color: var(--qc-primary) !important;
}

.seo-header .seo-nav a,
.seo-header .seo-nav a:hover {
  text-decoration: none !important;
}

.seo-article-image {
  box-shadow: var(--qc-shadow-md);
  border: 1px solid rgba(207, 225, 215, .85);
}

.seo-card {
  background: rgba(255, 255, 255, .9) !important;
  border-color: var(--qc-line) !important;
  box-shadow: var(--qc-shadow-sm);
}

.seo-callout {
  border-radius: 14px;
  border-left-width: 4px;
  box-shadow: 0 5px 16px rgba(166, 113, 35, .08);
}

.seo-footer {
  color: var(--qc-ink-soft) !important;
}

@media (max-width: 767px) {
  body {
    background: #f6faf8;
  }

  header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  button,
  [role="button"] {
    min-height: 44px;
  }

  [class*="rounded-xl"],
  [class*="rounded-2xl"],
  [class*="rounded-3xl"] {
    border-radius: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button,
  [role="button"],
  a[class*="bg-"],
  button[class*="bg-"] {
    transition: none;
  }
}

/* Theme switcher and topical rail. */
.qc-topic-rail {
  width: min(1320px, calc(100% - 2 * var(--qc-layout-gutter, 1.25rem)));
  margin: .75rem auto 0;
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 48px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.qc-topic-rail::-webkit-scrollbar {
  display: none;
}

.qc-topic-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 42px;
  padding: .32rem .7rem .32rem .36rem;
  color: #31584a;
  background: rgba(255, 255, 255, .86);
  border: 1px solid #dce9e1;
  border-radius: 999px;
  box-shadow: 0 3px 12px rgba(20, 63, 47, .06);
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none !important;
  white-space: nowrap;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.qc-topic-chip:hover,
.qc-topic-chip:focus-visible {
  color: var(--qc-primary);
  background: #fff;
  border-color: #9fcbb5;
  box-shadow: 0 6px 16px rgba(20, 63, 47, .11);
  transform: translateY(-1px);
}

.qc-topic-icon {
  width: 31px;
  height: 31px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 31px;
  color: #fff;
  background: linear-gradient(145deg, #197756, #0e5b41);
  border: 2px solid rgba(255, 255, 255, .8);
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(13, 93, 64, .18);
}

.qc-topic-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.qc-topic-cancer .qc-topic-icon { background: linear-gradient(145deg, #9b5d8d, #704267); }
.qc-topic-diabetes .qc-topic-icon { background: linear-gradient(145deg, #347bb1, #245d8a); }
.qc-topic-sport .qc-topic-icon { background: linear-gradient(145deg, #bd7a28, #93601f); }

.qc-theme-toggle {
  margin-left: auto;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: #31584a;
  background: rgba(255, 255, 255, .9);
  border: 1px solid #dce9e1;
  border-radius: 50%;
  box-shadow: 0 3px 12px rgba(20, 63, 47, .06);
  cursor: pointer;
}

.qc-theme-toggle:hover,
.qc-theme-toggle:focus-visible {
  color: #fff;
  background: var(--qc-primary);
  border-color: var(--qc-primary);
}

.qc-theme-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="dark"] {
  color-scheme: dark;
  background: #0c1712;
}

html[data-theme="dark"] body {
  color: #e7f3ec;
  background:
    radial-gradient(circle at 8% -5%, rgba(23, 81, 59, .3), transparent 30rem),
    linear-gradient(180deg, #101d17 0%, #0d1913 54%, #101d17 100%);
}

html[data-theme="dark"] header {
  background: rgba(17, 35, 27, .94) !important;
  border-bottom-color: #29493a !important;
  box-shadow: 0 2px 18px rgba(0, 0, 0, .2) !important;
}

html[data-theme="dark"] header nav a,
html[data-theme="dark"] header nav a:hover {
  color: #c4ded0 !important;
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4 {
  color: #e2f2e8;
}

html[data-theme="dark"] [class*="bg-white"],
html[data-theme="dark"] [class*="bg-card"] {
  background-color: #14251c !important;
}

html[data-theme="dark"] [class*="text-gray-"],
html[data-theme="dark"] [class*="text-slate-"],
html[data-theme="dark"] [class*="text-muted"] {
  color: #b6cbc0 !important;
}

html[data-theme="dark"] [class*="border-gray"],
html[data-theme="dark"] [class*="border-slate"],
html[data-theme="dark"] [class*="border-green"],
html[data-theme="dark"] [class*="border-emerald"],
html[data-theme="dark"] [class*="rounded-"][class*="border"] {
  border-color: #2b4b3c !important;
}

html[data-theme="dark"] [class*="rounded-"][class*="border"] {
  box-shadow: 0 5px 20px rgba(0, 0, 0, .16) !important;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea {
  color: #e7f3ec !important;
  background: #182c21 !important;
  border-color: #3a5c4a !important;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #91aa9d;
}

html[data-theme="dark"] .qc-topic-chip,
html[data-theme="dark"] .qc-theme-toggle {
  color: #c4ded0;
  background: rgba(20, 37, 28, .94);
  border-color: #2d5140;
}

html[data-theme="dark"] .qc-topic-chip:hover,
html[data-theme="dark"] .qc-topic-chip:focus-visible {
  color: #e8f7ee;
  background: #1a3225;
  border-color: #5b9f7c;
}

html[data-theme="dark"] .qc-theme-toggle:hover,
html[data-theme="dark"] .qc-theme-toggle:focus-visible {
  color: #fff;
  background: #237a58;
}

html[data-theme="dark"] .seo-fallback {
  color: #e7f3ec !important;
  background: transparent !important;
}

html[data-theme="dark"] .seo-header,
html[data-theme="dark"] .seo-card {
  background: rgba(20, 37, 28, .94) !important;
  border-color: #2d5140 !important;
}

html[data-theme="dark"] .seo-fallback h1,
html[data-theme="dark"] .seo-fallback h2,
html[data-theme="dark"] .seo-fallback h3 {
  color: #e2f2e8;
}

html[data-theme="dark"] .seo-meta,
html[data-theme="dark"] .seo-muted,
html[data-theme="dark"] .seo-caption,
html[data-theme="dark"] .seo-footer {
  color: #abc3b5 !important;
}

html[data-theme="dark"] .seo-callout {
  color: #f5e3c5;
  background: #332a18;
  border-left-color: #d19a4b;
}

@media (max-width: 767px) {
  .qc-topic-rail {
    width: calc(100% - 2rem);
    margin-top: .55rem;
    gap: .4rem;
  }

  .qc-topic-chip {
    min-height: 40px;
    padding-right: .6rem;
    font-size: .76rem;
  }

  .qc-topic-icon {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
  }

  .qc-theme-toggle {
    width: 40px;
    height: 40px;
  }
}

/* Compact top rail: visual-only circular symbols with accessible labels. */
.qc-topic-rail {
  min-height: 36px;
  margin-top: .45rem;
  gap: .4rem;
  justify-content: flex-end;
}

.qc-topic-chip {
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  gap: 0;
  justify-content: center;
  border-width: 1px;
  box-shadow: 0 2px 8px rgba(20, 63, 47, .06);
}

.qc-topic-chip > span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.qc-topic-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  border-width: 1px;
  box-shadow: none;
}

.qc-topic-icon svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

.qc-theme-toggle {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(20, 63, 47, .06);
}

.qc-theme-toggle svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 767px) {
  .qc-topic-rail {
    width: calc(100% - 1.25rem);
    min-height: 34px;
    margin-top: .35rem;
    gap: .32rem;
    justify-content: flex-start;
  }

  .qc-topic-chip,
  .qc-theme-toggle {
    width: 28px;
    min-width: 28px;
    height: 28px;
    min-height: 28px;
  }

  .qc-topic-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }

  .qc-topic-icon svg {
    width: 12px;
    height: 12px;
  }

  .qc-theme-toggle svg {
    width: 14px;
    height: 14px;
  }
}

/* Faixa temática compacta: ícones discretos, sem texto visual, com acessibilidade preservada. */
.qc-topic-rail {
  display: flex;
  align-items: center;
  gap: 6px;
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 10020;
}
.qc-topic-chip {
  width: 30px;
  height: 30px;
  min-width: 30px;
  padding: 0 !important;
  display: inline-grid !important;
  place-items: center;
  border-radius: 50% !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  box-shadow: 0 3px 12px rgba(16,61,45,.16);
  text-decoration: none !important;
}
.qc-topic-chip > span:not(.qc-topic-icon) { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.qc-topic-icon, .qc-topic-icon svg { width: 16px; height: 16px; display: block; }
.qc-topic-icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.qc-theme-toggle { position: fixed; top: 10px; right: 14px; z-index: 10020; width: 30px; height: 30px; min-width: 30px; padding: 0 !important; display: grid; place-items: center; border-radius: 50% !important; }
.qc-theme-toggle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
html[data-theme="dark"] { --qc-ink: #edf8f2; --qc-ink-soft: #b4c9bf; --qc-primary: #63d4a2; --qc-primary-dark: #97ebc4; --qc-primary-soft: #183e31; --qc-surface: #17231f; --qc-surface-soft: #1c2e26; --qc-line: #3d5b4e; --qc-shadow-sm: 0 4px 18px rgba(0,0,0,.22); --qc-shadow-md: 0 14px 42px rgba(0,0,0,.28); }
html[data-theme="dark"], html[data-theme="dark"] body { background: #111a17 !important; color: var(--qc-ink) !important; }
html[data-theme="dark"] header, html[data-theme="dark"] .seo-header { background: rgba(23,35,31,.94) !important; border-color: var(--qc-line) !important; color: var(--qc-ink) !important; }
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3, html[data-theme="dark"] h4 { color: #e5f8ee !important; }
html[data-theme="dark"] [class*="bg-white"], html[data-theme="dark"] [class*="bg-card"], html[data-theme="dark"] .seo-card { background-color: #17231f !important; color: var(--qc-ink) !important; }
html[data-theme="dark"] input, html[data-theme="dark"] select, html[data-theme="dark"] textarea { background: #1c2e26 !important; color: var(--qc-ink) !important; border-color: var(--qc-line) !important; }
@media (max-width: 767px) { .qc-topic-rail { top: 7px; left: 8px; gap: 4px; } .qc-topic-chip, .qc-theme-toggle { width: 28px; height: 28px; min-width: 28px; } .qc-theme-toggle { top: 7px; right: 8px; } .qc-topic-icon, .qc-topic-icon svg, .qc-theme-toggle svg { width: 15px; height: 15px; } }

/* Text-only theme control after removal of decorative upper symbols. */
.qc-theme-toggle { width: auto; min-width: 42px; padding: 0 .75rem; border-radius: 999px; font-size: .76rem; }
