:root {
  --primary: #0ea5e9;
  --primary-dark: #0369a1;
  --primary-deep: #0c2d4a;
  --primary-light: #38bdf8;
  --accent: #f59e0b;
  --accent-bg: #fffbeb;
  --bg: #eef2f7;
  --bg-card: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-light: #94a3b8;
  --text-tertiary: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --success-bg: #ecfdf5;
  --warning-bg: #fffbeb;
  --danger-bg: #fef2f2;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.09), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12), 0 4px 8px rgba(0,0,0,0.06);
  --shadow-glow: 0 0 20px rgba(14,165,233,0.25);
  --header-gradient: linear-gradient(135deg, #020617 0%, #0c2d4a 45%, #0369a1 100%);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Animations ─────────────────────────────────────── */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes pulse-dot {
  0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 1; }
  50%       { transform: translateX(-50%) scaleX(1.4); opacity: 0.7; }
}
@keyframes breathe {
  0%, 100% { opacity: 0.9; }
  50%       { opacity: 0.6; }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Header ─────────────────────────────────────────── */
.header {
  background: var(--header-gradient);
  color: white;
  padding: 16px 18px 18px;
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(2,6,23,0.4);
  overflow: hidden;
}

/* Subtle grid pattern in header */
.header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(14,165,233,0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(14,165,233,0.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* Glow orb in header */
.header::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(14,165,233,0.3) 0%, transparent 70%);
  pointer-events: none;
  animation: breathe 4s ease-in-out infinite;
}

.header-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header h1 {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  position: relative;
  z-index: 1;
  background: linear-gradient(90deg, #ffffff 0%, #7dd3fc 40%, #ffffff 70%, #bae6fd 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 4s linear infinite;
}

.header .subtitle {
  font-size: 11px;
  opacity: 0.55;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.back-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 7px 11px;
  border-radius: 10px;
  display: none;
  transition: background 0.2s;
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.back-btn:active { background: rgba(255,255,255,0.2); }
.back-btn.visible { display: flex; align-items: center; }

/* ── Bottom Nav ─────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0,0,0,0.07);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.07);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--text-tertiary);
  cursor: pointer;
  border: none;
  background: none;
  transition: color 0.2s, transform 0.15s;
  position: relative;
}
.nav-item:active { transform: scale(0.88); }
.nav-item.active { color: var(--primary); }
.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  border-radius: 0 0 4px 4px;
  animation: pulse-dot 2.5s ease-in-out infinite;
}
.nav-item svg { width: 20px; height: 20px; margin-bottom: 3px; }

/* ── Pages ──────────────────────────────────────────── */
.page { display: none; padding: 20px 16px; }
.page.active { display: block; animation: fadeSlideIn 0.28s cubic-bezier(0.22,1,0.36,1); }

/* Staggered card entrance */
.page.active .card:nth-child(1) { animation: cardEnter 0.3s ease-out 0.04s both; }
.page.active .card:nth-child(2) { animation: cardEnter 0.3s ease-out 0.08s both; }
.page.active .card:nth-child(3) { animation: cardEnter 0.3s ease-out 0.12s both; }
.page.active .card:nth-child(4) { animation: cardEnter 0.3s ease-out 0.16s both; }
.page.active .card:nth-child(5) { animation: cardEnter 0.3s ease-out 0.20s both; }
.page.active .card:nth-child(6) { animation: cardEnter 0.3s ease-out 0.24s both; }
.page.active .card:nth-child(7) { animation: cardEnter 0.3s ease-out 0.28s both; }
.page.active .card:nth-child(8) { animation: cardEnter 0.3s ease-out 0.32s both; }

/* ── Section header ─────────────────────────────────── */
.section-header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-tertiary);
  margin-bottom: 14px;
}

/* ── Cards ──────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s cubic-bezier(0.22,1,0.36,1), box-shadow 0.2s;
  border: 1px solid rgba(0,0,0,0.04);
  position: relative;
  overflow: hidden;
}
.card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary-light), var(--primary));
  opacity: 0;
  transition: opacity 0.2s;
  border-radius: 3px 0 0 3px;
}
.card:active { transform: scale(0.97); box-shadow: var(--shadow); }
.card:active::after { opacity: 1; }
.card h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.2px; padding-right: 48px; }
.card p { font-size: 13px; color: var(--text-secondary); line-height: 1.45; padding-right: 48px; }
.card .formula {
  font-family: 'Georgia', serif;
  font-style: italic;
  color: var(--primary-dark);
  margin-top: 8px;
  font-size: 13px;
  background: linear-gradient(90deg, #f0f9ff, #e0f2fe);
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(14,165,233,0.12);
}
.card .card-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.card .card-arrow {
  position: absolute;
  right: 16px;
  bottom: 16px;
  color: var(--text-tertiary);
  font-size: 15px;
}

/* ── Calculator ─────────────────────────────────────── */
.calc-container { max-width: 500px; margin: 0 auto; }
.calc-header { margin-bottom: 24px; }
.calc-header h2 { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 4px; }
.calc-header p { color: var(--text-secondary); font-size: 14px; }

.input-group { margin-bottom: 16px; }
.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-group .hint {
  font-size: 11px;
  color: var(--text-tertiary);
  font-weight: 400;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
}
.input-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-card);
  color: var(--text);
}
.input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}
.input-group input::placeholder { color: var(--text-tertiary); font-weight: 400; font-size: 15px; }

