
:root {
  /* Official UTIcalc Palette */
  --brand-navy: #0D233A;
  --brand-cyan: #00A5CF;
  --brand-cyan-light: #25B6D2;
  --brand-slate: #4A5568;
  
  --primary: #00A5CF;
  --primary-dark: #0D233A;
  --primary-light: rgba(0, 165, 207, 0.12);
  --primary-glow: rgba(0, 165, 207, 0.25);
  
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f9fc;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #00A5CF;
  --text-muted: #64748b;
  --shadow-sm: 0 1px 3px rgba(13, 35, 58, 0.06);
  --shadow-md: 0 4px 12px rgba(13, 35, 58, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-full: 9999px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* OLED DARK THEME (PURE CONTRAST & BEIRA-LEITO READABILITY) */
body.theme-oled {
  --bg-primary: #000000 !important;
  --bg-secondary: #0a0e14 !important;
  --bg-card: #0d121c !important;
  --bg-card-hover: #151d2a !important;
  --bg-input: #080c12 !important;
  --border-color: #1e293b !important;
  --brand-navy: #f8fafc !important;
  --brand-cyan: #00b4d8 !important;
  --brand-slate: #cbd5e1 !important;
  --text-main: #f8fafc !important;
  --text-secondary: #cbd5e1 !important;
  --text-muted: #94a3b8 !important;
  color: #f8fafc !important;
}

body.theme-oled .hero-navy-elem {
  fill: #f8fafc !important;
  stroke: #f8fafc !important;
}

body.theme-oled .hero-slate-elem {
  fill: #94a3b8 !important;
}

body.theme-oled .hub-card,
body.theme-oled .other-calc-box,
body.theme-oled .calc-selector-card,
body.theme-oled .clinical-card,
body.theme-oled .vent-panel,
body.theme-oled .subtab-pane,
body.theme-oled .drug-card {
  background: #0d121c !important;
  border-color: #1e293b !important;
  color: #f8fafc !important;
}

body.theme-oled .hub-card:hover {
  border-color: var(--brand-cyan) !important;
  background: #151d2a !important;
  box-shadow: 0 6px 20px rgba(0, 180, 216, 0.25) !important;
}

body.theme-oled .bed-manager-bar {
  background: #000000 !important;
  border-color: #1e293b !important;
}

body.theme-oled .bed-drawer {
  background: #080c12 !important;
  border-color: #1e293b !important;
}

body.theme-oled input, 
body.theme-oled select,
body.theme-oled textarea {
  background: #080c12 !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}

body.theme-oled input:focus, 
body.theme-oled select:focus {
  border-color: var(--brand-cyan) !important;
  outline: none;
}

body.theme-oled table th {
  background: #080c12 !important;
  color: #f8fafc !important;
  border-color: #1e293b !important;
}

body.theme-oled table td {
  color: #cbd5e1 !important;
  border-color: #1e293b !important;
}

body.theme-oled .calc-result-banner {
  background: rgba(0, 180, 216, 0.12) !important;
  border-color: rgba(0, 180, 216, 0.4) !important;
  color: #f8fafc !important;
}

body.theme-oled .calc-result-banner strong {
  color: #38bdf8 !important;
}

body.theme-oled .status-badge {
  background: rgba(0, 180, 216, 0.18) !important;
  color: #38bdf8 !important;
  border-color: rgba(0, 180, 216, 0.4) !important;
}

body.theme-oled .site-header { display: none !important; }

body.theme-oled .brand-title {
  color: #f8fafc !important;
}

body.theme-oled .btn-nav-chip {
  background: #0d121c !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}

body.theme-oled .btn-nav-chip.active {
  background: var(--brand-cyan) !important;
  color: #000000 !important;
  font-weight: 800 !important;
}

body.theme-oled h1, 
body.theme-oled h2, 
body.theme-oled h3, 
body.theme-oled h4 {
  color: #f8fafc !important;
}

body.theme-oled p, 
body.theme-oled span, 
body.theme-oled label {
  color: inherit;
}

body.theme-oled [style*="color: #0D233A"],
body.theme-oled [style*="color: rgb(13, 35, 58)"] {
  color: #f8fafc !important;
}

body.theme-oled [style*="color: #4A5568"],
body.theme-oled [style*="color: rgb(74, 85, 104)"] {
  color: #94a3b8 !important;
}

body.theme-oled [style*="color: #0f172a"],
body.theme-oled [style*="color: #334155"] {
  color: #f8fafc !important;
}

body.theme-oled [style*="background: #ffffff"],
body.theme-oled [style*="background: white"],
body.theme-oled [style*="background-color: #ffffff"],
body.theme-oled [style*="background-color: white"] {
  background: #0d121c !important;
  color: #f8fafc !important;
}

body.theme-oled [style*="background: #f8fafc"],
body.theme-oled [style*="background: #f1f5f9"] {
  background: #080c12 !important;
  color: #f8fafc !important;
}


/* BED MANAGER COMPACT HEADER (< 42px) */
.bed-manager-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(13, 35, 58, 0.05);
  padding: 0.35rem 0.85rem;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
}

.bed-manager-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: nowrap;
}

.bed-pills-group {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.bed-pill-btn {
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--brand-slate);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bed-pill-btn:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

.bed-pill-btn.active {
  background: var(--brand-cyan);
  color: #ffffff;
  border-color: var(--brand-cyan);
  box-shadow: 0 2px 6px rgba(0, 165, 207, 0.35);
}

.bed-summary-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.775rem;
  color: var(--brand-navy);
  background: rgba(0, 165, 207, 0.08);
  border: 1px solid rgba(0, 165, 207, 0.2);
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.bed-summary-pill:hover {
  background: rgba(0, 165, 207, 0.15);
  border-color: var(--brand-cyan);
}

.btn-theme-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--brand-navy);
  border-radius: var(--radius-full);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.btn-theme-toggle:hover {
  border-color: var(--brand-cyan);
  transform: scale(1.05);
}

.bed-drawer {
  max-width: 1200px;
  margin: 0.35rem auto 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  box-shadow: var(--shadow-md);
  animation: drawerSlideDown 0.2s ease;
}

@keyframes drawerSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.bed-drawer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  gap: 0.65rem;
  align-items: flex-end;
}

.bed-drawer-field label {
  display: block;
  font-size: 0.725rem;
  font-weight: 700;
  color: var(--brand-slate);
  margin-bottom: 0.25rem;
}

.bed-drawer-field input, .bed-drawer-field select {
  width: 100%;
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  color: var(--brand-navy);
  box-sizing: border-box;
}

.btn-bed-action {
  padding: 0.4rem 0.75rem;
  font-size: 0.775rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

/* 1-CLICK COPY BUTTON */
.btn-copy-prescription {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
  font-weight: 700;
  color: #065f46;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy-prescription:hover {
  background: #10b981;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.25);
}

/* TOAST NOTIFICATION */
.copy-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #0D233A;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  z-index: 9999;
  border: 1px solid var(--brand-cyan);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastFadeIn 0.3s ease;
}

@keyframes toastFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CARD ICON WRAPPER */

.hero-logo-badge {
  background: transparent;
}
body.theme-oled .hero-logo-badge {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

.hub-card-icon-wrapper {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(0, 165, 207, 0.08);
  border: 1px solid rgba(0, 165, 207, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hub-card:hover .hub-card-icon-wrapper {
  background: rgba(0, 165, 207, 0.16);
  border-color: var(--brand-cyan);
  transform: translateY(-2px) scale(1.05);
}

.hub-card-icon-svg {
  width: 38px;
  height: 38px;
  display: block;
}

body.theme-oled .hub-card-icon-wrapper {
  background: rgba(0, 165, 207, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
}

body.theme-oled .hub-card:hover .hub-card-icon-wrapper {
  background: rgba(0, 165, 207, 0.22);
  border-color: var(--brand-cyan);
}

/* PCR DISPLAY & CONTROLS */
.pcr-clock-display {
  font-family: var(--font-mono);
  font-size: 3.5rem;
  font-weight: 900;
  color: #ef4444;
  letter-spacing: 0.05em;
  line-height: 1;
}

.pcr-clock-display.cycle-ended {
  animation: pcrAlertBlink 0.8s infinite;
}

@keyframes pcrAlertBlink {
  0%, 100% { color: #ef4444; text-shadow: 0 0 25px rgba(239, 68, 68, 0.8); }
  50% { color: #f59e0b; text-shadow: none; }
}

.metronome-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #cbd5e1;
  display: inline-block;
  transition: all 0.05s ease;
}

.metronome-dot.flash {
  background: #10b981;
  box-shadow: 0 0 14px #10b981;
  transform: scale(1.35);
}

.pcr-log-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  max-height: 220px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.825rem;
  color: var(--brand-navy);
}

.pcr-log-entry {
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}

.pcr-log-entry:last-child {
  border-bottom: none;
}

/* ==========================================================================
   GF Cuidado Intensivo - Design System & Styling
   Minimalist Hub + Intensive Care Calculators & Clinical Scores
   ========================================================================== */

:root {
  /* Clinical Clean Light Default */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;

  /* Typography */
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Status Colors */
  --status-low: #0284c7;
  --status-normal: #059669;
  --status-warning: #d97706;
  --status-danger: #dc2626;

  /* Accents */
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --accent-purple: #7c3aed;
  --accent-cyan: #0891b2;

  /* Radius & Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.09);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #f8fafc;
  --border-color: #e2e8f0;
  --border-focus: #2563eb;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 25px -3px rgba(0, 0, 0, 0.09);
  --primary-light: rgba(37, 99, 235, 0.08);
}

/* Base Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: max(70px, env(safe-area-inset-bottom, 0px));
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  touch-action: manipulation;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header (Visible only inside categories) */
.site-header { display: none !important; }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  gap: 1rem;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.brand-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

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

.patient-weight-bar {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem 0.35rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  box-shadow: var(--shadow-sm);
}

.patient-weight-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.weight-input {
  width: 65px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 700;
  text-align: center;
  padding: 0.2rem;
  font-family: var(--font-mono);
  outline: none;
}

.weight-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.weight-unit {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-weight-btns {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-weight-preset {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-weight-preset:hover, .btn-weight-preset.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-icon {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

/* ==========================================================================
   MINIMALIST HOME HUB (PORTAL PURAMENTE LIMPO)
   ========================================================================== */

.home-hub-section {
  padding: 4rem 0 2rem 0;
  animation: fadeIn 0.3s ease;
}

.hub-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3rem auto;
}

.hub-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(6, 182, 212, 0.25);
  margin-bottom: 1rem;
}

.hub-main-title {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #ffffff 40%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .hub-main-title {
  background: linear-gradient(135deg, #0f172a 40%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hub-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.6;
}

/* Minimalist Category Boxes Grid (2x2 Desktop Layout) */
.home-categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  max-width: 980px;
  margin: 0 auto;
}

@media (max-width: 800px) {
  .home-categories-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }
}

.hub-card {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: inherit;
  text-align: left;
  width: 100%;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.85rem 1.65rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.25rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.hub-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  transition: var(--transition);
}

.hub-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: var(--shadow-lg);
}

.hub-card:active {
  transform: scale(0.98);
  border-color: var(--primary);
  background: var(--bg-card-hover);
}

.hub-card:hover::after {
  background: linear-gradient(90deg, #2563eb, #06b6d4);
}

.hub-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hub-icon-wrapper {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  border: 1px solid var(--border-color);
}

.hub-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin-top: 0.6rem;
}

.hub-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 0.35rem;
}

.hub-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.hub-badge {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-muted);
}

.hub-arrow-btn {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform 0.2s ease;
}

.hub-card:hover .hub-arrow-btn {
  transform: translateX(4px);
}

/* ==========================================================================
   DETAILS VIEW
   ========================================================================== */

.details-container {
  display: none;
  padding-top: 1.5rem;
  animation: fadeIn 0.25s ease;
}

.details-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.header-back-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.category-quick-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  max-width: 100%;
}

.btn-nav-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-nav-chip:hover {
  color: var(--text-main);
  border-color: var(--border-focus);
}

.btn-nav-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.details-header-title-box {
  margin-bottom: 1.5rem;
}

.active-view-title {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.active-view-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* ==========================================================================
   DRUG CARDS GRID
   ========================================================================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

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

.drug-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
  position: relative;
  backdrop-filter: blur(8px);
}

.drug-card:hover {
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: var(--shadow-md);
  background: var(--bg-card-hover);
}

.card-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.drug-names {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.drug-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.drug-commercial {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

.badge-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* Dilution Selector & Info Box */
.dilution-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dilution-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.dilution-select {
  flex: 1;
  min-width: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.5rem;
  outline: none;
  cursor: pointer;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  transition: var(--transition);
}

.btn-custom-dilution {
  flex-shrink: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-custom-dilution:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.dilution-details-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.concentration-badge {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(6, 182, 212, 0.25);
}

/* Dual Calculator Inputs */
.calc-dual-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.calc-input-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: var(--transition);
}

.calc-input-block:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.calc-input-label {
  font-size: 0.725rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  justify-content: space-between;
}

.calc-input-row {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.calc-input-field {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  outline: none;
}

.calc-input-unit {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.flow-stepper-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.btn-step {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.25rem 0.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: center;
  transition: var(--transition);
}

.btn-step:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* Slider Track */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slider-track-wrap {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
}

.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: transparent;
  outline: none;
  cursor: pointer;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: grab;
  transition: transform 0.1s ease;
}

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

.range-colored-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: var(--radius-full);
  pointer-events: none;
  transition: width 0.1s ease, background-color 0.2s ease;
}

/* Status Badges */
.therapeutic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.775rem;
}

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

.status-badge {
  font-size: 0.725rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.status-badge.status-low {
  background: rgba(6, 182, 212, 0.15);
  color: var(--status-low);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.status-badge.status-normal {
  background: rgba(16, 185, 129, 0.15);
  color: var(--status-normal);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.status-badge.status-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--status-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.status-badge.status-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--status-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.clinical-tip {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.18);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
  line-height: 1.45;
}

.clinical-tip.status-danger {
  border-left-color: var(--status-danger);
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.clinical-tip.status-warning {
  border-left-color: var(--status-warning);
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.1);
}

.clinical-tip.status-normal {
  border-left-color: var(--status-normal);
  color: #86efac;
  background: rgba(16, 185, 129, 0.1);
}

[data-theme="light"] .clinical-tip {
  background: #f1f5f9;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.btn-copy-prescription {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}

.btn-copy-prescription:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

/* ==========================================================================
   ANTIBIOTICS SECTION
   ========================================================================== */

.subtabs-scroll-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
}

.renal-calc-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.renal-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 1rem;
  margin-top: 0.75rem;
  align-items: end;
}

.form-group-clcr {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-label-clcr {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input-clcr, .form-select-clcr {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 500;
  outline: none;
  font-family: inherit;
  transition: var(--transition);
  width: 100%;
  line-height: 1.4;
}

.form-input-clcr {
  font-family: var(--font-mono);
  font-weight: 600;
}

.form-select-clcr option {
  background: var(--bg-card);
  color: var(--text-main);
  padding: 0.5rem;
}

.form-input-clcr:focus, .form-select-clcr:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.clcr-result-badge {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.clcr-val-display {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
}

.clcr-unit-display {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Search Box in Antibiotics & Hub */
.search-box-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 260px;
  max-width: 380px;
}

.search-box-wrapper .search-icon {
  position: absolute;
  left: 0.85rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.85rem 0.55rem 2.35rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.875rem;
  font-family: inherit;
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light);
}

.search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.825rem;
}

.abx-table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.abx-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.abx-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.85rem 1rem;
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border-color);
}

.abx-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}

.abx-table tr:last-child td {
  border-bottom: none;
}

.abx-table tr:hover {
  background: var(--bg-card-hover);
}

.abx-name-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.abx-name-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
}

.abx-commercial-tag {
  font-size: 0.75rem;
  color: var(--accent-purple);
  font-weight: 600;
}

.abx-indication-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.15rem;
}

.highlight-renal-active {
  background: rgba(59, 130, 246, 0.14) !important;
  border-left: 3px solid var(--primary);
  font-weight: 600;
}

.scores-panel, .disorder-panel {
  animation: fadeIn 0.25s ease;
}

/* ==========================================================================
   SCORES SECTION
   ========================================================================== */

.score-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.score-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--bg-secondary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 0.85rem;
  transition: var(--transition);
}

