/* ===================================================================
   MDTools — World-Class Clinical Design System
   Version 3.0 — Complete redesign (Linear/Stripe quality)
   =================================================================== */

/* --- Design Tokens --- */
:root {
  /* Primary palette */
  --primary:      #1e40af;
  --primary-hover: #1e3a8a;
  --primary-light: #dbeafe;
  --primary-faint: #eff6ff;

  /* Neutrals */
  --gray-50:   #f9fafb;
  --gray-100:  #f3f4f6;
  --gray-200:  #e5e7eb;
  --gray-300:  #d1d5db;
  --gray-400:  #9ca3af;
  --gray-500:  #6b7280;
  --gray-600:  #4b5563;
  --gray-700:  #374151;
  --gray-800:  #1f2937;
  --gray-900:  #111827;

  /* Status */
  --teal:       #0d9488;
  --teal-bg:    #f0fdfa;
  --teal-border:#99f6e4;
  --amber:      #b45309;
  --amber-bg:   #fffbeb;
  --amber-border:#fde68a;
  --red:        #b91c1c;
  --red-bg:     #fef2f2;
  --red-border: #fecaca;
  --red-dark:   #991b1b;
  --red-dark-bg:#fef2f2;
  --red-dark-border:#f87171;

  /* Category colors */
  --cat-cardiology:     #dc2626;
  --cat-nephrology:     #7c3aed;
  --cat-pulmonology:    #0891b2;
  --cat-hepatology:     #b45309;
  --cat-general:        #6b7280;
  --cat-electrolytes:   #059669;
  --cat-emergency:      #e11d48;
  --cat-infectious:     #d97706;
  --cat-neonatology:    #ec4899;
  --cat-pain:           #8b5cf6;
  --cat-burns:          #ea580c;
  --cat-imaging:        #0284c7;

  /* Surfaces */
  --bg:         #ffffff;
  --bg-alt:     #f9fafb;
  --surface:    #ffffff;

  /* Borders */
  --border:       #e5e7eb;
  --border-light: #f3f4f6;

  /* Shadows */
  --shadow-card:       0 1px 3px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-sm:         0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:         0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg:         0 10px 15px -3px rgba(0,0,0,0.06), 0 4px 6px -4px rgba(0,0,0,0.03);
  --shadow-focus:      0 0 0 3px rgba(30,64,175,0.12);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, monospace;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

body {
  min-height: 100vh;
  font-family: var(--font);
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--gray-600);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--gray-900);
  font-weight: 700;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }

p { color: var(--gray-600); }

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition-fast);
}
a:hover {
  color: var(--primary-hover);
}

strong { font-weight: 700; color: var(--gray-800); }
small { font-size: 0.8125rem; }

/* --- Layout --- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Skip Link (Accessibility) --- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  position: fixed;
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: var(--surface);
  border: 2px solid var(--primary);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  z-index: 10000;
  font-weight: 600;
  color: var(--gray-900);
}

/* ===================================================================
   HEADER
   =================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

/* Logo / Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--gray-900);
}
.brand:hover { text-decoration: none; color: var(--gray-900); }

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}
.brand-tagline {
  font-size: 0.8125rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* Navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-nav a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--gray-500);
  transition: var(--transition-fast);
}
.site-nav a:hover {
  color: var(--gray-900);
  background: var(--gray-50);
  text-decoration: none;
}
.site-nav a.active {
  color: var(--primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--gray-700);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover {
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  border-color: var(--gray-300);
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(30,64,175,0.2);
  color: #fff;
}

/* ===================================================================
   HERO (Homepage)
   =================================================================== */
.hero-section {
  padding: 56px 0 40px;
  position: relative;
}

/* Gradient behind hero — full-width bleed */
.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-faint) 0%, var(--bg) 100%);
  z-index: -1;
}

.hero-content {
  max-width: 680px;
}

.hero-content h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--gray-900);
  margin-bottom: 16px;
}

.hero-content > p {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--gray-600);
  max-width: 56ch;
}