.result-box {
  border-radius: var(--radius);
  padding: 24px 20px;
  text-align: center;
  margin-top: 20px;
  animation: countUp 0.35s cubic-bezier(0.22,1,0.36,1);
  border: 1px solid transparent;
}
.result-box .value { font-size: 42px; font-weight: 900; letter-spacing: -2px; }
.result-box .unit { font-size: 13px; opacity: 0.65; margin-top: 2px; font-weight: 600; letter-spacing: 0.3px; }
.result-box .interpretation {
  font-size: 14px;
  margin-top: 14px;
  font-weight: 500;
  line-height: 1.55;
  opacity: 0.9;
}
.result-normal  { background: var(--success-bg); color: var(--success);  border-color: rgba(5,150,105,0.15); }
.result-warning { background: var(--warning-bg); color: var(--warning); border-color: rgba(217,119,6,0.15); }
.result-danger  { background: var(--danger-bg);  color: var(--danger);  border-color: rgba(220,38,38,0.15); }
.result-neutral { background: var(--border-light); color: var(--text); border-color: var(--border); }

.calc-btn {
  width: 100%;
  padding: 16px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  transition: transform 0.12s, box-shadow 0.2s;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 12px rgba(14,165,233,0.35);
}
.calc-btn:active { transform: scale(0.98); box-shadow: 0 2px 6px rgba(14,165,233,0.25); }
.calc-btn-secondary {
  background: var(--border-light);
  color: var(--text);
  box-shadow: none;
  border: 1.5px solid var(--border);
}
.calc-btn-secondary:active { background: var(--border); }

/* ── Protocol Wizard ─────────────────────────────────── */
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-progress { display: flex; gap: 4px; margin-bottom: 24px; }
.wizard-progress .dot {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: var(--border);
  transition: background 0.3s;
}
.wizard-progress .dot.done    { background: var(--primary); }
.wizard-progress .dot.current { background: var(--primary-light); }

.wizard-header { margin-bottom: 20px; }
.wizard-header .step-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--primary);
  margin-bottom: 4px;
}
.wizard-header h3 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }

