﻿/* =====================================================================
   myflowX Engineering Notebook - Reading Layout
   ===================================================================== */

html {
  scroll-behavior: auto;
}

body#engtools-body {
  /* Neutral warm-gray palette (Vercel/shadcn-tier, no cool tint) */
  --nb-bg-soft: #f7f7f8;
  --nb-text: #0a0a0a;
  --nb-muted: rgba(10, 10, 10, 0.55);
  --nb-accent: #ff9800;
  --nb-accent-deep: #ff7a00;
  --nb-shadow-md: 0 30px 64px rgba(0, 0, 0, 0.16);
  --nb-radius-xl: 16px;
  --nb-radius-lg: 13px;
  --nb-radius-md: 10px;
  --nb-pad-x: clamp(12px, 2vw, 34px);
  --nb-focus-ring: 0 0 0 3px rgba(255, 152, 0, 0.24);

  font-family: "Outfit", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--nb-text);
  background: var(--nb-bg-soft);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
}

body#engtools-body.nb-page {
  background-color: #fafafa;
  background-image: radial-gradient(circle, rgba(10, 10, 10, 0.04) 1px, transparent 1px);
  background-size: 28px 28px;
}

body#engtools-body *,
body#engtools-body *::before,
body#engtools-body *::after {
  box-sizing: border-box;
}

body#engtools-body img,
body#engtools-body svg {
  display: block;
  max-width: 100%;
}

body#engtools-body *::selection {
  color: inherit;
  background: rgba(255, 152, 0, 0.2);
}

body#engtools-body input,
body#engtools-body textarea,
body#engtools-body button {
  font: inherit;
  text-transform: none;
  letter-spacing: normal;
}

body#engtools-body .nb-page-wrap {
  position: relative;
  background: transparent;
  overflow-anchor: none;
}

body#engtools-body .nb-page-wrap::before {
  content: none;
}

body#engtools-body {
  --vh: 1vh;
  overflow-x: hidden;
  overflow-anchor: none;
}

body#engtools-body .mil-wrapper,
body#engtools-body .mil-content {
  overflow-anchor: none;
}

/* Cursor ball must sit above nb-shell (z-index: 12) stacking context */
body#engtools-body .mil-ball {
  z-index: 9999;
}

body#engtools-body .mil-wrapper,
body#engtools-body .mil-content,
body#engtools-body #swupMain {
  min-height: calc(var(--vh) * 100);
  overflow-anchor: none;
}

@supports (height: 100svh) {
  body#engtools-body .mil-wrapper,
  body#engtools-body .mil-content,
  body#engtools-body #swupMain {
    min-height: 100svh;
  }
}

@supports (-webkit-touch-callout: none) {
  @media (max-width: 1200px) {
    body#engtools-body .mil-wrapper,
    body#engtools-body .mil-content,
    body#engtools-body #swupMain,
    body#engtools-body .nb-page-wrap {
      height: auto;
      min-height: auto;
      overflow: visible;
    }

    body#engtools-body {
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: auto;
    }
  }
}

body#engtools-body .nb-container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding-left: var(--nb-pad-x);
  padding-right: var(--nb-pad-x);
}

body#engtools-body .container-fluid.nb-container {
  width: 100%;
}

body#engtools-body .nb-shell {
  position: relative;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-anchor: none;
}

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
body#engtools-body .nb-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  align-items: start;
  gap: 10px;

  width: 100%;
  padding: 16px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: none;
  position: relative;
  top: auto;
}

body#engtools-body .nb-topbar::before {
  content: none;
}

body#engtools-body .nb-topbar::after {
  content: none;
}

body#engtools-body .nb-topbar-left {
  min-width: 0;
}

body#engtools-body .nb-topbar-right {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6px;
}

body#engtools-body .nb-topbar-date-row {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin-top: -2px;
}

body#engtools-body .nb-publish-date--top {
  min-height: 26px;
  padding: 0;
  margin-top: 0;
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

body#engtools-body .nb-h1-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
}

body#engtools-body .nb-head-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #ffffff;
  color: var(--nb-accent-deep);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

body#engtools-body .nb-h1-row:hover .nb-head-icon {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