.hero-subtitle {
  font-size: 0.9375rem;
  color: var(--gray-500);
  margin-top: 8px;
  line-height: 1.6;
}

.hero-accent-line {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary) 20%, var(--primary) 80%, transparent);
  opacity: 0.15;
  margin: 0;
}

/* Search Bar */
.search-bar {
  margin-top: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===================================================================
   FORMS & INPUTS
   =================================================================== */
.input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-family: var(--font);
  font-size: 0.9375rem;
  color: var(--gray-900);
  transition: var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-focus);
}

.input::placeholder {
  color: var(--gray-400);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8.825L1.175 4 2.238 2.938 6 6.7l3.762-3.762L10.825 4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

@media (max-width: 768px) {
  .input, select {
    padding: 12px 14px;
    font-size: 1rem;
  }
}

/* Search inputs (larger) */
.search-bar .input {
  flex: 1;
  min-width: 280px;
  padding: 14px 18px;
  padding-left: 44px;
  font-size: 0.9375rem;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
}
.search-bar .input:focus {
  box-shadow: var(--shadow-md), var(--shadow-focus);
}
.search-bar select {
  width: auto;
  min-width: 200px;
  padding: 14px 38px 14px 16px;
  font-size: 0.875rem;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

/* ===================================================================
   BREADCRUMBS
   =================================================================== */
.breadcrumbs {
  font-size: 0.8125rem;
  color: var(--gray-400);
  margin-bottom: 8px;
  font-weight: 500;
}
.breadcrumbs a {
  color: var(--gray-400);
}
.breadcrumbs a:hover {
  color: var(--primary);
}

/* ===================================================================
   TOOL GRID (Homepage Cards)
   =================================================================== */
.tools-section {
  padding: 40px 0 24px;
}

.section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 20px;
}

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

.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  border-left: 4px solid var(--gray-300);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border);
  text-decoration: none;
}

/* Category-colored left borders */
.card[data-cat="Cardiology"]             { border-left-color: var(--cat-cardiology); }
.card[data-cat="Nephrology"]             { border-left-color: var(--cat-nephrology); }
.card[data-cat="Pulmonology"]            { border-left-color: var(--cat-pulmonology); }
.card[data-cat="Hepatology"]             { border-left-color: var(--cat-hepatology); }
.card[data-cat="General"]                { border-left-color: var(--cat-general); }
.card[data-cat="Electrolytes/Acid–Base"] { border-left-color: var(--cat-electrolytes); }
.card[data-cat="Emergency/Critical Care"]{ border-left-color: var(--cat-emergency); }
.card[data-cat="Infectious Disease"]     { border-left-color: var(--cat-infectious); }
.card[data-cat="Neonatology"]            { border-left-color: var(--cat-neonatology); }
.card[data-cat="Pain/Pharmacology"]      { border-left-color: var(--cat-pain); }
.card[data-cat="Burns/Trauma"]           { border-left-color: var(--cat-burns); }
.card[data-cat="Imaging"]               { border-left-color: var(--cat-imaging); }

.card .meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}

.card h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--gray-900);
  line-height: 1.35;
}

.card p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Pills / Tags — subtle with dot */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0;
  color: var(--gray-400);
}

.pill.cat::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
}

/* Dot colors by category */
.card[data-cat="Cardiology"] .pill.cat::before              { background: var(--cat-cardiology); }
.card[data-cat="Nephrology"] .pill.cat::before              { background: var(--cat-nephrology); }
.card[data-cat="Pulmonology"] .pill.cat::before             { background: var(--cat-pulmonology); }
.card[data-cat="Hepatology"] .pill.cat::before              { background: var(--cat-hepatology); }
.card[data-cat="General"] .pill.cat::before                 { background: var(--cat-general); }
.card[data-cat="Electrolytes/Acid–Base"] .pill.cat::before  { background: var(--cat-electrolytes); }
.card[data-cat="Emergency/Critical Care"] .pill.cat::before { background: var(--cat-emergency); }
.card[data-cat="Infectious Disease"] .pill.cat::before      { background: var(--cat-infectious); }
.card[data-cat="Neonatology"] .pill.cat::before             { background: var(--cat-neonatology); }
.card[data-cat="Pain/Pharmacology"] .pill.cat::before       { background: var(--cat-pain); }
.card[data-cat="Burns/Trauma"] .pill.cat::before            { background: var(--cat-burns); }
.card[data-cat="Imaging"] .pill.cat::before                 { background: var(--cat-imaging); }