.score-checkbox-label:hover {
  border-color: var(--primary);
}

.score-checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

/* ==========================================================================
   MODAL & TOAST
   ========================================================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: slideUp 0.25s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.btn-primary {
  background: var(--primary);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

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

.btn-secondary {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.toast-msg {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid var(--primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: translateY(100px);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  pointer-events: none;
}

.toast-msg.show {
  transform: translateY(0);
  opacity: 1;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   MÓDULO: CALCULADORAS EM VENTILAÇÃO MECÂNICA
   ========================================================================== */

.vent-presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1.25rem;
}

.vent-preset-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.btn-vent-preset {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-vent-preset:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
}

.btn-vent-preset:active {
  transform: scale(0.96);
}

.vent-main-grid {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media screen and (max-width: 960px) {
  .vent-main-grid {
    grid-template-columns: 1fr;
  }
}

.vent-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-md);
}

.vent-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.vent-panel-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vent-input-group {
  margin-bottom: 0.9rem;
}

.vent-input-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.vent-input-label {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.vent-input-subtext {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-family: var(--font-mono);
  font-weight: 600;
}

.vent-input-field-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  transition: var(--transition);
}

.vent-input-field-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.vent-input-field {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  width: 100%;
}

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

.vent-input-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 0.4rem;
}

