:root {
  --primary: #0d9488;
  --primary-dark: #0f766e;
  --primary-light: #ccfbf1;
  --primary-subtle: #f0fdfa;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-400: #94a3b8;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --amber-text: #92400e;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--slate-50);
  color: var(--slate-800);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Medical Disclaimer Banner */
.disclaimer-banner {
  background-color: var(--amber-bg);
  border-bottom: 1px solid var(--amber-border);
  color: var(--amber-text);
  font-size: 0.85rem;
  padding: 8px 16px;
  text-align: center;
}
.disclaimer-banner strong {
  font-weight: 700;
}

/* Header & Nav */
header.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--slate-200);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--slate-900);
  text-decoration: none;
}
.brand-logo svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
}
.brand-logo span.tag {
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 9999px;
  margin-left: 4px;
}

nav.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav.main-nav a {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--slate-700);
  text-decoration: none;
  padding: 6px 4px;
  position: relative;
}
nav.main-nav a:hover, nav.main-nav a.active {
  color: var(--primary-dark);
  text-decoration: none;
}
nav.main-nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}
.btn-primary {
  background: var(--primary);
  color: var(--white);
}
.btn-primary:hover {
  background: var(--primary-dark);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-outline {
  border: 1px solid var(--slate-200);
  background: var(--white);
  color: var(--slate-700);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary-dark);
  background: var(--primary-subtle);
  text-decoration: none;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
}

/* Hero Section */
.hero {
  padding: 60px 0 40px;
  background: radial-gradient(circle at top right, var(--primary-subtle), var(--slate-50));
  border-bottom: 1px solid var(--slate-200);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 9999px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 2.75rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--slate-900);
  margin-bottom: 18px;
}

.hero p.lead {
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--slate-600);
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Section styling */
section.page-section {
  padding: 60px 0;
}
.section-header {
  margin-bottom: 36px;
}
.section-header h2 {
  font-size: 2rem;
  font-weight: 750;
  color: var(--slate-900);
  margin-bottom: 8px;
}
.section-header p {
  color: var(--slate-600);
  font-size: 1.05rem;
}

/* Pillar Grid */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.card-icon svg {
  width: 24px;
  height: 24px;
}

.card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 10px;
}

.card p {
  color: var(--slate-600);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

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

/* Interactive Pacing Tool Card */
.tool-box {
  background: linear-gradient(135deg, var(--white), var(--primary-subtle));
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-top: 40px;
}
.tool-box h3 {
  font-size: 1.4rem;
  color: var(--slate-900);
  margin-bottom: 12px;
}

/* Article Layout for Inner Pages */
.article-container {
  max-width: 820px;
  margin: 40px auto;
  padding: 0 20px;
}
.article-header {
  margin-bottom: 36px;
  border-bottom: 1px solid var(--slate-200);
  padding-bottom: 24px;
}
.article-header h1 {
  font-size: 2.5rem;
  line-height: 1.25;
  color: var(--slate-900);
  margin-bottom: 14px;
}
.article-meta {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  color: var(--slate-600);
}
.article-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--slate-800);
}
.article-body h2 {
  font-size: 1.75rem;
  color: var(--slate-900);
  margin: 36px 0 16px;
  border-bottom: 2px solid var(--slate-100);
  padding-bottom: 8px;
}
.article-body h3 {
  font-size: 1.35rem;
  color: var(--slate-900);
  margin: 28px 0 12px;
}
.article-body p {
  margin-bottom: 20px;
}
.article-body ul, .article-body ol {
  margin-bottom: 24px;
  padding-left: 28px;
}
.article-body li {
  margin-bottom: 8px;
}
.callout {
  background: var(--slate-100);
  border-left: 4px solid var(--primary);
  padding: 20px 24px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 28px 0;
}
.callout-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--slate-900);
  margin-bottom: 6px;
}

/* Reference Box */
.reference-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 40px;
  font-size: 0.9rem;
}
.reference-box h4 {
  font-size: 1.05rem;
  color: var(--slate-900);
  margin-bottom: 12px;
}
.reference-box ol {
  padding-left: 20px;
}
.reference-box li {
  margin-bottom: 6px;
  color: var(--slate-600);
}

