/* =====================================================================
   ED Sepsis Education & Operational Readiness Tool
   Population Health Bible (PHB) design system
   Navy #0d2b4e  |  Teal #1d9e75  |  Gold #ba7517
   Scoped to #st-root. Structural rules carry !important so a CSS
   optimizer cannot strip the layout after upload.
   ===================================================================== */

#st-root *,
#st-root *::before,
#st-root *::after { box-sizing: border-box !important; }

#st-root {
  --navy:   #0d2b4e;
  --teal:   #1d9e75;
  --gold:   #ba7517;
  --ink:    #1c2733;
  --muted:  #5b6b7a;
  --line:   #e2e8ee;
  --bg:     #f5f8fb;
  --card:   #ffffff;
  --navy-soft: #eef3f8;
  --teal-soft: #e7f6ef;
  --gold-soft: #fbf3e3;
  --red:    #b3261e;
  --amber:  #c77700;

  font-family: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  color: var(--ink) !important;
  background: #f5f8fb !important;
  line-height: 1.6 !important;
  max-width: 1180px !important;
  margin: 0 auto !important;
  padding: 0 18px 64px !important;
  -webkit-font-smoothing: antialiased;
}

#st-root h1, #st-root h2, #st-root h3, #st-root h4 {
  font-family: "Playfair Display", Georgia, serif !important;
  color: var(--navy) !important;
  line-height: 1.2 !important;
  margin: 0 0 .4em !important;
}

#st-root p { margin: 0 0 1em !important; }
#st-root a { color: var(--teal); }

/* ---------- Masthead ---------- */
#st-root .st-mast {
  background: #0d2b4e !important;
  background: linear-gradient(135deg, #0d2b4e 0%, #143a64 100%) !important;
  color: #fff !important;
  border-radius: 16px !important;
  padding: 30px 32px !important;
  margin: 22px 0 8px !important;
  border-top: 5px solid var(--gold) !important;
}
#st-root .st-mast .st-eyebrow {
  font-size: .72rem !important;
  letter-spacing: .16em !important;
  text-transform: uppercase !important;
  color: #8fd8bb !important;
  font-weight: 700 !important;
  margin-bottom: 10px !important;
}
#st-root .st-mast h1 { color: #fff !important; font-size: 2.15rem !important; }
#st-root .st-mast .st-sub { color: #cdd9e6 !important; font-size: 1.02rem !important; max-width: 760px; margin-bottom: 0 !important; }
#st-root .st-byline { font-size: .9rem !important; color: #a9bdd2 !important; margin-top: 14px !important; }

/* ---------- Disclaimer banner ---------- */
#st-root .st-disclaimer {
  background: #fbf3e3 !important;
  border: 1px solid #e8d3a3 !important;
  border-left: 5px solid var(--gold) !important;
  border-radius: 12px !important;
  padding: 14px 18px !important;
  margin: 16px 0 0 !important;
  font-size: .92rem !important;
  color: #6b5418 !important;
}
#st-root .st-disclaimer strong { color: #7a5f12 !important; }

/* ---------- Tab nav (sticky) ---------- */
#st-root .st-nav {
  position: sticky !important;
  top: 0 !important;
  z-index: 30 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 6px !important;
  background: rgba(245,248,251,.94) !important;
  backdrop-filter: blur(6px);
  padding: 12px 0 10px !important;
  margin: 18px 0 22px !important;
  border-bottom: 1px solid var(--line) !important;
}
#st-root .st-tab {
  appearance: none !important;
  border: 1px solid var(--line) !important;
  background: #fff !important;
  color: var(--muted) !important;
  font-family: inherit !important;
  font-size: .9rem !important;
  font-weight: 600 !important;
  padding: 9px 15px !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all .15s ease !important;
}
#st-root .st-tab:hover { color: var(--navy) !important; border-color: #c5d3e0 !important; }
#st-root .st-tab.is-active {
  background: var(--navy) !important;
  color: #fff !important;
  border-color: var(--navy) !important;
}

