* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg-page: linear-gradient(135deg, #e8f4f8 0%, #f0f7ff 100%);
  --bg-surface: #ffffff;
  --bg-surface-raised: #f8fbff;
  --bg-surface-muted: #f8fafc;
  --bg-surface-accent: #f0f7ff;
  --bg-surface-active: #e8f2ff;
  --bg-surface-alt: #fafbfd;
  --bg-input: #ffffff;
  --bg-header: #0d6efd;
  --text-primary: #1a2b3c;
  --text-secondary: #3a4a5a;
  --text-muted: #5a6a7a;
  --text-faint: #7a8a9a;
  --text-caption: #64748b;
  --text-accent: #0d6efd;
  --text-heading: #0d6efd;
  --text-accent-dark: #2c5282;
  --text-on-accent: #ffffff;
  --border: #dce4ec;
  --border-strong: #c8d4e0;
  --border-input: #c5d3e0;
  --border-dashed: #c5d3e0;
  --accent: #0d6efd;
  --accent-hover: #0b5ed7;
  --accent-soft: #b6d4fe;
  --accent-ring: rgba(13, 110, 253, 0.15);
  --shadow-sm: rgba(0, 0, 0, 0.04);
  --shadow-md: rgba(0, 0, 0, 0.08);
  --shadow-header: rgba(0, 0, 0, 0.15);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
  --header-outline: rgba(255, 255, 255, 0.85);
  --header-outline-hover: rgba(255, 255, 255, 0.15);
  --code-bg: #f0f4f8;
  --note-bg: #fff8e6;
  --note-border: #f0ad4e;
  --rx-wrap-bg: linear-gradient(180deg, #f0f7ff 0%, #fafbfd 100%);
  --rx-card-bg: #f8fbff;
  --rx-card-hover: #eef5ff;
  --rx-card-active: #e8f2ff;
  --tier-default-bg: #e2e8f0;
  --tier-default-text: #475569;
  --result-ok-bg: #ecfdf5;
  --result-ok-border: #10b981;
  --result-ok-text: #047857;
  --result-warn-bg: #fffbeb;
  --result-warn-border: #f59e0b;
  --result-warn-text: #b45309;
  --result-err-bg: #fef2f2;
  --result-err-border: #ef4444;
  --result-err-text: #b91c1c;
  --flow-step-bg: #e8f2ff;
  --flow-step-border: #c8ddf5;
  --table-head-bg: #e8f2ff;
  --theme-toggle-bg: rgba(255, 255, 255, 0.14);
  --theme-toggle-bg-hover: rgba(255, 255, 255, 0.24);
  --outline-btn-bg: transparent;
  --outline-btn-text: #475569;
  --outline-btn-border: #c5d3e0;
  --med-card-bg: #f8fbff;
  --med-card-border: #c8d4e0;
  --med-card-hover-bg: #eef5ff;
  --med-card-hover-border: #0d6efd;
  --med-badge-full-bg: #dcfce7;
  --med-badge-full-text: #166534;
  --med-badge-full-border: #86efac;
  --med-badge-ref-bg: #dbeafe;
  --med-badge-ref-text: #1e40af;
  --med-badge-ref-border: #93c5fd;
  --med-badge-ext-bg: #f1f5f9;
  --med-badge-ext-text: #475569;
  --med-badge-ext-border: #cbd5e1;
  --badge-guarantee-bg: #dcfce7;
  --badge-guarantee-text: #14532d;
  --badge-guarantee-border: #22c55e;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: linear-gradient(160deg, #0b1120 0%, #141e2e 45%, #1a2332 100%);
  --bg-surface: #1e293b;
  --bg-surface-raised: #243044;
  --bg-surface-muted: #1a2332;
  --bg-surface-accent: #1e3a5f;
  --bg-surface-active: #253550;
  --bg-surface-alt: #222d3d;
  --bg-input: #162032;
  --bg-header: #1e4a7a;
  --text-primary: #e8eef4;
  --text-secondary: #c5d0dc;
  --text-muted: #94a3b8;
  --text-faint: #7a8a9a;
  --text-caption: #94a3b8;
  --text-accent: #6ea8fe;
  --text-heading: #8ec5ff;
  --text-accent-dark: #93c5fd;
  --text-on-accent: #ffffff;
  --border: #334155;
  --border-strong: #475569;
  --border-input: #475569;
  --border-dashed: #475569;
  --accent: #4d9fff;
  --accent-hover: #3d8eef;
  --accent-soft: #2563eb;
  --accent-ring: rgba(77, 159, 255, 0.28);
  --shadow-sm: rgba(0, 0, 0, 0.28);
  --shadow-md: rgba(0, 0, 0, 0.38);
  --shadow-header: rgba(0, 0, 0, 0.45);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.42);
  --header-outline: rgba(255, 255, 255, 0.62);
  --header-outline-hover: rgba(255, 255, 255, 0.14);
  --code-bg: #2d3748;
  --note-bg: #3d3420;
  --note-border: #d97706;
  --rx-wrap-bg: linear-gradient(180deg, #1e3a5f 0%, #1a2332 100%);
  --rx-card-bg: #243044;
  --rx-card-hover: #2a3a52;
  --rx-card-active: #2d4568;
  --tier-default-bg: #334155;
  --tier-default-text: #cbd5e1;
  --result-ok-bg: #064e3b;
  --result-ok-border: #10b981;
  --result-ok-text: #6ee7b7;
  --result-warn-bg: #78350f;
  --result-warn-border: #f59e0b;
  --result-warn-text: #fcd34d;
  --result-err-bg: #7f1d1d;
  --result-err-border: #ef4444;
  --result-err-text: #fca5a5;
  --flow-step-bg: #1e3a5f;
  --flow-step-border: #2563eb;
  --table-head-bg: #1e3a5f;
  --theme-toggle-bg: rgba(255, 255, 255, 0.1);
  --theme-toggle-bg-hover: rgba(255, 255, 255, 0.18);
  --outline-btn-bg: transparent;
  --outline-btn-text: #cbd5e1;
  --outline-btn-border: #64748b;
  --med-card-bg: #243044;
  --med-card-border: #475569;
  --med-card-hover-bg: #2a3a52;
  --med-card-hover-border: #6ea8fe;
  --med-badge-full-bg: rgba(34, 197, 94, 0.22);
  --med-badge-full-text: #86efac;
  --med-badge-full-border: rgba(74, 222, 128, 0.55);
  --med-badge-ref-bg: rgba(59, 130, 246, 0.22);
  --med-badge-ref-text: #93c5fd;
  --med-badge-ref-border: rgba(96, 165, 250, 0.55);
  --med-badge-ext-bg: rgba(148, 163, 184, 0.18);
  --med-badge-ext-text: #cbd5e1;
  --med-badge-ext-border: rgba(148, 163, 184, 0.45);
  --badge-guarantee-bg: rgba(34, 197, 94, 0.24);
  --badge-guarantee-text: #bbf7d0;
  --badge-guarantee-border: #4ade80;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  transition: background 0.25s ease, color 0.25s ease;
}

header.app-header,
body > header:not(.landing-header):not(.landing-section-head):not(.home-hero) {
  background: var(--bg-header);
  color: var(--text-on-accent);
  padding: 1rem 2rem;
  box-shadow: 0 2px 8px var(--shadow-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

header.app-header h1,
body > header:not(.landing-header):not(.landing-section-head):not(.home-hero) h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.card,
form.card {
  background: var(--bg-surface);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: var(--shadow-card);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

main .card {
  width: min(480px, calc(100% - 2rem));
  margin: 0 auto;
}

form.card {
  place-self: center;
  width: min(420px, calc(100% - 2rem));
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

[hidden] {
  display: none !important;
}

body.auth-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem 2rem;
  min-height: 0;
}

.auth-main > form.card,
.auth-main > .auth-card {
  margin: 0;
  width: min(420px, calc(100% - 2rem));
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
}

.icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  text-align: center;
}

.card {
  text-align: center;
}

.card h2 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  color: var(--text-heading);
}

.card p {
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

form.card h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
  color: var(--text-heading);
  text-align: center;
}

form.card label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

form.card input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-input);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

form.card input[type="checkbox"],
form.card input[type="radio"] {
  width: auto;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

form.card input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

form.card button {
  margin-top: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

form.card button:hover {
  background: var(--accent-hover);
}

form.card a {
  margin-top: 0.5rem;
  text-align: center;
  color: var(--text-accent);
  font-size: 0.9rem;
  text-decoration: none;
}

form.card a:hover {
  text-decoration: underline;
}

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s;
}

.btn:hover {
  background: var(--accent-hover);
}

footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-faint);
  font-size: 0.875rem;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.medhub-logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  text-decoration: none;
  line-height: 0;
  cursor: pointer;
}

.medhub-home-link {
  gap: 0.65rem;
  line-height: normal;
  color: inherit;
}

.medhub-home-link:hover {
  opacity: 0.92;
}

.medhub-home-label {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  line-height: 1.2;
}

.medhub-logo {
  display: block;
  width: auto;
  height: auto;
  object-fit: contain;
}

.medhub-logo--header {
  max-height: 44px;
  max-width: min(210px, 48vw);
}

.medhub-logo--auth {
  max-height: 48px;
  max-width: min(220px, 72vw);
}

.medhub-logo--landing {
  max-height: 56px;
  max-width: min(240px, 58vw);
}

.auth-page-header {
  justify-content: center;
}

.auth-page-header .medhub-logo-link {
  cursor: pointer;
}

.auth-page-header .medhub-logo-link:hover {
  opacity: 0.92;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.user-menu-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: inherit;
  font: inherit;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.perfil-card {
  max-width: 640px;
  margin: 0 auto;
}

.perfil-lead {
  margin: 0 0 1.25rem;
}

.perfil-block {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.perfil-block:last-of-type {
  border-bottom: none;
}

.perfil-block h3 {
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: var(--text-heading);
}

.perfil-form label {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.perfil-form input,
.perfil-form select {
  width: 100%;
  margin-top: 0.25rem;
}

.profile-crm-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.profile-crm-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.profile-crm-field select,
.profile-crm-field input {
  width: 100%;
  box-sizing: border-box;
}

.profile-crm-field select {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-input);
  color: var(--text-primary);
}

.profile-rx-preview-label {
  margin: 0.75rem 0 0.35rem;
  font-size: 0.85rem;
  text-align: left;
}

.profile-rx-preview {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface-muted);
  border-radius: 8px;
  font-size: 0.92rem;
  text-align: left;
}

.onboarding-profile-card > label[for="onboarding-rx-name"] {
  display: block;
  margin-top: 0.25rem;
  text-align: left;
}

.profile-user-type {
  margin: 0 0 0.35rem;
  font-weight: 600;
}

.onboarding-profile-card fieldset {
  border: 0;
  margin: 0 0 1rem;
  padding: 0;
}

.onboarding-profile-card legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
  padding: 0;
}