.vent-steppers {
  display: flex;
  gap: 0.25rem;
  margin-left: 0.5rem;
}

.btn-vent-step {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-vent-step:hover {
  background: var(--primary);
  color: #fff;
}

.btn-vent-step:active {
  transform: scale(0.92);
}

/* Gender selector tabs */
.gender-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.btn-gender {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.btn-gender.active {
  background: rgba(59, 130, 246, 0.2);
  border-color: var(--primary);
  color: #fff;
  font-weight: 700;
}

/* Results Grid */
.vent-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metric-card.hero-metric {
  background: linear-gradient(145deg, #ffffff, #f0f7ff);
  border: 1.5px solid rgba(37, 99, 235, 0.3);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
}

.metric-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.metric-card-title {
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-card-symbol {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.metric-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-normal {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.metric-value-box {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin: 0.35rem 0;
}

.metric-value-big {
  font-family: var(--font-mono);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}

.metric-unit {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-progress-bg {
  width: 100%;
  height: 6px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0.5rem 0;
}

.metric-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.3s ease, background-color 0.3s ease;
}

.metric-footer {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.75rem;
}

.metric-ref {
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.25rem;
}

.metric-desc {
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Protective checklist banner */
.vent-checklist-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-top: 1.25rem;
}

.vent-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.vent-check-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.825rem;
}

.vent-check-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* Tables for PBW and Guides */
.vent-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.vent-table th {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.vent-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.vent-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ==========================================================================
   MÓDULO: INTUBAÇÃO OROTRAQUEAL & VIA AÉREA DIFÍCIL (VAD)
   ========================================================================== */

.cormack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.cormack-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  position: relative;
  transition: var(--transition);
}

.cormack-card.grade-1 { border-top: 4px solid #10b981; }
.cormack-card.grade-2a { border-top: 4px solid #06b6d4; }
.cormack-card.grade-2b { border-top: 4px solid #f59e0b; }
.cormack-card.grade-3 { border-top: 4px solid #f97316; }
.cormack-card.grade-4 { border-top: 4px solid #ef4444; }

.cormack-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.65rem;
}

.cormack-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.cormack-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
}

.cormack-view-box {
  width: 100%;
  height: 130px;
  background: #050811;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
  padding: 4px;
}

.cormack-svg-diagram {
  width: 100%;
  height: 100%;
  max-height: 122px;
  display: block;
}

.macocha-item {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 0.5rem;
}

.macocha-item:hover {
  border-color: var(--primary);
  background: rgba(59, 130, 246, 0.08);
}

.macocha-item.selected {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
}

.macocha-points-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
}

/* FLUXOGRAMA DE RECRUTAMENTO ALVEOLAR & TITULAÇÃO DE PEEP */
.flowchart-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.flowchart-step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.flowchart-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.peep-titration-row {
  display: grid;
  grid-template-columns: 80px 100px 110px 110px 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.peep-titration-row.best-peep {
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid #10b981;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   IPHONE & MOBILE OPTIMIZATIONS (100% TOUCH RESPONSIVE & NO AUTO-ZOOM)
   ========================================================================== */

button, input, select, a {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media screen and (max-width: 768px) {
  /* Prevent iOS Safari from forcing auto-zoom on inputs */
  input, select, textarea, .form-input-clcr, .form-select-clcr, .weight-input, .search-input {
    font-size: 16px !important;
  }

  .calc-input-field {
    font-size: 1.3rem !important;
  }

  .container {
    padding: 0 0.85rem;
  }

  /* Home Hub Mobile */
  .home-hub-section {
    padding: 2rem 0 1.5rem 0;
  }

  .hub-hero {
    margin-bottom: 1.5rem;
  }

  .hub-main-title {
    font-size: 2.1rem;
    line-height: 1.15;
  }

  .hub-subtitle {
    font-size: 0.9rem;
    line-height: 1.5;
  }

  .home-categories-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hub-card {
    padding: 1.35rem 1.2rem;
  }

  /* Header Bar on Mobile */
  .site-header { display: none !important; }

  .header-inner {
    flex-wrap: wrap;
    gap: 0.6rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .patient-weight-bar {
    flex: 1;
    justify-content: space-between;
    padding: 0.35rem 0.65rem;
  }

  .quick-weight-btns {
    gap: 0.2rem;
  }

  .btn-weight-preset {
    padding: 0.3rem 0.5rem;
    font-size: 0.775rem;
    min-width: 32px;
    min-height: 32px;
  }

  /* Category Top Navigation Bar */
  .details-top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  .header-back-btn {
    width: 100%;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.875rem;
  }

  .category-quick-nav {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }

  .category-quick-nav::-webkit-scrollbar {
    display: none;
  }

  .subtabs-scroll-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.35rem;
    scrollbar-width: none;
  }

  .subtabs-scroll-bar::-webkit-scrollbar {
    display: none;
  }

  .btn-nav-chip {
    padding: 0.55rem 0.95rem;
    font-size: 0.825rem;
    flex-shrink: 0;
  }

  /* Calculators */
  .calc-dual-container {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .flow-stepper-row {
    gap: 0.4rem;
  }

  .btn-step {
    min-height: 42px;
    font-size: 0.9rem;
    flex: 1;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .drug-card {
    padding: 1.15rem 1rem;
  }

  .score-form-grid {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }

  .renal-calc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .abx-table th, .abx-table td {
    padding: 0.65rem 0.65rem;
    font-size: 0.8rem;
  }
}

.hero-logo-light {
  display: block !important;
}
.hero-logo-dark {
  display: none !important;
}
body.theme-oled .hero-logo-light {
  display: none !important;
}
body.theme-oled .hero-logo-dark {
  display: block !important;
}



/* Light mode defaults */
.hero-navy-elem {
  transition: all 0.2s ease;
}
.hero-slate-elem {
  transition: all 0.2s ease;
}

/* ==========================================================================
   UTIcalc HERO VECTOR SVG & DARK MODE REFINEMENTS
   ========================================================================== */
.uticalc-hero-svg {
  max-width: 380px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  transition: transform 0.25s ease;
}

.uticalc-hero-svg:hover {
  transform: scale(1.02);
}

body.theme-oled .uticalc-hero-svg {
  filter: drop-shadow(0 4px 20px rgba(0, 180, 216, 0.18));
}

body.theme-oled .hero-navy-elem,
body.theme-oled text.hero-navy-elem,
body.theme-oled rect.hero-navy-elem,
body.theme-oled path.hero-navy-elem,
body.theme-oled circle.hero-navy-elem,
body.theme-oled g.hero-navy-elem line,
body.theme-oled g.hero-navy-elem circle {
  fill: #f8fafc !important;
  stroke: #f8fafc !important;
}

body.theme-oled .hero-slate-elem,
body.theme-oled text.hero-slate-elem {
  fill: #cbd5e1 !important;
}

body.theme-oled .home-hub-section {
  background: radial-gradient(circle at 50% 120px, rgba(0, 180, 216, 0.08) 0%, transparent 65%) !important;
}


/* UTIcalc Official Responsive Hero Logo Toggle (Light & Dark OLED) */
.hero-logo-img {
  max-width: 420px;
  width: 100%;
  height: auto;
  margin: 0 auto;
  transition: opacity 0.25s ease;
}

.hero-logo-light {
  display: block !important;
}

.hero-logo-dark {
  display: none !important;
}

body.theme-oled .hero-logo-light {
  display: none !important;
}

body.theme-oled .hero-logo-dark {
  display: block !important;
}

.hero-logo-badge {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

body.theme-oled .hero-logo-badge {
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* ==========================================================================
   PURE VECTOR HERO LOGO & GLOBAL FOOTER STYLES
   ========================================================================== */

.uticalc-hero-vector-svg {
  max-width: 440px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 2px 8px rgba(0, 165, 207, 0.08));
  transition: all 0.3s ease;
}

.hero-text-uti {
  fill: #00A5CF;
}

.hero-text-calc {
  fill: var(--brand-navy);
  transition: fill 0.25s ease;
}

.hero-text-slogan {
  fill: var(--brand-slate);
  transition: fill 0.25s ease;
}

.hero-cross-bl {
  fill: var(--brand-navy);
  transition: fill 0.25s ease;
}

.hero-accent-bl {
  fill: var(--brand-navy);
  transition: fill 0.25s ease;
}

/* OLED Dark Mode Adaptations for Vector Hero */
body.theme-oled .uticalc-hero-vector-svg {
  filter: drop-shadow(0 4px 16px rgba(0, 194, 232, 0.18));
}

body.theme-oled .hero-text-calc {
  fill: #F8FAFC !important;
}

body.theme-oled .hero-text-slogan {
  fill: #CBD5E1 !important;
}

body.theme-oled .hero-cross-bl {
  fill: #2563EB !important;
}

body.theme-oled .hero-accent-bl {
  fill: #CBD5E1 !important;
}

/* STANDARDIZED GLOBAL FOOTER */
.site-global-footer {
  width: 100%;
  max-width: 900px;
  margin: 3.5rem auto 2.5rem auto;
  padding: 1.5rem 1rem 1rem 1rem;
  text-align: center;
  position: relative;
  clear: both;
}

.site-global-footer .footer-divider {
  width: 100%;
  max-width: 320px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(13, 35, 58, 0.15), transparent);
  margin: 0 auto 1.25rem auto;
}

.site-global-footer .footer-author-text {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--brand-slate);
  letter-spacing: 0.02em;
  margin: 0;
  line-height: 1.5;
}

.site-global-footer .footer-author-text strong {
  color: var(--brand-navy);
  font-weight: 700;
}

body.theme-oled .site-global-footer .footer-divider {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
}

body.theme-oled .site-global-footer .footer-author-text {
  color: #94a3b8 !important;
}

body.theme-oled .site-global-footer .footer-author-text strong {
  color: #f8fafc !important;
}

/* ==========================================================================
   ENHANCED CALCULATOR STYLING (Corticoides, Opioides, Gasometria)
   ========================================================================== */

.other-calc-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  transition: all 0.25s ease;
}

.calc-selectors-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
  margin: 1.25rem 0;
}

@media (max-width: 768px) {
  .calc-selectors-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
  .invert-btn-wrapper {
    order: 0;
    margin: -0.25rem 0;
  }
}

.calc-selector-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 14px;
  padding: 1.25rem;
  transition: all 0.2s ease;
  position: relative;
}

.calc-selector-card:hover,
.calc-selector-card:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 4px 16px rgba(0, 165, 207, 0.12);
}

.calc-selector-card.target {
  background: rgba(0, 165, 207, 0.04);
  border-color: rgba(0, 165, 207, 0.35);
}

.calc-selector-card.target:hover,
.calc-selector-card.target:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 4px 16px rgba(0, 165, 207, 0.18);
}

.selector-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--brand-navy);
  margin-bottom: 0.65rem;
}

.calc-field-sublabel {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-slate);
  margin-bottom: 0.4rem;
}

.calc-input-group-row {
  margin-top: 0.85rem;
}

/* Numeric input wrapper with unit badge */
.calc-numeric-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 0.25rem 0.65rem 0.25rem 0.85rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.calc-numeric-input-wrapper:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(0, 165, 207, 0.2);
  background: #ffffff;
}

.form-input-lg {
  width: 100%;
  border: none !important;
  background: transparent !important;
  font-family: var(--font-mono) !important;
  font-size: 1.35rem !important;
  font-weight: 700 !important;
  color: var(--text-main) !important;
  outline: none !important;
  padding: 0.35rem 0 !important;
  box-shadow: none !important;
}

.calc-unit-pill {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-slate);
  background: rgba(0, 165, 207, 0.08);
  border: 1px solid rgba(0, 165, 207, 0.2);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
  margin-left: 0.5rem;
}

.calc-field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: block;
  margin-top: 0.4rem;
  line-height: 1.3;
}

