/* ==========================================================================
   NiMH SoC / EKF article  —  self-contained block
   All selectors are scoped to .nhm-ekf so nothing here can leak into the
   rest of the page, and global element rules cannot leak in either.
   ========================================================================== */
.nhm-ekf{
  --nhm-ink:#1a1e24;
  --nhm-strong:#0d1116;
  --nhm-muted:#5f6b7a;
  --nhm-line:#d9dfe7;
  --nhm-wash:#f7f8fa;
  --nhm-accent:#b4531f;
  --nhm-link:#1b5e8f;
  max-width:100%;
  margin:0 auto;
  padding:0 0 48px;
  font-size:17px;
  font-weight:400;
  line-height:1.75;
  color:var(--nhm-ink);
  text-align:left;
  letter-spacing:normal;
  word-wrap:break-word;
  -webkit-font-smoothing:antialiased;
}
.nhm-ekf *,
.nhm-ekf *::before,
.nhm-ekf *::after{ box-sizing:border-box; }

/* --- headings --- */
.nhm-ekf h1,
.nhm-ekf h2,
.nhm-ekf h3{
  margin:0;
  padding:0;
  font-weight:700;
  line-height:1.3;
  color:var(--nhm-strong);
  letter-spacing:normal;
  text-transform:none;
  text-indent:0;
  background:none;
  border:0;
}
.nhm-ekf h1{
  font-size:32px;
  margin:0 0 20px;
}
.nhm-ekf h2{
  font-size:24px;
  margin:46px 0 18px;
  padding-top:20px;
  border-top:1px solid var(--nhm-line);
  scroll-margin-top:90px;
}
.nhm-ekf h3{
  font-size:16px;
  margin:32px 0 10px;
  color:var(--nhm-accent);
  letter-spacing:.01em;
}

/* --- text --- */
.nhm-ekf p{
  margin:0 0 18px;
  padding:0;
  font-size:inherit;
  line-height:inherit;
  color:inherit;
  text-indent:0;
  text-align:left;
}
.nhm-ekf strong{ font-weight:650; color:var(--nhm-strong); }
.nhm-ekf em{ font-style:italic; color:var(--nhm-muted); }

.nhm-ekf ul,
.nhm-ekf ol{
  margin:0 0 18px;
  padding:0 0 0 1.45em;
  list-style-position:outside;
}
.nhm-ekf ul{ list-style-type:disc; }
.nhm-ekf ol{ list-style-type:decimal; }
.nhm-ekf li{
  margin:7px 0;
  padding:0;
  border:0;
  background:none;
  text-indent:0;
  list-style-image:none;
}

.nhm-ekf a{
  color:var(--nhm-link);
  text-decoration:none;
  border-bottom:1px solid rgba(27,94,143,.35);
  background:none;
}
.nhm-ekf a:hover{
  text-decoration:none;
  border-bottom-color:var(--nhm-link);
}

/* --- inline code --- */
.nhm-ekf code{
  font-size:.87em;
  background:#f1f3f6;
  color:#8a4b1a;
  padding:.1em .36em;
  border:0;
  border-radius:3px;
  white-space:nowrap;
}

/* --- code blocks --- */
.nhm-ekf pre{
  margin:22px 0;
  padding:16px 18px;
  background:#0f141b;
  color:#d5dee8;
  border:0;
  border-radius:8px;
  overflow-x:auto;
  font-size:13px;
  line-height:1.6;
  white-space:pre;
  text-indent:0;
  tab-size:4;
  -webkit-overflow-scrolling:touch;
}
.nhm-ekf pre code{
  background:none;
  color:inherit;
  padding:0;
  border:0;
  border-radius:0;
  font-size:inherit;
  white-space:pre;
}

/* --- table --- */
.nhm-ekf table{
  width:100%;
  max-width:100%;
  margin:24px 0;
  border:1px solid var(--nhm-line);
  border-collapse:collapse;
  border-spacing:0;
  font-size:15px;
  line-height:1.6;
  text-align:center;
  background:none;
  table-layout:auto;
}
.nhm-ekf th,
.nhm-ekf td{
  border:1px solid var(--nhm-line);
  padding:11px 12px;
  text-align:center;
  vertical-align:middle;
  background:none;
  color:inherit;
  font-weight:400;
  text-indent:0;
}
.nhm-ekf th{
  background:var(--nhm-wash);
  color:#39424e;
  font-size:13px;
  font-weight:700;
}
.nhm-ekf caption{ caption-side:top; text-align:center; }

/* --- figure --- */
.nhm-ekf figure{
  margin:28px 0;
  padding:0;
  text-align:center;
}
.nhm-ekf figure img{
  display:inline-block;
  width:auto;
  max-width:100%;
  height:auto;
  border:0;
  vertical-align:middle;
}
.nhm-ekf figcaption{
  margin-top:10px;
  font-size:13.5px;
  line-height:1.6;
  color:var(--nhm-muted);
  text-align:center;
  text-indent:0;
}

/* --- formulas (rendered as inline SVG, no JS needed) --- */
.nhm-ekf .nhm-eq{
  margin:22px 0;
  padding:2px 0;
  text-align:center;
  overflow-x:auto;
  overflow-y:hidden;
}
.nhm-ekf .nhm-eq img{
  display:inline-block;
  max-width:100%;
  height:auto;
  border:0;
  vertical-align:middle;
}
.nhm-ekf .nhm-im{
  display:inline-block;
  white-space:nowrap;
}
.nhm-ekf .nhm-im svg{
  display:inline-block;
  max-width:100%;
  height:auto;
  color:inherit;
}

/* --- responsive --- */
@media (max-width:640px){
  .nhm-ekf{ font-size:16px; }
  .nhm-ekf h1{ font-size:26px; }
  .nhm-ekf h2{ font-size:21px; margin-top:38px; }
  .nhm-ekf table{ font-size:14px; }
  .nhm-ekf th,
  .nhm-ekf td{ padding:9px 8px; }
  .nhm-ekf pre{ font-size:12px; padding:14px; }
}