body#engtools-body .nb-head-icon svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body#engtools-body .nb-h1 {
  margin: 0;
  color: #060709;
  font-weight: 800;
  letter-spacing: -0.032em;
  line-height: 1.04;
  font-size: clamp(21px, 1.5vw, 28px);
  white-space: nowrap;
}

body#engtools-body .nb-h1--compact {
  font-weight: 700;
}

body#engtools-body .nb-title-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: auto;
  padding: 0 0 0 12px;
  margin-left: 2px;
  border: 0;
  background: transparent;
  color: rgba(10, 12, 16, 0.48);
  white-space: nowrap;
  transform: none;
  position: relative;
}

body#engtools-body .nb-title-count::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 14px;
  transform: translateY(-50%);
  background: rgba(10, 12, 16, 0.14);
}

body#engtools-body .nb-title-count .v {
  color: #0a0a0a;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

body#engtools-body .nb-title-count .k {
  color: rgba(10, 12, 16, 0.52);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

body#engtools-body .nb-lead {
  margin: 10px 0 0;
  color: var(--nb-muted);
  font-size: clamp(12px, 0.82vw, 14px);
  line-height: 1.36;
  max-width: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body#engtools-body .nb-lead--compact {
  margin-top: 10px;
}

body#engtools-body .nb-library-updated {
  display: none;
}

body#engtools-body .nb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

/* ---------------------------------------------------------------------
   Buttons and Inputs
   --------------------------------------------------------------------- */
body#engtools-body .nb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(21, 24, 29, 0.74);
  background: #12161d;
  color: #f6f8fb;
  cursor: pointer;

  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.2px;

  transition: transform 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

body#engtools-body .nb-btn-icon {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

body#engtools-body .nb-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 122, 0, 0.86);
  color: #0a0c0f;
  background: var(--nb-accent-deep);
  box-shadow: 0 14px 26px rgba(255, 122, 0, 0.32), 0 6px 14px rgba(0, 0, 0, 0.2);
}

body#engtools-body .nb-btn:focus-visible {
  outline: none;
  border-color: rgba(255, 152, 0, 0.44);
  box-shadow: var(--nb-focus-ring);
}

body#engtools-body .nb-btn:active {
  transform: translateY(0);
}

body#engtools-body .nb-btn--ghost {
  background: #fff;
  color: rgba(10, 12, 16, 0.74);
  border-color: rgba(0, 0, 0, 0.14);
}

body#engtools-body .nb-btn--ghost:hover {
  background: #111317;
  color: var(--nb-accent-deep);
  border-color: rgba(255, 122, 0, 0.76);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

body#engtools-body .nb-btn--sm {
  height: 26px;
  padding: 0 9px;
  font-size: 9px;
}

body#engtools-body .nb-btn.is-active {
  border-color: rgba(255, 122, 0, 0.76);
  background: #111318;
  color: var(--nb-accent-deep);
}

body#engtools-body #nbLibraryToggle.is-active {
  border-color: rgba(255, 122, 0, 0.92);
  background: var(--nb-accent-deep);
  color: #0a0c0f;
  box-shadow: 0 10px 20px rgba(255, 122, 0, 0.22);
}

body#engtools-body .nb-search {
  width: 100%;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.22);
  background: #fff;
  color: #0d1117;
  padding: 0 16px;

  text-transform: none;
  letter-spacing: normal;

  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

body#engtools-body .nb-search::placeholder {
  color: rgba(15, 17, 21, 0.46);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-size: 10px;
  font-weight: 600;
}

body#engtools-body .nb-search:focus {
  outline: none;
  border-color: rgba(255, 152, 0, 0.62);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.16), 0 8px 18px rgba(0, 0, 0, 0.08);
}

body#engtools-body .nb-search--side {
  height: 42px;
}

/* ---------------------------------------------------------------------
   Main layout
   --------------------------------------------------------------------- */
body#engtools-body .nb-app {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

body#engtools-body.nb-focus .nb-app {
  grid-template-columns: minmax(0, 1fr);
}

body#engtools-body.nb-focus .nb-library,
body#engtools-body.nb-focus #nbLibraryCollapse {
  display: none;
}