/* ---------- Panels ---------- */
#st-root .st-panel { display: none !important; animation: stfade .25s ease both; }
#st-root .st-panel.is-active { display: block !important; }
@keyframes stfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
#st-root .st-card {
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  padding: 22px 24px !important;
  margin: 0 0 18px !important;
  box-shadow: 0 1px 2px rgba(13,43,78,.04) !important;
}
#st-root .st-grid { display: grid !important; gap: 16px !important; }
#st-root .st-grid.cols-2 { grid-template-columns: repeat(2, 1fr) !important; }
#st-root .st-grid.cols-3 { grid-template-columns: repeat(3, 1fr) !important; }
#st-root .st-grid.cols-4 { grid-template-columns: repeat(4, 1fr) !important; }
@media (max-width: 860px) {
  #st-root .st-grid.cols-2,
  #st-root .st-grid.cols-3,
  #st-root .st-grid.cols-4 { grid-template-columns: 1fr !important; }
  #st-root .st-mast { padding: 24px 20px !important; }
  #st-root .st-mast h1 { font-size: 1.7rem !important; }
}

/* ---------- Metric cards ---------- */
#st-root .st-metric {
  background: #fff !important;
  border: 1px solid var(--line) !important;
  border-top: 4px solid var(--teal) !important;
  border-radius: 12px !important;
  padding: 18px 18px 16px !important;
  text-align: left !important;
}
#st-root .st-metric.alt { border-top-color: var(--gold) !important; }
#st-root .st-metric.warn { border-top-color: var(--red) !important; }
#st-root .st-metric .num {
  font-family: "Playfair Display", Georgia, serif !important;
  font-size: 2.1rem !important;
  font-weight: 700 !important;
  color: var(--navy) !important;
  line-height: 1 !important;
}
#st-root .st-metric .lbl { font-size: .9rem !important; color: var(--ink) !important; margin-top: 6px !important; font-weight: 600 !important; }
#st-root .st-metric .src { font-size: .76rem !important; color: var(--muted) !important; margin-top: 8px !important; }
#st-root .st-metric .src a { color: var(--muted) !important; text-decoration: underline dotted !important; }

/* citation chip with hover tooltip */
#st-root .st-cite {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px !important; height: 16px !important;
  margin-left: 5px !important;
  font-size: .64rem !important;
  font-weight: 700 !important;
  color: #fff !important;
  background: var(--teal) !important;
  border-radius: 50% !important;
  cursor: help !important;
  vertical-align: super !important;
  text-decoration: none !important;
}
#st-root .st-cite .st-tip {
  position: absolute !important;
  bottom: 130% !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 250px !important;
  background: var(--navy) !important;
  color: #eef3f8 !important;
  font-size: .76rem !important;
  font-weight: 400 !important;
  line-height: 1.45 !important;
  text-align: left !important;
  padding: 10px 12px !important;
  border-radius: 8px !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: opacity .15s ease !important;
  z-index: 50 !important;
  box-shadow: 0 8px 24px rgba(13,43,78,.28) !important;
}
#st-root .st-cite:hover .st-tip { opacity: 1 !important; visibility: visible !important; }
#st-root .st-cite .st-tip a { color: #8fd8bb !important; }

/* ---------- Pills / tags ---------- */
#st-root .st-pill {
  display: inline-block !important;
  font-size: .74rem !important;
  font-weight: 700 !important;
  letter-spacing: .03em !important;
  text-transform: uppercase !important;
  padding: 3px 9px !important;
  border-radius: 999px !important;
}
#st-root .st-pill.navy { background: var(--navy-soft) !important; color: var(--navy) !important; }
#st-root .st-pill.teal { background: var(--teal-soft) !important; color: #0f6e4d !important; }
#st-root .st-pill.gold { background: var(--gold-soft) !important; color: #8a5d0f !important; }
#st-root .st-pill.red  { background: #f7e0de !important; color: var(--red) !important; }

/* ---------- Tables ---------- */
#st-root .st-table { width: 100% !important; border-collapse: collapse !important; font-size: .92rem !important; }
#st-root .st-table th {
  text-align: left !important;
  background: var(--navy) !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: 10px 12px !important;
}
#st-root .st-table td { padding: 10px 12px !important; border-bottom: 1px solid var(--line) !important; vertical-align: top !important; }
#st-root .st-table tr:nth-child(even) td { background: #fafcfe !important; }