.option-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color 0.2s, background 0.2s, transform 0.12s;
}
.option-btn:active { transform: scale(0.98); }
.option-btn:hover  { border-color: var(--primary-light); }
.option-btn.selected { border-color: var(--primary); background: #f0f9ff; color: var(--primary-dark); font-weight: 600; }

.alert-box {
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
  line-height: 1.65;
  border-left: 4px solid;
}
.alert-info    { background: #eff6ff; color: #1e40af; border-left-color: #3b82f6; }
.alert-warning { background: var(--warning-bg); color: #92400e; border-left-color: var(--warning); }
.alert-danger  { background: var(--danger-bg); color: #991b1b; border-left-color: var(--danger); }
.alert-success { background: var(--success-bg); color: #065f46; border-left-color: var(--success); }

/* ── Reference ──────────────────────────────────────── */
.section-title {
  font-size: 20px;
  font-weight: 800;
  margin: 4px 0 16px;
  color: var(--text);
  letter-spacing: -0.4px;
}
.ref-content { font-size: 14px; line-height: 1.8; }
.ref-content h4 {
  margin: 22px 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.1px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border-light);
}
.ref-content h5 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-dark);
  margin: 12px 0 6px;
}
.ref-content ul, .ref-content ol { padding-left: 20px; margin-bottom: 14px; }
.ref-content li { margin-bottom: 8px; }
.ref-content .formula-block {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Georgia', serif;
  font-style: italic;
  text-align: center;
  margin: 16px 0;
  font-size: 16px;
  color: var(--primary-dark);
  border: 1px solid rgba(14,165,233,0.15);
  letter-spacing: 0.3px;
}

.search-input {
  width: 100%;
  padding: 13px 14px 13px 44px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: var(--bg-card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") 14px center no-repeat;
}
.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}

/* ── Flashcards ─────────────────────────────────────── */
.flashcard {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 36px 28px;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.22,1,0.36,1);
  user-select: none;
  border: 1px solid rgba(0,0,0,0.04);
}
.flashcard:active { transform: scale(0.97) rotate(-0.5deg); }
.flashcard .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--primary);
  margin-bottom: 20px;
  font-weight: 700;
}
.flashcard .content { font-size: 17px; line-height: 1.65; color: var(--text); }
.flashcard-nav { display: flex; gap: 10px; margin-top: 20px; justify-content: center; }
.flashcard-nav button {
  padding: 12px 20px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.12s;
}
.flashcard-nav button:active { transform: scale(0.94); background: var(--border-light); }
.flashcard-nav button:disabled { opacity: 0.35; cursor: default; }
.flashcard-nav button.flip-btn {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(14,165,233,0.3);
}
.flashcard-counter {
  text-align: center;
  color: var(--text-tertiary);
  font-size: 13px;
  margin-top: 14px;
  font-weight: 600;
}

/* ── Quiz ───────────────────────────────────────────── */
.quiz-question {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  margin: 16px 0 20px;
  letter-spacing: -0.2px;
}
.quiz-option {
  display: block;
  width: 100%;
  padding: 15px 18px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: left;
  font-size: 15px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: border-color 0.2s, transform 0.12s, background 0.2s;
  font-weight: 450;
}
.quiz-option:active { transform: scale(0.98); }
.quiz-option.correct  { border-color: var(--success); background: var(--success-bg); }
.quiz-option.incorrect { border-color: var(--danger); background: var(--danger-bg); }
.quiz-option:disabled { cursor: default; }
.quiz-score {
  text-align: center;
  padding: 40px 20px;
  animation: scaleIn 0.4s cubic-bezier(0.22,1,0.36,1);
}
.quiz-score .big {
  font-size: 60px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -3px;
}
.quiz-score .score-label  { font-size: 16px; color: var(--text-secondary); margin: 8px 0; }
.quiz-score .score-message { color: var(--text-secondary); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }

/* ── Sex selector ───────────────────────────────────── */
.sex-selector { display: flex; gap: 8px; margin-bottom: 20px; }
.sex-btn {
  flex: 1;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  font-size: 15px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
  font-weight: 500;
}
.sex-btn:active { transform: scale(0.97); }
.sex-btn.selected {
  border-color: var(--primary);
  background: #f0f9ff;
  color: var(--primary-dark);
  font-weight: 700;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.1);
}