/* Tool count note */
.count-note {
  margin-top: 16px;
  font-size: 0.8125rem;
  color: var(--gray-400);
}

/* ===================================================================
   TOOL PAGE HERO
   =================================================================== */
.page-hero {
  padding: 24px 0 20px;
}
.page-hero h1 {
  margin-bottom: 8px;
  font-size: 1.75rem;
}
.page-hero p {
  font-size: 0.9375rem;
  max-width: 65ch;
  color: var(--gray-600);
}

/* ===================================================================
   TOOL LAYOUT (Calculator Pages)
   =================================================================== */
.tool-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.panel h2 {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-500);
  margin-bottom: 16px;
}

/* Sidebar (aside) panel — warm clinical tips background */
.tool-layout > aside.panel {
  background: #fafdf9;
  border-color: #e8ede5;
}

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.field label {
  display: block;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--gray-700);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field small {
  display: block;
  color: var(--gray-400);
  font-size: 0.75rem;
  margin-top: 4px;
}

/* Checkbox fields */
.field label input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  vertical-align: middle;
  accent-color: var(--primary);
  cursor: pointer;
}

/* ===================================================================
   RESULT PANELS
   =================================================================== */
.result {
  margin-top: 24px;
  border-radius: 12px;
  padding: 24px;
  background: var(--primary-faint);
  border: 1.5px solid rgba(30,64,175,0.1);
  position: relative;
}

.result .big {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--gray-900);
  line-height: 1.1;
}

.result .sub {
  color: var(--gray-600);
  margin-top: 6px;
  font-size: 0.875rem;
}

/* ===================================================================
   STATUS FLAGS (Color-coded badges)
   =================================================================== */
.flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.8125rem;
  padding: 5px 12px;
  border-radius: 9999px;
  margin-top: 12px;
  letter-spacing: 0.01em;
}

.flag.ok {
  background: var(--teal-bg);
  color: var(--teal);
  border: 1.5px solid var(--teal-border);
}
.flag.warn {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1.5px solid var(--amber-border);
}
.flag.bad {
  background: var(--red-bg);
  color: var(--red);
  border: 1.5px solid var(--red-border);
}
.flag.critical {
  background: var(--red-dark-bg);
  color: var(--red-dark);
  border: 1.5px solid var(--red-dark-border);
  font-weight: 800;
}

/* ===================================================================
   KEY-VALUE GRID
   =================================================================== */
.kv {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kv div {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: var(--transition-fast);
}
.kv div:hover {
  border-color: var(--gray-300);
}

.kv b {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--gray-400);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.kv span {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--gray-800);
}

/* ===================================================================
   NOTES, REFERENCES, DISCLAIMERS
   =================================================================== */
.note {
  margin-top: 16px;
  color: var(--gray-500);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.note ul, .note ol {
  margin-top: 8px;
  padding-left: 20px;
}
.note li {
  margin-bottom: 4px;
}

.disclaimer {
  margin-top: 20px;
  padding: 14px 18px;
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: 10px;
  font-size: 0.8125rem;
  color: var(--gray-700);
  line-height: 1.5;
}

.refs {
  margin-top: 12px;
  color: var(--gray-500);
  font-size: 0.8125rem;
  line-height: 1.5;
}
.refs li {
  margin-left: 18px;
  margin-top: 8px;
}

/* ===================================================================
   FOOTER (Homepage)
   =================================================================== */
.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  background: var(--gray-50);
}

.footer-inner {
  padding: 40px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 48px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-weight: 700;
  font-size: 1rem;
  color: var(--gray-900);
}

.footer-section h3 {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-400);
  margin-bottom: 12px;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin-bottom: 6px;
}