/* ---------- Form controls ---------- */
#st-root .st-field { margin-bottom: 14px !important; }
#st-root .st-field label { display: block !important; font-weight: 600 !important; font-size: .9rem !important; margin-bottom: 5px !important; color: var(--navy) !important; }
#st-root .st-field input[type="number"],
#st-root .st-field select {
  width: 100% !important;
  padding: 9px 11px !important;
  border: 1px solid #cdd9e6 !important;
  border-radius: 9px !important;
  font-family: inherit !important;
  font-size: .95rem !important;
  background: #fff !important;
  color: var(--ink) !important;
}
#st-root .st-field input:focus,
#st-root .st-field select:focus { outline: 2px solid var(--teal) !important; border-color: var(--teal) !important; }

/* score readout chips */
#st-root .st-score {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  padding: 16px !important;
  text-align: center !important;
  background: #fff !important;
}
#st-root .st-score .name { font-size: .78rem !important; text-transform: uppercase !important; letter-spacing: .06em !important; color: var(--muted) !important; font-weight: 700 !important; }
#st-root .st-score .val { font-family: "Playfair Display", Georgia, serif !important; font-size: 2.3rem !important; font-weight: 700 !important; line-height: 1 !important; margin: 6px 0 4px !important; }
#st-root .st-score .flag { font-size: .82rem !important; font-weight: 700 !important; }
#st-root .st-score.lo .val { color: var(--teal) !important; }
#st-root .st-score.lo .flag { color: #0f6e4d !important; }
#st-root .st-score.hi { border-color: #e6b3af !important; background: #fdf4f3 !important; }
#st-root .st-score.hi .val { color: var(--red) !important; }
#st-root .st-score.hi .flag { color: var(--red) !important; }
#st-root .st-score.mid { border-color: #e8d3a3 !important; background: #fdf9f0 !important; }
#st-root .st-score.mid .val { color: var(--amber) !important; }
#st-root .st-score.mid .flag { color: var(--amber) !important; }

/* concordance readout */
#st-root .st-concord {
  margin-top: 16px !important;
  border-radius: 12px !important;
  padding: 16px 18px !important;
  background: var(--navy-soft) !important;
  border-left: 4px solid var(--navy) !important;
  font-size: .95rem !important;
}
#st-root .st-concord.alert { background: #fdf4f3 !important; border-left-color: var(--red) !important; }

/* ---------- Bundle clock ---------- */
#st-root .st-clock {
  display: flex !important; flex-wrap: wrap !important; align-items: center !important;
  gap: 14px !important;
  background: var(--navy) !important;
  color: #fff !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  margin-bottom: 16px !important;
}
#st-root .st-clock .big { font-family: "Playfair Display", Georgia, serif !important; font-size: 2.2rem !important; font-weight: 700 !important; }
#st-root .st-clock .lbl { color: #b6c8db !important; font-size: .82rem !important; text-transform: uppercase !important; letter-spacing: .06em !important; }
#st-root .st-btn {
  appearance: none !important;
  border: none !important;
  border-radius: 9px !important;
  font-family: inherit !important;
  font-weight: 700 !important;
  font-size: .9rem !important;
  padding: 9px 16px !important;
  cursor: pointer !important;
  transition: filter .15s ease !important;
}
#st-root .st-btn.primary { background: var(--teal) !important; color: #fff !important; }
#st-root .st-btn.ghost { background: rgba(255,255,255,.14) !important; color: #fff !important; }
#st-root .st-btn.gold { background: var(--gold) !important; color: #fff !important; }
#st-root .st-btn:hover { filter: brightness(1.07) !important; }

/* bundle element rows */
#st-root .st-bundle-item {
  display: flex !important; align-items: flex-start !important; gap: 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  margin-bottom: 10px !important;
  background: #fff !important;
}
#st-root .st-bundle-item.done { background: var(--teal-soft) !important; border-color: #b6e3cf !important; }
#st-root .st-bundle-check {
  flex: 0 0 auto !important;
  width: 26px !important; height: 26px !important;
  border-radius: 7px !important;
  border: 2px solid #cdd9e6 !important;
  background: #fff !important;
  cursor: pointer !important;
  font-weight: 800 !important;
  color: #fff !important;
  line-height: 22px !important;
  text-align: center !important;
  font-size: 1rem !important;
}
#st-root .st-bundle-item.done .st-bundle-check { background: var(--teal) !important; border-color: var(--teal) !important; }
#st-root .st-bundle-body { flex: 1 1 auto !important; }
#st-root .st-bundle-body h4 { margin-bottom: 3px !important; font-size: 1.02rem !important; }
#st-root .st-bundle-body p { margin: 0 !important; font-size: .9rem !important; color: var(--muted) !important; }
#st-root .st-stamp { font-size: .8rem !important; color: #0f6e4d !important; font-weight: 700 !important; margin-top: 6px !important; }