body#engtools-body.nb-focus .nb-reader {
  border-color: rgba(255, 122, 0, 0.76);
  box-shadow: var(--nb-shadow-md);
}

@media (min-width: 992px) {
  body#engtools-body #nbLibraryCollapse.collapse {
    display: block;
  }

  body#engtools-body.nb-focus #nbLibraryCollapse.collapse {
    display: none;
  }
}

/* ---------------------------------------------------------------------
   Sidebar filters
   --------------------------------------------------------------------- */
body#engtools-body .nb-library {
  --nb-library-gutter: 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #ffffff;
  box-shadow: none;
  overflow: hidden;

  position: sticky;
  top: 86px;
  max-height: calc((var(--vh) * 100) - 102px);
  display: flex;
  flex-direction: column;
  isolation: isolate;
}

@supports (height: 100svh) {
  body#engtools-body .nb-library {
    max-height: calc(100svh - 102px);
  }
}

body#engtools-body .nb-library::before {
  content: none;
}

body#engtools-body .nb-lib-head {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px var(--nb-library-gutter) 11px;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  background: transparent;
}

body#engtools-body .nb-lib-title {
  color: #0a0c10;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

body#engtools-body .nb-lib-title::before {
  content: none;
}

body#engtools-body .nb-lib-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

body#engtools-body .nb-lib-hint {
  margin-top: 3px;
  color: rgba(10, 12, 16, 0.42);
  font-size: 11px;
  line-height: 1.4;
}

body#engtools-body .nb-lib-hint a,
body#engtools-body .nb-lib-hint .nb-link {
  color: rgba(10, 12, 16, 0.42);
  text-decoration: none;
}

body#engtools-body .nb-lib-search {
  margin-top: 10px;
}

body#engtools-body .nb-note-list {
  flex: 1 1 auto;
  min-height: 0;
  padding: 9px var(--nb-library-gutter) 12px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scroll-padding-block: 12px 16px;
}

body#engtools-body .nb-note-list::-webkit-scrollbar {
  width: 9px;
}

body#engtools-body .nb-note-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(15, 17, 21, 0.24);
  border: 2px solid #fff;
}

body#engtools-body .nb-note-link {
  display: block;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;

  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  padding: 10px 12px;
  margin: 0;
  position: relative;

  transition: background 0.14s ease, border-color 0.14s ease;
}

body#engtools-body .nb-note-link[hidden] {
  display: none;
}

body#engtools-body .nb-note-link::before {
  content: none;
}

body#engtools-body .nb-note-link::after {
  content: none;
}

body#engtools-body .nb-note-link:hover {
  background: rgba(0, 0, 0, 0.025);
}

body#engtools-body .nb-note-link.is-active {
  background: rgba(0, 0, 0, 0.035);
  border-color: #111111;
  box-shadow: none;
}

body#engtools-body .nb-note-link.is-active .nb-note-link-title {
  color: #0a0a0a;
}

body#engtools-body .nb-note-link:hover::before,
body#engtools-body .nb-note-link.is-active::before {
  content: none;
}

body#engtools-body .nb-note-link-title {
  color: #0f1318;
  font-size: 13px;
  line-height: 1.28;
  font-weight: 700;
  padding-right: 4px;
  letter-spacing: 0;
  transition: color 0.22s ease, letter-spacing 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body#engtools-body .nb-note-link-sub {
  margin-top: 5px;
  color: var(--nb-muted);
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body#engtools-body .nb-note-link-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body#engtools-body .nb-note-link-meta .d {
  color: rgba(10, 12, 16, 0.42);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

body#engtools-body .nb-note-link-meta .t {
  display: none;
}

body#engtools-body .nb-lib-foot {
  padding: 11px 16px 12px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

/* ---------------------------------------------------------------------
   Reading area
   --------------------------------------------------------------------- */
body#engtools-body .nb-reader {
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: #ffffff;
  box-shadow: none;
  padding: clamp(32px, 3vw, 56px) clamp(28px, 3.6vw, 64px);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  overflow-anchor: none;
}

body#engtools-body .nb-reader::before {
  content: none;
}

