/* ─── Variables ─────────────────────────────────── */
:root {
  --primary: #1d4ed8;
  --primary-light: #dbeafe;
  --primary-dark: #1e40af;
  --bg: #f8faff;
  --sidebar-bg: #0f172a;
  --sidebar-width: 220px;
  --sidebar-collapsed: 60px;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
  --header-h: 56px;
  --transition: all .25s ease;
}

/* ─── Reset & base ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }

/* ─── App layout ─────────────────────────────────── */
#app { display: flex; min-height: 100vh; }

/* ─── Sidebar ────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-width); background: var(--sidebar-bg); flex-shrink: 0;
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh;
  z-index: 100; transition: width .3s ease; overflow: hidden;
}
#sidebar.collapsed { width: var(--sidebar-collapsed); }
#sidebar.collapsed .nav-label,
#sidebar.collapsed .logo-text,
#sidebar.collapsed .nav-divider { opacity: 0; width: 0; overflow: hidden; white-space: nowrap; }

.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px; border-bottom: 1px solid rgba(255,255,255,.08); min-height: 60px; }
.sidebar-logo { display: flex; align-items: center; gap: 10px; overflow: hidden; }
.logo-icon { color: #60a5fa; display: flex; flex-shrink: 0; }
.logo-icon svg { width: 22px; height: 22px; }
.logo-title { display: block; color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .06em; white-space: nowrap; }
.logo-sub { display: block; color: rgba(255,255,255,.4); font-size: .6rem; white-space: nowrap; }
#sidebar-toggle { background: none; border: none; color: rgba(255,255,255,.4); cursor: pointer; padding: 4px; border-radius: 4px; transition: var(--transition); flex-shrink: 0; }
#sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.08); }
#sidebar-toggle svg { width: 18px; height: 18px; }

#sidebar-nav { flex: 1; padding: 12px 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px;
  color: rgba(255,255,255,.5); cursor: pointer; transition: var(--transition);
  text-decoration: none; white-space: nowrap; border: none; background: none; width: 100%;
  font-family: inherit; font-size: inherit;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); }
.nav-item.active { background: rgba(37,99,235,.3); color: #93c5fd; }
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { display: flex; flex-direction: column; font-size: .75rem; overflow: hidden; transition: var(--transition); }
.nav-num { font-size: .55rem; color: rgba(255,255,255,.3); display: block; }
.nav-item.active .nav-num { color: rgba(147,197,253,.6); }
.nav-divider { height: 1px; background: rgba(255,255,255,.08); margin: 8px 4px; transition: var(--transition); }
.nav-cv { margin-top: auto; }

/* ─── Main wrapper ────────────────────────────────── */
#main-wrapper { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; transition: margin-left .3s ease; min-width: 0; }
.sidebar-collapsed #main-wrapper { margin-left: var(--sidebar-collapsed); }

/* ─── Header ─────────────────────────────────────── */
#main-header {
  height: var(--header-h); background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