/* ── Tabs within pages ──────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 20px;
  background: var(--border-light);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
}
.tab-btn:active { transform: scale(0.95); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  box-shadow: 0 3px 10px rgba(14,165,233,0.35);
}

/* ── Protocol badge ─────────────────────────────────── */
.protocol-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}
.badge-steps { background: #f0f9ff; color: var(--primary-dark); }

/* ── Edu cards ──────────────────────────────────────── */
.edu-card { display: flex; align-items: center; gap: 16px; }
.edu-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.edu-icon-flash { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.edu-icon-quiz  { background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.edu-icon-curva { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.edu-info h3 { font-size: 16px; font-weight: 700; }
.edu-info p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── Tables ─────────────────────────────────────────── */
.ref-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0;
  font-size: 13px;
  box-shadow: var(--shadow);
}
.ref-content table th { padding: 10px 8px; text-align: center; font-weight: 700; }
.ref-content table td { padding: 10px 8px; text-align: center; border-top: 1px solid var(--border-light); }

/* ── Button row ─────────────────────────────────────── */
.btn-row { display: flex; gap: 8px; margin-top: 24px; }
.btn-row .calc-btn { margin-top: 0; }

/* ── Empty state ─────────────────────────────────────── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-tertiary); }
.empty-state svg { width: 48px; height: 48px; margin-bottom: 12px; opacity: 0.35; }

/* ── MRC Sum Score ───────────────────────────────────── */
.mrc-legend {
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.9;
}
.mrc-legend-item strong { color: var(--primary-dark); margin-right: 4px; }

.mrc-row {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.03);
}
.mrc-label { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.mrc-sides { display: flex; gap: 10px; }
.mrc-side { flex: 1; }
.mrc-side-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.mrc-btns { display: flex; gap: 4px; }
.mrc-btn {
  flex: 1;
  padding: 9px 2px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.mrc-btn:active { transform: scale(0.9); }
.mrc-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
}

/* ── FSS-ICU ────────────────────────────────────────── */
.fss-legend {
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.9;
}
.fss-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
  font-size: 11px;
  font-weight: 700;
  margin-right: 6px;
  flex-shrink: 0;
}
.fss-legend-item { display: flex; align-items: center; }

.fss-item-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.03);
}
.fss-item-header { margin-bottom: 10px; }
.fss-item-header strong { font-size: 14px; font-weight: 700; display: block; }
.fss-item-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; display: block; }
.fss-score-row { display: flex; gap: 4px; }
.fss-btn {
  flex: 1;
  padding: 10px 2px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  color: var(--text-secondary);
}
.fss-btn:active { transform: scale(0.9); }
.fss-btn.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
}

/* ── P0.1 / POCC ────────────────────────────────────── */
.p01-context-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.p01-ctx-btn {
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.p01-ctx-btn:active { transform: scale(0.95); }
.p01-ctx-btn.selected {
  border-color: var(--primary);
  background: #f0f9ff;
  color: var(--primary-dark);
  font-weight: 700;
}

.p01-ref-table { display: flex; flex-direction: column; gap: 6px; margin: 10px 0 16px; }
.p01-ref-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
}
.p01-ref-row.normal  { background: var(--success-bg); color: #065f46; }
.p01-ref-row.warning { background: var(--warning-bg); color: #92400e; }
.p01-ref-row.danger  { background: var(--danger-bg);  color: #991b1b; }
.p01-ref-row.neutral { background: var(--border-light); color: var(--text-secondary); }
.p01-ref-val {
  font-weight: 800;
  font-size: 12px;
  white-space: nowrap;
  min-width: 72px;
  font-family: 'Georgia', serif;
}

/* ── HACOR Score ────────────────────────────────────── */
.hacor-card {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(0,0,0,0.03);
}
.hacor-var-label { font-size: 14px; font-weight: 700; margin-bottom: 10px; color: var(--text); }
.hacor-opciones { display: flex; flex-direction: column; gap: 5px; }
.hacor-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 13px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
  width: 100%;
}
.hacor-btn:active { transform: scale(0.98); }
.hacor-btn.selected { border-color: var(--primary); background: #f0f9ff; }
.hacor-btn.selected .hacor-pts { color: var(--primary-dark); font-weight: 800; }
.hacor-range { color: var(--text); }
.hacor-pts {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  background: var(--border-light);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.hacor-timeline { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.hacor-tl-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.hacor-tl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  margin-top: 4px;
  flex-shrink: 0;
}

/* ── Curvas y Asincronías ───────────────────────────── */
.curva-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.04);
  animation: fadeSlideIn 0.3s ease-out;
}
.curva-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.curva-nombre { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.2px; }
.curva-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.curva-svg-wrap {
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 8px 4px;
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.curva-desc { font-size: 13px; line-height: 1.65; color: var(--text-secondary); margin-top: 12px; }
.curva-detail {
  background: var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 8px;
}
.curva-correccion { background: var(--success-bg); }
.curva-detail-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}
.curva-correccion .curva-detail-label { color: var(--success); }
.curva-detail-text { font-size: 13px; line-height: 1.6; color: var(--text); }