.onboarding-role-group {
  display: grid;
  gap: 0.65rem;
}

.onboarding-role-card {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0.15rem 0.65rem;
  align-items: start;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color, rgba(255, 255, 255, 0.12));
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.onboarding-role-card:hover {
  border-color: var(--accent, #3b82f6);
}

.onboarding-role-card:has(input:checked) {
  border-color: var(--accent, #3b82f6);
  background: var(--bg-surface-muted);
}

.onboarding-role-card input {
  margin-top: 0.2rem;
}

.onboarding-role-title {
  font-weight: 600;
}

.onboarding-role-desc {
  grid-column: 2;
  font-size: 0.88rem;
}

.onboarding-profile-card {
  padding-bottom: 1.5rem;
}

.auth-step-badge {
  display: inline-block;
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.onboarding-crm-fields {
  display: none;
  margin-top: 0.75rem;
  text-align: left;
}

.onboarding-profile-card:has(input[name="userType"][value="doctor"]:checked) .onboarding-crm-fields {
  display: block;
}

.profile-student-upgrade {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: var(--bg-surface-muted);
}

.profile-student-upgrade .btn {
  margin-top: 0.5rem;
}

.profile-identity-lock {
  margin: 0.75rem 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.08);
}

.profile-identity-limit-notice {
  margin: 0 0 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-size: 0.9rem;
  line-height: 1.45;
}

.profile-identity-limit-notice strong {
  display: block;
  margin-bottom: 0.25rem;
}

.profile-identity-lock label {
  margin-top: 0.5rem;
}

.profile-address-grid {
  display: grid;
  grid-template-columns: 1fr 4rem 6.5rem;
  gap: 0.5rem 0.75rem;
}

.profile-email-readonly {
  margin: 0.35rem 0;
  font-size: 1rem;
}

.perfil-fold {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface-muted);
}

.perfil-fold summary {
  padding: 0.65rem 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.perfil-fold-body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
}

.rx-profile-hint {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 8px;
  font-size: 0.88rem;
}

.rx-print-address {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.btn-outline {
  background: var(--outline-btn-bg);
  border: 1px solid var(--header-outline);
  color: var(--text-on-accent);
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.2s;
}

.btn-outline:hover {
  background: var(--header-outline-hover);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  border: 1px solid var(--header-outline);
  background: var(--theme-toggle-bg);
  color: var(--text-on-accent);
  font-size: 0.8rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.theme-toggle:hover {
  background: var(--theme-toggle-bg-hover);
}

.theme-toggle-icon {
  font-size: 1rem;
  line-height: 1;
}

.theme-toggle-label {
  font-weight: 500;
}

.muted {
  color: var(--text-muted);
}

.dashboard-card {
  width: min(640px, calc(100% - 2rem));
  margin: 0 auto;
  text-align: left;
}

.dashboard-card h2 {
  margin-bottom: 0.75rem;
}

.dashboard-card p {
  margin-bottom: 0.75rem;
}

.dashboard-btn {
  margin-top: 0.5rem;
}

/* --- App com barra lateral --- */
body.app-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: 240px;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  padding: 1.25rem 0;
  box-shadow: 2px 0 8px var(--shadow-sm);
  transition: background 0.25s ease, border-color 0.25s ease;
}

.sidebar-title {
  padding: 0 1.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}

.sidebar-build {
  margin: 1.25rem 1.25rem 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--text-caption);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sidebar-group {
  margin: 0.85rem 1.25rem 0.15rem;
  padding: 0;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
}

.sidebar-group:first-of-type {
  margin-top: 0.35rem;
}

.sidebar-link {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-link:hover {
  background: var(--bg-surface-active);
  color: var(--text-accent);
}

.sidebar-link.active {
  background: var(--bg-surface-active);
  color: var(--text-accent);
  font-weight: 600;
  border-left-color: var(--accent);
}

.app-content {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: block;
}

.content-panel {
  display: none;
}

.content-panel.active {
  display: block;
}

.app-content .dashboard-card {
  width: 100%;
  max-width: 800px;
}

.app-content .home-card {
  max-width: 920px;
  overflow: hidden;
}

.home-main-section {
  margin-bottom: 1rem;
}

.home-main-section .home-main-title {
  font-size: 1.15rem;
  margin: 0 0 0.35rem;
}

.conta-card {
  max-width: 720px;
  margin: 0 auto;
}

.conta-card > h2 {
  margin-bottom: 0.35rem;
}

.conta-lead {
  margin: 0 0 1.25rem;
}

.home-main-title {
  font-size: 1.35rem;
  color: var(--accent);
  margin: 0 0 0.4rem;
  line-height: 1.3;
}

.home-main-lead {
  margin: 0 0 0.35rem;
  font-size: 0.92rem;
  line-height: 1.5;
}

.home-greeting-inline {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--text-secondary);
}

.home-greeting {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.35rem;
}

.home-hero {
  text-align: center;
  margin: -2rem -2rem 1.75rem;
  padding: 1.65rem 1.5rem 1.5rem;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(
    135deg,
    var(--accent) 0%,
    color-mix(in srgb, var(--accent) 82%, #0a3d8f) 100%
  );
  color: var(--text-on-accent);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.12);
}

.home-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.home-hero h2 {
  font-size: 1.65rem;
  margin-bottom: 0.5rem;
  color: var(--text-on-accent);
  font-weight: 700;
}

.home-hero .home-greeting {
  color: var(--text-on-accent);
  opacity: 0.98;
}

.home-tagline {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.home-card .card p.home-tagline,
.home-hero .home-tagline {
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: 0;
}

.coming-soon {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.ps-wrap {
  max-width: 960px;
}

.ps-search-label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ps-search {
  width: 100%;
  max-width: 420px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  font-size: 0.95rem;
}

.ps-search:focus {
  outline: none;
  border-color: var(--text-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.ps-count {
  margin: 0.5rem 0 0.75rem;
  font-size: 0.82rem;
}

.ps-condition-grid {
  margin-top: 0.25rem;
}

.ps-condition-grid .calc-category-name {
  font-size: 0.82rem;
  line-height: 1.35;
  text-align: left;
}

.ps-med-options {
  margin: 0.35rem 0 0.5rem;
  padding-left: 1.1rem;
  list-style: disc;
}

.ps-med-options li {
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.emerg-steps .ps-med-options {
  margin-top: 0.4rem;
}

.emerg-content > .ps-med-options {
  margin: 0.5rem 0 1rem;
  padding: 0.65rem 0.85rem 0.65rem 1.75rem;
  background: var(--bg-surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.ps-emerg-link-wrap {
  margin: 1rem 0 0;
}

.ps-emerg-link {
  width: auto;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
}

.ps-content {
  margin-top: 1rem;
}

.ps-placeholder {
  margin: 0;
  padding: 1.25rem 1rem;
  border: 1px dashed var(--border-input);
  border-radius: 10px;
  background: var(--bg-surface-muted);
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
  text-align: center;
}

/* Prescrição interativa PS */
.ps-rx-wrap {
  margin-bottom: 1.5rem;
  padding: 1.15rem 1.25rem;
  background: var(--rx-wrap-bg);
  border: 1px solid var(--accent-soft);
  border-radius: 12px;
}

.ps-rx-header h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  color: var(--text-accent);
}

.ps-rx-header .muted {
  margin: 0 0 1rem;
  font-size: 0.88rem;
}

.ps-rx-fieldset {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0 0 1rem;
  background: var(--bg-surface);
}

.ps-rx-fieldset legend {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-accent-dark);
  padding: 0 0.35rem;
}

.ps-rx-label {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.ps-rx-select {
  display: block;
  width: 100%;
  max-width: 420px;
  margin-top: 0.35rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  font-size: 0.9rem;
}

.ps-rx-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-size: 0.88rem;
  cursor: pointer;
}

.ps-rx-med-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ps-rx-med-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-raised);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.ps-rx-med-card:hover {
  border-color: var(--text-accent);
  background: var(--rx-card-hover);
}

.ps-rx-med-card:has(.ps-rx-med-check:checked) {
  border-color: var(--text-accent);
  background: var(--bg-surface-active);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
}

.ps-rx-med-check {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.ps-rx-med-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.88rem;
  line-height: 1.4;
}

.ps-rx-med-detail {
  font-size: 0.8rem;
  color: var(--text-caption);
}

.ps-rx-tier {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--tier-default-bg);
  color: var(--tier-default-text);
}

.ps-rx-tier--1ªlinha {
  background: #d1fae5;
  color: #065f46;
}

.ps-rx-tier--Alternativa {
  background: #fef3c7;
  color: #92400e;
}

.ps-rx-tier--Refractário,
.ps-rx-tier--Refractario {
  background: #fee2e2;
  color: #991b1b;
}

.ps-rx-tier--Evitar {
  background: #fecaca;
  color: #7f1d1d;
}

.ps-rx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.ps-rx-actions .btn {
  border: none;
  cursor: pointer;
  padding: 0.6rem 1.15rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
}

.ps-rx-analyze {
  background: var(--accent);
  color: var(--text-on-accent);
}

.ps-rx-analyze:hover {
  background: var(--accent-hover);
}

.ps-rx-clear {
  background: transparent;
  border: 1px solid var(--outline-btn-border) !important;
  color: var(--outline-btn-text);
}

.ps-rx-result {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border-left: 4px solid var(--text-caption);
}

.ps-rx-result h4 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.ps-rx-result--ok {
  background: var(--result-ok-bg);
  border-color: var(--result-ok-border);
}

.ps-rx-result--ok h4 {
  color: var(--result-ok-text);
}

.ps-rx-result--warning {
  background: var(--result-warn-bg);
  border-color: var(--result-warn-border);
}

.ps-rx-result--warning h4 {
  color: var(--result-warn-text);
}

.ps-rx-result--error {
  background: var(--result-err-bg);
  border-color: var(--result-err-border);
}

.ps-rx-result--error h4 {
  color: var(--result-err-text);
}

.ps-rx-result-list {
  margin: 0;
  padding-left: 1.15rem;
}

.ps-rx-msg {
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.ps-rx-disclaimer {
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: var(--text-caption);
}

.ps-rx-auto-note {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
}

.ps-rx-soon {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface-muted);
  border-radius: 8px;
  font-size: 0.85rem;
}

.ps-rx-protocol-divider {
  margin: 1.25rem 0 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ps-html-meds--hidden {
  display: none !important;
}

/* Seletor de etiologia (PS interativo) */
.ps-etiology-picker {
  margin-bottom: 0.25rem;
}

.ps-etiology-picker-title {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.ps-etiology-picker-hint {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
}

.ps-etiology-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ps-etiology-tab {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.ps-etiology-tab:hover {
  border-color: var(--accent-soft);
}

.ps-etiology-tab--active {
  border-color: var(--accent);
  background: var(--rx-wrap-bg);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.ps-etiology-tab input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ps-etiology-tab-rank {
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-accent);
  line-height: 1.3;
}

.ps-etiology-tab-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ps-etiology-tab-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ps-etiology-tab-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.ps-etiology-tab-badge {
  flex-shrink: 0;
  align-self: flex-start;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-accent-dark);
  background: var(--accent-soft);
}

.ps-etiology-incidence {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-accent-dark);
  background: var(--accent-soft);
  vertical-align: middle;
}

.ps-rx-fieldset--primary {
  border-color: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

.ps-rx-fieldset--etiology legend {
  font-size: 0.95rem;
  line-height: 1.45;
}

.rx-etiology-hint {
  margin: 0 0 1rem;
  padding: 0.75rem 0.9rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--rx-wrap-bg);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.rx-options-group--etiology legend {
  font-size: 0.95rem;
  line-height: 1.45;
}

.rx-options-group--primary {
  border-color: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-soft);
}

/* Calculadora pediátrica — painel principal */
.ped-calc-form {
  margin-top: 0.5rem;
}

.ped-calc-weight-row input {
  max-width: 220px;
}

.ped-calc-patient-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.25rem;
}

.ped-calc-field {
  flex: 1;
  min-width: 100px;
}

.ped-calc-field--short {
  flex: 0 0 90px;
  min-width: 80px;
}

.ped-calc-patient-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--rx-wrap-bg);
  border: 1px solid var(--accent-soft);
  font-size: 0.9rem;
}

.ped-calc-patient-faixa {
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--accent-soft);
  color: var(--text-accent-dark);
}

.ped-calc-meta {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.ped-calc-rx-cell {
  font-size: 0.86rem;
  line-height: 1.45;
}

.ped-calc-rx-cell strong {
  color: var(--text-accent-dark);
}

.ped-calc-warn {
  color: var(--danger, #c62828);
  font-size: 0.78rem;
  font-weight: 600;
}

.ped-calc-row-warn {
  opacity: 0.85;
}

.ped-calc-med-table--rx th:nth-child(3),
.ped-calc-med-table--rx td:nth-child(3) {
  min-width: 110px;
}

.ped-calc-fluid-card {
  margin: 0.75rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface);
}

.ped-calc-fluid-card h5 {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
  color: var(--text-accent);
}

.ped-calc-fluid-card p {
  margin: 0.25rem 0;
  font-size: 0.88rem;
}

.ped-calc-fluid-note {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-surface-muted);
  font-size: 0.85rem;
}

.ped-calc-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0.85rem;
}

.ped-calc-tab {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ped-calc-tab:hover {
  border-color: var(--accent-soft);
}

.ped-calc-tab--active {
  border-color: var(--accent);
  background: var(--rx-wrap-bg);
  color: var(--text-accent-dark);
}

.ped-calc-panel-hint {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.ped-calc-result-block {
  margin-bottom: 1rem;
}

.ped-calc-result-block h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--text-accent);
}

.ped-calc-med-table td {
  vertical-align: top;
  font-size: 0.88rem;
}

.ped-calc-capped {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.ped-calc-adult-note {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-surface-muted);
  font-size: 0.88rem;
}

.calc-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
  max-width: 360px;
}

