/* Sleep-EVAL 2026 visual refresh
   Preserves the legacy information architecture while modernizing typography,
   spacing, navigation and the presentation of Ad-Infer / EVAL-KBS concepts. */

:root {
  --se-ink: #18324a;
  --se-text: #243746;
  --se-muted: #627487;
  --se-burgundy: #7a2434;
  --se-burgundy-dark: #5f1b28;
  --se-gold: #c7a45b;
  --se-blue: #2f5f87;
  --se-teal: #2f7e82;
  --se-bg: #f5f7fa;
  --se-card: #ffffff;
  --se-line: #dce4eb;
  --se-soft: #edf3f7;
  --se-shadow: 0 14px 36px rgba(29, 54, 77, 0.10);
}

html { scroll-behavior: smooth; }

body {
  margin: 0 !important;
  background: var(--se-bg) !important;
  color: var(--se-text) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--se-blue); }
a:hover, a:focus { color: var(--se-burgundy); }

/* ---------- Masthead ---------- */
header {
  background: #fff;
  box-shadow: 0 1px 0 rgba(32, 57, 80, .08);
}

header .container {
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  padding: 0 !important;
}

.page-header {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.header-table {
  width: 100% !important;
  min-height: 132px;
  border: 0 !important;
  background: linear-gradient(118deg, var(--se-burgundy-dark) 0%, var(--se-burgundy) 46%, #274f70 100%) !important;
}

.header-table tbody,
.header-table tr {
  width: 100%;
}

.header-table td {
  border: 0 !important;
  vertical-align: middle !important;
  background: transparent !important;
}

.header-table td:first-child {
  width: 170px !important;
  padding: 12px 16px 12px 24px !important;
}

.header-table td:first-child img {
  width: 132px !important;
  height: 100px !important;
  object-fit: cover;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}

.header-table td:nth-child(2) {
  width: auto !important;
  padding: 18px 26px 14px 4px !important;
}

.header-table td:nth-child(2) h2 {
  margin: 0 0 8px !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  line-height: 1 !important;
  white-space: nowrap;
}

/* Legacy spans are visually replaced by the 2026 wordmark without changing URLs/pages. */
.header-table td:nth-child(2) h2 > * { display: none !important; }
.header-table td:nth-child(2) h2::before {
  content: "SLEEP-EVAL";
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: .035em;
}
.header-table td:nth-child(2) h2::after {
  content: "  RESEARCH";
  color: #f2dca9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .18em;
}

.header-paragraph {
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
  color: rgba(255,255,255,.9) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-style: normal !important;
  font-size: 0 !important;
  line-height: 1.4 !important;
}
.header-paragraph::before {
  content: "Knowledge-based evaluation of sleep disorders · Clinical inference powered by Ad-Infer";
  font-size: 15px;
  letter-spacing: .01em;
}

.header-sideInfo {
  width: 345px !important;
  padding: 14px 28px 12px 18px !important;
  color: rgba(255,255,255,.86) !important;
  background: transparent !important;
  text-align: right !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-style: normal !important;
  font-size: 13px !important;
  line-height: 1.4;
}
.header-sideInfo em { font-style: normal !important; }
.header-sideInfo p { margin: 3px 0 !important; }
.header-sideInfo p:nth-of-type(n+4) { display: none !important; }
.header-sideInfo a { color: #fff !important; text-decoration: none !important; }
.header-sideInfo a:hover { text-decoration: underline !important; }

/* ---------- Navigation ---------- */
header .navbar {
  margin: 0 !important;
  min-height: 48px;
  border: 0 !important;
  border-radius: 0 !important;
  background: #162f46 !important;
}
header .navbar .container-fluid {
  padding: 0 20px !important;
}
header .navbar-nav > li > a {
  color: rgba(255,255,255,.88) !important;
  font-size: 14px !important;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 15px 11px !important;
}
header .navbar-nav > li > a:hover,
header .navbar-nav > li.active > a,
header .navbar-nav > li.open > a {
  color: #fff !important;
  background: rgba(255,255,255,.10) !important;
}
.dropdown-menu {
  border: 0 !important;
  border-radius: 8px !important;
  box-shadow: 0 12px 30px rgba(18, 42, 62, .18) !important;
  padding: 7px 0 !important;
}
.dropdown-menu > li > a {
  padding: 8px 16px !important;
  color: var(--se-text) !important;
  font-size: 14px !important;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li.active > a {
  background: var(--se-soft) !important;
  color: var(--se-burgundy) !important;
}

/* ---------- Secondary tabs ---------- */
body > .nav-tabs,
.nav.nav-tabs {
  padding: 14px 4vw 0 !important;
  background: #fff;
  border-bottom: 1px solid var(--se-line) !important;
}
.nav-tabs > li > a {
  color: var(--se-muted) !important;
  border: 0 !important;
  border-radius: 8px 8px 0 0 !important;
  font-size: 14px;
  font-weight: 600;
}
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
  color: var(--se-burgundy) !important;
  background: var(--se-soft) !important;
  border: 0 !important;
}

/* ---------- Main legacy pages ---------- */
.myArticle {
  max-width: 1240px;
  margin: 34px auto 54px !important;
  padding: 0 26px;
}

.article-body {
  color: var(--se-text) !important;
  background: var(--se-card);
  padding: 34px 42px !important;
  border-radius: 16px;
  box-shadow: var(--se-shadow);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
}

.article-info-title,
.stanfordRed,
.article-subTitle,
.article-paragraph-header {
  color: var(--se-ink) !important;
}

.article-info-title {
  margin-top: 0;
  font-size: 34px !important;
  line-height: 1.15 !important;
  letter-spacing: -.02em;
}
.article-header { line-height: 1.25 !important; }
.article-hr { border-top: 2px solid var(--se-gold) !important; }

.article-content,
.article-content-info,
.article-content-element,
.article-paragraph,
.article-reference,
.article-info-reference,
.article-info-author {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif !important;
  color: var(--se-text) !important;
  font-size: 16px !important;
  line-height: 1.65 !important;
}
.article-title {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  color: var(--se-ink) !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
}
.article-subTitle,
.article-paragraph-header {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  letter-spacing: .035em;
}
.article-subTitle {
  margin-top: 38px !important;
  margin-bottom: 18px !important;
  font-size: 21px !important;
}
.article-paragraph-header { font-size: 16px !important; }
.article-paragraph { padding-left: 0 !important; }
.article-paragraph-element { padding-left: 28px !important; }

.jumbotron {
  background: linear-gradient(135deg, #f7fafc, #edf3f7) !important;
  border: 1px solid var(--se-line);
  border-left: 5px solid var(--se-gold);
  border-radius: 12px !important;
  padding: 18px 22px !important;
  margin: 28px 0 22px !important;
}
.article-intro {
  padding: 0 !important;
  margin: 0 !important;
  color: var(--se-ink) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 18px !important;
  line-height: 1.5 !important;
}

.article-body table:not(.architecture-table) {
  max-width: 100%;
}
.article-body img {
  max-width: 100%;
  height: auto;
}
figure { max-width: 100%; }
figcaption { color: var(--se-muted); font-size: 14px; margin-top: 8px; }

/* ---------- Sidebar ---------- */
.article-sidebar {
  background: transparent !important;
  margin: 0 0 24px !important;
  padding: 0 12px 0 22px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
}
.article-sidebar h3 {
  color: var(--se-ink) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 15px !important;
  letter-spacing: .1em;
}
.article-sidebar a {
  display: inline-block;
  color: var(--se-blue) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 14px !important;
  font-weight: 700;
  text-decoration: none !important;
  margin-top: 6px;
}
.article-sidebar p {
  color: var(--se-muted) !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 13.5px !important;
  line-height: 1.5 !important;
}

/* ---------- New Sleep-EVAL components ---------- */
.se-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #183850 0%, #234f68 52%, #7a2434 100%);
  color: #fff;
  padding: 72px 7vw 64px;
}
.se-hero::after {
  content: "";
  position: absolute;
  right: -140px;
  top: -180px;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  box-shadow: 0 0 0 70px rgba(255,255,255,.035), 0 0 0 140px rgba(255,255,255,.02);
}
.se-hero-inner { position: relative; z-index: 1; max-width: 1120px; margin: 0 auto; }
.se-eyebrow {
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 700;
  color: #f0d79b;
  font-size: 13px;
  margin-bottom: 14px;
}
.se-hero h1 {
  margin: 0 0 16px;
  color: #fff;
  font-size: clamp(38px, 5vw, 62px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 750;
}
.se-hero h1 span { color: #f1dca9; }
.se-hero p {
  max-width: 820px;
  margin: 0 0 26px;
  color: rgba(255,255,255,.9);
  font-size: 20px;
  line-height: 1.55;
}
.se-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.se-btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none !important;
}
.se-btn-primary { background: #fff; color: var(--se-ink) !important; }
.se-btn-secondary { border: 1px solid rgba(255,255,255,.45); color: #fff !important; }
.se-btn:hover { transform: translateY(-1px); }

.se-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 54px 28px;
}
.se-section.se-compact { padding-top: 32px; padding-bottom: 32px; }
.se-section h2 {
  color: var(--se-ink);
  font-size: 32px;
  line-height: 1.2;
  margin: 0 0 13px;
  letter-spacing: -.025em;
}
.se-lead {
  color: var(--se-muted);
  font-size: 18px;
  line-height: 1.65;
  max-width: 920px;
  margin-bottom: 26px;
}
.se-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px;
}
.se-card {
  background: #fff;
  border: 1px solid var(--se-line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(28,55,78,.06);
}
.se-card h3 { margin: 0 0 8px; color: var(--se-ink); font-size: 20px; }
.se-card p { margin: 0; color: var(--se-muted); line-height: 1.58; }
.se-card .se-label {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--se-burgundy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.se-card-accent { border-top: 4px solid var(--se-gold); }

.se-architecture {
  background: #fff;
  border-top: 1px solid var(--se-line);
  border-bottom: 1px solid var(--se-line);
}
.se-architecture-flow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
}
.se-node {
  background: linear-gradient(180deg,#fff,#f8fafc);
  border: 1px solid var(--se-line);
  border-radius: 13px;
  padding: 22px;
}
.se-node strong { display: block; color: var(--se-ink); font-size: 18px; margin-bottom: 7px; }
.se-node span { color: var(--se-muted); font-size: 14px; line-height: 1.52; }
.se-arrow { display: flex; align-items: center; color: var(--se-gold); font-size: 30px; font-weight: 300; }
.se-loop {
  margin-top: 18px;
  padding: 18px 22px;
  border-radius: 12px;
  background: #eef5f6;
  border: 1px solid #d4e6e7;
  color: #285c60;
  line-height: 1.6;
}

.se-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 12px;
}
.se-fact {
  padding: 18px;
  border-left: 3px solid var(--se-gold);
  background: #fff;
  border-radius: 8px;
}
.se-fact strong { display:block; color:var(--se-ink); font-size:17px; margin-bottom:4px; }
.se-fact span { color:var(--se-muted); font-size:13px; }

.se-notice {
  background: #fff8e8;
  border: 1px solid #ecd8a8;
  border-left: 4px solid var(--se-gold);
  color: #5c4a26;
  padding: 16px 18px;
  border-radius: 9px;
  margin: 20px 0 26px;
  line-height: 1.58;
}

.architecture-table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 10px !important;
  background: transparent !important;
  margin: 20px 0 !important;
}
.architecture-table td {
  border: 1px solid var(--se-line) !important;
  border-radius: 10px;
  padding: 16px !important;
  background: #f9fbfc !important;
  vertical-align: top;
}
.architecture-table tr.architecture-core td {
  background: #eef4f7 !important;
  border-color: #cddde8 !important;
}
.architecture-table tr.architecture-loop td {
  background: #eef7f5 !important;
  border-color: #cfe4df !important;
}

/* ---------- Footer ---------- */
footer.footer {
  height: auto !important;
  background: #142d43 !important;
  padding: 28px 4vw !important;
  text-align: center;
}
.footer-fonts { color: rgba(255,255,255,.84) !important; font-size: 13px !important; }
.footer a { color: #fff !important; }
.footer-legal { color: rgba(255,255,255,.62) !important; font-size: 12px !important; line-height: 1.55; }
.footer-img { opacity: .8; border-radius: 6px; }

#return-to-top {
  background: var(--se-burgundy) !important;
  width: 44px !important;
  height: 44px !important;
}
#return-to-top i { left: 13px !important; top: 11px !important; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .header-sideInfo { display: none !important; }
  .header-table td:first-child { width: 130px !important; }
  .header-table td:first-child img { width: 102px !important; height: 78px !important; }
  .header-table td:nth-child(2) h2::before { font-size: 30px; }
  .header-table td:nth-child(2) h2::after { font-size: 13px; }
  .se-grid { grid-template-columns: 1fr; }
  .se-architecture-flow { grid-template-columns: 1fr; }
  .se-arrow { justify-content: center; transform: rotate(90deg); min-height: 28px; }
  .se-facts { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 767px) {
  .header-table td:first-child { display: none; }
  .header-table td:nth-child(2) { padding: 18px 18px !important; }
  .header-table td:nth-child(2) h2 { white-space: normal; }
  .header-table td:nth-child(2) h2::before { font-size: 27px; }
  .header-table td:nth-child(2) h2::after { display:block; margin-top:8px; font-size:12px; }
  .header-paragraph::before { font-size: 13px; }
  header .navbar .container-fluid { padding: 0 12px !important; }
  header .navbar-nav > li > a { padding: 11px 15px !important; }
  ul.nav li.dropdown:hover > ul.dropdown-menu { display: none; }
  ul.nav li.dropdown.open > ul.dropdown-menu { display: block; }
  .myArticle { padding: 0 12px; margin-top: 20px !important; }
  .article-body { padding: 24px 20px !important; border-radius: 10px; }
  .article-info-title { font-size: 28px !important; }
  .article-sidebar { padding: 18px 20px !important; }
  .se-hero { padding: 52px 24px 48px; }
  .se-hero p { font-size: 17px; }
  .se-section { padding: 40px 20px; }
  .se-section h2 { font-size: 27px; }
  .se-facts { grid-template-columns: 1fr; }
}