/* Styled select dropdowns */
.form-select-lg {
  width: 100%;
  background-color: var(--bg-card);
  border: 1.5px solid var(--border-color);
  border-radius: 10px;
  padding: 0.65rem 2.25rem 0.65rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2300A5CF' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
}

.form-select-lg:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(0, 165, 207, 0.2);
}

/* Invert Button */
.invert-btn-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.5rem;
}

.btn-invert-drugs {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--brand-cyan);
  background: var(--bg-card);
  color: var(--brand-cyan);
  font-size: 1.35rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 4px 12px rgba(0, 165, 207, 0.2);
}

.btn-invert-drugs:hover {
  background: var(--brand-cyan);
  color: #ffffff;
  transform: rotate(180deg) scale(1.1);
  box-shadow: 0 6px 18px rgba(0, 165, 207, 0.35);
}

/* Gasometry Specific Grid & Cards */
.gasometry-inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0;
}

.gas-input-card {
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  transition: all 0.2s ease;
}

.gas-input-card:hover,
.gas-input-card:focus-within {
  border-color: var(--brand-cyan);
  box-shadow: 0 3px 12px rgba(0, 165, 207, 0.12);
  background: var(--bg-card);
}

.gas-input-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.gas-input-label {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--brand-navy);
}

.gas-normal-badge {
  font-size: 0.675rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(0,0,0,0.05);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

/* Dark Mode OLED Adjustments for inputs */
body.theme-oled .calc-selector-card {
  background: #0d131d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-oled .calc-selector-card.target {
  background: #091829 !important;
  border-color: rgba(0, 194, 232, 0.3) !important;
}

body.theme-oled .calc-numeric-input-wrapper {
  background: #05080c !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body.theme-oled .calc-numeric-input-wrapper:focus-within {
  border-color: var(--brand-cyan) !important;
  box-shadow: 0 0 0 3px rgba(0, 194, 232, 0.25) !important;
  background: #080e18 !important;
}

body.theme-oled .form-select-lg {
  background-color: #05080c !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
  color: #f8fafc !important;
}

body.theme-oled .form-input-lg {
  color: #f8fafc !important;
}

body.theme-oled .calc-unit-pill {
  background: rgba(0, 194, 232, 0.15) !important;
  color: #38bdf8 !important;
  border-color: rgba(0, 194, 232, 0.3) !important;
}

body.theme-oled .gas-input-card {
  background: #0d131d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-oled .gas-input-card:hover,
body.theme-oled .gas-input-card:focus-within {
  background: #111a27 !important;
  border-color: var(--brand-cyan) !important;
}

body.theme-oled .gas-input-label {
  color: #f8fafc !important;
}

body.theme-oled .gas-normal-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #94a3b8 !important;
}

body.theme-oled .btn-invert-drugs {
  background: #0d131d !important;
  border-color: var(--brand-cyan) !important;
  color: var(--brand-cyan) !important;
}

body.theme-oled .selector-label {
  color: #38bdf8 !important;
}

body.theme-oled .calc-field-sublabel {
  color: #cbd5e1 !important;
}

.btn-preset-weight {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-preset-weight:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

.btn-preset-weight.active {
  background: var(--brand-cyan) !important;
  color: #ffffff !important;
  border-color: var(--brand-cyan) !important;
  box-shadow: 0 2px 6px rgba(0, 165, 207, 0.3);
}

body.theme-oled .btn-preset-weight {
  background: #0d131d !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #cbd5e1 !important;
}

body.theme-oled .btn-preset-weight.active {
  background: var(--brand-cyan) !important;
  color: #ffffff !important;
}


/* ==========================================================================
   USER PRECAUTION OVERRIDES: REMOÇÃO DE TAGS E BARRAS SECUNDÁRIAS
   ========================================================================== */
.category-quick-nav {
  display: none !important;
}

.hub-badge {
  display: none !important;
}

.badge-tag {
  display: none !important;
}

.clinical-tip {
  display: none !important;
}

/* ==========================================================================
   ESTILIZAÇÃO DO BLOCO DE REFERÊNCIAS CLÍNICAS NOS MÓDULOS
   ========================================================================== */
.module-references-box {
  margin-top: 2.5rem;
  margin-bottom: 2rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.module-references-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}

.module-references-header .ref-icon {
  font-size: 1.1rem;
}

.module-references-header .ref-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
}

.module-references-list {
  margin: 0;
  padding-left: 1.2rem;
  list-style-type: square;
}

.module-references-list li {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.35rem;
}

.module-references-author {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px dashed var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

body.theme-oled .module-references-box {
  background: #0d131d !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-oled .module-references-header {
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-oled .module-references-author {
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

body.theme-oled .module-references-list li {
  color: #94a3b8 !important;
}


/* ==========================================================================
   MOBILE RESPONSIVENESS HARDENING & QOL ENHANCEMENTS
   ========================================================================== */

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

html, body {
  overflow-x: clip;
  max-width: 100%;
}

/* Prevent grid/flex children from pushing containers beyond 100vw */
.container,
.details-container,
.vent-panel,
.drug-card,
.metric-card,
.other-calc-box,
.calc-selector-card,
.gas-input-card,
.clinical-card,
.vent-input-group,
.calc-input-block,
.score-panel,
.calc-result-banner,
.module-references-box,
.abx-table-wrapper,
.renal-calc-box,
.macocha-layout-grid > * {
  min-width: 0;
  max-width: 100%;
}

input, select, textarea {
  max-width: 100%;
}

.macocha-layout-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
}

@media screen and (max-width: 900px) {
  .macocha-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* Search clear button */
.search-box-wrapper {
  position: relative;
}

.search-input-with-clear {
  padding-right: 2.5rem !important;
}

.search-clear-btn {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: var(--border-color);
  color: var(--text-main);
  font-size: 1.1rem;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 2;
}

.search-clear-btn:hover {
  background: var(--brand-cyan);
  color: #ffffff;
}

/* Floating Scroll-to-Top Button */
.btn-scroll-top {
  position: fixed;
  right: 1rem;
  bottom: max(1.1rem, env(safe-area-inset-bottom, 1.1rem));
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--brand-navy);
  box-shadow: 0 4px 14px rgba(13, 35, 58, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.btn-scroll-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.btn-scroll-top:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan);
}

body.theme-oled .btn-scroll-top {
  background: #0d121c !important;
  border-color: #334155 !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6) !important;
}

@media screen and (max-width: 768px) {
  .container {
    padding: 0 0.75rem;
  }

  .vent-panel,
  .other-calc-box,
  .renal-calc-box,
  .score-panel {
    padding: 1rem 0.9rem;
  }

  .calc-selector-card {
    padding: 1rem 0.85rem;
  }

  /* PEEP Titration Row responsive layout */
  .peep-titration-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem 0.65rem;
    padding: 0.75rem;
  }

  /* Modals fit mobile viewport cleanly */
  .modal-content,
  .custom-dilution-modal-content {
    width: 94vw !important;
    max-width: 94vw !important;
    max-height: 88dvh;
    overflow-y: auto;
    padding: 1.15rem !important;
  }

  /* Weight selector bar wraps cleanly */
  .weight-bar,
  .patient-weight-bar,
  .quick-weight-btns {
    flex-wrap: wrap;
  }

  /* Bed manager bar never clips theme toggle on narrow phones */
  .bed-manager-bar {
    padding: 0.35rem 0.5rem;
  }

  .bed-manager-inner {
    flex-wrap: wrap;
    gap: 0.35rem;
  }

  .bed-pills-group {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .bed-pill-btn {
    padding: 0.25rem 0.5rem;
    min-height: 30px;
  }

  /* Tables stay scrollable inside their own wrapper without widening page */
  .abx-table-wrapper,
  .vent-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Gasometry and calculator inputs */
  .gasometry-inputs-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 145px), 1fr));
    gap: 0.65rem;
  }

  .calc-numeric-input-wrapper {
    padding: 0.2rem 0.5rem 0.2rem 0.65rem;
  }

  .calc-unit-pill {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    margin-left: 0.35rem;
  }
}