.calc-form label {
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.calc-form input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 1rem;
}

.calc-form input:focus {
  outline: none;
  border-color: var(--text-accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.calc-form select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 1rem;
  background: var(--bg-surface);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.calc-block {
  padding: 1.25rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.calc-block h3 {
  font-size: 1rem;
  color: var(--text-accent);
  margin-bottom: 0.75rem;
}

.calc-block .calc-form {
  margin-top: 0;
  max-width: none;
}

.calc-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.calc-category-btn {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  text-align: left;
  padding: 1rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.calc-category-btn:hover {
  background: var(--bg-surface-active);
  border-color: var(--text-accent);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.12);
}

.calc-category-icon {
  font-size: 1.35rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.calc-category-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.4;
}

.btn-back {
  background: transparent;
  border: none;
  color: var(--text-accent);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  margin-bottom: 1rem;
}

.btn-back:hover {
  text-decoration: underline;
}

#calc-area-title,
#emerg-topic-title {
  font-size: 1.35rem;
  color: var(--text-accent);
  margin-bottom: 1rem;
}

.emerg-content {
  line-height: 1.6;
  color: var(--text-primary);
}

.emerg-content h3 {
  font-size: 1.05rem;
  color: var(--text-accent);
  margin: 1.25rem 0 0.5rem;
}

.emerg-content ul,
.emerg-content ol {
  margin: 0.5rem 0 1rem 1.25rem;
}

.emerg-content li {
  margin-bottom: 0.35rem;
}

.emerg-content code {
  font-size: 0.85em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.emerg-algo-block {
  margin-bottom: 1.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  border-left: 4px solid var(--text-accent);
  border-radius: 0 10px 10px 0;
}

.emerg-algo-block.emerg-algo-single {
  margin-bottom: 0;
  max-width: 900px;
}

.emerg-calc-block {
  margin: 1rem 0 1.25rem;
}

.emerg-calc-wide {
  max-width: 720px;
}

.emerg-calc-wide .calc-form {
  max-width: none;
}

.emerg-calc-score {
  font-size: 1.15rem;
  color: var(--text-accent);
}

.emerg-calc-alerts {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
  font-size: 0.88rem;
  line-height: 1.45;
}

.emerg-calc-alerts li {
  margin-bottom: 0.35rem;
}

.rsi-drug-fieldset {
  margin-top: 0.75rem;
}

.rsi-patient-fieldset {
  margin-bottom: 0.5rem;
  background: var(--bg-surface-accent);
  border-color: var(--accent-soft);
}

.rsi-patient-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.rsi-patient-summary {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #e8f4fd;
  border-radius: 8px;
  font-size: 0.92rem;
}

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

.rsi-drug-cat {
  margin: 0.85rem 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-accent-dark);
}

.rsi-drug-cat:first-child {
  margin-top: 0;
}

.rsi-drug-row {
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-muted);
  opacity: 0.72;
}

.rsi-drug-row-active {
  opacity: 1;
  border-color: var(--accent-soft);
  background: var(--bg-surface-accent);
}

.rsi-drug-check {
  margin-bottom: 0.45rem;
}

.rsi-drug-amp-label,
.rsi-drug-dose-label {
  display: block;
  margin: 0.35rem 0 0.2rem;
  font-size: 0.78rem;
  color: var(--text-caption);
}

.rsi-drug-row select,
.rsi-drug-row input[type="number"] {
  width: 100%;
  max-width: 100%;
}

.rsi-drug-meta {
  font-size: 0.78rem;
  color: var(--text-caption);
}

.rsi-result-title {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
  color: var(--text-accent-dark);
}

.rsi-flow-result {
  margin-bottom: 0.5rem;
}

.rsi-drug-table td {
  vertical-align: top;
  font-size: 0.88rem;
}

.broselow-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0.75rem 0 1rem;
}

.broselow-legend-item {
  padding: 0.45rem 0.5rem;
  border-radius: 6px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.broselow-legend-item small {
  display: block;
  font-weight: 500;
  font-size: 0.72rem;
  opacity: 0.9;
}

.broselow-zone-bar {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
}

.broselow-drug-table td {
  vertical-align: top;
  font-size: 0.86rem;
}

@media (max-width: 640px) {
  .broselow-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.emerg-algo-block h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

.emerg-algo-block h4 {
  font-size: 0.95rem;
  color: var(--text-accent-dark);
  margin: 1rem 0 0.4rem;
}

.emerg-steps {
  counter-reset: step;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.emerg-steps > li {
  counter-increment: step;
  position: relative;
  padding: 0.5rem 0 0.5rem 2.25rem;
  margin-bottom: 0.25rem;
  border-bottom: 1px dashed var(--border);
}

.emerg-steps > li:last-child {
  border-bottom: none;
}

.emerg-steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.45rem;
  width: 1.5rem;
  height: 1.5rem;
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.emerg-flow-v {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin: 0;
  max-width: none;
  width: 100%;
}

.emerg-flowcharts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0;
  align-items: stretch;
}

.emerg-flow-col {
  min-width: 0;
  padding: 0.85rem;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
}

.emerg-flow-col-shock {
  border-top: 3px solid #e67e00;
}

.emerg-flow-col-noshock {
  border-top: 3px solid var(--text-muted);
}

.emerg-flow-col h4 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  color: var(--text-accent);
}

.emerg-flow-col .emerg-flow-step {
  font-size: 0.78rem;
  padding: 0.38rem 0.55rem;
  line-height: 1.35;
  text-align: left;
}

.emerg-flow-col .emerg-flow-step.emerg-flow-loop {
  font-size: 0.75rem;
}

.emerg-flow-col .emerg-flow-arrow {
  padding: 0.08rem 0;
  font-size: 0.9rem;
}

.emerg-rhythm-grid-2 {
  grid-template-columns: 1fr 1fr;
}

@media (min-width: 700px) {
  .emerg-rhythm-grid:not(.emerg-rhythm-grid-2) {
    grid-template-columns: repeat(3, 1fr);
  }
}

.emerg-flow-step {
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface-active);
  border: 1px solid var(--flow-step-border);
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-primary);
  text-align: center;
}

.emerg-flow-step.emerg-flow-shock {
  background: #fff3e0;
  border-color: #ffc966;
  color: #7a4a00;
  font-weight: 600;
}

.emerg-flow-step.emerg-flow-loop {
  background: var(--code-bg);
  border-color: var(--border);
  font-size: 0.85rem;
}