#mobile-menu-btn { display: none; background: none; border: none; cursor: pointer; padding: 6px; border-radius: 6px; color: var(--text-muted); }
#mobile-menu-btn svg { width: 20px; height: 20px; }
#header-breadcrumb { flex: 1; font-size: .85rem; font-weight: 600; color: var(--text-muted); }
.btn-cv {
  display: flex; align-items: center; gap: 8px; background: var(--primary-light);
  color: var(--primary); border: 1px solid #bfdbfe; border-radius: 20px;
  padding: 6px 16px; font-size: .75rem; font-weight: 700; cursor: pointer;
  transition: var(--transition); white-space: nowrap; font-family: inherit;
}
.btn-cv:hover { background: var(--primary); color: #fff; }
.btn-cv svg { width: 16px; height: 16px; }

/* ─── View container ──────────────────────────────── */
#view-container { flex: 1; padding: 28px 32px; max-width: 1100px; width: 100%; }
#view-container.fade-in { animation: fadeIn .3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Section title ───────────────────────────────── */
.section-title {
  font-size: 1.05rem; font-weight: 800; color: var(--text); margin: 28px 0 14px;
  padding-bottom: 8px; border-bottom: 2px solid var(--primary-light);
}

/* ─── View header ─────────────────────────────────── */
.view-header { margin-bottom: 24px; }
.view-title { font-size: 1.6rem; font-weight: 800; color: var(--text); margin-bottom: 8px; line-height: 1.2; }
.view-subtitle { font-size: .88rem; color: var(--text-muted); line-height: 1.6; max-width: 680px; }

/* ─── HOME ───────────────────────────────────────── */
.hero-section {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 60%, #e0e7ff 100%);
  border: 1px solid #bfdbfe; border-radius: 16px; padding: 40px; margin-bottom: 32px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; background: var(--primary);
  color: #fff; border-radius: 20px; padding: 6px 16px; font-size: .72rem; font-weight: 700; margin-bottom: 18px;
}
.hero-badge svg { width: 14px; height: 14px; }
.hero-title { font-size: 2.2rem; font-weight: 800; color: var(--text); line-height: 1.2; margin-bottom: 14px; }
.hero-highlight { color: var(--primary); }
.hero-sub { font-size: .9rem; color: #374151; line-height: 1.7; max-width: 580px; margin-bottom: 28px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card { background: #fff; border-radius: 10px; padding: 16px; text-align: center; box-shadow: var(--shadow); border: 1px solid #dbeafe; }
.stat-val { font-size: 1.8rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: .68rem; color: var(--text-muted); margin-top: 6px; line-height: 1.4; }
.agenda-grid { display: flex; flex-direction: column; gap: 8px; }
.agenda-item {
  display: flex; align-items: center; gap: 16px; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
  cursor: pointer; transition: var(--transition);
}
.agenda-item:hover { border-color: var(--primary); box-shadow: 0 4px 16px rgba(29,78,216,.1); transform: translateX(4px); }
.agenda-num {
  background: var(--primary); color: #fff; width: 32px; height: 32px; border-radius: 50%;
  font-size: .72rem; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.agenda-content { flex: 1; }
.agenda-title { font-size: .83rem; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.agenda-title svg { width: 14px; height: 14px; color: var(--primary); }
.agenda-desc { font-size: .7rem; color: var(--text-muted); }
.agenda-arrow { color: var(--primary); flex-shrink: 0; }
.agenda-arrow svg { width: 18px; height: 18px; }

/* ─── MECHANISM ──────────────────────────────────── */
.mechanism-diagram {
  display: grid; grid-template-columns: 1fr 40px 1fr 40px 1fr;
  gap: 10px; align-items: start; margin-bottom: 24px;
}
.mech-pathway { background: #fff; border: 2px solid var(--border); border-radius: 12px; padding: 20px; }
.mech-mor { border-color: #3b82f6; }
.mech-nri { border-color: #8b5cf6; }
.mech-result { border-color: #22c55e; background: #f0fdf4; }
.mech-icon {
  width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
  justify-content: center; margin-bottom: 12px; background: var(--primary-light); color: var(--primary);
}
.mech-icon svg { width: 20px; height: 20px; }
.mech-pathway h3 { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.mech-pathway p { font-size: .74rem; color: var(--text-muted); margin-bottom: 10px; line-height: 1.5; }
.mech-pathway ul { list-style: disc; padding-left: 16px; }
.mech-pathway ul li { font-size: .71rem; color: #374151; margin-bottom: 4px; line-height: 1.5; }
.mech-badge { display: inline-block; margin-top: 10px; background: #dbeafe; color: var(--primary-dark); border-radius: 6px; padding: 4px 10px; font-size: .64rem; font-weight: 700; }
.mech-badge-green { background: #dcfce7; color: #166534; }
.mech-plus, .mech-equals {
  display: flex; align-items: center; justify-content: center; color: var(--primary);
  padding-top: 50px;
}
.mech-plus svg, .mech-equals svg { width: 26px; height: 26px; }

/* ─── TABLE ──────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: 10px; border: 1px solid var(--border); margin-bottom: 20px; }
.data-table { width: 100%; border-collapse: collapse; font-size: .78rem; }
.data-table th { background: var(--primary); color: #fff; padding: 10px 14px; text-align: left; font-size: .72rem; font-weight: 700; }
.data-table th:first-child { border-radius: 10px 0 0 0; }
.data-table th:last-child { border-radius: 0 10px 0 0; }
.data-table td { padding: 9px 14px; border-bottom: 1px solid var(--border); color: #374151; vertical-align: middle; }
.data-table tr:nth-child(even) td { background: #f8faff; }
.data-table tr:last-child td { border-bottom: none; }

/* ─── BADGES ─────────────────────────────────────── */
.badge-blue   { background: var(--primary-light); color: var(--primary); border-radius: 4px; padding: 2px 8px; font-size: .7rem; font-weight: 700; display: inline-block; }
.badge-green  { background: #dcfce7; color: #166534; border-radius: 4px; padding: 2px 8px; font-size: .7rem; font-weight: 700; display: inline-block; }
.badge-orange { background: #fff7ed; color: #9a3412; border-radius: 4px; padding: 2px 8px; font-size: .7rem; font-weight: 700; display: inline-block; }
.badge-red    { background: #fef2f2; color: #991b1b; border-radius: 4px; padding: 2px 8px; font-size: .7rem; font-weight: 700; display: inline-block; }

/* ─── HIGHLIGHT BOXES ────────────────────────────── */
.highlight-box { display: flex; gap: 14px; border-radius: 10px; padding: 16px 20px; margin: 14px 0; }
.highlight-box svg { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.highlight-box strong { display: block; font-size: .82rem; font-weight: 700; margin-bottom: 4px; }
.highlight-box div { font-size: .78rem; line-height: 1.6; }
.highlight-blue { background: #eff6ff; border: 1px solid #bfdbfe; color: var(--primary-dark); }
.highlight-blue svg { color: var(--primary); }

/* ─── EVIDENCE ───────────────────────────────────── */
.studies-grid { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.study-card-full { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.study-card-highlight { border-color: var(--primary); background: #f0f7ff; }
.study-badge { display: inline-block; background: var(--primary-light); color: var(--primary); border-radius: 6px; padding: 3px 10px; font-size: .68rem; font-weight: 700; margin-bottom: 8px; }
.study-badge-teal   { background: #ccfbf1; color: #0f766e; }
.study-badge-green  { background: #dcfce7; color: #166534; }
.study-badge-orange { background: #fff7ed; color: #9a3412; }
.study-card-full h3 { font-size: .88rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.study-card-full > p { font-size: .76rem; color: var(--text-muted); margin-bottom: 12px; line-height: 1.5; }
.study-results { display: flex; flex-wrap: wrap; gap: 10px; }
.result-item { background: #f8faff; border-radius: 8px; padding: 10px 14px; border: 1px solid var(--border); }
.result-val { font-size: 1.2rem; font-weight: 800; color: var(--primary); display: block; }
.result-label { font-size: .66rem; color: var(--text-muted); margin-top: 2px; }
.result-big .result-val { font-size: 1.5rem; }
.result-green { color: #166534 !important; }
.result-red   { color: #991b1b !important; }
.hta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.hta-card { border-radius: 10px; padding: 14px 16px; font-size: .76rem; line-height: 1.5; }
.hta-card strong { display: block; font-size: .8rem; margin-bottom: 5px; }
.hta-no         { background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.hta-restricted { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; }
.hta-eval       { background: #eff6ff; border: 1px solid #bfdbfe; color: var(--primary-dark); }

/* ─── CHARTS ─────────────────────────────────────── */
.chart-container {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; margin-bottom: 20px;
}
.chart-container canvas { max-height: 320px !important; }

/* ─── ASSESSMENT / DN4 ───────────────────────────── */
.cards-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.info-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 20px; text-align: center; }
.info-icon { color: var(--primary); margin-bottom: 10px; }
.info-icon svg { width: 24px; height: 24px; }
.info-val { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
.info-label { font-size: .7rem; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }

.classification-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 24px; }
.classif-card { background: #fff; border-radius: 12px; padding: 18px; border-top: 4px solid; box-shadow: var(--shadow); }
.classif-blue   { border-color: #3b82f6; }
.classif-orange { border-color: #f59e0b; }
.classif-purple { border-color: #8b5cf6; }
.classif-card h3 { font-size: .85rem; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.classif-card h3 svg { width: 16px; height: 16px; }
.classif-card p { font-size: .74rem; color: #374151; line-height: 1.5; margin-bottom: 10px; }
.classif-char { font-size: .69rem; color: var(--text-muted); font-style: italic; background: #f8faff; border-radius: 6px; padding: 8px 10px; line-height: 1.5; }

.dn4-container { background: #fff; border: 2px solid var(--primary-light); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.dn4-header { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.dn4-score-display { display: flex; align-items: baseline; gap: 6px; }
.dn4-score { font-size: 3rem; font-weight: 800; color: var(--primary); line-height: 1; transition: var(--transition); }
.dn4-score-label { font-size: .78rem; color: var(--text-muted); }
.dn4-interpretation { flex: 1; font-size: .8rem; line-height: 1.5; }
.dn4-result-neutral  { color: var(--text-muted); }
.dn4-result-positive { color: #9a3412; font-weight: 700; display: flex; align-items: flex-start; gap: 8px; }
.dn4-result-positive svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }
.dn4-result-negative { color: #166534; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.dn4-result-negative svg { width: 18px; height: 18px; }
.dn4-section-title {
  font-size: .74rem; font-weight: 700; color: var(--primary); text-transform: uppercase;
  letter-spacing: .06em; margin: 14px 0 8px; display: flex; align-items: center; gap: 8px;
}
.dn4-section-title svg { width: 15px; height: 15px; }
.dn4-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 8px;
  cursor: pointer; transition: var(--transition); margin-bottom: 3px; border: 1px solid transparent;
}
.dn4-item:hover { background: #f8faff; border-color: var(--border); }
.dn4-check { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.dn4-item-text { flex: 1; font-size: .78rem; color: #374151; }
.dn4-item-badge { background: #f1f5f9; color: var(--text-muted); border-radius: 4px; padding: 2px 8px; font-size: .63rem; white-space: nowrap; }
.dn4-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }
.dn4-validation { font-size: .7rem; color: var(--text-muted); }
.btn-reset {
  display: flex; align-items: center; gap: 6px; background: #f1f5f9;
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 14px;
  font-size: .74rem; cursor: pointer; color: var(--text-muted); transition: var(--transition);
  font-family: inherit;
}
.btn-reset:hover { background: var(--border); color: var(--text); }
.btn-reset svg { width: 14px; height: 14px; }

/* ─── FLOWCHART ──────────────────────────────────── */
.mermaid-container {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin-bottom: 24px; overflow-x: auto; text-align: center;
}
.cards-grid-3.criteria { gap: 12px; }
.criteria-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
.criteria-card svg { width: 20px; height: 20px; color: var(--primary); margin-bottom: 8px; display: block; }
.criteria-card h4 { font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.criteria-card p { font-size: .71rem; color: var(--text-muted); line-height: 1.5; }

.oms-ladder { display: flex; flex-direction: column; margin-bottom: 20px; }
.ladder-step { display: flex; gap: 16px; padding: 14px 18px; background: #f8faff; border: 1px solid var(--border); border-bottom: none; align-items: flex-start; }
.ladder-step:first-child { border-radius: 10px 10px 0 0; }
.ladder-step:last-child  { border-bottom: 1px solid var(--border); border-radius: 0 0 10px 10px; }
.ladder-highlight { background: #eff6ff; border-color: var(--primary); }
.ladder-num { background: var(--primary); color: #fff; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .72rem; font-weight: 800; flex-shrink: 0; margin-top: 2px; }
.ladder-step h4 { font-size: .82rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.ladder-step p { font-size: .72rem; color: var(--text-muted); line-height: 1.5; }
.ladder-tap { color: var(--primary); font-weight: 700; }

.flow-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; z-index: 200; padding: 16px; }
.flow-modal-box { background: #fff; border-radius: 14px; padding: 28px; max-width: 480px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.flow-modal-box h3 { font-size: 1rem; font-weight: 700; margin-bottom: 12px; color: var(--primary); }
.flow-modal-box p { font-size: .8rem; line-height: 1.7; color: #374151; margin-bottom: 18px; }
.flow-modal-box button { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 8px 20px; font-size: .8rem; cursor: pointer; font-family: inherit; }
.flow-modal-box button:hover { background: var(--primary-dark); }

/* ─── CASES ──────────────────────────────────────── */
.case-card-full { background: #fff; border-radius: 14px; padding: 24px; margin-bottom: 20px; border: 1px solid var(--border); border-top: 4px solid; box-shadow: var(--shadow); }
.case-blue   { border-top-color: #3b82f6; }
.case-green  { border-top-color: #22c55e; }
.case-orange { border-top-color: #f59e0b; }
.case-purple { border-top-color: #8b5cf6; }
.case-header { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.case-badge { border-radius: 6px; padding: 3px 10px; font-size: .68rem; font-weight: 700; }
.case-badge-blue   { background: #dbeafe; color: var(--primary); }
.case-badge-green  { background: #dcfce7; color: #166534; }
.case-badge-orange { background: #fff7ed; color: #9a3412; }
.case-badge-purple { background: #ede9fe; color: #5b21b6; }
.case-header h3 { font-size: .92rem; font-weight: 700; color: var(--text); }
.case-history { display: flex; gap: 12px; background: #f8faff; border-radius: 8px; padding: 14px; margin-bottom: 14px; font-size: .78rem; color: #374151; line-height: 1.7; border: 1px solid var(--border); }
.case-history svg { width: 17px; height: 17px; color: var(--text-muted); flex-shrink: 0; margin-top: 2px; }
.case-question { font-size: .85rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.case-options { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.case-option {
  display: flex; align-items: center; gap: 12px; background: #f8faff;
  border: 2px solid var(--border); border-radius: 8px; padding: 11px 15px;
  cursor: pointer; transition: var(--transition);
}
.case-option:hover { border-color: var(--primary); background: #eff6ff; }
.case-option input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; flex-shrink: 0; }
.case-option-text { flex: 1; font-size: .78rem; color: #374151; }
.option-correct  { border-color: #22c55e !important; background: #f0fdf4 !important; }
.option-incorrect{ border-color: #ef4444 !important; background: #fef2f2 !important; }
.case-feedback { border-radius: 10px; padding: 16px; margin-top: 10px; font-size: .78rem; line-height: 1.7; }
.feedback-correct  { background: #f0fdf4; border: 1px solid #bbf7d0; color: #14532d; }
.feedback-incorrect{ background: #fef2f2; border: 1px solid #fecaca; color: #7f1d1d; }
.feedback-badge { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; font-size: .8rem; }
.feedback-badge svg { width: 18px; height: 18px; }
.badge-correct   { color: #166534; }
.badge-incorrect { color: #991b1b; }
.btn-reveal {
  display: flex; align-items: center; gap: 8px; background: var(--primary); color: #fff;
  border: none; border-radius: 8px; padding: 9px 18px; font-size: .78rem; font-weight: 700;
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.btn-reveal:hover { background: var(--primary-dark); }
.btn-reveal svg { width: 16px; height: 16px; }
.quiz-score-bar {
  display: flex; align-items: center; gap: 8px; background: var(--primary-light);
  border: 1px solid #bfdbfe; border-radius: 10px; padding: 10px 16px; margin-bottom: 20px;
  font-size: .82rem; font-weight: 700; color: var(--primary-dark);
}
.quiz-score-bar svg { width: 18px; height: 18px; }

/* ─── DOSING ─────────────────────────────────────── */
.titration-timeline { display: flex; flex-direction: column; margin-bottom: 16px; position: relative; padding-left: 36px; }
.titration-timeline::before { content:''; position:absolute; left:7px; top:10px; bottom:10px; width:2px; background:var(--border); }
.titration-step { display: flex; gap: 16px; padding: 10px 0; align-items: flex-start; position: relative; }
.titration-dot { width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; position: absolute; left: -29px; top: 12px; border: 3px solid #fff; box-shadow: 0 0 0 2px currentColor; }
.titration-content { flex: 1; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; }
.titration-sem { font-size: .63rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.titration-dose { font-size: .92rem; font-weight: 800; color: var(--text); }
.titration-total { font-size: .75rem; color: var(--primary); font-weight: 600; margin-bottom: 2px; }
.titration-note { font-size: .7rem; color: var(--text-muted); }

.cards-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.adjustment-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 18px; }
.adjustment-card h4 { font-size: .84rem; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.adjustment-card h4 svg { width: 16px; height: 16px; color: var(--primary); }

.contraindications { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.contra-item { display: flex; align-items: center; gap: 10px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 10px 14px; font-size: .78rem; color: #7f1d1d; }
.contra-item svg { width: 16px; height: 16px; color: #ef4444; flex-shrink: 0; }

/* ─── DOCTOR PROFILE ─────────────────────────────── */
.doctor-hero {
  background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 50%, #2563eb 100%);
  border-radius: 16px; padding: 32px; display: flex; gap: 24px;
  align-items: center; margin-bottom: 28px; color: #fff;
}
.doctor-initials {
  width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.15);
  display: flex; align-items: center; justify-content: center; font-size: 1.8rem;
  font-weight: 800; flex-shrink: 0; border: 3px solid rgba(255,255,255,.3); letter-spacing: .05em;
}
.doctor-hero h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; }
.doctor-title { font-size: .82rem; opacity: .85; margin-bottom: 14px; }
.doctor-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.dbadge {
  display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 5px 12px; font-size: .72rem;
}
.dbadge svg { width: 14px; height: 14px; }

.cv-flow { display: flex; align-items: flex-start; gap: 8px; flex-wrap: nowrap; margin-bottom: 24px; overflow-x: auto; padding-bottom: 4px; }
.cv-node {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; min-width: 140px; flex: 1; border-top: 3px solid var(--primary);
  box-shadow: var(--shadow);
}
.cv-node-1 { border-top-color: #3b82f6; }
.cv-node-2 { border-top-color: #6366f1; }
.cv-node-3 { border-top-color: #8b5cf6; }
.cv-node-4 { border-top-color: #a855f7; }
.cv-node-5 { border-top-color: #22c55e; }
.cv-node-career-1 { border-top-color: #3b82f6; }
.cv-node-career-2 { border-top-color: #8b5cf6; }
.cv-node-career-3 { border-top-color: #22c55e; }
.cv-year { font-size: .64rem; color: var(--text-muted); margin-bottom: 4px; }
.cv-title { font-size: .78rem; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.cv-inst { font-size: .7rem; color: var(--text-muted); }
.cv-arrow { display: flex; align-items: center; padding-top: 18px; color: var(--primary); flex-shrink: 0; }
.cv-arrow svg { width: 18px; height: 18px; }

.aced-badge {
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(135deg, #fef9c3, #fef3c7);
  border: 2px solid #fbbf24; border-radius: 14px; padding: 20px; margin-top: 8px;
}
.aced-icon { color: #d97706; }
.aced-icon svg { width: 36px; height: 36px; }
.aced-title { font-size: .95rem; font-weight: 800; color: #92400e; }
.aced-sub { font-size: .74rem; color: #a16207; margin-top: 4px; }

/* ─── REFERENCES SYSTEM ─────────────────────────── */
.ref-sup {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--primary); color: #fff; border-radius: 3px;
  font-size: .58rem; font-weight: 700; padding: 1px 4px; margin: 0 1px;
  cursor: pointer; vertical-align: super; line-height: 1;
  transition: var(--transition);
}
.ref-sup:hover { background: var(--primary-dark); transform: scale(1.1); }

.refs-section { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.refs-toggle {
  display: flex; align-items: center; gap: 8px; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 14px; font-size: .74rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: var(--transition); font-family: inherit;
}
.refs-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.refs-toggle svg { width: 15px; height: 15px; }
.refs-list { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.ref-item {
  display: flex; gap: 10px; padding: 10px 12px; background: #f8faff;
  border: 1px solid var(--border); border-radius: 8px; align-items: flex-start;
}
.ref-num {
  background: var(--primary); color: #fff; border-radius: 4px;
  font-size: .64rem; font-weight: 700; padding: 2px 6px; flex-shrink: 0; margin-top: 1px;
}
.ref-body { flex: 1; font-size: .72rem; color: #374151; line-height: 1.5; }
.ref-if {
  background: #dcfce7; color: #166534; border-radius: 4px;
  font-size: .6rem; font-weight: 700; padding: 2px 6px; white-space: nowrap; flex-shrink: 0;
}
.ref-link {
  display: inline-flex; align-items: center; gap: 4px; color: var(--primary);
  font-size: .7rem; font-weight: 600; text-decoration: none; margin-top: 4px;
}
.ref-link:hover { text-decoration: underline; }
.btn-ref-link {
  display: inline-flex; align-items: center; gap: 6px; background: var(--primary-light);
  color: var(--primary); border: 1px solid #bfdbfe; border-radius: 6px;
  padding: 5px 12px; font-size: .72rem; font-weight: 600; cursor: pointer;
  transition: var(--transition); font-family: inherit; text-decoration: none;
}
.btn-ref-link:hover { background: var(--primary); color: #fff; }

/* ─── REFERENCE MODAL ────────────────────────────── */
.ref-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; z-index: 300; padding: 16px; }
.ref-modal-box {
  background: #fff; border-radius: 14px; padding: 28px; max-width: 500px; width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
}
.ref-modal-num {
  display: inline-block; background: var(--primary); color: #fff; border-radius: 6px;
  font-size: .72rem; font-weight: 700; padding: 3px 10px; margin-bottom: 12px;
}
.ref-modal-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 8px; line-height: 1.4; }
.ref-modal-authors { font-size: .78rem; color: var(--text-muted); margin-bottom: 6px; }
.ref-modal-journal { font-size: .78rem; color: var(--primary-dark); font-weight: 600; margin-bottom: 4px; }
.ref-modal-year { font-size: .74rem; color: var(--text-muted); margin-bottom: 14px; }
.ref-modal-if {
  display: inline-block; background: #dcfce7; color: #166534; border-radius: 6px;
  font-size: .72rem; font-weight: 700; padding: 3px 10px; margin-bottom: 16px;
}
.ref-modal-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.ref-modal-close {
  background: #f1f5f9; color: var(--text-muted); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 20px; font-size: .78rem; cursor: pointer;
  transition: var(--transition); font-family: inherit;
}
.ref-modal-close:hover { background: var(--border); color: var(--text); }

/* ─── EVIDENCE FILTER BAR ────────────────────────── */
.evidence-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; align-items: center;
}
.evidence-filter-bar span { font-size: .74rem; color: var(--text-muted); font-weight: 600; margin-right: 4px; }
.ef-badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 20px;
  padding: 4px 12px; font-size: .68rem; font-weight: 700; border: 1px solid transparent;
}
.ef-rct      { background: #dbeafe; color: #1e40af; border-color: #bfdbfe; }
.ef-realworld{ background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.ef-meta     { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }
.ef-obs      { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.ef-safety   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

/* ─── STUDY CARD NEW ─────────────────────────────── */
.study-card-new {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; border-left: 4px solid var(--primary);
}
.study-card-new.new-2025 { border-left-color: #8b5cf6; background: #fdf4ff; }
.study-card-new.new-safety { border-left-color: #ef4444; background: #fff5f5; }
.study-card-header {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px;
}
.study-card-header h3 { font-size: .88rem; font-weight: 700; color: var(--text); flex: 1; min-width: 180px; }
.study-ref { font-size: .7rem; color: var(--text-muted); margin-bottom: 10px; font-style: italic; }
.study-year-badge {
  background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd;
  border-radius: 6px; padding: 2px 8px; font-size: .65rem; font-weight: 700; white-space: nowrap;
}

/* ─── CHART LABELS ───────────────────────────────── */
.chart-label { font-size: .74rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.chart-source { font-size: .65rem; color: var(--text-muted); margin-top: 6px; font-style: italic; }

/* ─── HIGHLIGHT NEW / WARNING ────────────────────── */
.highlight-new {
  background: #fdf4ff; border: 1px solid #ddd6fe; border-radius: 10px;
  padding: 14px 18px; margin: 14px 0; font-size: .78rem; line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
}
.highlight-new svg { width: 18px; height: 18px; color: #8b5cf6; flex-shrink: 0; margin-top: 2px; }
.highlight-new strong { color: #5b21b6; display: block; margin-bottom: 4px; }
.highlight-warning {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px;
  padding: 14px 18px; margin: 14px 0; font-size: .78rem; line-height: 1.6;
  display: flex; gap: 12px; align-items: flex-start;
}
.highlight-warning svg { width: 18px; height: 18px; color: #d97706; flex-shrink: 0; margin-top: 2px; }
.highlight-warning strong { color: #92400e; display: block; margin-bottom: 4px; }

/* ─── EVIDENCE SUMMARY BAR (HOME) ────────────────── */
.evidence-summary-bar {
  display: flex; flex-wrap: wrap; gap: 0; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  margin-bottom: 20px; margin-top: 16px;
}
.esb-item {
  flex: 1; min-width: 120px; padding: 14px 18px; text-align: center;
  background: linear-gradient(135deg, #f0f7ff, #e8f0fe);
}
.esb-item:nth-child(even) { background: linear-gradient(135deg, #f9f0ff, #eee8fe); }
.esb-val { font-size: 1.4rem; font-weight: 800; color: var(--primary); display: block; line-height: 1; }
.esb-label { font-size: .65rem; color: var(--text-muted); margin-top: 5px; line-height: 1.4; }
.esb-divider { width: 1px; background: var(--border); }

/* ─── HERO EYEBROW & NEW BADGES ─────────────────── */
.hero-eyebrow {
  font-size: .72rem; font-weight: 700; color: var(--primary); text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 8px; display: block;
}
.hero-badge-new {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff;
  border-radius: 20px; padding: 5px 14px; font-size: .7rem; font-weight: 700; margin-bottom: 14px;
}
.hero-badge-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light); color: var(--primary);
  border: 1px solid #bfdbfe; border-radius: 20px; padding: 5px 14px;
  font-size: .7rem; font-weight: 700; margin-bottom: 14px; margin-left: 8px;
}

/* ─── SCROLL TO TOP ──────────────────────────────── */
#scroll-top {
  position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px;
  background: var(--primary); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(29,78,216,.35); opacity: 0; pointer-events: none;
  transition: var(--transition); z-index: 90;
}
#scroll-top.visible { opacity: 1; pointer-events: auto; }
#scroll-top svg { width: 20px; height: 20px; }

/* ─── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); width: var(--sidebar-width) !important; transition: transform .3s ease, width .3s ease; }
  #sidebar.mobile-open { transform: translateX(0); }
  #main-wrapper { margin-left: 0 !important; }
  #mobile-menu-btn { display: flex; }
  #sidebar-toggle { display: none; }
  #view-container { padding: 16px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 1.5rem; }
  .hero-section { padding: 20px; }
  .mechanism-diagram { grid-template-columns: 1fr; }
  .mech-plus, .mech-equals { padding-top: 0; }
  .classification-grid, .cards-grid-3, .hta-grid, .cards-grid-2 { grid-template-columns: 1fr; }
  .cv-flow { flex-wrap: wrap; }
  .cv-arrow { transform: rotate(90deg); }
  .btn-cv span { display: none; }
  .doctor-hero { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  #view-container { padding: 12px; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .view-title { font-size: 1.3rem; }
}