.footer-section a {
  font-size: 0.8125rem;
  color: var(--gray-600);
  font-weight: 500;
}
.footer-section a:hover {
  color: var(--primary);
}

.footer-disclaimer {
  margin-top: 12px;
  font-size: 0.75rem;
  color: var(--gray-400);
  line-height: 1.55;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--gray-400);
}

/* Simple footer (tool pages) */
.footer-simple {
  border-top: 1px solid var(--border);
  margin-top: 48px;
  padding: 24px 0 40px;
  color: var(--gray-500);
  font-size: 0.8125rem;
}
.footer-simple strong { color: var(--gray-700); }

/* ===================================================================
   HOMEPAGE CONTENT SECTIONS (SEO)
   =================================================================== */
.content-section {
  padding: 48px 0;
  border-top: 1px solid var(--border-light);
}

.content-section h2 {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: 12px;
  letter-spacing: -0.025em;
}

.content-section p {
  font-size: 0.9375rem;
  max-width: 68ch;
  line-height: 1.65;
}

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

.feature-card {
  padding: 24px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}
.feature-card:hover {
  box-shadow: var(--shadow-card-hover);
}

.feature-card h3 {
  margin-bottom: 6px;
  font-size: 0.9375rem;
  color: var(--gray-900);
}
.feature-card p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.55;
}
.feature-icon {
  font-size: 1.125rem;
  margin-bottom: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary-faint);
  color: var(--primary);
  font-weight: 700;
  line-height: 1;
}

/* Category sections */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 20px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--gray-700);
  transition: var(--transition);
  text-decoration: none;
}
.category-item:hover {
  border-color: var(--primary);
  color: var(--primary);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

/* FAQ Section */
.faq-section {
  padding: 48px 0;
  border-top: 1px solid var(--border-light);
}
.faq-section h2 {
  font-size: 1.5rem;
  color: var(--gray-900);
  margin-bottom: 24px;
}
.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 20px 0;
}
.faq-item:first-of-type {
  border-top: 1px solid var(--border-light);
}
.faq-item h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 6px;
}
.faq-item p {
  font-size: 0.875rem;
  color: var(--gray-600);
  line-height: 1.6;
  max-width: 68ch;
}

/* ===================================================================
   ABOUT PAGE
   =================================================================== */
.about-section {
  padding: 48px 0 32px;
}
.about-content {
  max-width: 680px;
}
.about-content h2 {
  margin-top: 40px;
  margin-bottom: 12px;
  font-size: 1.25rem;
  color: var(--gray-900);
}
.about-content p {
  margin-bottom: 16px;
  line-height: 1.7;
  font-size: 0.9375rem;
}
.about-content ul {
  margin: 12px 0 20px;
  padding-left: 24px;
}
.about-content li {
  margin-bottom: 8px;
  color: var(--gray-600);
  line-height: 1.6;
  font-size: 0.9375rem;
}