.emerg-flow-arrow {
  text-align: center;
  color: var(--text-faint);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.2rem 0;
}

.emerg-rhythm-intro {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.emerg-rhythm-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  margin-bottom: 1.25rem;
}

.emerg-rhythm-card {
  padding: 0.85rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  border-left: 4px solid var(--text-accent);
}

.emerg-rhythm-card strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-accent);
  margin-bottom: 0.35rem;
}

.emerg-rhythm-card p {
  margin: 0 0 0.35rem;
  font-size: 0.86rem;
  line-height: 1.45;
}

.emerg-rhythm-hint {
  color: var(--text-muted);
  font-size: 0.82rem !important;
  font-style: italic;
  margin-bottom: 0 !important;
}

.emerg-rhythm-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-on-accent);
  background: var(--accent);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
}

.emerg-rhythm-tag-shock {
  background: #e67e00;
}

.emerg-rhythm-tag-noshock {
  background: var(--text-muted);
}

.emerg-rhythm-card-shock {
  border-left-color: #e67e00;
}

.emerg-rhythm-card-noshock {
  border-left-color: var(--text-muted);
}

.emerg-ecg-figure {
  margin: 0 0 0.65rem;
}

.emerg-ecg-img {
  display: block;
  width: 100%;
  max-height: 140px;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: 0 1px 4px rgba(26, 43, 60, 0.08);
}

.emerg-ecg-img-clickable {
  cursor: zoom-in;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.emerg-ecg-img-clickable:hover {
  box-shadow: 0 4px 14px rgba(13, 110, 253, 0.25);
  transform: scale(1.01);
}

.emerg-ecg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem 1.25rem;
  background: rgba(12, 20, 32, 0.94);
}

.emerg-ecg-lightbox[hidden] {
  display: none !important;
}

.emerg-ecg-lightbox-inner {
  position: relative;
  max-width: min(96vw, 1280px);
  max-height: 92vh;
  margin: 0;
}

.emerg-ecg-lightbox-inner img {
  display: block;
  max-width: 100%;
  max-height: calc(92vh - 3.5rem);
  margin: 0 auto;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg-surface);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.emerg-ecg-lightbox-inner figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e8f0ff;
}

.emerg-ecg-lightbox-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: var(--bg-surface);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.emerg-ecg-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.emerg-ecg-lightbox-hint {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
  pointer-events: none;
}

body.emerg-ecg-lightbox-open {
  overflow: hidden;
}

.emerg-ecg-figure figcaption {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-accent);
  text-align: center;
}

.emerg-ecg-figure:has(.emerg-ecg-img-clickable)::after {
  content: 'Clique para ampliar';
  display: block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--text-caption);
  text-align: center;
}

.emerg-ecg-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

.emerg-ecg-gallery-item {
  margin-bottom: 0;
}

.emerg-ecg-gallery-item p {
  margin: 0.5rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
}

.emerg-ecg-img-strip {
  max-height: 110px;
}

.emerg-ecg-img-clinical {
  max-height: 280px;
}

.emerg-flow-question {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.5rem 0 0.75rem;
}

.emerg-flow-step.emerg-flow-decision {
  background: #fff8e6;
  border-color: #f0c060;
}

.emerg-flow-step.emerg-flow-noshock {
  background: #eef1f5;
  border-color: #b8c4d0;
  font-weight: 600;
}

.emerg-reversible-box {
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.emerg-reversible-box h4 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  color: var(--text-accent);
}

.emerg-reversible-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
}

.emerg-reversible-grid ul {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.86rem;
}

.emerg-reversible-grid li {
  margin-bottom: 0.25rem;
}

.emerg-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: #fff8e6;
  border-radius: 6px;
  border-left: 3px solid #f0ad4e;
}

.emerg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.75rem 0;
}

.emerg-table th,
.emerg-table td {
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  text-align: left;
}

.emerg-table th {
  background: var(--bg-surface-active);
  color: var(--text-accent);
  font-weight: 600;
}


.calc-soon-block {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-muted);
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
}

.calc-soon-block h3 {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.calc-soon-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.calc-soon-list li {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.calc-link-box {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-surface-accent);
  border-radius: 8px;
}

.calc-link-box .btn {
  margin-top: 0.75rem;
  border: none;
  cursor: pointer;
}

.calc-block-single {
  max-width: 480px;
  margin-top: 0.5rem;
}

.calc-block-single .calc-form {
  max-width: none;
}

.calc-fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin: 0.25rem 0;
}

.calc-fieldset legend {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 0.35rem;
}

.calc-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400 !important;
  font-size: 0.88rem !important;
  margin-bottom: 0.35rem;
  cursor: pointer;
}

.calc-check input {
  width: auto;
}

.calc-note {
  font-size: 0.8rem;
  color: var(--text-faint);
  margin-top: 0.5rem;
  line-height: 1.4;
}

.calc-result .calc-note {
  margin-top: 0.75rem;
}

@media (min-width: 900px) {
  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.calc-form button {
  margin-top: 0.25rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--text-on-accent);
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.calc-form button:hover {
  background: var(--accent-hover);
}

.calc-result {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface-accent);
  border-radius: 8px;
  border-left: 4px solid var(--text-accent);
}

.calc-result p {
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  text-align: left;
}

.calc-result p:last-child {
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .emerg-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .emerg-flowcharts-row {
    grid-template-columns: 1fr;
  }

  .emerg-rhythm-grid-2 {
    grid-template-columns: 1fr;
  }

  .emerg-reversible-grid {
    grid-template-columns: 1fr;
  }
}

/* --- Página inicial --- */
body.home-page main {
  align-items: stretch;
  padding: 0;
  display: block;
}

body.home-page main.landing-main,
.landing-main {
  width: 100%;
  max-width: none;
}

body.landing-single-page {
  scroll-behavior: smooth;
}

body.landing-single-page #topo,
body.landing-single-page #garantia,
body.landing-single-page #incluso,
body.landing-single-page #modulos,
body.landing-single-page #depoimentos,
body.landing-single-page #planos {
  scroll-margin-top: 4.75rem;
}

.landing-plan-login {
  text-align: center;
  margin: 1.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.landing-plan-login a {
  color: var(--text-accent);
  font-weight: 600;
}

.landing-single-page .pricing-v2-checkout {
  padding-top: 0.5rem;
}

#btn-plan-monthly:disabled,
#btn-plan-annual:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.landing-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-surface, #fff) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  box-shadow: 0 1px 0 var(--shadow-sm);
  padding: 0;
}

.landing-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.landing-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}

.landing-header-email-wrap {
  margin: 0;
}

.landing-header-email {
  width: min(200px, 42vw);
  padding: 0.4rem 0.65rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
}

.landing-header-login {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-accent);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.35rem 0.5rem;
}

.landing-header-login:hover {
  text-decoration: underline;
}

.landing-header-actions .theme-toggle {
  margin-left: 0.15rem;
}

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

.pricing-v2-intro {
  text-align: center;
  padding: 1.75rem 0 1rem;
  max-width: 680px;
  margin: 0 auto;
}

.pricing-v2-scroll-hint {
  margin: 1.25rem 0 0;
}

.pricing-v2-checkout {
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.pricing-v2-checkout .pricing-v2-trust {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

@media (max-width: 720px) {
  .landing-nav-links {
    display: none;
  }

  .landing-header-email {
    width: min(160px, 38vw);
  }
}

.landing-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.landing-nav {
  display: flex;
  align-items: center;
  gap: 0.65rem 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}

.landing-nav a {
  color: var(--text-secondary);
  text-decoration: none;
}

.landing-nav a:hover {
  color: var(--text-accent);
}

.landing-nav-muted {
  opacity: 0.85;
}

.landing-nav-cta {
  padding: 0.45rem 0.85rem !important;
  font-size: 0.88rem !important;
}

.landing-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
}

.landing-hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 0 2rem;
}

.landing-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  line-height: 1.15;
  color: var(--text-heading);
  margin: 0.75rem 0;
}

.landing-hero-lead {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 0 0 0.65rem;
}

.landing-hero-benefit {
  margin: 0 0 1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  display: inline-block;
}

[data-theme="dark"] .landing-hero-benefit {
  color: #93c5fd;
  background: rgba(77, 159, 255, 0.12);
  border-color: rgba(96, 165, 250, 0.35);
}

.landing-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}

.landing-badge-guarantee {
  background: var(--badge-guarantee-bg);
  color: var(--badge-guarantee-text);
  border: 1px solid var(--badge-guarantee-border);
  font-weight: 700;
  font-size: 0.84rem;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .landing-badge-guarantee {
  box-shadow: 0 0 0 1px rgba(74, 222, 128, 0.12), 0 2px 10px rgba(0, 0, 0, 0.28);
}

.pricing-guarantee-badge {
  margin-bottom: 0.65rem;
}

.landing-price-line {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent, #0d6efd);
  margin: 0.5rem 0 0.15rem;
}

.landing-price-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0 0 1.25rem;
}

.landing-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
}

.landing-btn-lg {
  padding: 0.75rem 1.35rem;
  font-size: 1rem;
}

.landing-stats {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.landing-stats li {
  text-align: center;
  padding: 0.65rem 0.4rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.landing-stats strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text-heading);
}