body#engtools-body .nb-reader::after {
  content: none;
}

body#engtools-body .nb-article {
  max-width: none;
  margin: 0;
  position: relative;
  z-index: 2;
}

body#engtools-body .nb-article[hidden] {
  display: none;
}

/* The article receives programmatic focus when the active note changes so
   screen readers announce the new title. Hide the focus ring for that path
   (mouse/click → programmatic focus) but keep it for real keyboard nav
   (Tab into the article) via :focus-visible. */
body#engtools-body .nb-article:focus {
  outline: none;
}
body#engtools-body .nb-article:focus-visible {
  outline: 2px solid var(--nb-accent, #ff7a00);
  outline-offset: 4px;
  border-radius: 6px;
}

body#engtools-body .nb-h2 {
  margin: 36px 0 16px;
  color: #0a0a0a;
  font-size: clamp(20px, 1.3vw, 24px);
  font-weight: 700;
  letter-spacing: -0.024em;
  line-height: 1.28;
  text-decoration: none;
  padding: 0 0 14px;
  border-left: 0;
  border-bottom: none;
  position: relative;
}

body#engtools-body .nb-article-body > .nb-h2:first-child {
  margin-top: 6px;
}

body#engtools-body .nb-h2::before {
  content: none;
}

body#engtools-body .nb-h2::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 36px;
  height: 2px;
  background: var(--nb-accent-deep);
  border-radius: 2px;
}

body#engtools-body .nb-h3 {
  margin: 32px 0 10px;
  color: #171717;
  font-size: clamp(16px, 1.05vw, 18px);
  font-weight: 600;
  letter-spacing: -0.014em;
  line-height: 1.4;
  text-decoration: none;
  padding-left: 0;
  border-left: 0;
}

body#engtools-body .nb-h3::before {
  content: none;
}

body#engtools-body .nb-p {
  color: rgba(15, 17, 21, 0.88);
  font-size: clamp(16px, 1vw, 17px);
  line-height: 1.72;
  letter-spacing: 0;
  text-align: justify;
  text-align-last: left;
  text-justify: inter-word;
  text-wrap: pretty;
  hyphens: none;
  margin: 0 0 20px;
  max-width: none;
}

body#engtools-body .nb-mobile-break {
  display: none;
}

body#engtools-body .nb-article-body > .nb-p:first-of-type {
  font-size: clamp(17px, 1.08vw, 18px);
  color: rgba(15, 17, 21, 0.9);
  line-height: 1.7;
}

body#engtools-body .nb-ul {
  margin: 4px 0 22px;
  padding-left: 0;
  list-style: none;
}

body#engtools-body .nb-ul li {
  color: rgba(15, 17, 21, 0.88);
  font-size: clamp(16px, 1vw, 17px);
  line-height: 1.72;
  letter-spacing: 0;
  text-align: left;
  hyphens: none;
  margin: 8px 0;
  padding-left: 22px;
  position: relative;
}

body#engtools-body .nb-ul li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.78em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: rgba(10, 10, 10, 0.5);
}

body#engtools-body .nb-inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgba(15, 17, 21, 0.05);
  border: 1px solid rgba(15, 17, 21, 0.10);
  border-radius: 5px;
  padding: 1px 6px;
  color: #1a2030;
  font-size: 0.87em;
}

body#engtools-body .nb-approx-temp {
  display: inline-flex;
  align-items: baseline;
  gap: 0.22em;
  white-space: nowrap;
  font-size: 0.96em;
}

body#engtools-body .nb-approx-symbol {
  display: inline-block;
  font-family: "Outfit", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  font-size: 0.88em;
  font-weight: 500;
  line-height: 1;
  transform: translateY(-0.02em);
}

body#engtools-body .nb-temp-value {
  font-weight: 700;
  letter-spacing: 0;
}

body#engtools-body .nb-math {
  margin: 2px 0 14px;
  text-align: left;
}

body#engtools-body .nb-math mjx-container[display="true"] {
  margin: 6px 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  color: rgba(10, 12, 16, 0.88);
  --mjx-line-thickness: 0.045em;
}

body#engtools-body .nb-math mjx-container[display="true"] mjx-math {
  font-size: 0.98em;
  font-weight: 400;
}