@media screen and (max-width: 600px) {
  .mobile-stack-grid {
    grid-template-columns: 1fr !important;
  }
}

@media screen and (max-width: 480px) {
  .renal-calc-grid {
    grid-template-columns: 1fr !important;
  }

  .vent-input-field-wrapper {
    padding: 0.3rem 0.5rem;
  }

  .vent-input-unit {
    font-size: 0.72rem;
  }
}

@media screen and (max-width: 355px) {
  .mobile-two-col-compact {
    grid-template-columns: 1fr !important;
  }
}


/* ==========================================================================
   SWISS CLINICAL DESIGN REVOLUTION (APPLE HEALTH + LINEAR PRECISION)
   ========================================================================== */

:root {
  --brand-navy: #0f172a;
  --brand-cyan: #0284c7;
  --brand-cyan-light: #0ea5e9;
  --brand-slate: #475569;

  --primary: #0284c7;
  --primary-dark: #0f172a;
  --primary-light: rgba(2, 132, 199, 0.1);
  --primary-glow: rgba(2, 132, 199, 0.18);

  --bg-primary: #f4f6f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-input: #f1f5f9;
  --border-color: rgba(15, 23, 42, 0.08);
  --border-focus: #0284c7;
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.03);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.09), 0 2px 6px rgba(15, 23, 42, 0.04);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --transition: all 0.16s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body {
  background-color: var(--bg-primary);
  color: var(--text-main);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  letter-spacing: -0.005em;
}