.landing-stats span {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

.landing-guarantee {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 1.35rem 1.5rem;
  margin: 0 0 2.5rem;
  background: linear-gradient(135deg, color-mix(in srgb, #16a34a 8%, var(--bg-surface)), var(--bg-surface));
  border-color: color-mix(in srgb, #16a34a 25%, var(--border));
}

.landing-guarantee-icon {
  flex-shrink: 0;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-weight: 800;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.landing-guarantee h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.landing-guarantee p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.95rem;
}

.landing-data-clarity {
  padding: 1.5rem 1.25rem;
}

.landing-data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.landing-data-card {
  background: var(--surface-elevated, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.landing-data-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.landing-data-card ul {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.92rem;
}

.landing-data-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.88rem;
}

.landing-compliance {
  padding: 1.5rem 1.25rem;
}

.landing-compliance-list {
  margin: 0.75rem auto 0;
  max-width: 720px;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.92rem;
}

.landing-compliance-list li + li {
  margin-top: 0.65rem;
}

.landing-section {
  margin-bottom: 2.75rem;
}

.landing-section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 1.75rem;
}

.landing-section-head h2 {
  font-size: 1.45rem;
  margin: 0 0 0.5rem;
  color: var(--text-heading);
}

.landing-section-head p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.landing-section-head-showcase {
  max-width: 720px;
  margin-bottom: 2rem;
}

.showcase-head-kicker {
  display: inline-block;
  margin-bottom: 0.65rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 18%, transparent), color-mix(in srgb, #22c55e 16%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 45%, #22c55e);
  color: var(--text-accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 14px color-mix(in srgb, var(--accent) 22%, transparent);
}

.landing-section-head-showcase h2 {
  font-size: clamp(1.45rem, 3.5vw, 1.85rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 0.65rem;
  background: linear-gradient(120deg, var(--accent) 0%, #22c55e 55%, #fbbf24 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.landing-section-head-showcase p {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.landing-section-head-showcase p strong {
  color: var(--text-primary);
  font-weight: 700;
}

[data-theme="dark"] .showcase-head-kicker {
  background: linear-gradient(135deg, rgba(77, 159, 255, 0.22), rgba(74, 222, 128, 0.18));
  border-color: rgba(96, 165, 250, 0.55);
  color: #bfdbfe;
  box-shadow: 0 2px 16px rgba(77, 159, 255, 0.2);
}

[data-theme="dark"] .landing-section-head-showcase h2 {
  background: linear-gradient(120deg, #93c5fd 0%, #6ee7b7 50%, #fde68a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

[data-theme="dark"] .landing-section-head-showcase p {
  color: #cbd5e1;
}

[data-theme="dark"] .landing-section-head-showcase p strong {
  color: #f1f5f9;
}

.app-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.app-preview-card h3 {
  font-size: 1rem;
  margin: 0.85rem 0 0.35rem;
  color: var(--text-heading);
}

.app-preview-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.app-mock {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  background: var(--bg-surface);
}

.app-mock-titlebar {
  background: #0d6efd;
  color: #fff;
  font-size: 0.72rem;
  padding: 0.4rem 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.app-mock-titlebar span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}

.app-mock-body {
  display: flex;
  min-height: 140px;
}

.app-mock-hero .app-mock-body {
  min-height: 200px;
}

.app-mock-sidebar {
  width: 38%;
  background: var(--bg-surface-muted, #f4f6f8);
  border-right: 1px solid var(--border);
  padding: 0.5rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.62rem;
  color: var(--text-muted);
}

.app-mock-sidebar.sm {
  width: 28%;
  font-size: 0.58rem;
}

.app-mock-sidebar span {
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
}

.app-mock-sidebar span.on {
  background: color-mix(in srgb, var(--accent, #0d6efd) 15%, transparent);
  color: var(--accent, #0d6efd);
  font-weight: 600;
}

.app-mock-panel {
  flex: 1;
  padding: 0.55rem 0.6rem;
  font-size: 0.68rem;
}

.mock-h {
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--text-heading);
  font-size: 0.72rem;
}

.mock-step {
  padding: 0.25rem 0.4rem;
  margin-bottom: 0.25rem;
  background: var(--bg-surface-raised);
  border-radius: 4px;
  border-left: 3px solid var(--border);
}

.mock-step-accent {
  border-left-color: var(--accent, #0d6efd);
}

.mock-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
}

.mock-chip {
  font-size: 0.58rem;
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: var(--bg-surface-accent);
  border: 1px solid var(--border);
}

.mock-search {
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
  background: var(--bg-input);
}

.mock-list-item {
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.mock-list-item.muted {
  color: var(--text-muted);
  font-size: 0.62rem;
}

.mock-rx {
  padding: 0.28rem 0.35rem;
  margin-bottom: 0.25rem;
  background: var(--bg-surface-raised);
  border-radius: 4px;
  font-size: 0.62rem;
}

.mock-btn-fake {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0.25rem 0.5rem;
  background: var(--accent, #0d6efd);
  color: #fff;
  border-radius: 6px;
  font-size: 0.58rem;
}

.mock-field {
  height: 0.55rem;
  margin-bottom: 0.35rem;
  background: var(--bg-surface-raised);
  border-radius: 4px;
  border: 1px solid var(--border);
  font-size: 0.55rem;
  padding: 0.15rem 0.35rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.mock-score {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent, #0d6efd);
}

.mock-score-sub {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.mock-flow {
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text-heading);
}

.mock-bar {
  height: 0.45rem;
  background: var(--bg-surface-raised);
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

.mock-bar.short {
  width: 65%;
}

.mock-tag {
  display: inline-block;
  font-size: 0.58rem;
  padding: 0.15rem 0.35rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}

.landing-reviews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.landing-review {
  margin: 0;
  padding: 1.25rem 1.35rem;
}

.landing-review p {
  margin: 0.65rem 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-secondary);
  font-style: italic;
}

.landing-review footer {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.85rem;
}

.landing-review footer strong {
  color: var(--text-heading);
}

.landing-review footer span {
  color: var(--text-muted);
}

.landing-stars {
  color: #f59e0b;
  letter-spacing: 0.05em;
  font-size: 0.95rem;
}

.landing-cta-final {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-top: 1rem;
  background: linear-gradient(180deg, var(--bg-surface), color-mix(in srgb, var(--accent, #0d6efd) 6%, var(--bg-surface)));
}

.landing-cta-final h2 {
  margin: 0 0 0.5rem;
  font-size: 1.4rem;
}

.landing-cta-final p {
  margin: 0 0 1.25rem;
  color: var(--text-muted);
}

.landing-cta-final .landing-hero-actions {
  justify-content: center;
  margin-bottom: 0;
}

.landing-disclaimer {
  max-width: 900px;
  margin: 2rem auto 0;
}

.landing-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.landing-footer a {
  color: var(--text-accent);
}

@media (max-width: 860px) {
  .landing-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .landing-hero > * {
    min-width: 0;
    max-width: 100%;
  }

  .landing-hero-visual {
    order: -1;
  }

  .landing-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .landing-nav-links {
    display: none;
  }

  .landing-guarantee {
    flex-direction: column;
    text-align: center;
  }
}

.home-card {
  width: min(920px, calc(100% - 1rem));
  margin: 0 auto;
  text-align: left;
  padding: 2rem 2rem 2.25rem;
  overflow: hidden;
}

.home-section {
  margin-bottom: 1.5rem;
}

.home-section h3 {
  font-size: 1.05rem;
  color: var(--text-heading);
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

.home-lead {
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

.home-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.home-features li {
  padding: 0.85rem 1rem;
  background: var(--bg-surface-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  line-height: 1.5;
}

.home-features strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.home-features span {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.home-disclaimer {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-caption);
  background: var(--bg-surface-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.home-disclaimer strong {
  color: var(--text);
}

.home-cta-text {
  text-align: center;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  font-size: 0.98rem;
}

.home-btn {
  display: block;
  width: fit-content;
  margin: 0 auto;
  text-align: center;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  background-color: var(--bg-input);
  color: var(--text-primary);
}

.emerg-note {
  background: var(--note-bg);
  border-left-color: var(--note-border);
}

.emerg-flow-step {
  background: var(--flow-step-bg);
  border-color: var(--flow-step-border);
}

.emerg-table th {
  background: var(--table-head-bg);
}

.calc-result {
  background: var(--bg-surface-accent);
  border-left-color: var(--accent);
}

/* --- Anamnese --- */
.anamnese-wrap {
  max-width: 820px;
}

.anamnese-drive-panel {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface-raised);
}

.anamnese-drive-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-accent);
}

.anamnese-drive-body {
  margin-top: 0.85rem;
}

.anamnese-drive-help code {
  font-size: 0.82em;
  background: var(--code-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.anamnese-drive-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0;
}

.anamnese-drive-actions .btn-outline {
  padding: 0.5rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  border: 1px solid var(--outline-btn-border);
  background: var(--outline-btn-bg);
  color: var(--outline-btn-text);
}

.anamnese-drive-status {
  font-size: 0.88rem;
  line-height: 1.45;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  margin: 0;
}

.anamnese-drive-status--idle {
  background: var(--bg-surface-muted);
  color: var(--text-muted);
}

.anamnese-drive-status--ok {
  background: var(--result-ok-bg);
  color: var(--result-ok-text);
  border: 1px solid var(--result-ok-border);
}

.anamnese-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.anamnese-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.anamnese-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.anamnese-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.65rem 0;
  font-size: 0.88rem;
  cursor: pointer;
}

.anamnese-input,
.anamnese-textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  font-size: 0.92rem;
  font-family: inherit;
  background: var(--bg-input);
  color: var(--text-primary);
}

.anamnese-textarea {
  resize: vertical;
  min-height: 4rem;
}

.anamnese-input:focus,
.anamnese-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.anamnese-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.anamnese-form-actions .btn,
.anamnese-form-actions .btn-outline {
  border: none;
  cursor: pointer;
  padding: 0.65rem 1.1rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.anamnese-form-actions .btn-outline {
  border: 1px solid var(--outline-btn-border);
  background: var(--outline-btn-bg);
  color: var(--outline-btn-text);
}

.anamnese-save-status {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.anamnese-save-status--ok {
  background: var(--result-ok-bg);
  color: var(--result-ok-text);
}

.anamnese-save-status--warn {
  background: var(--result-warn-bg);
  color: var(--result-warn-text);
}

.anamnese-save-status--pending {
  background: var(--bg-surface-accent);
  color: var(--text-accent);
}

.anamnese-history {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.anamnese-history h3 {
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: 0.75rem;
}

.anamnese-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.anamnese-history-item {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-raised);
}

.anamnese-history-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
}

.anamnese-history-meta span {
  color: var(--text-caption);
}

.anamnese-history-meta a {
  color: var(--text-accent);
  font-size: 0.85rem;
}

.anamnese-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.anamnese-history-btn {
  padding: 0.35rem 0.65rem !important;
  font-size: 0.8rem !important;
  color: var(--outline-btn-text) !important;
  border-color: var(--outline-btn-border) !important;
}

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

/* --- Medicações --- */
.med-wrap {
  max-width: 900px;
}

.med-filter-select {
  max-width: 360px;
  margin-bottom: 0.75rem;
  cursor: pointer;
}

.med-drug-grid {
  margin-top: 0.5rem;
}

.calc-category-card,
.med-drug-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  min-height: 4.75rem;
  padding: 0.85rem 1rem;
  background: var(--med-card-bg);
  border: 1px solid var(--med-card-border);
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  color: var(--text-primary);
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.calc-category-card:hover,
.med-drug-card:hover {
  background: var(--med-card-hover-bg);
  border-color: var(--med-card-hover-border);
  box-shadow: 0 2px 10px var(--shadow-sm);
}

.med-drug-card:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
}

.med-drug-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  color: var(--text-primary);
}

.med-drug-class {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text-secondary);
}

.med-drug-card .muted,
.med-wrap .muted,
.med-wrap .med-search-hint {
  color: var(--text-secondary);
}

.med-search-hint {
  font-size: 0.82rem;
  margin: 0.25rem 0 0.75rem;
  line-height: 1.45;
}

.med-tier-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.15rem;
}

.med-tier-badge--full {
  background: var(--med-badge-full-bg);
  color: var(--med-badge-full-text);
  border: 1px solid var(--med-badge-full-border);
}

.med-tier-badge--ref {
  background: var(--med-badge-ref-bg);
  color: var(--med-badge-ref-text);
  border: 1px solid var(--med-badge-ref-border);
}

.med-tier-badge--ext {
  background: var(--med-badge-ext-bg);
  color: var(--med-badge-ext-text);
  border: 1px solid var(--med-badge-ext-border);
}

.med-drug-card--reference {
  border-style: dashed;
  background: var(--bg-surface-muted);
}

[data-theme="dark"] .med-drug-card--reference {
  background: #1e293b;
}

/* --- Exames, interpretação, pacientes, ferramentas --- */
.clinical-wrap {
  max-width: 920px;
}

.clinical-record-list {
  margin-top: 0.75rem;
}

.clinical-record-item {
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
}

.clinical-record-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.clinical-record-meta strong {
  font-size: 0.95rem;
  color: var(--text-primary);
}

.clinical-record-meta span {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.clinical-record-tag {
  font-size: 0.78rem;
  color: var(--result-warn-text);
}

.clinical-allergy-banner {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--result-warn-border, #f0c674);
  background: var(--result-warn-bg, #fffbeb);
  color: var(--result-warn-text, #854d0e);
  font-size: 0.85rem;
  line-height: 1.45;
  text-align: left;
}

.clinical-record-snippet {
  display: block;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.clinical-record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.clinical-record-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.55rem;
}

.home-quick-section {
  margin-bottom: 1rem;
}

.home-quick-section h3 {
  margin-bottom: 0.35rem;
}

.home-quick-hint {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
}

.home-ferramentas-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0;
}

.home-tool-card {
  min-height: 5.5rem;
  padding: 0.85rem 0.9rem;
  text-align: left;
  align-items: flex-start;
}

.home-tool-card .calc-category-name {
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 600;
}

.home-tool-card .ferramentas-card-desc {
  display: block;
  margin-top: 0.2rem;
}

.home-tool-card--pediatric-aux {
  border-style: dashed;
  border-color: var(--accent-soft);
  background: var(--bg-surface-muted);
}

.home-tool-card-badge {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-accent-dark);
  background: var(--accent-soft);
}

.medhub-adult-scope-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--rx-wrap-bg);
  font-size: 0.88rem;
  line-height: 1.55;
}

.medhub-adult-scope-banner p {
  margin: 0 0 0.45rem;
}

.medhub-adult-scope-banner p:last-child {
  margin-bottom: 0;
}

.medhub-adult-scope-title {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.medhub-adult-scope-link-line {
  margin-top: 0.5rem !important;
  font-size: 0.85rem;
}

.medhub-ped-app-name {
  font-weight: 700;
  color: var(--text-accent-dark);
}

.medhub-ped-app-soon {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.08rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--bg-surface-muted);
  color: var(--text-muted);
}

.medhub-ped-app-anchor {
  font-weight: 700;
  color: var(--text-accent);
}

.medhub-ped-app-footer {
  margin-top: 1.5rem;
  padding: 1.1rem 1.15rem;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg-surface-muted);
  text-align: center;
}

.medhub-ped-app-footer h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  color: var(--text-accent);
}

.medhub-ped-app-footer p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.medhub-ped-app-soon-note {
  font-size: 0.84rem !important;
  color: var(--text-muted) !important;
}

.medhub-ped-app-btn {
  display: inline-block;
  margin-top: 0.35rem;
  text-decoration: none;
}

.medhub-ped-app-btn--soon {
  cursor: default;
  opacity: 0.85;
}

@media (min-width: 720px) {
  .home-ferramentas-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.home-quick-card {
  min-height: 4.25rem;
  padding: 0.65rem 0.55rem;
  text-align: center;
  align-items: center;
}

.home-quick-card .calc-category-name {
  font-size: 0.78rem;
  line-height: 1.3;
}

.home-settings-fold {
  margin: 0.5rem 0 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-surface-muted);
}

.home-settings-fold summary {
  padding: 0.65rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  list-style: none;
}

.home-settings-fold summary::-webkit-details-marker {
  display: none;
}

.home-settings-fold summary::before {
  content: '▸ ';
  color: var(--text-muted);
}

.home-settings-fold[open] summary::before {
  content: '▾ ';
}

.home-settings-fold-body {
  padding: 0 0.85rem 0.85rem;
  border-top: 1px solid var(--border);
}

.home-settings-fold-body .home-section {
  margin-bottom: 1rem;
}

.home-settings-fold-body .home-section:last-child {
  margin-bottom: 0;
}

.ferramentas-grid .ferramentas-card {
  flex-direction: column;
  align-items: flex-start;
  min-height: 5.5rem;
}

.ferramentas-card-desc {
  font-size: 0.78rem;
  line-height: 1.4;
  margin-top: 0.15rem;
}

.backup-section {
  margin-top: 0.5rem;
}

.backup-first-use-banner {
  background: rgba(255, 193, 7, 0.12);
  border: 1px solid rgba(255, 193, 7, 0.35);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.backup-first-use-banner p {
  margin: 0;
  flex: 1 1 220px;
  font-size: 0.92rem;
  line-height: 1.45;
}

.account-password-form {
  display: grid;
  gap: 0.5rem;
  max-width: 420px;
  margin-top: 0.75rem;
}

.account-password-form label {
  margin-top: 0.35rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
}

.backup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.backup-import-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.med-ref-notice {
  padding: 0.65rem 0.85rem;
  margin: 0.75rem 0 1rem;
  font-size: 0.88rem;
  line-height: 1.5;
  background: rgba(59, 130, 246, 0.08);
  border-left: 3px solid #3b82f6;
  border-radius: 0 6px 6px 0;
}

.med-bula-link {
  margin: 0.75rem 0;
  font-size: 0.9rem;
}

.med-bula-link a {
  font-weight: 600;
}

.med-external-anvisa {
  margin: 1rem 0 0.5rem;
  padding: 0.85rem 1rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--bg-surface-muted);
}

.med-external-title {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
}

.med-anvisa-btn {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
}

.med-class-badge {
  display: inline-block;
  margin: 0 0 1rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--bg-surface-muted);
  border-radius: 999px;
  border: 1px solid var(--border);
}

.med-detail-list {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.med-detail-list li {
  margin-bottom: 0.35rem;
}

.med-drug-content h4 {
  margin: 1rem 0 0.4rem;
  font-size: 0.92rem;
  color: var(--text-caption);
}

.med-drug-content h4:first-of-type {
  margin-top: 0;
}

/* --- Receituário --- */
.rx-wrap {
  max-width: 820px;
}

.rx-crm-field {
  display: flex;
  align-items: stretch;
  max-width: 320px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--input-border, #c5d3e0);
  border-radius: 8px;
  overflow: hidden;
  background: var(--input-bg, #fff);
}

.rx-crm-prefix {
  display: flex;
  align-items: center;
  padding: 0.55rem 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface-accent, #eef5ff);
  border-right: 1px solid var(--input-border, #c5d3e0);
  white-space: nowrap;
  user-select: none;
}

.rx-crm-input {
  flex: 1;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.rx-crm-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent-soft, rgba(13, 110, 253, 0.35));
}

.rx-suggest-banner {
  margin: 0.75rem 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface-accent);
  border: 1px solid var(--accent-soft);
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.5;
}

.rx-suggest-chip {
  display: inline-block;
  margin: 0.25rem 0.35rem 0 0;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--bg-surface);
  color: var(--text-accent);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.rx-suggest-chip:hover {
  background: var(--bg-surface-active);
}

.rx-suggest-lead {
  margin: 0 0 0.5rem;
}

.rx-suggest-combine {
  margin-top: 0.5rem;
  font-size: 0.88rem;
}

.rx-multi-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.rx-multi-block:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.rx-multi-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
  color: var(--text-accent);
}

.rx-source-banner {
  margin: 0 0 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
  background: var(--bg-surface-accent);
  border: 1px solid var(--accent-soft);
  color: var(--text-secondary);
}

.rx-option-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rx-option-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-raised);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.rx-option-card:hover {
  border-color: var(--accent);
  background: var(--rx-card-hover);
}

.rx-option-card--selected {
  border-color: var(--accent);
  background: var(--bg-surface-accent);
  box-shadow: 0 0 0 1px var(--accent-soft);
}

.rx-option-card-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
}

.rx-option-check {
  width: 1.1rem;
  height: 1.1rem;
  border: 2px solid var(--border-input);
  border-radius: 4px;
  flex-shrink: 0;
  position: relative;
  background: var(--bg-input);
}

.rx-option-card--selected .rx-option-check {
  border-color: var(--accent);
  background: var(--accent);
}

.rx-option-card--selected .rx-option-check::after {
  content: '';
  position: absolute;
  left: 0.2rem;
  top: 0.02rem;
  width: 0.35rem;
  height: 0.6rem;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.rx-selection-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.rx-selection-count {
  font-size: 0.9rem;
  color: var(--text-caption);
}

.rx-selection-actions {
  display: flex;
  gap: 0.5rem;
}

.rx-selection-actions .btn {
  border: none;
  cursor: pointer;
  padding: 0.55rem 1rem;
  border-radius: 8px;
}

.rx-selection-actions .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg-surface-raised);
  color: var(--text-primary);
  border: 1px solid var(--border) !important;
}

.rx-validation {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.rx-validation-msg {
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.rx-validation-msg--error {
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.45);
  color: #f87171;
}

.rx-validation-msg--warning {
  background: rgba(234, 179, 8, 0.12);
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fbbf24;
}

[data-theme="light"] .rx-validation-msg--error {
  color: #b91c1c;
}

[data-theme="light"] .rx-validation-msg--warning {
  color: #a16207;
}

.rx-meds-panel {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--accent-soft);
  border-radius: 10px;
  background: var(--bg-surface-accent);
}

.rx-meds-title {
  font-size: 1rem;
  color: var(--text-heading);
  margin: 0 0 0.35rem;
}

.rx-meds-hint {
  margin: 0 0 0.85rem;
  font-size: 0.85rem;
}

.rx-meds-group {
  margin: 0 0 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface-raised);
}

.rx-meds-group legend {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 0.35rem;
}

.rx-med-alt-group {
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1px dashed var(--border-input);
}

.rx-med-alt-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-caption);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.rx-med-item {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.45rem 0.2rem;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.rx-med-item input {
  margin-top: 0.2rem;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.rx-print-preview {
  margin-bottom: 0.75rem;
}

.rx-print-sheet {
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #111;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1.5;
  cursor: text;
  outline: none;
  min-height: 12rem;
}

.rx-print-sheet:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.rx-edit-hint {
  margin: -0.35rem 0 0.65rem;
  font-size: 0.85rem;
}

[data-theme="dark"] .rx-print-sheet {
  background: #f8fafc;
}

.rx-print-title {
  text-align: center;
  letter-spacing: 0.08em;
  font-size: 1rem;
  margin: 0 0 1rem;
  color: #111;
}

.rx-print-meta p {
  margin: 0.2rem 0;
  font-size: 0.92rem;
}

.rx-print-route {
  margin: 1rem 0 0.4rem;
  font-size: 0.92rem;
}

.rx-print-meds {
  margin: 0.35rem 0 0.85rem 1.1rem;
  padding: 0;
  font-size: 0.92rem;
}

.rx-print-meds li {
  margin-bottom: 0.55rem;
}

.rx-print-orient {
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.rx-print-orient ul {
  margin: 0.3rem 0 0 1rem;
  padding: 0;
}

.rx-print-sign {
  margin-top: 1.5rem;
  font-size: 0.92rem;
}

.rx-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.rx-result-actions .btn {
  border: none;
  cursor: pointer;
  padding: 0.6rem 1.1rem;
  border-radius: 8px;
}

.rx-option-card strong {
  font-size: 0.92rem;
  color: var(--text-primary);
}

.rx-option-preview {
  font-size: 0.82rem;
  color: var(--text-caption);
  line-height: 1.4;
}

.rx-result {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.rx-result h3 {
  font-size: 1rem;
  color: var(--text-heading);
  margin-bottom: 0.65rem;
}

.rx-result-text {
  width: 100%;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  resize: vertical;
}

.anamnese-queixa-hint {
  margin: -0.35rem 0 0.5rem;
  padding: 0.55rem 0.75rem;
  background: var(--bg-surface-accent);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border: 1px solid var(--accent-soft);
}

.anamnese-link-rx {
  border: none;
  background: none;
  color: var(--text-accent);
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  padding: 0;
}

.ps-rx-tier--Profilaxia {
  background: #dbeafe;
  color: #1e40af;
}

[data-theme="dark"] .ps-rx-tier--Profilaxia {
  background: #1e3a5f;
  color: #93c5fd;
}

/* Compliance — termo de uso, privacidade, auth */
.compliance-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
}

.compliance-overlay[hidden] {
  display: none !important;
}

body.compliance-modal-open {
  overflow: hidden;
}

.compliance-modal {
  width: min(640px, 100%);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 1.25rem 1.35rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.compliance-modal--narrow {
  width: min(420px, 100%);
}

.compliance-modal-scroll {
  overflow-y: auto;
  max-height: 55vh;
  padding-right: 0.35rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.compliance-modal-scroll h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  color: var(--text);
}

.compliance-modal-scroll ul {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.2rem;
}

.compliance-check {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.compliance-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compliance-label {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.compliance-input {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  background: var(--bg-input);
  color: var(--text);
}

.compliance-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger, #b91c1c);
}

.compliance-privacy-banner,
.compliance-inline-notice {
  margin: 0 0 0.85rem;
  padding: 0.75rem 0.9rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--bg-surface-accent);
  border: 1px solid var(--accent-soft);
  border-radius: 8px;
}

.compliance-privacy-banner strong,
.compliance-inline-notice strong {
  color: var(--text);
}

form.card .auth-notice,
form.card .auth-hint {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

form.card .auth-terms-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: 0.65rem;
  row-gap: 0;
  margin: 0.85rem 0 0.5rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  text-align: left;
  font-weight: 400;
  cursor: pointer;
}

form.card .auth-terms-check input[type="checkbox"] {
  grid-column: 1;
  grid-row: 1;
  margin-top: 0.2rem;
}

form.card .auth-terms-check span {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

form.card .auth-terms-check a {
  margin-top: 0;
  text-align: inherit;
  display: inline;
  font-size: inherit;
  white-space: normal;
}

.auth-main > form.card.auth-card {
  text-align: left;
}

.auth-main > form.card.auth-card h1,
.auth-main > form.card.auth-card > button,
.auth-main > form.card.auth-card > a[href="login.html"] {
  text-align: center;
}

form.card .auth-terms-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--text-accent);
  text-decoration: underline;
  cursor: pointer;
}

form.card .auth-forgot-wrap {
  margin: 0.65rem 0 0;
  text-align: center;
}

form.card .auth-forgot-link {
  font-size: 0.88rem;
  color: var(--text-accent);
}

form.card .auth-notice-warn {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--result-warn-border, #f0c674);
  background: var(--result-warn-bg, #fffbeb);
  color: var(--result-warn-text, #854d0e);
}

form.card .auth-notice-compact {
  text-align: left;
}

form.card .auth-notice-compact summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}

form.card .auth-notice-compact summary::-webkit-details-marker {
  display: none;
}

form.card .auth-notice-compact summary::before {
  content: '▸ ';
}

form.card .auth-notice-compact[open] summary::before {
  content: '▾ ';
}

form.card .auth-notice-compact p {
  margin: 0.5rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}

form.card .auth-pricing-wrap {
  margin: 0.85rem 0 0;
  text-align: center;
}

form.card .auth-pricing-link {
  font-size: 0.88rem;
  color: var(--text-accent);
}

.home-cta-secondary {
  text-align: center;
  margin: 0.75rem 0 0;
  font-size: 0.92rem;
}

.home-cta-secondary a {
  color: var(--text-accent);
}

/* --- Planos / billing --- */
body.pricing-page {
  display: block;
}

body.pricing-page main,
body.pricing-page .pricing-v2 {
  display: block;
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
}

.pricing-v2 {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.pricing-v2-hero {
  text-align: center;
  padding: 2rem 0 1.75rem;
  max-width: 640px;
  margin: 0 auto;
}

.pricing-v2-hero h1 {
  font-size: clamp(1.65rem, 4vw, 2.1rem);
  color: var(--text-heading);
  margin: 0.65rem 0 0.5rem;
  line-height: 1.2;
}

.pricing-v2-subtitle {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.25rem;
  font-size: 1.02rem;
}

.pricing-v2-notice {
  text-align: left;
  margin-bottom: 1rem;
}

.pricing-v2-email {
  text-align: left;
  padding: 1.15rem 1.25rem;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  box-shadow: 0 4px 20px var(--shadow-sm);
}

.pricing-v2-email input {
  width: 100%;
  margin-top: 0.35rem;
}

.pricing-v2-plans {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.15fr);
  gap: 0.6rem;
  align-items: stretch;
  max-width: 680px;
  margin: 0 auto 1.5rem;
}

.pricing-v2-plan {
  padding: 1.35rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pricing-v2-plan:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px var(--shadow-md);
}

.pricing-v2-plan-featured {
  padding: 1.65rem 1.45rem 1.45rem;
  border: 2px solid var(--accent);
  box-shadow: 0 10px 36px color-mix(in srgb, var(--accent) 22%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--bg-surface)), var(--bg-surface));
  z-index: 1;
}

.pricing-v2-plan-featured .pricing-amount {
  font-size: 1.95rem;
}

.pricing-v2-discount-badge {
  display: block;
  width: fit-content;
  margin: 0 0 0.65rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  box-shadow: 0 2px 10px rgba(34, 197, 94, 0.35);
}

[data-theme="dark"] .pricing-v2-discount-badge {
  background: linear-gradient(135deg, #15803d, #22c55e);
  box-shadow: 0 2px 12px rgba(74, 222, 128, 0.25);
}

.pricing-v2-installments {
  margin: 0.15rem 0 0.85rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-surface));
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--border));
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-accent);
  line-height: 1.4;
}

.pricing-v2-popular {
  position: absolute;
  top: -0.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-v2-plan-name {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.pricing-v2-plan-tagline {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.pricing-v2-plan-features {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
  flex: 1;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.pricing-v2-plan-features li {
  padding: 0.3rem 0;
}

.pricing-v2-cta {
  width: 100%;
  margin-top: auto;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

.pricing-v2-cta-primary {
  font-weight: 700;
}

.pricing-v2-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem 1.5rem;
  padding: 1rem 0 2.5rem;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}

.pricing-v2-module-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.85rem;
}

.pricing-v2-module {
  padding: 1rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  transition: border-color 0.15s;
}

.pricing-v2-module:hover {
  border-color: var(--accent-soft);
}

.pricing-v2-module span {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 0.35rem;
}

.pricing-v2-module strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-heading);
  margin-bottom: 0.2rem;
}

.pricing-v2-module small {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.pricing-v2-previews {
  grid-template-columns: repeat(3, 1fr);
}

.pricing-v2-previews .app-preview-card h3 {
  text-align: center;
  font-size: 0.92rem;
}

.pricing-v2-final {
  margin-top: 2rem;
}

.pricing-v2-legal {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.pricing-v2-legal a {
  color: var(--text-accent);
}

@media (max-width: 800px) {
  .pricing-v2-plans {
    grid-template-columns: 1fr;
    max-width: 420px;
    gap: 0.85rem;
  }

  .pricing-v2-plan-featured {
    order: -1;
  }

  .pricing-v2-module-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-v2-previews {
    grid-template-columns: 1fr;
  }
}

.pricing-page header,
.pricing-page footer {
  text-align: center;
}

.pricing-main {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem 1rem 2rem;
}

.pricing-hero {
  margin-bottom: 1.25rem;
}

.pricing-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.pricing-lead {
  color: var(--text-secondary);
  line-height: 1.55;
}

.pricing-notice,
.pricing-dev-note {
  margin: 1rem 0 0;
  padding: 0.75rem 0.85rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.pricing-notice {
  background: var(--bg-surface-accent);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.pricing-dev-note {
  background: var(--result-warn-bg, #fffbeb);
  border: 1px solid var(--result-warn-border, #f0c674);
  color: var(--result-warn-text, #854d0e);
}

.pricing-email-label {
  display: block;
  margin-top: 1rem;
}

.pricing-email-hint {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pricing-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pricing-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.pricing-card-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.pricing-badge {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
}

.pricing-amount {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0.35rem 0 0.5rem;
  color: var(--text-primary);
}

.pricing-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.pricing-features {
  margin: 1rem 0;
  padding-left: 1.1rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.pricing-btn {
  width: 100%;
  margin-top: auto;
}

.pricing-legal,
.pricing-back {
  margin: 1.25rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.pricing-success-card {
  max-width: 520px;
  margin: 2rem auto;
  text-align: center;
}

.pricing-success-email {
  font-weight: 600;
  color: var(--text-primary);
}

.pricing-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.25rem;
}

.billing-status-text {
  margin: 0.5rem 0 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.billing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.auth-legal-links {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.85rem;
}

.auth-legal-links a {
  color: var(--text-accent);
}

.auth-pricing-note {
  margin: 0.65rem 0 0;
  font-size: 0.82rem;
  text-align: left;
  line-height: 1.45;
}

.legal-page header,
.legal-page footer {
  text-align: center;
}

.legal-main {
  max-width: 720px;
  margin: 1.5rem auto 2rem;
  padding: 2rem;
}

.legal-body {
  line-height: 1.6;
  color: var(--text-secondary);
}

.legal-body h3 {
  margin: 1.25rem 0 0.5rem;
  color: var(--text-primary);
  font-size: 1rem;
}

.legal-body ul {
  margin: 0.5rem 0;
  padding-left: 1.25rem;
}

.legal-back {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.9rem;
}

.legal-back a {
  color: var(--text-accent);
}

/* --- App showcase (prévias alta fidelidade) --- */
.marketing-light,
.showcase-wrap {
  --shot-bg: #f0f4f8;
  --shot-surface: #ffffff;
  --shot-border: #dce4ec;
  --shot-text: #1a2b3c;
  --shot-muted: #5a6a7a;
  --shot-accent: #0d6efd;
  --shot-accent-soft: #e8f2ff;
  --shot-header: #0d6efd;
  color: var(--shot-text);
}

.showcase-wrap {
  margin-top: 0.5rem;
}

.showcase-tabs-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  margin-bottom: 1rem;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--shot-accent) transparent;
  -webkit-overflow-scrolling: touch;
}

.showcase-tabs-scroll::-webkit-scrollbar {
  height: 5px;
}

.showcase-tabs-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--shot-accent) 55%, var(--shot-border));
  border-radius: 999px;
}

.showcase-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.45rem;
  justify-content: center;
  min-width: min-content;
  padding: 0 0.15rem 0.35rem;
}

.showcase-tab {
  border: 1px solid var(--shot-border);
  background: var(--shot-surface);
  color: var(--shot-muted);
  padding: 0.45rem 0.85rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-family: inherit;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  position: relative;
  flex-shrink: 0;
  white-space: nowrap;
}

.showcase-tab-bar {
  position: absolute;
  left: 0.65rem;
  right: 0.65rem;
  bottom: 0.28rem;
  height: 3px;
  border-radius: 999px;
  background: rgba(13, 110, 253, 0.15);
  overflow: hidden;
}

.showcase-tab-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--shot-accent);
}

.showcase-tab:not(.active) .showcase-tab-bar {
  opacity: 0.35;
}

.showcase-tab:hover {
  border-color: var(--shot-accent);
  color: var(--shot-accent);
}

.showcase-tab.active {
  background: var(--shot-accent);
  border-color: var(--shot-accent);
  color: #fff;
  font-weight: 600;
}

.showcase-layout {
  display: grid;
  grid-template-columns: 1.45fr 0.55fr;
  gap: 1.25rem;
  align-items: start;
}

.showcase-stage-wrap {
  min-width: 0;
}

.showcase-stage {
  transition: opacity 0.14s ease;
  min-width: 0;
}

.showcase-carousel-ui {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: center;
}

.showcase-slide-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--shot-accent);
  text-align: center;
  min-height: 1.25rem;
}

.showcase-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}

.showcase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: color-mix(in srgb, var(--shot-accent) 22%, var(--shot-border));
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.showcase-dot.active {
  background: var(--shot-accent);
  transform: scale(1.25);
}

.showcase-dot:hover {
  background: var(--shot-accent);
}

.showcase-info {
  padding: 1.35rem 1.25rem;
  background: var(--shot-surface) !important;
  border: 1px solid var(--shot-border) !important;
  box-shadow: 0 8px 28px rgba(13, 110, 253, 0.08);
}

.showcase-info-kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--shot-accent);
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.showcase-info h3 {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  color: var(--shot-text);
}

.showcase-info > p {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--shot-muted);
  margin: 0 0 0.85rem;
}

.showcase-info-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--shot-text);
}

.showcase-info-list li {
  margin-bottom: 0.35rem;
}

.shot-browser {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--shot-border);
  box-shadow: 0 16px 48px rgba(26, 43, 60, 0.14);
  background: var(--shot-surface);
}