body#engtools-body .nb-math mjx-container[display="true"] mjx-mtext,
body#engtools-body .nb-math mjx-container[display="true"] mjx-utext {
  font-family: inherit;
  font-weight: 400;
}

body#engtools-body .nb-math mjx-container[display="true"] mjx-c {
  font-weight: 400;
}

body#engtools-body .nb-p mjx-container[display="true"] {
  margin: 6px 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
  color: rgba(10, 12, 16, 0.88);
  --mjx-line-thickness: 0.045em;
}

body#engtools-body .nb-p mjx-container[display="true"] mjx-math {
  font-size: 0.98em;
  font-weight: 400;
}

body#engtools-body .nb-p mjx-container[display="true"] mjx-mtext,
body#engtools-body .nb-p mjx-container[display="true"] mjx-utext {
  font-family: inherit;
  font-weight: 400;
}

body#engtools-body .nb-p mjx-container[display="true"] mjx-c {
  font-weight: 400;
}

body#engtools-body .nb-link {
  color: #0a0a0a;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(255, 122, 0, 0.45);
  transition: text-decoration-color 0.15s ease;
}

body#engtools-body .nb-link:hover {
  color: #0a0a0a;
  text-decoration-color: var(--nb-accent-deep);
}

body#engtools-body .nb-code {
  margin: 20px 0;
  padding: 16px 18px;
  border-radius: var(--nb-radius-md);
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-top: 3px solid rgba(255, 122, 0, 0.5);
  background: #0c0f15;
  color: #c8d0de;
  overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  line-height: 1.75;
}

body#engtools-body .nb-callout {
  margin: 28px 0;
  padding: 14px 18px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.025);
  color: rgba(15, 17, 21, 0.86);
  font-size: clamp(15px, 0.96vw, 16px);
  line-height: 1.7;
  font-weight: 400;
  position: relative;
}

body#engtools-body .nb-callout::before {
  content: none;
}

body#engtools-body .nb-hr {
  border: 0;
  margin: 36px 0;
  height: 1px;
  background: rgba(0, 0, 0, 0.06);
  position: relative;
}

body#engtools-body .nb-hr::after {
  content: ". . .";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  padding: 0 12px;
  color: rgba(0,0,0,0.22);
  font-size: 14px;
  letter-spacing: 6px;
  line-height: 1;
}

/* ---------------------------------------------------------------------
   Figures (inline reading style)
   --------------------------------------------------------------------- */
body#engtools-body .nb-figures {
  margin-top: 18px;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
}

body#engtools-body .nb-figure {
  margin: 0 0 28px;
  padding: 6px;
  border-radius: var(--nb-radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: #fff;
}

body#engtools-body .nb-figure:only-child {
  grid-column: 1 / -1;
}

body#engtools-body .nb-figure-link {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(15, 17, 21, 0.08);
  background: #fff;
}

body#engtools-body .nb-figure-img {
  display: block;
  width: 100%;
  max-height: min(720px, 76vh);
  object-fit: contain;
  background: #fff;
  transition: transform 0.2s ease;
}

body#engtools-body .nb-figure-link:hover .nb-figure-img {
  transform: scale(1.01);
}

body#engtools-body .nb-figure-cap {
  margin-top: 9px;
  padding-bottom: 2px;
  color: var(--nb-muted);
  font-size: 12px;
  line-height: 1.65;
}

/* ---------------------------------------------------------------------
   Footer and floating controls
   --------------------------------------------------------------------- */
body#engtools-body .nb-article-foot {
  margin-top: 32px;
  max-width: none;
  margin-left: 0;
  margin-right: 0;
  padding: 20px 0 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.09);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
}

body#engtools-body .nb-article-foot [data-nav="prev"] {
  justify-self: start;
}

body#engtools-body .nb-article-foot [data-nav="next"] {
  justify-self: end;
}

body#engtools-body .nb-article-signature {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: rgba(10, 12, 16, 0.42);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  white-space: nowrap;
}

body#engtools-body .nb-signature-brand {
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
}

body#engtools-body .nb-signature-x {
  font-size: 13px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--nb-accent-deep);
}