/* Tabular numbers everywhere for zero layout jitter while typing/sliding */
strong,
.calc-input-field,
.form-input-lg,
.vent-input-field,
.form-input-clcr,
.metric-card,
.status-badge,
.metric-badge,
.concentration-badge {
  font-variant-numeric: tabular-nums;
}

/* 1. Glassmorphic Bed Manager Bar */
.bed-manager-bar {
  background: rgba(255, 255, 255, 0.82) !important;
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
}

body.theme-oled .bed-manager-bar {
  background: rgba(10, 14, 20, 0.84) !important;
  border-bottom-color: rgba(255, 255, 255, 0.08) !important;
}

.bed-pill-btn {
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition: var(--transition);
}

.bed-pill-btn.active {
  background: var(--brand-navy) !important;
  color: #ffffff !important;
  border-color: var(--brand-navy) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
}

body.theme-oled .bed-pill-btn.active {
  background: #38bdf8 !important;
  color: #020617 !important;
  border-color: #38bdf8 !important;
}

/* 2. Hero & Bento Grid Home Hub */
.home-hub-section {
  padding: 1.75rem 0 2rem 0;
}

.hub-hero {
  margin-top: 0.25rem !important;
  margin-bottom: 1.5rem !important;
}

.uticalc-hero-vector-svg {
  max-width: 340px !important;
  filter: none !important;
}