/* clinical caution inset */
#st-root .st-caution {
  background: #fdf4f3 !important;
  border: 1px solid #e6b3af !important;
  border-left: 4px solid var(--red) !important;
  border-radius: 10px !important;
  padding: 12px 15px !important;
  font-size: .88rem !important;
  color: #7a201b !important;
  margin-top: 10px !important;
}
#st-root .st-caution strong { color: #5e1814 !important; }

/* progress bar */
#st-root .st-progress { height: 12px !important; background: #e7eef4 !important; border-radius: 999px !important; overflow: hidden !important; margin: 8px 0 !important; }
#st-root .st-progress > span { display: block !important; height: 100% !important; background: linear-gradient(90deg, var(--teal), #29b885) !important; width: 0%; transition: width .3s ease !important; }

/* disposition result */
#st-root .st-dispo {
  border-radius: 12px !important;
  padding: 18px 20px !important;
  margin-top: 8px !important;
  border: 1px solid var(--line) !important;
  background: #fff !important;
}
#st-root .st-dispo .tier { font-family: "Playfair Display", Georgia, serif !important; font-size: 1.5rem !important; font-weight: 700 !important; }
#st-root .st-dispo.icu { background: #fdf4f3 !important; border-color: #e6b3af !important; }
#st-root .st-dispo.icu .tier { color: var(--red) !important; }
#st-root .st-dispo.step { background: #fdf9f0 !important; border-color: #e8d3a3 !important; }
#st-root .st-dispo.step .tier { color: var(--amber) !important; }
#st-root .st-dispo.floor { background: var(--teal-soft) !important; border-color: #b6e3cf !important; }
#st-root .st-dispo.floor .tier { color: #0f6e4d !important; }

/* checklist (SEP-1) */
#st-root .st-check-row { display: flex !important; align-items: flex-start !important; gap: 12px !important; padding: 11px 0 !important; border-bottom: 1px solid var(--line) !important; }
#st-root .st-check-row input { margin-top: 4px !important; width: 18px !important; height: 18px !important; accent-color: var(--teal) !important; flex: 0 0 auto !important; }
#st-root .st-check-row .win { font-size: .8rem !important; color: var(--muted) !important; }

/* chart wrap */
#st-root .st-chart-wrap { position: relative !important; height: 300px !important; }

/* references */
#st-root .st-ref { padding: 14px 0 !important; border-bottom: 1px solid var(--line) !important; font-size: .92rem !important; }
#st-root .st-ref .meta { display: flex !important; gap: 8px !important; flex-wrap: wrap !important; margin-bottom: 5px !important; }
#st-root .st-ref .cite-text { color: var(--ink) !important; }
#st-root .st-ref a { color: var(--teal) !important; word-break: break-word !important; }

/* 2026 update callout */
#st-root .st-update {
  background: linear-gradient(135deg, #e7f6ef 0%, #f0faf5 100%) !important;
  border: 1px solid #b6e3cf !important;
  border-left: 5px solid var(--teal) !important;
  border-radius: 12px !important;
  padding: 16px 20px !important;
  margin-bottom: 18px !important;
}
#st-root .st-update h4 { color: #0f6e4d !important; }
#st-root .st-update ul { margin: 6px 0 0 !important; padding-left: 18px !important; }
#st-root .st-update li { margin-bottom: 4px !important; font-size: .92rem !important; }

/* note line */
#st-root .st-note { font-size: .82rem !important; color: var(--muted) !important; }

/* footer */
#st-root .st-foot {
  margin-top: 30px !important;
  padding-top: 18px !important;
  border-top: 2px solid var(--line) !important;
  font-size: .85rem !important;
  color: var(--muted) !important;
}
#st-root .st-foot strong { color: var(--navy) !important; }

/* small helpers */
#st-root .lead { font-size: 1.08rem !important; color: var(--muted) !important; }
#st-root .st-divider { height: 1px !important; background: var(--line) !important; margin: 18px 0 !important; }
#st-root ul.st-list { margin: 0 0 1em !important; padding-left: 20px !important; }
#st-root ul.st-list li { margin-bottom: 5px !important; }