.shot-browser-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  background: #e8eef4;
  border-bottom: 1px solid var(--shot-border);
}

.shot-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.shot-dot-r { background: #ff5f57; }
.shot-dot-y { background: #febc2e; }
.shot-dot-g { background: #28c840; }

.shot-url {
  margin-left: 0.5rem;
  font-size: 0.72rem;
  color: var(--shot-muted);
  background: #fff;
  border: 1px solid var(--shot-border);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  flex: 1;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shot-app-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.85rem;
  background: var(--shot-header);
  color: #fff;
  font-size: 0.82rem;
}

.shot-app-header strong {
  font-size: 0.95rem;
}

.shot-user {
  margin-left: auto;
  opacity: 0.95;
}

.shot-pill {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
}

.shot-app-body {
  display: flex;
  min-height: 320px;
  background: var(--shot-bg);
}

.shot-sidebar {
  width: 34%;
  min-width: 120px;
  max-width: 180px;
  background: var(--shot-surface);
  border-right: 1px solid var(--shot-border);
  padding: 0.5rem 0;
}

.shot-nav-group {
  margin: 0.55rem 0.65rem 0.2rem;
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.shot-nav-item {
  display: block;
  padding: 0.38rem 0.65rem;
  font-size: 0.68rem;
  color: var(--shot-muted);
  border-left: 3px solid transparent;
}

.shot-nav-item.active {
  background: var(--shot-accent-soft);
  color: var(--shot-accent);
  font-weight: 600;
  border-left-color: var(--shot-accent);
}

.shot-content {
  flex: 1;
  padding: 0.85rem;
  overflow: hidden;
}

.shot-card {
  background: var(--shot-surface);
  border: 1px solid var(--shot-border);
  border-radius: 10px;
  padding: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  height: 100%;
}

.shot-h {
  margin: 0 0 0.55rem;
  font-size: 0.82rem;
  color: var(--shot-text);
  line-height: 1.35;
}

.shot-muted {
  font-size: 0.68rem;
  color: var(--shot-muted);
  margin: 0 0 0.5rem;
}

.shot-search {
  border: 1px solid var(--shot-border);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  font-size: 0.72rem;
  color: #94a3b8;
  background: #fff;
  margin-bottom: 0.5rem;
}

.shot-search-filled {
  color: var(--shot-text);
  border-color: var(--shot-accent);
  box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.12);
}

.shot-alert {
  background: #fff8e6;
  border-left: 3px solid #f0ad4e;
  padding: 0.35rem 0.5rem;
  font-size: 0.68rem;
  margin-bottom: 0.45rem;
  border-radius: 0 6px 6px 0;
}

.shot-rx-line {
  font-size: 0.72rem;
  padding: 0.35rem 0.45rem;
  margin-bottom: 0.3rem;
  background: #f8fbff;
  border-radius: 6px;
  border: 1px solid var(--shot-border);
  color: var(--shot-text);
}

.shot-btn {
  display: inline-block;
  margin-top: 0.45rem;
  padding: 0.38rem 0.65rem;
  background: var(--shot-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: default;
}

.shot-btn-ghost {
  background: #fff;
  color: var(--shot-accent);
  border: 1px solid var(--shot-accent);
}

.shot-rx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.shot-step-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.shot-step {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.7rem;
  padding: 0.35rem 0.45rem;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid var(--shot-border);
}

.shot-step span {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--shot-text);
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shot-step-on {
  background: var(--shot-accent-soft);
  border-color: #b6d4fe;
}

.shot-step-on span {
  background: var(--shot-accent);
  color: #fff;
}

.shot-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.5rem;
}

.shot-tags span {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  background: #ecfdf5;
  color: #047857;
  border-radius: 999px;
}

.shot-tag-row {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.shot-tag-a {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-weight: 600;
}

.shot-tag-rename {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
}

.shot-body-text {
  font-size: 0.68rem;
  line-height: 1.45;
  margin: 0 0 0.35rem;
  color: var(--shot-text);
}

.shot-form-grid {
  display: grid;
  gap: 0.35rem;
}

.shot-label {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--shot-muted);
}

.shot-field {
  border: 1px solid var(--shot-border);
  border-radius: 6px;
  padding: 0.35rem 0.45rem;
  font-size: 0.68rem;
  background: #fff;
  color: #94a3b8;
}

.shot-field-filled {
  color: var(--shot-text);
}

.shot-field-area {
  min-height: 2.2rem;
}

.shot-calc-grid {
  display: grid;
  gap: 0.25rem;
  font-size: 0.68rem;
  margin-bottom: 0.5rem;
}

.shot-calc-grid label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.shot-result {
  padding: 0.55rem 0.65rem;
  background: var(--shot-accent-soft);
  border: 1px solid #b6d4fe;
  border-radius: 8px;
  font-size: 0.78rem;
  color: var(--shot-text);
}

@media (max-width: 900px) {
  .showcase-layout {
    grid-template-columns: 1fr;
  }

  .shot-app-body {
    min-height: 280px;
  }

  .showcase-tabs-scroll {
    margin-bottom: 0.85rem;
  }

  .showcase-tabs {
    justify-content: flex-start;
  }
}