.home-categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.9rem;
  max-width: 1040px;
  margin: 0 auto;
}

/* PCR Card spans full top row as compact Emergency Strip */
.hub-card[data-category="pcr"] {
  grid-column: 1 / -1;
  flex-direction: row !important;
  align-items: center !important;
  padding: 1rem 1.35rem !important;
  border-left: 4px solid #ef4444 !important;
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.04) 0%, var(--bg-card) 45%) !important;
}

.hub-card[data-category="pcr"] > div:first-child {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
  min-width: 0;
}

.hub-card[data-category="pcr"] .hub-card-header {
  margin: 0;
  flex-shrink: 0;
}

.hub-card[data-category="pcr"] .hub-card-icon-wrapper {
  width: 44px;
  height: 44px;
  margin: 0;
}

.hub-card[data-category="pcr"] .hub-card-title {
  margin-top: 0;
  font-size: 1.1rem;
}

.hub-card[data-category="pcr"] .hub-card-footer {
  border-top: none !important;
  padding-top: 0 !important;
  flex-shrink: 0;
}

.hub-card {
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1.05rem 1.25rem;
  gap: 0.85rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: var(--transition);
}

.hub-card::after {
  display: none !important;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 132, 199, 0.35);
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
}

.hub-card:active {
  transform: scale(0.985);
}