body#engtools-body .nb-signature-tail {
  margin-left: 6px;
  color: rgba(10, 12, 16, 0.38);
  font-size: 11px;
  font-weight: 500;
}

body#engtools-body .nb-fab {
  display: none;
}

body#engtools-body .nb-clipboard-proxy {
  position: fixed;
  top: 0;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

body#engtools-body .nb-article:not([hidden]) {
  animation: nb-article-in 0.38s cubic-bezier(0.2, 0.65, 0.22, 1) both;
}

@keyframes nb-article-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (min-width: 900px) {
  body#engtools-body .nb-figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1200px) {
  body#engtools-body .nb-topbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  body#engtools-body .nb-topbar-right {
    align-items: flex-start;
    gap: 7px;
  }

  body#engtools-body .nb-topbar-date-row {
    justify-content: flex-start;
  }

  body#engtools-body .nb-hero-actions {
    justify-content: flex-start;
  }

  body#engtools-body .nb-lead {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    max-width: none;
    line-height: 1.48;
  }

  body#engtools-body .nb-library {
    position: relative;
    top: auto;
    max-height: none;
  }

  body#engtools-body .nb-fab {
    display: none;
  }
}

@media (max-width: 992px) {
  body#engtools-body .nb-topbar {
    padding: 10px 12px;
    gap: 7px;
  }

  body#engtools-body .nb-topbar-left {
    display: contents;
  }

  body#engtools-body .nb-h1-row {
    order: 1;
    flex-wrap: wrap;
  }

  body#engtools-body .nb-h1 {
    white-space: normal;
  }

  body#engtools-body .nb-lead {
    order: 2;
  }

  body#engtools-body .nb-topbar-right {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    order: 4;
  }

  body#engtools-body .nb-hero-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
  }

  body#engtools-body .nb-library-updated {
    display: inline-flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 5px;
    color: rgba(10, 12, 16, 0.56);
    white-space: nowrap;
  }

  body#engtools-body .nb-library-updated .k {
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.72px;
    text-transform: uppercase;
  }

  body#engtools-body .nb-library-updated .v {
    font-size: 10px;
    font-weight: 700;
    color: rgba(10, 12, 16, 0.72);
  }

  body#engtools-body #nbLibraryToggle,
  body#engtools-body #nbToggleFocus,
  body#engtools-body .nb-publish-date--top {
    height: 28px;
    min-height: 28px;
    padding: 0 9px;
    font-size: 9px;
    letter-spacing: 0.86px;
  }

  body#engtools-body #nbLibraryToggle {
    justify-self: start;
  }

  body#engtools-body #nbToggleFocus {
    justify-self: start;
  }

  body#engtools-body .nb-topbar-date-row {
    display: none;
  }

  body#engtools-body.nb-focus .nb-shell {
    gap: 8px;
  }

  body#engtools-body.nb-focus .nb-topbar {
    padding: 9px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    border-color: rgba(255, 122, 0, 0.58);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.08);
  }

  body#engtools-body.nb-focus .nb-lead,
  body#engtools-body.nb-focus .nb-topbar-date-row,
  body#engtools-body.nb-focus #nbLibraryToggle {
    display: none;
  }

  body#engtools-body.nb-focus .nb-topbar-right {
    width: auto;
    display: block;
    grid-column: 2;
  }

  body#engtools-body.nb-focus .nb-hero-actions {
    display: flex;
    justify-content: flex-end;
  }

  body#engtools-body.nb-focus #nbToggleFocus {
    grid-column: auto;
  }

  body#engtools-body .nb-app {
    grid-template-columns: 1fr;
  }

  body#engtools-body .nb-library {
    position: relative;
    top: auto;
    max-height: none;
  }

  body#engtools-body .nb-reader {
    padding: 18px;
  }

  body#engtools-body.nb-focus .nb-reader {
    padding: 16px 14px;
    border-color: rgba(255, 122, 0, 0.76);
  }

  body#engtools-body .nb-article-head,
  body#engtools-body .nb-article-body,
  body#engtools-body .nb-figures,
  body#engtools-body .nb-article-foot {
    max-width: none;
  }

  body#engtools-body .nb-article-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 6px;
    overflow: hidden;
  }

  body#engtools-body .nb-article-foot [data-nav="prev"],
  body#engtools-body .nb-article-foot [data-nav="next"] {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    height: 30px;
    padding: 0 9px;
    font-size: 9px;
    letter-spacing: 0.75px;
    justify-content: center;
  }

  body#engtools-body .nb-article-signature {
    flex: 0 0 auto;
    min-height: 30px;
    padding: 0 8px;
    margin-inline: 0;
  }

  body#engtools-body .nb-signature-brand,
  body#engtools-body .nb-signature-x {
    font-size: 12px;
  }

  body#engtools-body .nb-signature-tail {
    display: inline;
    margin-left: 4px;
    font-size: 10px;
    letter-spacing: 0;
  }

}