/* ===================================================================
   RESPONSIVE DESIGN
   =================================================================== */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .hero-section {
    padding: 40px 24px 32px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tool-layout {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  .kv {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }

  .grid {
    grid-template-columns: 1fr;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }

  .site-nav a:not(.btn) {
    display: none;
  }

  .hero-content h1 {
    font-size: 1.75rem;
  }

  .hero-section {
    padding: 32px 16px 24px;
  }

  .result .big {
    font-size: 1.6rem;
  }

  .panel {
    padding: 20px;
  }

  .search-bar .input {
    min-width: unset;
    width: 100%;
  }
  .search-bar select {
    width: 100%;
    min-width: unset;
  }
  .search-bar {
    flex-direction: column;
  }

  .brand-tagline {
    display: none;
  }
}

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

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ===================================================================
   HOMEPAGE V2 — Platform Redesign
   =================================================================== */

/* Hero V2 */
.hero-section-v2 {
  padding: 72px 0 56px;
  position: relative;
}
.hero-section-v2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-faint) 0%, var(--bg) 100%);
  z-index: -1;
}
.hero-v2-content {
  max-width: 720px;
}
.hero-v2-content h1 {
  font-size: clamp(2.125rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -0.035em;
  color: var(--gray-900);
  margin-bottom: 16px;
}
.hero-v2-content > p {
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--gray-600);
  max-width: 58ch;
}
.hero-ctas {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero-ctas .btn {
  padding: 12px 24px;
  font-size: 0.9375rem;
  border-radius: 10px;
}
.hero-ctas .btn-primary {
  box-shadow: 0 2px 8px rgba(30,64,175,0.18);
}
.btn-outline {
  background: var(--surface);
  border: 1.5px solid var(--gray-300);
  color: var(--gray-700);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-faint);
}
.hero-trust {
  margin-top: 20px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.hero-trust span {
  font-size: 0.8125rem;
  color: var(--gray-400);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Featured Tools Section */
.featured-section {
  padding: 56px 0 48px;
  position: relative;
}
.featured-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: var(--gray-50);
  z-index: -1;
}
.section-header {
  margin-bottom: 32px;
}
.section-header h2 {
  font-size: 1.5rem;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}
.section-header p {
  font-size: 0.9375rem;
  color: var(--gray-500);
  max-width: 56ch;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.featured-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.featured-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}
.featured-card:hover {
  box-shadow: var(--shadow-lg);
  text-decoration: none;
  color: inherit;
}
.featured-card.active:hover {
  border-color: var(--gray-300);
  transform: translateY(-2px);
}
.featured-card.coming-soon {
  opacity: 0.82;
  cursor: default;
}

/* Accent bar colors */
.featured-card.accent-imaging::before   { background: var(--cat-imaging); }
.featured-card.accent-electrolytes::before { background: var(--cat-electrolytes); }
.featured-card.accent-pain::before      { background: var(--cat-pain); }
.featured-card.accent-infectious::before { background: var(--cat-infectious); }

.featured-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  flex-shrink: 0;
}
.featured-card-icon.icon-imaging   { background: #e0f2fe; color: var(--cat-imaging); }
.featured-card-icon.icon-electrolytes { background: #d1fae5; color: var(--cat-electrolytes); }
.featured-card-icon.icon-pain      { background: #ede9fe; color: var(--cat-pain); }
.featured-card-icon.icon-infectious { background: #fef3c7; color: var(--cat-infectious); }

.featured-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.3;
}
.featured-card p {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.6;
  flex-grow: 1;
}
.featured-card-cta {
  margin-top: 20px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
}
.featured-card-cta svg {
  transition: transform 0.15s ease;
}
.featured-card.active:hover .featured-card-cta svg {
  transform: translateX(3px);
}
.coming-soon-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: var(--gray-100);
  color: var(--gray-400);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 16px;
}

/* Calculators Section V2 */
.calculators-section {
  padding: 56px 0 40px;
}
.calc-search-bar {
  margin-top: 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.calc-search-bar .input {
  flex: 1;
  min-width: 260px;
  padding: 12px 16px 12px 40px;
  font-size: 0.875rem;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
  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='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.calc-search-bar .input:focus {
  box-shadow: var(--shadow-sm), var(--shadow-focus);
}
.calc-search-bar select {
  width: auto;
  min-width: 180px;
  padding: 12px 36px 12px 14px;
  font-size: 0.8125rem;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}

/* Compact calculator cards */
.calc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.calc-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  position: relative;
  border-left: 3px solid var(--gray-300);
}
.calc-card:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border);
  text-decoration: none;
}
/* Category-colored left borders */
.calc-card[data-cat="Cardiology"]             { border-left-color: var(--cat-cardiology); }
.calc-card[data-cat="Nephrology"]             { border-left-color: var(--cat-nephrology); }
.calc-card[data-cat="Pulmonology"]            { border-left-color: var(--cat-pulmonology); }
.calc-card[data-cat="Hepatology"]             { border-left-color: var(--cat-hepatology); }
.calc-card[data-cat="General"]                { border-left-color: var(--cat-general); }
.calc-card[data-cat="Electrolytes/Acid–Base"] { border-left-color: var(--cat-electrolytes); }
.calc-card[data-cat="Emergency/Critical Care"]{ border-left-color: var(--cat-emergency); }
.calc-card[data-cat="Infectious Disease"]     { border-left-color: var(--cat-infectious); }
.calc-card[data-cat="Neonatology"]            { border-left-color: var(--cat-neonatology); }
.calc-card[data-cat="Pain/Pharmacology"]      { border-left-color: var(--cat-pain); }
.calc-card[data-cat="Burns/Trauma"]           { border-left-color: var(--cat-burns); }
.calc-card[data-cat="Imaging"]               { border-left-color: var(--cat-imaging); }