.hub-card-icon-wrapper {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}

.hub-card-icon-svg {
  width: 100%;
  height: 100%;
}

.hub-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin-top: 0.65rem;
  line-height: 1.25;
}

.hub-card-tags {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  line-height: 1.35;
}

.hub-card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 0.65rem;
  justify-content: flex-end;
}

.hub-arrow-btn {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-cyan);
}

/* Mobile 2-column Bento Grid */
@media screen and (max-width: 800px) {
  .home-hub-section {
    padding: 1rem 0 1.5rem 0;
  }

  .uticalc-hero-vector-svg {
    max-width: 260px !important;
  }

  .home-categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .hub-card {
    padding: 0.95rem 0.9rem 0.85rem 0.9rem;
    gap: 0.6rem;
    border-radius: 14px;
  }

  .hub-card[data-category="pcr"] {
    padding: 0.85rem 1rem !important;
  }

  .hub-card[data-category="pcr"] > div:first-child {
    gap: 0.75rem;
  }

  .hub-card[data-category="pcr"] .hub-card-tags {
    display: none;
  }

  .hub-card-icon-wrapper {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  .hub-card-title {
    font-size: 0.92rem;
    margin-top: 0.45rem;
  }

  .hub-card-tags {
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .hub-card-footer {
    padding-top: 0.45rem;
  }

  .hub-arrow-btn {
    font-size: 0.72rem;
  }
}

/* 3. Segmented Controls (iOS / Linear style) */
.subtabs-scroll-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  max-width: 100%;
  overflow-x: auto;
}

.btn-nav-chip {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: none;
}

.btn-nav-chip:hover {
  color: var(--text-main);
  background: rgba(15, 23, 42, 0.04);
}

.btn-nav-chip.active {
  background: var(--bg-card) !important;
  color: var(--brand-navy) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08) !important;
  font-weight: 700;
}

body.theme-oled .btn-nav-chip.active {
  background: #162032 !important;
  color: #f8fafc !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* 4. Preset Chips & Back Button */
.preset-chip {
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  transition: var(--transition);
}

.preset-chip.active {
  background: var(--brand-navy) !important;
  color: #ffffff !important;
  border-color: var(--brand-navy) !important;
}

body.theme-oled .preset-chip.active {
  background: #38bdf8 !important;
  color: #020617 !important;
  border-color: #38bdf8 !important;
}

.header-back-btn {
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  min-height: 40px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.header-back-btn:hover {
  background: var(--brand-navy);
  border-color: var(--brand-navy);
  color: #ffffff;
}

/* 5. Unified Card & Calculator Surfaces (Less Noise, More Hierarchy) */
.drug-card,
.vent-panel,
.other-calc-box,
.renal-calc-box,
.score-panel,
.metric-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.drug-title,
.vent-panel-title {
  letter-spacing: -0.015em;
}

.calc-selector-card {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
}

.calc-selector-card.target {
  background: rgba(2, 132, 199, 0.04);
  border-color: rgba(2, 132, 199, 0.25);
}

.calc-result-banner {
  border-radius: var(--radius-md);
  border: 1px solid rgba(2, 132, 199, 0.22);
  background: rgba(2, 132, 199, 0.04);
}

/* 6. Precision Range Sliders for Drug BIC Cards */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--brand-cyan);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: transform 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.12);
}

body.theme-oled input[type="range"]::-webkit-slider-thumb {
  background: #0f172a;
  border-color: #38bdf8;
}

/* 7. Tactile Copy & Action Buttons */
.btn-copy-prescription {
  border-radius: 10px;
  min-height: 40px;
  font-weight: 600;
  letter-spacing: -0.005em;
  transition: var(--transition);
}

.btn-copy-prescription:active {
  transform: scale(0.97);
}


/* ==========================================================================
   CARD TEXT FRAMING & ANTI-CLIPPING HARDENING
   ========================================================================== */

.card-header-top {
  flex-wrap: wrap;
}

.drug-title,
.drug-commercial,
.vent-panel-title,
.calc-result-banner,
.calc-field-hint,
.clinical-tip,
.module-references-list li {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.status-badge,
.metric-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  white-space: normal;
  line-height: 1.3;
  text-align: left;
  overflow-wrap: break-word;
}

.calc-selector-card {
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.calc-selector-card .form-select-lg,
.form-select-clcr {
  max-width: 100%;
  width: 100%;
  text-overflow: ellipsis;
  overflow: hidden;
}

#corticoid-result-val,
#opioid-result-val {
  font-size: clamp(1.5rem, 5vw, 2.15rem) !important;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.calc-result-banner {
  padding: 0.95rem 1.05rem;
  overflow-wrap: break-word;
  word-wrap: break-word;
}