@media (max-width: 640px) {
  body#engtools-body {
    --nb-pad-x: 8px;
  }

  body#engtools-body .nb-h1 {
    font-size: 24px;
    white-space: normal;
  }

  body#engtools-body .nb-p,
  body#engtools-body .nb-ul li {
    font-size: 16px;
    line-height: 1.7;
  }

  body#engtools-body .nb-p {
    max-width: none;
    text-align: justify;
    text-align-last: left;
    text-justify: inter-word;
    text-wrap: wrap;
    -webkit-hyphens: none;
    hyphens: none;
  }

  body#engtools-body .nb-mobile-break {
    display: block;
    height: 0;
  }

  body#engtools-body .nb-h2 {
    margin: 28px 0 12px;
    padding-left: 12px;
  }

  body#engtools-body .nb-h2::before {
    content: none;
  }
}

/* ---------------------------------------------------------------------
   Mobile frame parity with Blog (prevent top text bleed)
   --------------------------------------------------------------------- */
@media (max-width: 1200px) {
  body#engtools-body .mil-frame {
    padding: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    height: 90px;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
  }

  body#engtools-body .mil-frame .mil-frame-top {
    height: 90px;
    background-color: rgba(0, 0, 0, 0.95);
    border-bottom: solid 1px rgba(255, 255, 255, 0.1);
    padding: 0 30px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
}

@supports (-webkit-touch-callout: none) {
  @media (max-width: 1200px) {
    body#engtools-body::before {
      content: "";
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: calc(env(safe-area-inset-top, 0px) + 1px);
      background: #080808;
      z-index: 1001;
      pointer-events: none;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  body#engtools-body * {
    transition: none;
    scroll-behavior: auto;
    animation: none;
  }
}

/* =====================================================================
   Reading Progress Bar
   ===================================================================== */
body#engtools-body .nb-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 10;
  overflow: hidden;
  border-radius: var(--nb-radius-xl) var(--nb-radius-xl) 0 0;
}

body#engtools-body .nb-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--nb-accent-deep);
  transition: width 0.12s linear;
  border-radius: 0 2px 2px 0;
}

/* =====================================================================
   Article header - clean engineering document layout
   ===================================================================== */
body#engtools-body .nb-article-head {
  max-width: none;
  margin: 0;
  padding: 0 0 12px;
  border-bottom: 0;
  position: relative;
}

body#engtools-body .nb-article-head::after {
  content: none;
}

body#engtools-body .nb-article-head-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* Published date: inline label with calendar icon */
body#engtools-body .nb-publish-date {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: none;
  padding: 0;
  white-space: nowrap;
}

body#engtools-body .nb-publish-date .nb-meta-icon {
  color: rgba(10, 12, 16, 0.4);
}

body#engtools-body .nb-publish-date .k {
  color: rgba(10, 12, 16, 0.42);
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgba(10, 12, 16, 0.18);
}

body#engtools-body .nb-publish-date .v {
  color: rgba(10, 12, 16, 0.62);
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.2px;
}

/* Article title */
body#engtools-body .nb-article-title {
  margin: 18px 0 0;
  color: #0a0a0a;
  font-weight: 800;
  letter-spacing: -0.034em;
  line-height: 1.08;
  font-size: clamp(28px, 2vw, 40px);
  text-wrap: balance;
  text-decoration: none;
}