.calc-card .calc-cat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin-bottom: 4px;
}
.calc-card .calc-cat::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-400);
  flex-shrink: 0;
}
/* Dot colors by category */
.calc-card[data-cat="Cardiology"] .calc-cat::before              { background: var(--cat-cardiology); }
.calc-card[data-cat="Nephrology"] .calc-cat::before              { background: var(--cat-nephrology); }
.calc-card[data-cat="Pulmonology"] .calc-cat::before             { background: var(--cat-pulmonology); }
.calc-card[data-cat="Hepatology"] .calc-cat::before              { background: var(--cat-hepatology); }
.calc-card[data-cat="General"] .calc-cat::before                 { background: var(--cat-general); }
.calc-card[data-cat="Electrolytes/Acid–Base"] .calc-cat::before  { background: var(--cat-electrolytes); }
.calc-card[data-cat="Emergency/Critical Care"] .calc-cat::before { background: var(--cat-emergency); }
.calc-card[data-cat="Infectious Disease"] .calc-cat::before      { background: var(--cat-infectious); }
.calc-card[data-cat="Neonatology"] .calc-cat::before             { background: var(--cat-neonatology); }
.calc-card[data-cat="Pain/Pharmacology"] .calc-cat::before       { background: var(--cat-pain); }
.calc-card[data-cat="Burns/Trauma"] .calc-cat::before            { background: var(--cat-burns); }
.calc-card[data-cat="Imaging"] .calc-cat::before                 { background: var(--cat-imaging); }

.calc-card h3 {
  font-size: 0.875rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--gray-900);
  line-height: 1.3;
}
.calc-card p {
  font-size: 0.75rem;
  color: var(--gray-500);
  line-height: 1.45;
}

/* Why MDTools V2 */
.why-section {
  padding: 56px 0;
  position: relative;
}
.why-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  background: var(--gray-50);
  z-index: -1;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.why-card {
  padding: 28px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.why-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 16px;
  background: var(--primary-faint);
  color: var(--primary);
}
.why-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}
.why-card p {
  font-size: 0.8125rem;
  color: var(--gray-500);
  line-height: 1.6;
}

/* Back to all tools link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-400);
  margin-bottom: 4px;
  transition: var(--transition-fast);
}
.back-link:hover {
  color: var(--primary);
}
.back-link svg {
  width: 14px;
  height: 14px;
}

/* Updated brand tagline */
.brand-tagline-platform {
  font-size: 0.8125rem;
  color: var(--gray-400);
  font-weight: 500;
}

/* Responsive for new sections */
@media (max-width: 900px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
  .calc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-section-v2 {
    padding: 48px 16px 40px;
  }
  .hero-v2-content h1 {
    font-size: 1.75rem;
  }
  .featured-section,
  .calculators-section,
  .why-section {
    padding: 40px 0 32px;
  }
  .featured-card {
    padding: 24px;
  }
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .why-grid {
    grid-template-columns: 1fr;
  }
  .calc-search-bar {
    flex-direction: column;
  }
  .calc-search-bar .input {
    min-width: unset;
    width: 100%;
  }
  .calc-search-bar select {
    width: 100%;
    min-width: unset;
  }
  .hero-ctas {
    flex-direction: column;
  }
  .hero-ctas .btn {
    text-align: center;
  }
}

/* ===================================================================
   PRINT STYLES
   =================================================================== */
@media print {
  .site-header, .site-nav, .site-footer, .footer-simple, .search-bar, .breadcrumbs, .btn {
    display: none !important;
  }
  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
  .panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