/* Footer */
footer.site-footer {
  background: var(--slate-900);
  color: var(--slate-400);
  padding: 60px 0 30px;
  margin-top: 80px;
  font-size: 0.9rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 36px;
  margin-bottom: 40px;
}
.footer-col h4 {
  color: var(--white);
  font-size: 1rem;
  margin-bottom: 16px;
}
.footer-col ul {
  list-style: none;
}
.footer-col li {
  margin-bottom: 10px;
}
.footer-col a {
  color: var(--slate-400);
  text-decoration: none;
}
.footer-col a:hover {
  color: var(--white);
}
.footer-bottom {
  border-top: 1px solid var(--slate-800);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

/* Forms & Pacing Tool Inputs */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--slate-800);
}
.form-input, .form-select {
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--white);
  color: var(--slate-800);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.2);
}

/* Medical Data Tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 28px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--slate-200);
  background: var(--white);
}
.med-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
}
.med-table th {
  background: var(--slate-100);
  color: var(--slate-900);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--slate-200);
  white-space: nowrap;
}
.med-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-200);
  color: var(--slate-700);
  vertical-align: top;
}
.med-table tr:last-child td {
  border-bottom: none;
}
.med-table tr:hover td {
  background-color: var(--primary-subtle);
}

/* Breadcrumbs */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--slate-600);
  margin-bottom: 16px;
}
.breadcrumbs a {
  color: var(--slate-600);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.breadcrumbs span.separator {
  color: var(--slate-400);
}
.breadcrumbs span.current {
  color: var(--slate-800);
  font-weight: 600;
}

/* PMID Badges */
.pmid-badge {
  display: inline-flex;
  align-items: center;
  background: var(--slate-100);
  color: var(--primary-dark);
  border: 1px solid var(--slate-200);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  text-decoration: none;
  margin-left: 6px;
  transition: all 0.15s ease;
}
.pmid-badge:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  text-decoration: none;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -40px;
  left: 20px;
  background: var(--slate-900);
  color: var(--white);
  padding: 8px 16px;
  z-index: 1000;
  border-radius: 4px;
  transition: top 0.2s ease;
  font-weight: 600;
}
.skip-link:focus {
  top: 10px;
}

/* Interactive Timer & Tool Components */
.timer-card {
  background: var(--white);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
  text-align: center;
}
.timer-display {
  font-size: 3.5rem;
  font-weight: 800;
  font-family: monospace;
  color: var(--slate-900);
  margin: 16px 0;
  letter-spacing: 2px;
}
.timer-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.timer-badge {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 9999px;
  background: var(--primary-light);
  color: var(--primary-dark);
}

/* Logging Table & Form Elements */
.log-input {
  width: 90px;
  padding: 8px 10px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  text-align: center;
}
.log-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, 0.2);
}

/* Clinical Order & Copy Box */
.clinical-box {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 24px 0;
  position: relative;
}
.clinical-box pre {
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: monospace;
  font-size: 0.88rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-x: auto;
  color: var(--slate-800);
}
.copy-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.copy-btn:hover {
  background: var(--primary-dark);
}

/* Titration Cards */
.titration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}
.titration-step {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-md);
  padding: 20px;
  border-top: 4px solid var(--primary);
  box-shadow: var(--shadow-sm);
}
.titration-step h4 {
  font-size: 1.1rem;
  color: var(--slate-900);
  margin-bottom: 8px;
}
.titration-dose {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--primary-dark);
  margin-bottom: 6px;
}

/* Print Optimization */
@media print {
  header.site-header, footer.site-footer, .disclaimer-banner, .btn, .timer-actions, .skip-link {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt;
  }
  .article-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .clinical-box, .med-table {
    border: 1px solid #000000 !important;
  }
}

/* Responsive */
@media (max-width: 860px) {
  .hero h1 { font-size: 2.2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  nav.main-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 20px;
    border-bottom: 1px solid var(--slate-200);
    box-shadow: var(--shadow-md);
  }
  nav.main-nav.open { display: flex; }
  .menu-toggle { display: block; }
}

@media (max-width: 540px) {
  .hero h1 { font-size: 1.85rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