/* Summary - clean abstract-style lead text */
body#engtools-body .nb-article-summary {
  margin: 10px 0 0;
  color: rgba(10, 10, 10, 0.55);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.55;
  max-width: 68ch;
  font-style: normal;
  font-weight: 400;
  letter-spacing: -0.005em;
}

@media (min-width: 1200px) {
  body#engtools-body .nb-article-summary {
    max-width: none;
    font-size: clamp(15px, 0.88vw, 17px);
    line-height: 1.5;
    white-space: nowrap;
  }
}

body#engtools-body .nb-article-body {
  padding: 18px 0 8px;
  max-width: none;
  margin: 0;
  overflow-wrap: break-word;
  word-break: normal;
}

/* =====================================================================
   Article meta - inline icon + text, no framed pills
   ===================================================================== */
body#engtools-body .nb-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  padding: 0;
  min-height: auto;
  color: rgba(10, 12, 16, 0.52);
  font-size: 12.5px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  border-radius: 0;
}

body#engtools-body .nb-meta-item > span {
  line-height: 1;
}

body#engtools-body .nb-meta-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  color: rgba(10, 12, 16, 0.42);
}

/* Thin vertical divider between article meta items */
body#engtools-body .nb-article-meta {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  column-gap: 0;
  row-gap: 8px;
  flex: 0 0 auto;
  justify-content: flex-end;
}

body#engtools-body .nb-article-meta > .nb-meta-item,
body#engtools-body .nb-article-meta > .nb-meta-action {
  padding-left: 12px;
  padding-right: 12px;
  position: relative;
}

body#engtools-body .nb-article-meta > .nb-meta-item:first-child,
body#engtools-body .nb-article-meta > .nb-meta-action:first-child {
  padding-left: 0;
}

body#engtools-body .nb-article-meta > .nb-meta-item + .nb-meta-item::before,
body#engtools-body .nb-article-meta > .nb-meta-item + .nb-meta-action::before,
body#engtools-body .nb-article-meta > .nb-meta-action + .nb-meta-item::before,
body#engtools-body .nb-article-meta > .nb-meta-action + .nb-meta-action::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 10px;
  background: rgba(10, 12, 16, 0.1);
}

/* Copy link as an inline action */
body#engtools-body .nb-meta-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 2px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  color: var(--nb-accent-deep);
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
  box-shadow: none;
  transition: transform 0.14s ease, color 0.15s ease;
}

body#engtools-body .nb-meta-action:hover {
  transform: translateY(-1px);
  color: #d56300;
  box-shadow: none;
}

body#engtools-body .nb-meta-action:hover .nb-meta-icon {
  color: currentColor;
}

body#engtools-body .nb-meta-action:focus-visible {
  outline: none;
  box-shadow: var(--nb-focus-ring);
}

body#engtools-body .nb-meta-action .nb-meta-icon {
  color: currentColor;
}

@media (max-width: 992px) {
  body#engtools-body .nb-article-head-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  body#engtools-body .nb-article-meta {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

@media (max-width: 640px) {
  body#engtools-body .nb-article-title {
    font-size: 21px;
  }
}

/* =====================================================================
   Focus mode - reader border tweak
   ===================================================================== */
body#engtools-body.nb-focus .nb-reader {
  border-top-color: var(--nb-accent-deep);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
}

/* =====================================================================
   Search wrapper with inline icon
   ===================================================================== */
body#engtools-body .nb-search-wrap {
  position: relative;
  display: block;
  height: 44px;
}

body#engtools-body .nb-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #0a0a0a;
  pointer-events: none;
  z-index: 1;
}

body#engtools-body .nb-search-wrap .nb-search,
body#engtools-body .nb-search-wrap .nb-search--side {
  height: 44px;
  margin-bottom: 0;
  padding: 0 16px 0 48px;
  line-height: 44px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #ffffff;
}

body#engtools-body .nb-search-wrap .nb-search:focus {
  background: #ffffff;
  border-color: rgba(255, 122, 0, 0.5);
}

body#engtools-body .nb-search-wrap .nb-search::placeholder {
  color: rgba(10, 12, 16, 0.4);
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 500;
}
