:root {
  --nrv-red: #d50f34;
  --nrv-red-dark: #a70d2b;
  --ink: #20232a;
  --soft-ink: #3f4650;
  --muted: #6b7280;
  --line: #e5e7eb;
  --panel: #f7f8fa;
  --dark: #111318;
  --dark-soft: #1d2129;
  --sidebar-width: 300px;
  --soft-shadow: 0 14px 38px rgb(17 19 24 / 4%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 42px;
}

body {
  margin: 0;
  background: #fff;
  color: var(--soft-ink);
  font-family:
    Inter, Lato, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
}

a {
  color: var(--nrv-red-dark);
}

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid rgb(255 255 255 / 8%);
  background: linear-gradient(180deg, #111318 0%, #191d25 100%);
  color: #fff;
}

.brand {
  position: relative;
  padding: 1.25rem 1.05rem 1rem;
  background: var(--dark);
}

.brand::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: var(--nrv-red);
  content: "";
}

.brand > a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  font-size: 1.12rem;
  font-weight: 850;
  line-height: 1.2;
  text-decoration: none;
}

.brand img {
  width: 142px;
  height: auto;
}

.search-box {
  position: relative;
  display: block;
  margin-top: 0.9rem;
}

.search-box svg {
  position: absolute;
  top: 50%;
  left: 0.9rem;
  width: 17px;
  fill: none;
  stroke: rgb(255 255 255 / 58%);
  stroke-linecap: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 42px;
  padding: 0 1rem 0 2.65rem;
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: 999px;
  outline: 0;
  background: rgb(255 255 255 / 7.5%);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
}

.search-box input:focus {
  border-color: rgb(213 15 52 / 72%);
  box-shadow: 0 0 0 3px rgb(213 15 52 / 18%);
}

.search-box input::placeholder {
  color: rgb(255 255 255 / 55%);
}

.primary-nav {
  padding: 0.25rem 0 2rem;
}

.nav-caption {
  margin: 1.65rem 1.25rem 0.35rem;
  color: var(--nrv-red);
  font-size: 0.79rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.primary-nav > a {
  display: block;
  min-height: 38px;
  padding: 0.5rem 1.05rem 0.5rem 1.25rem;
  border-left: 3px solid transparent;
  color: rgb(255 255 255 / 72%);
  font-size: 0.91rem;
  line-height: 1.4;
  text-decoration: none;
}

.primary-nav > a:hover {
  border-left-color: var(--nrv-red);
  background: rgb(213 15 52 / 12%);
  color: #fff;
}

.primary-nav > a.active {
  border-left-color: var(--nrv-red);
  background: rgb(255 255 255 / 7%);
  color: #fff;
  font-weight: 800;
}

.nav-muted {
  cursor: default;
}

.section-nav {
  padding: 0.35rem 0 0.65rem;
  background: rgb(255 255 255 / 3.5%);
}

.chapter-nav-label {
  margin: 0.8rem 1.25rem 0.3rem;
  color: var(--nrv-red);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.section-nav a,
.section-nav span {
  display: block;
  min-height: 34px;
  padding: 0.5rem 1.05rem 0.5rem 1.65rem;
  border-left: 3px solid transparent;
  color: rgb(255 255 255 / 58%);
  font-size: 0.86rem;
  line-height: 1.45;
  text-decoration: none;
}

.section-nav span {
  color: rgb(255 255 255 / 34%);
  cursor: default;
}

.section-nav a:hover,
.section-nav a.current {
  border-left-color: var(--nrv-red);
  background: rgb(213 15 52 / 10%);
  color: #fff;
}

.section-nav a.active-chapter {
  border-left-color: var(--nrv-red);
  background: rgb(255 255 255 / 6%);
  color: #fff;
  font-weight: 800;
}

.section-nav a.chapter-two-link {
  margin: 0;
  padding: 0.5rem 1.05rem 0.5rem 1.65rem;
  border: 0;
  border-left: 3px solid transparent;
  background: transparent;
  color: rgb(255 255 255 / 58%);
  font-weight: 400;
}

.section-nav a.chapter-two-link:hover {
  border-left-color: var(--nrv-red);
  background: rgb(213 15 52 / 10%);
  color: #fff;
  cursor: pointer;
}

.section-nav a.chapter-two-link.active-chapter {
  border-left-color: var(--nrv-red);
  background: rgb(255 255 255 / 6%);
  color: #fff;
  font-weight: 800;
}

.sidebar-note {
  margin: auto 1.25rem 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(255 255 255 / 9%);
  color: rgb(255 255 255 / 38%);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.content-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1120px);
  justify-content: center;
  gap: 0;
  min-height: 100vh;
  margin: 0 auto;
  padding: 4.2rem min(5vw, 4.5rem) 5.5rem;
}

.content {
  min-width: 0;
}

.document-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  color: var(--nrv-red);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.home-link {
  display: inline-flex;
  align-items: center;
  margin: 0 0 1.35rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
  text-decoration: none;
}

.home-link:hover {
  color: var(--nrv-red-dark);
}

.draft-label {
  padding: 0.25rem 0.55rem;
  border: 1px solid #efc5cd;
  background: #fff7f8;
  color: var(--nrv-red-dark);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.kicker-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.language-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
}

.language-switch a {
  padding: 0.24rem 0.55rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.5;
  text-decoration: none;
  text-transform: none;
}

.language-switch a + a {
  border-left: 1px solid var(--line);
}

.language-switch a:hover,
.language-switch a.active {
  background: var(--nrv-red);
  color: #fff;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  font-family: inherit;
}

h1 {
  margin: 0 0 2.15rem;
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
  font-size: clamp(2rem, 3vw, 3rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.12;
}

.bottom-author {
  margin: 2.2rem 0 0.45rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  line-height: 1;
  opacity: 0.42;
  text-align: right;
}

h2 {
  margin: 2.8rem 0 1.25rem;
  font-size: clamp(1.55rem, 2vw, 2.2rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.18;
}

h2::before {
  display: block;
  width: 44px;
  height: 3px;
  margin-bottom: 0.78rem;
  background: var(--nrv-red);
  content: "";
}

.chapter-section {
  margin-top: 4.2rem;
  padding-top: 0.5rem;
}

h3 {
  margin: 2.6rem 0 1.1rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
  font-size: clamp(1.28rem, 1.8vw, 1.52rem);
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
}

h3::before {
  display: block;
  width: 42px;
  height: 3px;
  margin-bottom: 0.7rem;
  background: var(--nrv-red);
  content: "";
}

h4 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
  font-weight: 850;
}

p {
  margin: 0 0 1.05rem;
}

.lead {
  max-width: none;
  margin-bottom: 1.65rem;
  color: #4b5563;
  font-size: 1.09rem;
  line-height: 1.75;
}

.scope-note {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  margin: 2.2rem 0 2.75rem;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--nrv-red);
  background: var(--panel);
}

.scope-note strong {
  color: var(--ink);
}

.scope-note span {
  color: var(--muted);
}

.chapter-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 2.1rem 0 2.4rem;
}

/* Legacy blocks from the earlier single-page draft must never show again.
   This also protects VS Code Simple Browser/Webview when it keeps an old DOM
   but loads the current stylesheet. */
.chapter-overview,
.chapter-local-nav {
  display: none !important;
}

.chapter-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--soft-shadow);
}

.chapter-card > span {
  color: var(--nrv-red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.chapter-card strong {
  display: block;
  margin: 0.5rem 0;
  font-size: 1.03rem;
  line-height: 1.35;
}

.chapter-card small {
  color: var(--muted);
  font-weight: 750;
}

.chapter-card-next {
  border-color: #efc5cd;
  border-left: 5px solid var(--nrv-red);
  background:
    linear-gradient(135deg, rgb(213 15 52 / 8%), transparent 52%), #fff;
}

.chapter-card-next strong,
.chapter-card-next small {
  color: var(--nrv-red-dark);
}

.chapter-card:hover {
  border-color: var(--nrv-red);
  transform: translateY(-1px);
}

.chapter-card-disabled {
  background: var(--panel);
  color: var(--muted);
}

.chapter-switcher {
  margin: 0 0 2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.chapter-switcher-bottom {
  margin: 2.3rem 0 1.1rem;
}

.chapter-switcher-label {
  display: block;
  margin-bottom: 0.85rem;
  color: var(--nrv-red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chapter-switcher div {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chapter-switcher a,
.chapter-switcher .disabled {
  display: block;
  min-height: 0;
  padding: 0.82rem 0.95rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--soft-ink);
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.45;
  text-decoration: none;
}

.chapter-switcher a:hover {
  border-color: rgb(213 15 52 / 35%);
  background: #fff;
  color: var(--nrv-red-dark);
}

.chapter-switcher a.current {
  border-color: var(--line);
  border-left-color: var(--nrv-red);
  border-left-width: 4px;
  background: #fff;
  color: var(--nrv-red-dark);
}

.chapter-switcher .disabled {
  color: var(--muted);
  cursor: default;
  opacity: 0.72;
}

.chapter-local-nav {
  margin: 2rem 0 2.7rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.chapter-local-nav > span {
  display: block;
  margin-bottom: 0.75rem;
  color: var(--nrv-red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.chapter-local-nav div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem 1rem;
}

.chapter-local-nav a {
  display: block;
  padding: 0.55rem 0.65rem;
  border-left: 3px solid var(--line);
  color: var(--soft-ink);
  font-size: 0.9rem;
  line-height: 1.45;
  text-decoration: none;
}

.chapter-local-nav a:hover,
.chapter-local-nav a.current {
  border-left-color: var(--nrv-red);
  background: #fff7f8;
  color: var(--nrv-red-dark);
}

.chapter-local-nav-bottom {
  margin-top: 3rem;
}

.rationale-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.7rem 0 1rem;
}

.rationale-card {
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--nrv-red);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.rationale-card > span {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--nrv-red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rationale-card strong {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.4;
}

.rationale-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.65;
}

.rationale-summary {
  margin: 0 0 1.7rem;
  padding: 0.95rem 1.05rem;
  border-left: 4px solid var(--nrv-red);
  background: #fff7f8;
  color: var(--soft-ink);
}

.rationale-summary strong {
  color: var(--nrv-red-dark);
}

.equipment-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 1.7rem 0;
}

.equipment-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.85rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.equipment-card > span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #efc5cd;
  background: #fff7f8;
  color: var(--nrv-red);
  font-size: 0.74rem;
  font-weight: 850;
}

.equipment-card h4 {
  margin-bottom: 0.35rem;
}

.equipment-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.equipment-card-accent {
  border-left: 4px solid var(--nrv-red);
}

.monitor-role-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 1.7rem 0 1.1rem;
  border: 1px solid var(--line);
  background: var(--line);
}

.monitor-role-note > div {
  padding: 1.15rem;
  background: var(--panel);
}

.monitor-role-note span,
.download-type {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--nrv-red);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.monitor-role-note strong {
  display: block;
  margin-bottom: 0.42rem;
  color: var(--ink);
}

.monitor-role-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.download-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.7rem 0 2rem;
}

.download-card {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 1.3rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--nrv-red);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.download-card h4 {
  font-size: 1.05rem;
}

.download-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.download-card a,
.pending-link {
  display: block;
  margin-top: auto;
  padding: 0.75rem 0.85rem;
  border: 1px solid #efc5cd;
  background: #fff7f8;
  color: var(--nrv-red-dark);
  font-size: 0.84rem;
  font-weight: 850;
  line-height: 1.45;
  text-decoration: none;
}

.download-card a:hover {
  border-color: var(--nrv-red);
  background: #fff;
}

.download-card-pending {
  border-top-color: #9ca3af;
}

.pending-link {
  border-color: var(--line);
  background: var(--panel);
  color: var(--muted);
}

.procedure-steps {
  display: grid;
  gap: 0;
  margin: 1.7rem 0;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.procedure-steps li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.88rem 0;
  border-bottom: 1px solid var(--line);
}

.procedure-steps span {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  background: var(--nrv-red);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 850;
}

.procedure-steps p {
  margin: 0.28rem 0 0;
  color: var(--soft-ink);
  line-height: 1.6;
}

.formula-panel {
  display: grid;
  gap: 0;
  margin: 1.4rem 0 2rem;
  padding: 0 1.2rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--nrv-red);
  background:
    linear-gradient(135deg, rgb(213 15 52 / 4%), transparent 48%), #fff;
}

.equation-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 32px minmax(260px, 1.45fr);
  gap: 0.75rem;
  align-items: center;
  padding: 1.35rem 0;
}

.equation-row + .equation-row {
  border-top: 1px solid var(--line);
}

.equation-name {
  overflow-wrap: anywhere;
  color: var(--nrv-red-dark);
  font-size: clamp(0.88rem, 1.6vw, 1.02rem);
  font-weight: 850;
  letter-spacing: -0.01em;
}

.equation-equals {
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 500;
  text-align: center;
}

.equation-fraction {
  display: grid;
  min-width: 0;
  color: var(--ink);
  font-size: clamp(0.82rem, 1.45vw, 0.98rem);
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.equation-fraction > span {
  overflow-wrap: anywhere;
  padding: 0.35rem 0.55rem;
}

.equation-fraction > span:first-child {
  border-bottom: 2px solid var(--ink);
}

.measurement-formula {
  border-left-color: #f6a87d;
  background:
    linear-gradient(135deg, rgb(188 236 255 / 20%), transparent 38%),
    linear-gradient(315deg, rgb(255 180 135 / 14%), transparent 44%), #fff;
}

.measurement-formula .term-outer {
  color: #2f8ea9;
  font-weight: 900;
}

.measurement-formula .term-inner {
  color: #55a93d;
  font-weight: 900;
}

.measurement-formula .term-intervals {
  color: #d7793f;
  font-weight: 900;
}

.measurement-figure img {
  display: block;
  background: #7f837d;
}

.monitor-setup-figure img {
  display: block;
  max-height: 620px;
  object-fit: contain;
  background: #f4f4f4;
}

.placeholder-figure {
  background: #fff;
}

.image-placeholder {
  display: flex;
  min-height: 330px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.55rem;
  padding: 2rem;
  border: 14px solid #fff;
  background:
    linear-gradient(135deg, rgb(213 15 52 / 6%), transparent 48%),
    repeating-linear-gradient(
      -45deg,
      #f5f6f8,
      #f5f6f8 12px,
      #fafafb 12px,
      #fafafb 24px
    );
  color: var(--ink);
  text-align: center;
}

.image-placeholder > span {
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--nrv-red);
  background: #fff;
  color: var(--nrv-red);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.image-placeholder strong {
  max-width: 660px;
  font-size: 1.05rem;
  line-height: 1.45;
}

.image-placeholder small {
  max-width: 700px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.6;
}

.measurement-placeholder .image-placeholder {
  min-height: 390px;
}

.practical-list {
  display: grid;
  gap: 0.65rem;
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.practical-list li {
  position: relative;
  padding: 0.82rem 0.95rem 0.82rem 2.4rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--soft-ink);
  line-height: 1.55;
}

.practical-list li::before {
  position: absolute;
  top: 0.88rem;
  left: 0.92rem;
  color: var(--nrv-red);
  content: "—";
  font-weight: 900;
}

.capture-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.5rem 0 2rem;
  padding: 0;
  list-style: none;
}

.capture-checklist li {
  position: relative;
  min-height: 74px;
  padding: 0.95rem 1rem 0.95rem 3rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--soft-ink);
  font-size: 0.9rem;
  line-height: 1.55;
}

.capture-checklist li::before {
  position: absolute;
  top: 1rem;
  left: 1rem;
  width: 18px;
  height: 18px;
  border: 2px solid var(--nrv-red);
  background: #fff7f8;
  content: "";
}

.doc-figure {
  margin: 2.2rem 0 2.75rem;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.doc-figure img {
  width: 100%;
  background: #fff;
}

.figure-label {
  padding: 0.68rem 0.9rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  color: var(--nrv-red-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.doc-figure figcaption {
  padding: 1rem 1.15rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.figure-grid {
  display: grid;
  gap: 1rem;
  padding: 1rem;
  background: #fff;
}

.figure-grid.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.figure-grid.capture-guidance-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.figure-grid > div {
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel);
}

.figure-grid img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #808080;
}

.fixation-comparison img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
}

.figure-grid span {
  display: block;
  padding: 0.65rem 0.75rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.45;
}

.pattern-figure img {
  max-height: 520px;
  object-fit: contain;
  background: #808080;
}

.pattern-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.pattern-specs span {
  padding: 0.34rem 0.55rem;
  border: 1px solid #efc5cd;
  background: #fff;
  color: var(--nrv-red-dark);
  font-size: 0.78rem;
  font-weight: 800;
}

.wide-figure img {
  max-height: 540px;
  object-fit: contain;
}

.diagram-figure {
  background: #fbfbfc;
}

.diagram-figure img {
  padding: clamp(1rem, 3vw, 2.5rem);
}

.calibration-types {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 1.8rem 0 1.25rem;
}

.calibration-type {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--ink);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.calibration-type.stereo-type {
  border-top-color: var(--nrv-red);
}

.type-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--line);
}

.type-heading span {
  color: var(--nrv-red-dark);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.type-heading strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.type-summary,
.includes-note {
  min-height: 4.8rem;
  margin: 1rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.includes-note {
  padding: 0.8rem 0.9rem;
  border-left: 3px solid var(--nrv-red);
  background: #fff7f8;
  color: var(--soft-ink);
  font-weight: 650;
}

.parameter-groups {
  margin: 0;
}

.parameter-groups > div {
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.parameter-groups dt {
  margin-bottom: 0.25rem;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 850;
}

.parameter-groups dd {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.6;
}

.type-use {
  margin: auto 0 0;
  padding-top: 1rem;
  color: var(--soft-ink);
  font-size: 0.88rem;
}

.type-use strong {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--nrv-red-dark);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.model-note {
  margin: 1.2rem 0 2rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 0.88rem;
}

.concept-callout {
  margin: 2.4rem 0 1.4rem;
  padding: 1.5rem 1.6rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--nrv-red);
  background: #fff;
}

.concept-callout > span {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--nrv-red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.concept-callout h4 {
  margin-bottom: 0.65rem;
  font-size: 1.13rem;
}

.concept-callout p:last-child {
  margin-bottom: 0;
}

.calibration-rectify-note {
  margin: 1.6rem 0;
}

.step-definitions {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.step-definitions div {
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  background: #fff;
}

.step-definitions dt {
  margin-bottom: 0.3rem;
  color: var(--ink);
  font-weight: 850;
}

.step-definitions dd {
  margin: 0;
  color: var(--muted);
}

.camera-use-list {
  margin: 1.8rem 0 2rem;
  border-top: 1px solid var(--line);
}

.camera-use {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 1rem;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--line);
}

.camera-index {
  color: var(--nrv-red);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.camera-use p {
  margin: 0;
  color: var(--muted);
}

.supporting-example {
  margin-top: 1.5rem;
}

.next-section {
  margin-top: 3.2rem;
  padding: 1.6rem 1.75rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--nrv-red);
  background: #fff;
}

.next-section > span {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--nrv-red);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.next-section strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--ink);
  font-size: 1.15rem;
}

.next-section p {
  margin: 0;
  color: var(--muted);
}

.transition-note {
  margin: 2.5rem 0 0;
  padding: 1.1rem 1.2rem;
  border-left: 4px solid var(--nrv-red);
  background: var(--panel);
  color: var(--soft-ink);
  font-weight: 650;
}

.article-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 1.1rem 0 3.2rem;
}

.pager-link {
  display: flex;
  min-height: 58px;
  align-items: center;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
  text-decoration: none;
}

.pager-next {
  justify-content: flex-end;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  text-align: right;
}

.pager-prev {
  background: #fff;
}

.pager-link:hover {
  border-color: var(--nrv-red);
}

.pager-disabled {
  color: var(--muted);
  background: var(--panel);
  font-weight: 700;
  cursor: default;
}

/* DVS Rectify guide */
body.rectify-doc-page .content {
  max-width: 1180px;
}

body.rectify-doc-page .scope-note p {
  margin: 0;
}

body.rectify-doc-page .scope-note {
  grid-template-columns: 140px minmax(0, 1fr);
  padding: 1rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
}

body.rectify-doc-page .doc-section,
body.rectify-doc-page .rectify-topic {
  scroll-margin-top: 36px;
}

body.rectify-doc-page .doc-section > p,
body.rectify-doc-page .rectify-topic > p {
  max-width: 1080px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

body.rectify-doc-page .rectify-topic {
  margin: 2rem 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  border-left: 0;
}

body.rectify-doc-page .rectify-topic h4 {
  margin: 0 0 0.7rem;
  color: var(--ink);
  font-size: clamp(1.08rem, 1.7vw, 1.3rem);
}

body.rectify-doc-page figure {
  margin: 1.65rem auto;
}

body.rectify-doc-page .doc-figure,
body.rectify-doc-page .comparison-figure figure {
  border: 0;
  background: transparent;
  box-shadow: none;
}

body.rectify-doc-page figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: #fff;
}

body.rectify-doc-page figcaption {
  margin: 0;
  padding: 0.7rem 0 0;
  border-top: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
  text-align: left;
}

body.rectify-doc-page .rectify-figure {
  width: min(100%, 700px);
}

body.rectify-doc-page #stereo-search .rectify-figure {
  width: min(100%, 420px);
}

body.rectify-doc-page #feature-search .rectify-figure,
body.rectify-doc-page #ai-depth .rectify-figure,
body.rectify-doc-page #industry .rectify-figure,
body.rectify-doc-page #lens .rectify-figure,
body.rectify-doc-page #nearest .rectify-figure {
  width: min(100%, 560px);
}

body.rectify-doc-page .comparison-figure {
  width: min(100%, 900px);
  margin: 1.8rem auto;
}

body.rectify-doc-page .comparison-figure .figure-grid.two-up {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
  padding: 0;
  background: transparent;
}

body.rectify-doc-page .comparison-figure figure {
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
}

body.rectify-doc-page .comparison-figure img {
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #16181d;
}

body.rectify-doc-page .rectify-flow-row {
  display: grid;
  grid-template-columns: repeat(7, max-content);
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  margin: 1.5rem 0;
  padding: 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: var(--panel);
}

body.rectify-doc-page .rectify-flow-row > span,
body.rectify-doc-page .rectify-flow-row > strong {
  padding: 0.5rem 0.7rem;
  border: 1px solid #d9dfe7;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

body.rectify-doc-page .rectify-flow-row > b {
  color: var(--nrv-red);
}

body.rectify-doc-page .rectify-flow-set .rectify-flow-row {
  grid-template-columns: 95px repeat(5, max-content);
  margin: 0;
  border-bottom: 0;
}

body.rectify-doc-page .rectify-flow-set .rectify-flow-row:last-child {
  border-bottom: 1px solid var(--line);
}

body.rectify-doc-page .rectify-distortion-row {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(360px, 1.15fr);
  gap: 1.4rem;
  align-items: stretch;
  margin: 1.5rem 0;
}

body.rectify-doc-page .rectify-distortion-row .rectify-figure {
  width: 100%;
  margin: 0;
}

body.rectify-doc-page .rectify-distortion-row .rectify-figure img {
  height: 100%;
  min-height: 260px;
  object-fit: contain;
}

body.rectify-doc-page .rectify-math-panel,
body.rectify-doc-page .rectify-calc-steps > div {
  padding: 1.2rem 1.35rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  background: #fbfcfd;
}

body.rectify-doc-page .rectify-math-panel {
  display: grid;
  align-content: center;
  gap: 0.8rem;
}

body.rectify-doc-page .rectify-math-panel math,
body.rectify-doc-page .rectify-calc-steps math {
  min-width: max-content;
  font-size: 1.08rem;
}

body.rectify-doc-page .rectify-io-line,
body.rectify-doc-page .rectify-key-statement,
body.rectify-doc-page .source-note {
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--line);
  border-left: 0;
  background: transparent;
}

body.rectify-doc-page .source-note {
  color: var(--muted);
  font-size: 0.9rem;
}

body.rectify-doc-page .rectify-calc-steps {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}

body.rectify-doc-page .rectify-calc-steps > div > span {
  color: var(--nrv-red-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.rectify-doc-page .rectify-calc-steps h4 {
  margin: 0.35rem 0 0.5rem;
  color: var(--ink);
}

body.rectify-doc-page .rectify-process-heading {
  margin-top: 2.4rem;
  color: var(--ink);
}

body.rectify-doc-page .rectify-process-copy {
  margin-top: -0.35rem;
}

body.rectify-doc-page .rectify-process-figure,
body.rectify-doc-page .workflow-figure,
body.rectify-doc-page .rectify-overview {
  width: min(100%, 720px);
}

body.rectify-doc-page .rectify-overview img {
  padding: 1rem;
}

body.rectify-doc-page .rectify-requirements {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.3rem;
}

@media (max-width: 760px) {
  body.rectify-doc-page .comparison-figure .figure-grid.two-up,
  body.rectify-doc-page .rectify-distortion-row {
    grid-template-columns: 1fr;
  }

  body.rectify-doc-page .rectify-flow-row,
  body.rectify-doc-page .rectify-flow-set .rectify-flow-row {
    grid-template-columns: 1fr;
    text-align: center;
  }

  body.rectify-doc-page .rectify-flow-row > b {
    transform: rotate(90deg);
  }
}

.article-pager + .page-footer {
  margin-top: 0;
}

.page-toc {
  position: sticky;
  top: 2.5rem;
  align-self: start;
  padding-left: 1rem;
  border-left: 1px solid var(--line);
}

.page-toc strong {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--ink);
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-toc a,
.page-toc span {
  display: block;
  padding: 0.42rem 0.55rem;
  border-left: 3px solid transparent;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.4;
  text-decoration: none;
}

.page-toc span {
  color: #a3a8b1;
}

.page-toc a:hover,
.page-toc a.current {
  border-left-color: var(--nrv-red);
  background: transparent;
  color: var(--nrv-red-dark);
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 1.7rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.page-footer a {
  text-decoration: none;
}

.search-empty {
  margin-top: 3rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  text-align: center;
}

.search-hidden {
  display: none;
}

.mobile-header,
.nav-backdrop {
  display: none;
}

@media (max-width: 1120px) {
  .content-wrap {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-toc {
    display: none;
  }

  .chapter-local-nav div,
  .chapter-overview,
  .figure-grid.two-up,
  .figure-grid.capture-guidance-grid,
  .article-pager,
  .equipment-grid,
  .monitor-role-note,
  .download-list,
  .capture-checklist {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  html {
    scroll-padding-top: 72px;
  }

  .mobile-header {
    position: fixed;
    z-index: 40;
    inset: 0 0 auto;
    display: flex;
    height: 58px;
    align-items: center;
    gap: 0.9rem;
    padding: 0 1rem;
    border-bottom: 3px solid var(--nrv-red);
    background: var(--dark);
  }

  .mobile-header a {
    color: #fff;
    font-weight: 800;
    text-decoration: none;
  }

  .menu-button {
    display: grid;
    width: 34px;
    height: 34px;
    place-content: center;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  .menu-button span {
    display: block;
    width: 21px;
    height: 2px;
    background: #fff;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  .nav-backdrop {
    position: fixed;
    z-index: 20;
    inset: 0;
    border: 0;
    background: rgb(17 19 24 / 54%);
  }

  body.nav-open .nav-backdrop {
    display: block;
  }

  .content-wrap {
    margin-left: 0;
    padding: 2.4rem 1.2rem 4rem;
  }

  .rationale-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 15px;
  }

  .document-kicker {
    align-items: flex-start;
  }

  .kicker-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .scope-note {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .calibration-types {
    grid-template-columns: 1fr;
  }

  .type-summary,
  .includes-note {
    min-height: 0;
  }

  .diagram-figure img {
    padding: 0.7rem;
  }

  .image-placeholder {
    min-height: 260px;
    padding: 1.2rem;
  }

  .equation-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
    text-align: center;
  }

  .equation-fraction {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .sidebar {
    transition: none;
  }
}
/* Standalone GitHub Pages additions */
.source-note {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin: 28px 0 42px;
  padding: 22px 26px;
  border: 1px solid var(--border, #dfe4ea);
  border-left: 6px solid var(--accent, #e4003a);
  background: #f6f8fb;
  color: var(--muted, #64748b);
}
.source-note strong {
  color: var(--ink, #111827);
  font-size: 1.05rem;
}
.source-note span {
  line-height: 1.75;
}
.source-note b {
  color: var(--ink, #111827);
}
.home-panels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 30px 0 34px;
}
.home-panel {
  display: block;
  padding: 26px 28px;
  border: 1px solid var(--border, #dfe4ea);
  border-top: 4px solid var(--accent, #e4003a);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
  transition:
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}
.home-panel:hover,
.home-panel:focus-visible {
  border-color: var(--accent, #e4003a);
  transform: translateY(-3px);
  box-shadow: 0 20px 42px rgba(15, 23, 42, 0.1);
}
.home-panel:focus-visible {
  outline: 3px solid rgb(15 118 110 / 22%);
  outline-offset: 3px;
}
.home-panel span {
  display: block;
  margin-bottom: 12px;
  color: var(--accent, #e4003a);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.home-panel h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  line-height: 1.35;
}
.home-panel h2::before {
  display: none;
}
.home-panel p {
  margin: 0;
  color: var(--muted, #64748b);
  line-height: 1.75;
}
.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 36px 0 48px;
}
.sitemap-card {
  display: block;
  min-height: 260px;
  padding: 32px;
  border: 1px solid var(--border, #dfe4ea);
  border-top: 6px solid var(--accent, #e4003a);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.07);
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.sitemap-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #e4003a);
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.11);
}
.calibration-preview-card {
  overflow: hidden;
}
.calibration-card-thumb {
  display: block;
  width: calc(100% + 64px);
  max-width: none;
  height: 172px;
  margin: -32px -32px 24px;
  border-bottom: 1px solid var(--border, #dfe4ea);
  background: #f8fafc;
  object-fit: cover;
}
.sitemap-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  margin-bottom: 24px;
  border: 1px solid #f3b8c5;
  background: #fff7f9;
  color: var(--accent, #e4003a);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.entry-card-kicker {
  display: block;
  margin: 0 0 12px;
  color: var(--accent, #e4003a);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
}
.sitemap-card h2 {
  margin: 0 0 14px;
  font-size: 1.28rem;
  line-height: 1.35;
}
.sitemap-card h2::before {
  display: none;
}
.sitemap-card p {
  margin: 0;
  color: var(--muted, #64748b);
  font-size: 0.96rem;
  line-height: 1.75;
}
.repository-note {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #dfe4ea);
  color: var(--muted, #64748b);
  font-size: 0.92rem;
  text-align: right;
}
@media (max-width: 1100px) {
  .home-panels,
  .sitemap-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .source-note { grid-template-columns: 1fr; gap: 10px; }
  .sitemap-card { min-height: auto; }
}

/* Jay Tech Notes home page: keep the article pages in the NRV red style,
   but make the landing page feel more like a personal technical homepage. */
body.home-page {
  --nrv-red: #0f766e;
  --nrv-red-dark: #115e59;
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
  --border: #dfe6f0;
  background:
    radial-gradient(circle at 12% 4%, rgb(20 184 166 / 9%), transparent 28%),
    radial-gradient(circle at 86% 2%, rgb(15 23 42 / 5%), transparent 24%),
    #ffffff;
}

body.home-page .document-kicker {
  color: var(--accent);
  letter-spacing: 0.08em;
}

body.home-page .draft-label {
  border-color: #cbd5e1;
  background: #f8fafc;
  color: #334155;
}

body.home-page h1 {
  border-bottom-color: #e2e8f0;
}

body.home-page h2::before,
body.home-page h3::before {
  background: var(--accent);
}

body.home-page .lead,
body.home-page .doc-section > p {
  color: #475569;
}

body.home-page .lead {
  margin-bottom: 44px;
}

body.home-page .home-panels {
  margin: 40px 0 58px;
}

body.home-page .chapter-switcher {
  margin: 0 0 76px;
}

body.home-page .doc-section + .doc-section {
  margin-top: 96px;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

body.home-page .project-grid,
body.home-page .sitemap-grid {
  margin-top: 42px;
  margin-bottom: 66px;
}

body.home-page .home-panel {
  border-top-color: var(--accent);
}

body.home-page .home-panel span,
body.home-page .chapter-switcher-label {
  color: var(--accent);
}

body.home-page .source-note {
  border-left-color: var(--accent);
  background: #f8fafc;
}

body.home-page .doc-section > .nrv-docs-link-line {
  margin-top: 8px;
}

body.home-page .doc-section > .nrv-docs-link-description {
  margin-top: 16px;
  margin-bottom: 0;
}

body.home-page .nrv-docs-link-line a {
  color: var(--accent);
  font-weight: 750;
  text-underline-offset: 3px;
}

body.home-page .nrv-docs-url {
  display: inline;
  margin-left: 0.35em;
  font-weight: 500;
  overflow-wrap: anywhere;
}

body.home-page .nrv-docs-link-line a:focus-visible {
  outline: 3px solid rgb(15 118 110 / 24%);
  outline-offset: 2px;
}

body.home-page .chapter-switcher a:hover {
  border-color: rgb(15 118 110 / 28%);
  color: var(--accent);
}

body.home-page .sitemap-card {
  border-top-color: var(--accent);
}

body.home-page .sitemap-card:hover {
  border-color: var(--accent);
}

body.home-page .sitemap-number {
  border-color: #99f6e4;
  background: var(--accent-soft);
  color: var(--accent);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0 48px;
}

.project-card {
  display: block;
  min-height: 230px;
  overflow: hidden;
  padding: 0 0 30px;
  border: 1px solid var(--border, #dfe4ea);
  border-top: 4px solid var(--accent, #0f766e);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent, #0f766e);
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.1);
}

.project-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border, #dfe4ea);
  background: #e2e8f0;
}

.project-card .sitemap-number {
  margin: 26px 30px 16px;
}

.project-card small {
  display: block;
  margin: 0 30px 12px;
  color: var(--accent, #0f766e);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.project-card h2 {
  margin: 0 30px 14px;
  font-size: 1.28rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-card h2::before {
  display: none;
}

.project-card p {
  margin: 0 30px;
  color: var(--muted, #64748b);
  line-height: 1.75;
}

/* Planned work stays on the homepage as non-clickable preview cards. */
#drone-motion-capture .planned-work-grid {
  grid-template-columns: repeat(3, minmax(0, 360px));
  grid-auto-rows: 1fr;
  align-items: stretch;
  justify-content: start;
  gap: 18px;
  margin-bottom: 36px;
}

#drone-motion-capture .plan-card {
  min-height: 0;
  padding-bottom: 20px;
  cursor: default;
}

#drone-motion-capture .plan-card:hover {
  border-color: var(--border, #dfe4ea);
  transform: none;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

#drone-motion-capture .plan-card-link {
  cursor: pointer;
}

#drone-motion-capture .plan-card-link:hover,
#drone-motion-capture .plan-card-link:focus-visible {
  border-color: var(--accent, #0f766e);
  transform: translateY(-3px);
  box-shadow: 0 24px 52px rgba(15, 23, 42, 0.1);
}

#drone-motion-capture .plan-card-link:focus-visible {
  outline: 3px solid rgb(15 118 110 / 24%);
  outline-offset: 3px;
}

#event-stereo-depth .plan-open-label {
  display: inline-flex;
  margin: 18px 30px 0;
  color: var(--accent, #0f766e);
  font-size: 0.82rem;
  font-weight: 850;
}

#drone-motion-capture .plan-thumb-image {
  object-fit: contain;
  background: #fff;
}

#drone-motion-capture .plan-thumb-empty {
  display: block;
  background: #eef2f5;
}

#drone-motion-capture .plan-card .project-thumb {
  height: auto;
  aspect-ratio: 4 / 3;
}

#drone-motion-capture .plan-thumb-frame {
  overflow: hidden;
}

#drone-motion-capture .plan-thumb-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.1);
}

#drone-motion-capture .plan-card .sitemap-number {
  width: 44px;
  height: 44px;
  margin: 18px 20px 12px;
  font-size: 0.82rem;
}

#drone-motion-capture .plan-card small {
  margin: 0 20px 8px;
  font-size: 0.66rem;
}

#drone-motion-capture .plan-card h2 {
  margin: 0 20px 10px;
  font-size: 1.05rem;
  min-height: 2.7em;
}

#drone-motion-capture .plan-card p {
  margin: 0 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

@media (max-width: 980px) {
  #drone-motion-capture .planned-work-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  #drone-motion-capture .planned-work-grid {
    grid-template-columns: 1fr;
  }
}

/* Graduation thesis / capstone plan page. */
/* Initial mocap article: reuse the shared document typography and figure styles. */
.drone-mocap-page h1 {
  word-break: keep-all;
}

.drone-mocap-page .mocap-setup-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.drone-mocap-page .doc-figure img {
  height: auto;
}

.drone-mocap-page .scope-note p {
  margin: 0;
}

.drone-mocap-page .content p a,
.drone-mocap-page .doc-figure figcaption a {
  color: var(--accent);
}

.drone-mocap-page .mocap-setup-grid img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #fff;
}

.drone-mocap-page .mocap-video {
  aspect-ratio: 16 / 9;
  background: #111827;
}

.drone-mocap-page .mocap-demo-figure {
  width: min(100%, 760px);
  margin: 1.6rem auto 2.4rem;
}

.drone-mocap-page .mocap-video iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

@media (max-width: 620px) {
  .drone-mocap-page .mocap-setup-grid {
    grid-template-columns: 1fr;
  }
}

body.planned-detail-page {
  --accent: #0f766e;
  --accent-soft: #ecfdf5;
}

body.planned-detail-page .document-kicker,
body.planned-detail-page .chapter-switcher-label {
  color: var(--accent);
}

body.planned-detail-page .draft-label {
  border-color: #99f6e4;
  background: var(--accent-soft);
  color: var(--accent);
}

body.planned-detail-page h2::before,
body.planned-detail-page h3::before {
  background: var(--accent);
}

body.planned-detail-page .home-link:hover,
body.planned-detail-page .page-footer a,
body.planned-detail-page .chapter-switcher a:hover,
body.planned-detail-page .chapter-switcher a.current {
  color: var(--accent);
}

body.planned-detail-page .chapter-switcher a.current {
  border-left-color: var(--accent);
}

body.planned-detail-page .scope-note {
  border-left-color: var(--accent);
}

body.planned-detail-page .planned-hero {
  width: min(100%, 940px);
  margin-right: auto;
  margin-left: auto;
}

body.planned-detail-page .planned-hero img {
  max-height: 680px;
  object-fit: contain;
}

body.camera-case-page .camera-case-photo-grid img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

body.camera-case-page .camera-case-final-grid {
  margin: 2.2rem 0 2.75rem;
}

body.camera-case-page .camera-case-final-grid img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #f4f5f7;
}

body.planned-detail-page .lab-timeline article {
  border-top-color: var(--accent);
}

body.planned-detail-page .lab-timeline span {
  border-color: rgb(15 118 110 / 22%);
  background: var(--accent-soft);
  color: var(--accent);
}

body.planned-detail-page .wiki-panel {
  border-left-color: var(--accent);
}

body.planned-detail-page .doc-section h4 {
  margin: 1.65rem 0 0.55rem;
}

body.planned-detail-page .thesis-process-list {
  margin: 1.8rem 0;
  padding: 0;
  border-block: 1px solid var(--line);
  list-style: none;
}

body.planned-detail-page .thesis-process-list li {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  padding: 1rem 0;
}

body.planned-detail-page .thesis-process-list li + li {
  border-top: 1px solid var(--line);
}

body.planned-detail-page .thesis-process-list strong {
  color: var(--ink);
}

body.planned-detail-page .thesis-process-list span {
  color: var(--muted);
}

body.planned-detail-page .thesis-equipment-note {
  margin-top: 1.8rem;
}

body.planned-detail-page .thesis-role-list {
  margin: 1.5rem 0 1.8rem;
  border-top: 1px solid var(--line);
}

body.planned-detail-page .thesis-role-list > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 1.05rem 0;
  border-bottom: 1px solid var(--line);
}

body.planned-detail-page .thesis-role-list dt {
  color: var(--accent);
  font-weight: 850;
}

body.planned-detail-page .thesis-role-list dd {
  margin: 0;
}

body.planned-detail-page .thesis-check-list {
  margin: 1.5rem 0 1.8rem;
  padding: 1.2rem 1.4rem 1.2rem 2.6rem;
  border-left: 4px solid var(--accent);
  background: var(--panel);
}

body.planned-detail-page .thesis-check-list li + li {
  margin-top: 0.5rem;
}

body.planned-detail-page .thesis-check-list strong {
  color: var(--ink);
}

body.planned-detail-page .thesis-table-wrap {
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  border: 1px solid var(--line);
}

body.planned-detail-page .thesis-schedule-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.9rem;
}

body.planned-detail-page .thesis-schedule-table th,
body.planned-detail-page .thesis-schedule-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

body.planned-detail-page .thesis-schedule-table thead th {
  background: var(--panel);
  color: var(--ink);
  font-weight: 850;
}

body.planned-detail-page .thesis-schedule-table tbody th {
  width: 110px;
  color: var(--accent);
  font-weight: 850;
  white-space: nowrap;
}

body.planned-detail-page .thesis-schedule-table tbody tr:last-child th,
body.planned-detail-page .thesis-schedule-table tbody tr:last-child td {
  border-bottom: 0;
}

@media (max-width: 620px) {
  body.planned-detail-page .thesis-process-list li,
  body.planned-detail-page .thesis-role-list > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.project-card-compact {
  min-height: 190px;
  padding-bottom: 24px;
}

.project-card-compact .sitemap-number {
  width: 48px;
  height: 48px;
  margin: 24px 26px 14px;
  font-size: 0.9rem;
}

.project-card-compact small {
  margin: 0 26px 10px;
}

.project-card-compact h2 {
  margin: 0 26px 12px;
  font-size: 1.12rem;
}

.project-card-compact p {
  margin: 0 26px;
  line-height: 1.65;
}

.pdf-actions {
  display: flex;
  justify-content: flex-end;
  margin: 26px 0 18px;
}

.pdf-open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.65rem 1rem;
  border: 1px solid rgb(15 118 110 / 24%);
  background: var(--accent-soft, #ecfdf5);
  color: var(--accent, #0f766e);
  font-weight: 850;
  line-height: 1.3;
  text-decoration: none;
}

.pdf-open-link:hover {
  border-color: var(--accent, #0f766e);
  color: var(--accent, #0f766e);
}

.pdf-viewer-section {
  overflow: hidden;
  border: 1px solid var(--border, #dfe6f0);
  background: #f8fafc;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}

.pdf-viewer {
  display: block;
  width: 100%;
  height: min(78vh, 980px);
  min-height: 680px;
  border: 0;
  background: #fff;
}

.pdf-viewer-poster {
  min-height: 860px;
}

@media (max-width: 1100px) {
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .pdf-actions {
    justify-content: stretch;
  }

  .pdf-open-link {
    width: 100%;
  }

  .pdf-viewer {
    height: 72vh;
    min-height: 520px;
  }

  body.home-page .lead {
    margin-bottom: 34px;
  }

  body.home-page .home-panels {
    margin: 32px 0 46px;
  }

  body.home-page .chapter-switcher {
    margin-bottom: 58px;
  }

  body.home-page .doc-section + .doc-section {
    margin-top: 72px;
    padding-top: 14px;
  }
}

/* SoC/FPGA bus note cards and diagrams */
.hardware-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hardware-card-grid .sitemap-card {
  min-height: 285px;
}

.bus-map-grid,
.axi-flow {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 28px 0 34px;
}

.axi-flow {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.bus-map-grid article,
.axi-flow div {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--nrv-red);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.bus-map-grid span,
.axi-flow span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 34px;
  margin-bottom: 0.8rem;
  padding: 0 0.55rem;
  border: 1px solid rgb(213 15 52 / 22%);
  background: rgb(213 15 52 / 6%);
  color: var(--nrv-red-dark);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bus-map-grid h4,
.axi-flow strong {
  display: block;
  margin: 0 0 0.5rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.bus-map-grid p,
.axi-flow p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

@media (max-width: 1100px) {
  .hardware-card-grid,
  .bus-map-grid,
  .axi-flow {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 760px) {
  .hardware-card-grid,
  .bus-map-grid,
  .axi-flow {
    grid-template-columns: 1fr;
  }

  .definition-grid {
    grid-template-columns: 1fr;
  }

  .rtl-card pre {
    font-size: 0.78rem;
  }
}

.lab-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin: 26px 0 34px;
}

.lab-timeline article {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--nrv-red);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.lab-timeline span {
  display: inline-flex;
  margin-bottom: 0.7rem;
  padding: 0.25rem 0.55rem;
  border: 1px solid rgb(213 15 52 / 22%);
  background: rgb(213 15 52 / 6%);
  color: var(--nrv-red-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lab-timeline h4 {
  margin: 0 0 0.45rem;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.35;
}

.lab-timeline p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.wiki-panel {
  margin: 1.8rem 0;
  padding: 1.25rem 1.35rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--nrv-red);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.wiki-panel h4 {
  margin: 0 0 0.6rem;
  color: var(--ink);
}

.wiki-panel p:last-child {
  margin-bottom: 0;
}

.signal-table-wrap {
  overflow-x: auto;
  margin: 1.3rem 0 2rem;
  border: 1px solid var(--line);
  background: #fff;
}

.signal-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.signal-table th,
.signal-table td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.signal-table th {
  background: var(--panel);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.signal-table td:first-child {
  color: var(--nrv-red-dark);
  font-weight: 850;
  white-space: nowrap;
}

.rtl-card {
  margin: 1.4rem 0 2rem;
  border: 1px solid var(--line);
  background: #10131a;
  color: #e7edf7;
  box-shadow: var(--soft-shadow);
}

.rtl-card > span {
  display: block;
  padding: 0.68rem 0.9rem;
  border-bottom: 1px solid rgb(255 255 255 / 10%);
  color: #ffb7c2;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rtl-card pre {
  overflow-x: auto;
  margin: 0;
  padding: 1rem 1.1rem 1.15rem;
  font-size: 0.86rem;
  line-height: 1.65;
}

.rtl-card code {
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.4rem 0 2rem;
}

.definition-grid article {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  background: #fff;
}

.definition-grid h3,
.definition-grid h4 {
  margin-bottom: 0.45rem;
  color: var(--ink);
}

.definition-grid p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

.sequence-list {
  display: grid;
  gap: 0.75rem;
  margin: 1.25rem 0 2rem;
  counter-reset: sequence;
}

.sequence-list li {
  position: relative;
  list-style: none;
  padding: 0.85rem 1rem 0.85rem 3rem;
  border: 1px solid var(--line);
  background: #fff;
}

.sequence-list li::before {
  position: absolute;
  top: 0.86rem;
  left: 0.9rem;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 999px;
  background: var(--nrv-red);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.45rem;
  text-align: center;
  counter-increment: sequence;
  content: counter(sequence);
}

.sequence-list strong {
  color: var(--ink);
}

/* The personal GitHub-project collection stays compact on desktop. */
#side-projects .project-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#side-projects .project-card {
  min-height: 0;
  padding-bottom: 20px;
}

#side-projects .project-thumb {
  aspect-ratio: 4 / 3;
}

#side-projects .project-card .sitemap-number {
  width: 44px;
  height: 44px;
  margin: 18px 20px 12px;
  font-size: 0.82rem;
}

#side-projects .project-card small {
  margin: 0 20px 8px;
  font-size: 0.66rem;
}

#side-projects .project-card h2 {
  margin: 0 20px 10px;
  font-size: 1.05rem;
}

#side-projects .project-card p {
  margin: 0 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* SNN: two evidence cards plus a compact two-row code stack. */
#snn-research .project-grid {
  grid-template-columns: repeat(3, minmax(0, 360px));
  justify-content: start;
  gap: 18px;
  margin-bottom: 36px;
}

#snn-research .project-card {
  min-height: 0;
  padding-bottom: 18px;
}

#snn-research .project-card:not(.project-card-compact) {
  padding-bottom: 20px;
}

#snn-research .project-card:not(.project-card-compact) .project-thumb {
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

#snn-research .project-card:not(.project-card-compact) .sitemap-number {
  width: 44px;
  height: 44px;
  margin: 18px 20px 12px;
  font-size: 0.82rem;
}

#snn-research .project-card:not(.project-card-compact) small {
  margin: 0 20px 8px;
  font-size: 0.66rem;
}

#snn-research .project-card:not(.project-card-compact) h2 {
  margin: 0 20px 10px;
  font-size: 1.05rem;
}

#snn-research .project-card:not(.project-card-compact) p {
  margin: 0 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

#snn-research .snn-compact-stack {
  display: grid;
  min-width: 0;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 1100px) {
  #side-projects .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  #side-projects .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  #snn-research .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #snn-research .snn-compact-stack {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: 1fr;
  }
}

@media (max-width: 480px) {
  #snn-research .project-grid {
    grid-template-columns: 1fr;
  }

  #snn-research .snn-compact-stack {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(2, minmax(0, 1fr));
  }
}

/* NRV FPGA troubleshooting pages are scoped so other article styles stay unchanged. */
#nrv-fpga-troubleshooting .troubleshooting-card-grid {
  grid-template-columns: repeat(2, minmax(0, 360px));
  justify-content: start;
  gap: 18px;
  margin-bottom: 36px;
}

#nrv-fpga-troubleshooting .project-card {
  min-height: 0;
  padding-bottom: 20px;
}

#nrv-fpga-troubleshooting .project-thumb {
  aspect-ratio: 4 / 3;
}

#nrv-fpga-troubleshooting .project-card .sitemap-number {
  width: 44px;
  height: 44px;
  margin: 18px 20px 12px;
  font-size: 0.82rem;
}

#nrv-fpga-troubleshooting .project-card small {
  margin: 0 20px 8px;
  font-size: 0.66rem;
}

#nrv-fpga-troubleshooting .project-card h2 {
  margin: 0 20px 10px;
  font-size: 1.05rem;
}

#nrv-fpga-troubleshooting .project-card p {
  margin: 0 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

/* Keep the DVS, SoC and competition entry cards at the compact troubleshooting scale. */
#nrv-dvs-calibration .sitemap-card,
#nrv-dvs-rectify .sitemap-card,
#event-stereo-depth .sitemap-card,
#hardware-notes .sitemap-card {
  min-height: 0;
  padding: 0 0 20px;
  overflow: hidden;
}

#nrv-dvs-calibration .calibration-card-thumb,
#nrv-dvs-rectify .calibration-card-thumb,
#event-stereo-depth .calibration-card-thumb {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  margin: 0;
}

#event-stereo-depth .depth-card-thumb-empty {
  display: block;
  background: #eef2f5;
}

#nrv-dvs-calibration .sitemap-number,
#nrv-dvs-rectify .sitemap-number,
#event-stereo-depth .sitemap-number,
#hardware-notes .sitemap-number {
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: 18px 20px 12px;
  font-size: 0.82rem;
}

#nrv-dvs-calibration .entry-card-kicker,
#nrv-dvs-rectify .entry-card-kicker,
#event-stereo-depth .entry-card-kicker,
#hardware-notes .entry-card-kicker {
  margin: 0 20px 8px;
  font-size: 0.66rem;
}

#nrv-dvs-calibration .sitemap-card h2,
#nrv-dvs-rectify .sitemap-card h2,
#event-stereo-depth .sitemap-card h2,
#hardware-notes .sitemap-card h2 {
  margin: 0 20px 10px;
  font-size: 1.05rem;
}

#nrv-dvs-calibration .sitemap-card p,
#nrv-dvs-rectify .sitemap-card p,
#event-stereo-depth .sitemap-card p,
#hardware-notes .sitemap-card p {
  margin: 0 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

body.troubleshooting-page .troubleshooting-summary {
  display: grid;
  margin: 1.6rem 0 1.2rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--nrv-red);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

body.troubleshooting-page .summary-row {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
}

body.troubleshooting-page .summary-row:last-child {
  border-bottom: 0;
}

body.troubleshooting-page .summary-row strong {
  color: var(--nrv-red-dark);
}

body.troubleshooting-page .summary-row span {
  color: var(--soft-ink);
  line-height: 1.6;
}

body.troubleshooting-page .jump-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.2rem 0 2.2rem;
}

body.troubleshooting-page .jump-links a {
  padding: 0.5rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 750;
  text-decoration: none;
}

body.troubleshooting-page .jump-links a:hover {
  border-color: var(--nrv-red);
  color: var(--nrv-red-dark);
}

body.troubleshooting-page .debug-flow {
  display: grid;
  grid-template-columns: repeat(7, auto);
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  margin: 1.5rem 0 2rem;
  padding: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

body.troubleshooting-page .debug-flow div {
  display: grid;
  min-width: 145px;
  padding: 0.8rem;
  border: 1px solid var(--line);
  background: #fff;
}

body.troubleshooting-page .debug-flow div > span {
  color: var(--nrv-red);
  font-size: 0.72rem;
  font-weight: 850;
}

body.troubleshooting-page .debug-flow strong {
  margin: 0.25rem 0;
  color: var(--ink);
}

body.troubleshooting-page .debug-flow small {
  color: var(--muted);
}

body.troubleshooting-page .debug-flow > b {
  color: var(--nrv-red);
}

body.troubleshooting-page .troubleshooting-figure {
  max-width: 920px;
  margin-right: auto;
  margin-left: auto;
}

body.troubleshooting-page .troubleshooting-figure img {
  width: 100%;
  max-height: 620px;
  object-fit: contain;
  background: #f4f5f7;
}

/* Keep the troubleshooting article's reference images secondary to the explanation. */
body.troubleshooting-page .doc-figure {
  margin: 1.5rem auto 2rem;
}

/* Each troubleshooting reference has a different aspect ratio. */
body.troubleshooting-page .figure-flash-failure {
  width: min(100%, 880px);
}

body.troubleshooting-page .figure-qspi-board {
  width: min(100%, 560px);
}

body.troubleshooting-page .figure-erase-result {
  width: min(100%, 460px);
}

body.troubleshooting-page .figure-program-result {
  width: min(100%, 620px);
}

body.troubleshooting-page .figure-i2c-ports {
  width: min(100%, 820px);
}

body.troubleshooting-page .figure-i2c-architecture {
  width: min(100%, 760px);
}

body.troubleshooting-page .figure-i2c-data-stream {
  width: min(100%, 920px);
}

body.troubleshooting-page .figure-i2c-waveform {
  width: min(100%, 880px);
}

body.troubleshooting-page .figure-camera-system {
  width: min(100%, 920px);
}

body.troubleshooting-page .doc-figure figcaption {
  padding: 0.7rem 0.8rem;
  font-size: 0.78rem;
}

body.troubleshooting-page .hardware-reference-figure {
  max-width: 720px;
}

/* Competition notes: scoped additions for the home collection and six articles. */

.competition-collection {
  display: grid;
  gap: 72px;
  margin: 42px 0 66px;
}

.capture-guidance-figure {
  width: min(100%, 1080px);
  margin: 1.75rem auto 2rem;
}

.capture-guidance-figure .figure-grid img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
}

.capture-guidance-table-wrap {
  overflow-x: auto;
  margin: 1.25rem 0 2rem;
  border: 1px solid var(--line);
}

.capture-guidance-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: var(--soft-ink);
  font-size: 0.92rem;
  line-height: 1.55;
}

.capture-guidance-table th,
.capture-guidance-table td {
  padding: 0.82rem 0.9rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.capture-guidance-table th {
  width: 30%;
  color: var(--ink);
  background: #f7f8fa;
  font-weight: 800;
}

.calibration-workflow-page .workflow-figure {
  width: min(100%, 960px);
  margin: 1.35rem auto 1.15rem;
}

.calibration-workflow-page .workflow-figure img {
  max-height: 480px;
  object-fit: contain;
}

.calibration-workflow-page .workflow-entry-figure {
  width: min(100%, 780px);
}

.calibration-workflow-page .sorting-samples-figure {
  width: min(100%, 360px);
  margin: 1.25rem auto 1.5rem;
}

.calibration-workflow-page .sorting-samples-figure img {
  max-height: 210px;
  object-fit: contain;
}

.calibration-workflow-page .workflow-figure figcaption {
  color: var(--ink);
}

.yaml-file-block {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: #f6f8fb;
  color: var(--ink);
  font: 700 0.95rem/1.4 "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

.competition-group {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 18px 44px rgb(15 23 42 / 7%);
}

.competition-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
  padding: 26px 28px 24px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.competition-group-header > div {
  max-width: 780px;
}

.competition-group-header span {
  display: block;
  margin-bottom: 8px;
  color: #0f766e;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.competition-group-header h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.4rem;
}

.competition-group-header h3::before {
  display: none;
}

.competition-group-header p {
  margin: 0;
  color: #475569;
  line-height: 1.7;
}

.competition-group-header > strong {
  flex: 0 0 auto;
  padding: 0.55rem 0.75rem;
  border: 1px solid #99f6e4;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 0.82rem;
}

.competition-project-summary {
  margin: 24px 24px 0;
  padding: 22px 24px;
  border: 1px solid #d9e4e8;
  border-left: 4px solid #0f766e;
  background: #f8fafc;
}

.competition-project-summary > span {
  display: block;
  margin-bottom: 0.45rem;
  color: #0f766e;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.competition-project-summary h4 {
  margin: 0 0 0.55rem;
  color: var(--ink);
  font-size: 1.12rem;
  line-height: 1.45;
}

.competition-project-summary > p {
  max-width: 900px;
  margin: 0;
  color: #475569;
  line-height: 1.75;
}

.competition-summary-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 1.25rem 0 0;
}

.competition-summary-facts div {
  padding-top: 0.8rem;
  border-top: 1px solid #cbd5e1;
}

.competition-summary-facts dt {
  margin-bottom: 0.3rem;
  color: #115e59;
  font-size: 0.78rem;
  font-weight: 850;
}

.competition-summary-facts dd {
  margin: 0;
  color: #475569;
  font-size: 0.84rem;
  line-height: 1.65;
}

#competition-case-studies .competition-card-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
  padding: 24px;
  gap: 18px;
}

#competition-case-studies .sitemap-card {
  min-height: 270px;
  padding: 24px 22px;
}

#competition-case-studies .sitemap-card small {
  display: block;
  margin: 1rem 0 0.45rem;
  color: #64748b;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.09em;
}

#competition-case-studies .competition-intro-card {
  border-top: 4px solid #0f766e;
  background: #f0fdfa;
}

#competition-case-studies .competition-intro-card h2 {
  color: #115e59;
}

body.home-page .content-wrap {
  width: 100%;
  max-width: 1640px;
  grid-template-columns: minmax(0, 1120px) 270px;
  align-items: start;
  gap: 52px;
}

body.home-page .home-page-toc {
  top: 2rem;
  margin-top: 8.8rem;
  padding: 1.15rem 0 1.15rem 1.2rem;
  border-left-color: #cbd5e1;
}

body.home-page .home-page-toc strong {
  color: var(--accent);
  font-size: 0.86rem;
}

body.home-page .home-page-toc a {
  padding: 0.68rem 0.72rem;
  font-size: 0.88rem;
  line-height: 1.5;
}

body.home-page .home-page-toc a:hover,
body.home-page .home-page-toc a.current {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

body.competition-page {
  --competition-accent: #0f766e;
  --competition-accent-dark: #115e59;
  --competition-accent-soft: #f0fdfa;
  --nrv-red: var(--competition-accent);
  --nrv-red-dark: var(--competition-accent-dark);
}

body.competition-page .draft-label {
  border-color: color-mix(in srgb, var(--competition-accent) 32%, white);
  background: var(--competition-accent-soft);
  color: var(--competition-accent-dark);
}

body.competition-page .scope-note {
  border-left-color: var(--competition-accent);
  background: var(--competition-accent-soft);
}

body.competition-page .chapter-switcher-label,
body.competition-page .figure-label,
body.competition-page .page-footer a,
body.competition-page .home-link:hover {
  color: var(--competition-accent-dark);
}

body.competition-page .chapter-switcher a:hover {
  border-color: color-mix(in srgb, var(--competition-accent) 34%, white);
  color: var(--competition-accent-dark);
}

body.competition-page .chapter-switcher a.current {
  border-left-color: var(--competition-accent);
  color: var(--competition-accent-dark);
}

body.competition-page .rtl-card > span {
  color: #99f6e4;
}

body.competition-page .sequence-list li::before {
  background: var(--competition-accent);
}

body.competition-page .signal-table td:first-child {
  color: var(--competition-accent-dark);
}

.architecture-flow {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 1.5rem 0 2rem;
}

.architecture-flow span {
  display: flex;
  min-height: 76px;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--competition-accent);
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
}

.architecture-flow b {
  display: flex;
  align-items: center;
  color: var(--competition-accent);
  font-size: 1.15rem;
}

.architecture-flow-long span {
  font-size: 0.86rem;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 1.5rem 0 2rem;
}

.metric-grid article {
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--competition-accent);
  background: #fff;
  text-align: center;
}

.metric-grid strong {
  display: block;
  color: var(--competition-accent-dark);
  font-size: 1.35rem;
  line-height: 1.25;
}

.metric-grid span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
}

.metric-grid-featured article {
  background: var(--competition-accent-soft);
}

.check-list {
  margin: 1.4rem 0 2rem;
  padding: 1.15rem 1.3rem 1.15rem 2.5rem;
  border-left: 4px solid var(--competition-accent);
  background: var(--competition-accent-soft);
}

.check-list li + li {
  margin-top: 0.55rem;
}

body.competition-page .doc-figure img {
  max-height: 720px;
  object-fit: contain;
}

.work-concept-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem;
  margin: 2rem 0 2.5rem;
  padding: 1.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.work-concept-grid h3 {
  margin: 0 0 0.8rem;
  color: var(--ink);
  font-size: 1.08rem;
}

.work-concept-grid h3::before {
  display: none;
}

.work-concept-grid ul {
  margin: 0;
  padding-left: 1.2rem;
}

.work-concept-grid li + li {
  margin-top: 0.55rem;
}

.concept-list {
  display: grid;
  gap: 0.65rem;
  margin: 1.35rem 0 2rem;
}

.concept-list div {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--line);
}

.concept-list dt {
  color: var(--competition-accent-dark);
  font-weight: 850;
}

.concept-list dd {
  margin: 0;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.2rem;
  margin: 2rem 0 2.75rem;
}

.evidence-grid .doc-figure {
  margin: 0;
}

.compact-figure {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.competition-overview-page .lead {
  max-width: 820px;
}

.competition-overview-page .overview-project {
  padding: 1.8rem 0 0;
}

.overview-project-heading > span {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--competition-accent-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.overview-project-heading h2 {
  margin-top: 0;
}

.overview-facts {
  margin-bottom: 1.5rem;
}

.project-at-a-glance {
  margin: 2rem 0 3rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: #f8fafc;
}

.project-at-a-glance h2 {
  margin-top: 0;
}

.project-identity-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 1.2rem 0 0;
}

.project-identity-grid div {
  min-height: 126px;
  padding: 1rem;
  border: 1px solid #dbe4ea;
  border-top: 3px solid var(--competition-accent);
  background: #fff;
}

.project-identity-grid dt {
  margin-bottom: 0.45rem;
  color: var(--competition-accent-dark);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.project-identity-grid dd {
  margin: 0;
  color: #334155;
  font-size: 0.88rem;
  line-height: 1.6;
}

.scope-pipeline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.25fr) auto minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  margin: 1.5rem 0 2rem;
}

.scope-pipeline-aix {
  grid-template-columns:
    minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1.2fr) auto
    minmax(0, 1fr) auto minmax(0, 1fr);
}

.scope-pipeline > b {
  display: flex;
  align-items: center;
  color: var(--competition-accent);
  font-size: 1.1rem;
}

.scope-node {
  display: flex;
  min-height: 126px;
  flex-direction: column;
  justify-content: center;
  padding: 1rem;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.scope-node > span {
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.scope-node > strong {
  margin: 0.45rem 0;
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.45;
}

.scope-node > small {
  color: #64748b;
  line-height: 1.5;
}

.scope-node-active {
  border: 2px solid var(--competition-accent);
  background: var(--competition-accent-soft);
  box-shadow: 0 12px 28px rgb(15 118 110 / 10%);
}

.scope-node-external {
  border-style: dashed;
  background: #f8fafc;
}

.verification-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 1.25rem 0 2rem;
}

.verification-status-grid article {
  padding: 1rem;
  border: 1px solid var(--line);
  background: #fff;
}

.verification-status-grid p {
  margin: 0.7rem 0 0;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.65;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.55rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
}

.status-implemented {
  color: #047857;
  background: #ecfdf5;
}

.status-simulated {
  color: #1d4ed8;
  background: #eff6ff;
}

.status-estimated {
  color: #92400e;
  background: #fffbeb;
}

.status-open {
  color: #9f1239;
  background: #fff1f2;
}

.contribution-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 1.5rem 0 2rem;
}

.contribution-matrix article {
  padding: 1.2rem;
  border: 1px solid var(--line);
  background: #fff;
}

.contribution-matrix span {
  color: var(--competition-accent-dark);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.contribution-matrix h3 {
  margin: 0.45rem 0;
  color: var(--ink);
  font-size: 1rem;
}

.contribution-matrix h3::before {
  display: none;
}

.contribution-matrix p {
  margin: 0;
  color: #475569;
  font-size: 0.88rem;
  line-height: 1.65;
}

.article-link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 1.5rem 0 2rem;
}

.article-link-grid.project-index-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.article-link-grid a {
  display: flex;
  min-height: 156px;
  flex-direction: column;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--competition-accent);
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.article-link-grid a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgb(15 23 42 / 9%);
}

.article-link-grid span {
  color: var(--competition-accent-dark);
  font-size: 0.7rem;
  font-weight: 850;
}

.article-link-grid strong {
  margin: 0.6rem 0;
  color: var(--ink);
  line-height: 1.45;
}

.article-link-grid small {
  color: #64748b;
  line-height: 1.55;
}

.ball-board-diagram {
  position: relative;
  width: min(620px, calc(100% - 5rem));
  aspect-ratio: 1;
  margin: 3.2rem auto 2.5rem;
  border: 2px solid #94a3b8;
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), #cbd5e1 50%, transparent calc(50% + 1px)),
    linear-gradient(transparent calc(50% - 1px), #cbd5e1 50%, transparent calc(50% + 1px)),
    #f8fafc;
  box-shadow: inset 0 0 0 10px #fff;
}

.board-dimension,
.board-axis,
.board-direction,
.board-target,
.board-ball {
  position: absolute;
}

.board-dimension {
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.board-dimension-top {
  top: -1.7rem;
  left: 50%;
  transform: translateX(-50%);
}

.board-dimension-side {
  top: 50%;
  right: -2.8rem;
  transform: rotate(90deg) translateY(-50%);
}

.board-axis {
  color: #0f766e;
  font-size: 0.72rem;
  font-weight: 900;
}

.board-axis-x {
  top: calc(50% + 0.45rem);
  right: 0.9rem;
}

.board-axis-y {
  top: 0.9rem;
  left: calc(50% + 0.45rem);
}

.board-direction {
  padding: 0.25rem 0.45rem;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-size: 0.68rem;
  font-weight: 800;
  white-space: nowrap;
}

.board-direction-top {
  top: -0.9rem;
  left: 50%;
  transform: translateX(-50%);
}

.board-direction-right {
  top: 50%;
  right: -2.2rem;
  transform: translateY(-50%) rotate(90deg);
}

.board-direction-bottom {
  bottom: -0.9rem;
  left: 50%;
  transform: translateX(-50%);
}

.board-direction-left {
  top: 50%;
  left: -2.2rem;
  transform: translateY(-50%) rotate(-90deg);
}

.board-target {
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
}

.board-target i {
  width: 54px;
  height: 54px;
  border: 2px dashed #0f766e;
  border-radius: 50%;
  background: rgb(240 253 250 / 76%);
}

.board-target small,
.board-ball small {
  margin-top: 0.35rem;
  color: #475569;
  font-size: 0.65rem;
  font-style: normal;
  line-height: 1.4;
  white-space: nowrap;
}

.board-ball {
  top: 66%;
  left: 68%;
  display: grid;
  justify-items: center;
  transform: translate(-50%, -50%);
  text-align: center;
}

.board-ball i {
  width: 30px;
  height: 30px;
  border: 3px solid #1e3a8a;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 5px 12px rgb(30 58 138 / 24%);
}

.figure-note {
  max-width: 760px;
  margin: 0 auto 1.5rem;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.65;
}

.equation-card {
  overflow-x: auto;
  margin: 1.25rem 0 1.75rem;
  padding: 1.2rem 1.3rem;
  border-left: 4px solid var(--competition-accent);
  background: #0f172a;
}

.equation-card code {
  color: #e2e8f0;
  font-size: 0.88rem;
  line-height: 1.9;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .competition-group-header {
    flex-direction: column;
  }

  #competition-case-studies .competition-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .competition-summary-facts {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .architecture-flow {
    display: grid;
    grid-template-columns: 1fr;
  }

  .architecture-flow b {
    justify-content: center;
    transform: rotate(90deg);
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-identity-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .scope-pipeline,
  .scope-pipeline-aix {
    grid-template-columns: 1fr;
  }

  .scope-pipeline > b {
    justify-content: center;
    transform: rotate(90deg);
  }
}

@media (max-width: 760px) {
  .work-concept-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .concept-list div {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  #competition-case-studies .competition-card-grid,
  .project-identity-grid,
  .verification-status-grid,
  .contribution-matrix,
  .article-link-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .competition-group-header,
  #competition-case-studies .competition-card-grid,
  .competition-project-summary {
    padding: 20px;
  }

  .competition-project-summary {
    margin: 20px 20px 0;
  }

  #competition-case-studies .competition-card-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .ball-board-diagram {
    width: calc(100% - 4rem);
  }

  .board-direction {
    font-size: 0.58rem;
  }
}

@media (max-width: 1400px) {
  body.home-page .content-wrap {
    max-width: none;
    grid-template-columns: minmax(0, 1120px);
    gap: 0;
  }

  body.home-page .home-page-toc {
    display: none;
  }
}

body.troubleshooting-page .control-center-reference-figure {
  max-width: 820px;
}

body.troubleshooting-page .terminal-figure img {
  max-height: 760px;
  background: #000;
}

body.troubleshooting-page .log-block {
  overflow-x: auto;
  margin: 1.3rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid #262b35;
  border-left: 5px solid var(--nrv-red);
  background: #10131a;
  color: #e8edf5;
  font: 0.88rem/1.65 "Cascadia Mono", Consolas, monospace;
}

body.troubleshooting-page .code-block-light {
  border-color: #ccd4de;
  border-left-color: var(--nrv-red);
  background: #f6f8fa;
  color: #182230;
  font: 0.9rem/1.75 "Cascadia Mono", Consolas, "Courier New", monospace;
  letter-spacing: 0;
  tab-size: 4;
}

body.troubleshooting-page .code-block-light code {
  color: inherit;
  font: inherit;
  letter-spacing: 0;
}

body.troubleshooting-page .address-math {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.2rem;
  margin: 1.2rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid var(--line);
  border-left: 5px solid var(--nrv-red);
  background: var(--panel);
}

body.troubleshooting-page .address-math span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

body.troubleshooting-page .address-math strong {
  color: var(--ink);
  font-size: 1.08rem;
}

body.troubleshooting-page .diagnostic-table-wrap {
  overflow-x: auto;
  margin: 1.3rem 0 2rem;
  border: 1px solid var(--line);
  background: #fff;
}

body.troubleshooting-page .diagnostic-table {
  width: 100%;
  min-width: 660px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

body.troubleshooting-page .diagnostic-table th,
body.troubleshooting-page .diagnostic-table td {
  padding: 0.78rem 0.85rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

body.troubleshooting-page .diagnostic-table th {
  background: var(--panel);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

body.troubleshooting-page .diagnostic-table tr:last-child td {
  border-bottom: 0;
}

body.troubleshooting-page .status-chip {
  display: inline-flex;
  padding: 0.25rem 0.48rem;
  border: 1px solid #b9c8bd;
  background: #eff8f1;
  color: #256139;
  font-size: 0.78rem;
  font-weight: 800;
}

body.troubleshooting-page .status-chip.focus {
  border-color: rgb(213 15 52 / 28%);
  background: rgb(213 15 52 / 6%);
  color: var(--nrv-red-dark);
}

body.troubleshooting-page .root-cause-card {
  margin: 1.4rem 0 1.6rem;
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line);
  border-top: 4px solid var(--nrv-red);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

body.troubleshooting-page .root-cause-card > span {
  color: var(--nrv-red);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.troubleshooting-page .root-cause-card h4 {
  margin: 0.45rem 0 0.7rem;
  color: var(--ink);
  font-size: 1.08rem;
}

body.troubleshooting-page .root-cause-card p {
  margin: 0;
}

body.troubleshooting-page .solution-steps {
  display: grid;
  gap: 0.7rem;
  margin: 1.3rem 0 1.6rem;
  padding: 0;
  counter-reset: solution;
}

body.troubleshooting-page .solution-steps li {
  position: relative;
  list-style: none;
  padding: 0.9rem 1rem 0.9rem 3.2rem;
  border: 1px solid var(--line);
  background: #fff;
  line-height: 1.65;
}

body.troubleshooting-page .solution-steps li::before {
  position: absolute;
  top: 0.9rem;
  left: 0.95rem;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--nrv-red);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 850;
  line-height: 1.55rem;
  text-align: center;
  counter-increment: solution;
  content: counter(solution);
}

body.troubleshooting-page .warning-note {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
  padding: 1rem 1.15rem;
  border: 1px solid #e7c68d;
  border-left: 5px solid #c68418;
  background: #fffaf0;
}

body.troubleshooting-page .warning-note strong {
  color: #8b590a;
}

body.troubleshooting-page .warning-note span {
  line-height: 1.65;
}

body.troubleshooting-page .takeaway-list {
  display: grid;
  gap: 0.65rem;
  padding-left: 1.25rem;
}

body.troubleshooting-page .reference-section a {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  body.troubleshooting-page .debug-flow {
    grid-template-columns: 1fr;
  }

  body.troubleshooting-page .debug-flow > b {
    transform: rotate(90deg);
    text-align: center;
  }
}

@media (max-width: 680px) {
  #nrv-fpga-troubleshooting .troubleshooting-card-grid,
  body.troubleshooting-page .summary-row,
  body.troubleshooting-page .warning-note {
    grid-template-columns: 1fr;
  }
}

/* Competition notes — aligned with the homepage section and card system. */
.competition-home {
  --case-accent: var(--accent);
  margin-top: 6rem;
  padding-top: 1.25rem;
  border-top: 1px solid #e2e8f0;
}

.competition-home-heading {
  max-width: 780px;
  margin-bottom: 3.75rem;
}

.competition-project-meta {
  display: block;
  margin: 0 0 0.65rem;
  color: var(--case-accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.competition-home-heading h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.65rem, 2.2vw, 2rem);
  line-height: 1.25;
}

.competition-home-heading h2::before {
  display: block;
}

.competition-home-heading p {
  margin: 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.75;
}

.competition-home .competition-collection {
  gap: 3.5rem;
  margin: 0;
}

.competition-home .competition-group {
  --project-accent: #0f766e;
  --project-soft: #ecfdf5;
  --project-number-border: #99f6e4;
  position: relative;
  overflow: visible;
  border: 0;
  border-top: 4px solid var(--project-accent);
  padding: 2.25rem 2rem 2.5rem;
  background: linear-gradient(180deg, var(--project-soft) 0, #f8fafc 150px);
  box-shadow: none;
}

.competition-project-intro {
  padding: 0 0 1.75rem;
}

.competition-project-intro h3 {
  margin: 0 0 1rem;
  padding: 0;
  border: 0;
  font-size: clamp(1.35rem, 1.8vw, 1.6rem);
  line-height: 1.35;
}

.competition-project-intro h3::before {
  display: block;
  background: var(--project-accent);
}

.competition-project-intro > p:not(.competition-project-meta) {
  max-width: 920px;
  margin: 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.75;
}

.competition-project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 1.5rem 0 0;
}

.competition-project-facts div {
  padding-top: 0.9rem;
  border-top: 2px solid #d9e2e8;
}

.competition-project-facts dt {
  margin-bottom: 0.35rem;
  color: var(--project-accent);
  font-size: 0.8rem;
  font-weight: 800;
}

.competition-project-facts dd {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.65;
}

.competition-home .competition-card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.competition-card {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  padding: 2rem;
  border: 1px solid var(--border, #dfe4ea);
  border-top: 6px solid var(--project-accent);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: 0 18px 40px rgb(15 23 42 / 7%);
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.competition-card:hover {
  border-color: var(--project-accent);
  transform: translateY(-3px);
  box-shadow: 0 24px 52px rgb(15 23 42 / 11%);
}

.competition-card .sitemap-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-width: 58px;
  height: 58px;
  margin-bottom: 24px;
  padding: 0 0.55rem;
  border: 1px solid var(--project-number-border);
  background: var(--project-soft);
  color: var(--project-accent);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.05em;
}

.competition-card .entry-card-kicker {
  color: var(--project-accent);
}

.competition-card h4 {
  margin: 0 0 14px;
  font-size: 1.28rem;
  line-height: 1.35;
}

.competition-card p {
  margin: 0;
  color: #5b6573;
  font-size: 0.96rem;
  line-height: 1.75;
  word-break: keep-all;
}

.competition-card {
  min-height: 0;
  padding: 0 0 20px;
  overflow: hidden;
}

.competition-card .sitemap-number {
  width: 44px;
  min-width: 44px;
  height: 44px;
  margin: 18px 20px 12px;
  font-size: 0.82rem;
}

.competition-card .entry-card-kicker {
  margin: 0 20px 8px;
  font-size: 0.66rem;
}

.competition-card h4 {
  margin: 0 20px 10px;
  font-size: 1.05rem;
}

.competition-card p {
  margin: 0 20px;
  font-size: 0.92rem;
  line-height: 1.6;
}

body.competition-page {
  --competition-accent: #0f766e;
  --competition-accent-dark: #0b5f59;
  --competition-accent-soft: #f3faf9;
  color: #334155;
  font-size: 17px;
  line-height: 1.78;
}

body.competition-page .content-wrap {
  width: min(100%, 1120px);
  padding-top: 3.5rem;
}

body.competition-page .content {
  width: 100%;
}

body.competition-page .document-kicker {
  margin-bottom: 0.7rem;
  color: #0f766e;
  font-size: 0.78rem;
  letter-spacing: 0.045em;
  text-transform: none;
}

body.competition-page .draft-label {
  padding: 0;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 0.78rem;
  letter-spacing: 0;
  white-space: nowrap;
}

body.competition-page .home-link {
  margin-bottom: 1.1rem;
  font-size: 0.84rem;
}

body.competition-page .chapter-switcher {
  margin: 0 0 2rem;
  padding: 1rem;
  border: 1px solid #cbd5e1;
  background: #fff;
}

body.competition-page .chapter-switcher-label {
  display: block;
  margin-bottom: 0.85rem;
  padding: 0;
  color: var(--competition-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.competition-page .chapter-switcher div {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0;
}

body.competition-page .chapter-switcher a {
  display: block;
  margin: 0;
  padding: 0.82rem 0.95rem;
  border: 1px solid #dbe3e8;
  border-left: 4px solid transparent;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.45;
}

body.competition-page .chapter-switcher a:hover {
  border-color: color-mix(in srgb, var(--competition-accent) 34%, white);
  background: #fff;
  color: var(--competition-accent-dark);
}

body.competition-page .chapter-switcher a.current {
  border-color: #dbe3e8;
  border-left-color: var(--competition-accent);
  background: var(--competition-accent-soft);
  color: var(--competition-accent-dark);
}

body.competition-page .chapter-switcher-bottom {
  margin: 2.3rem 0 1.1rem;
}

body.competition-page h1 {
  max-width: 900px;
  margin: 0 0 1.2rem;
  padding: 0;
  border: 0;
  font-size: clamp(2rem, 3.35vw, 2.65rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.22;
  word-break: keep-all;
}

body.competition-page .lead {
  max-width: 900px;
  margin: 0 0 2.4rem;
  color: #475569;
  font-size: 1.06rem;
  line-height: 1.8;
}

body.competition-page .doc-section {
  margin-top: 4.75rem;
}

body.competition-page .doc-section > h2 {
  margin: 0 0 1.15rem;
  padding-top: 1.2rem;
  border-top: 1px solid #cbd5e1;
  font-size: clamp(1.45rem, 2.1vw, 1.85rem);
  line-height: 1.35;
  word-break: keep-all;
}

body.competition-page .doc-section > h2::before {
  display: block;
  background: var(--competition-accent);
}

body.competition-page .doc-section h3 {
  margin: 2.6rem 0 1.1rem;
  padding-top: 1.15rem;
  border-top: 1px solid #cbd5e1;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  line-height: 1.35;
}

body.competition-page .doc-section h3::before {
  display: block;
  background: var(--competition-accent);
}

body.competition-page p,
body.competition-page li,
body.competition-page dd,
body.competition-page td {
  word-break: keep-all;
}

.case-summary {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  margin: 2.2rem 0 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.case-summary h2 {
  margin: 0 0 0.75rem;
  font-size: 1.2rem;
  line-height: 1.45;
}

.case-summary h2::before {
  display: none;
}

.case-summary p {
  margin: 0;
  color: #475569;
}

.case-facts {
  display: grid;
  gap: 0.6rem;
  margin: 0;
}

.case-facts div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 0.75rem;
}

.case-facts dt {
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 800;
}

.case-facts dd {
  margin: 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

.case-flow {
  display: grid;
  grid-template-columns: repeat(var(--flow-count, 4), minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 1.6rem 0 2rem;
  border: 1px solid #cbd5e1;
  background: #cbd5e1;
}

.case-flow-step {
  min-height: 132px;
  padding: 1.1rem;
  background: #fff;
}

.case-flow-step span {
  display: block;
  margin-bottom: 0.5rem;
  color: #0f766e;
  font-size: 0.74rem;
  font-weight: 800;
}

.case-flow-step strong {
  display: block;
  color: #1e293b;
  font-size: 0.96rem;
  line-height: 1.45;
}

.case-flow-step small {
  display: block;
  margin-top: 0.5rem;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.55;
}

.case-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.4rem 0 2rem;
}

.case-card {
  padding: 1.2rem;
  border: 1px solid #dbe3e8;
  background: #fff;
}

.case-card > span {
  color: #0f766e;
  font-size: 0.76rem;
  font-weight: 800;
}

.case-card h3 {
  margin: 0.45rem 0 0.5rem !important;
  padding: 0 !important;
  border: 0 !important;
  font-size: 1.02rem !important;
}

.case-card h3::before {
  display: none !important;
}

.case-card p,
.case-card li {
  color: #566171;
  font-size: 0.9rem;
  line-height: 1.68;
}

.case-card p:last-child,
.case-card ul:last-child {
  margin-bottom: 0;
}

.evidence-note {
  margin: 1.5rem 0 2rem;
  padding: 1rem 1.15rem;
  border-left: 3px solid #0f766e;
  background: #f8fafc;
  color: #475569;
  font-size: 0.92rem;
  line-height: 1.7;
}

.evidence-note strong {
  color: #1e293b;
}

.evidence-note.warning {
  border-left-color: #b45309;
  background: #fffbeb;
}

.result-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 1.5rem 0 2rem;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.result-band article {
  padding: 1.15rem;
  border-right: 1px solid #e2e8f0;
  text-align: left;
}

.result-band article:last-child {
  border-right: 0;
}

.result-band strong {
  display: block;
  color: #0b5f59;
  font-size: 1.25rem;
  line-height: 1.35;
}

.result-band span {
  display: block;
  margin-top: 0.35rem;
  color: #64748b;
  font-size: 0.8rem;
  line-height: 1.45;
}

.code-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.1rem 0 2rem;
}

.code-links a {
  padding: 0.5rem 0.72rem;
  border: 1px solid #cbd5e1;
  color: #0b5f59;
  font: 700 0.82rem/1.4 "Cascadia Mono", Consolas, monospace;
  text-decoration: none;
}

.code-links a:hover {
  border-color: #0f766e;
  background: #f3faf9;
}

body.competition-page .signal-table-wrap {
  margin: 1.4rem 0 2rem;
  overflow-x: auto;
  border: 1px solid #dbe3e8;
}

body.competition-page .signal-table {
  min-width: 680px;
  font-size: 0.88rem;
  line-height: 1.55;
}

body.competition-page .signal-table th,
body.competition-page .signal-table td {
  padding: 0.75rem 0.85rem;
}

body.competition-page .signal-table th {
  background: #f8fafc;
  color: #1e293b;
}

body.competition-page .doc-figure {
  overflow: hidden;
  margin: 1.6rem 0 2.2rem;
  border: 1px solid #dbe3e8;
  background: #fff;
}

body.competition-page .figure-label {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0b5f59;
  font-size: 0.78rem;
  font-weight: 800;
}

body.competition-page .doc-figure img {
  width: 100%;
  max-height: 680px;
  object-fit: contain;
  background: #fff;
}

body.competition-page .doc-figure figcaption {
  padding: 0.75rem 0.9rem;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.82rem;
  line-height: 1.6;
}

body.competition-page .page-footer {
  margin-top: 5rem;
  padding-top: 1.1rem;
  border-top: 1px solid #cbd5e1;
}

body.competition-page .page-footer a {
  font-size: 0.86rem;
}

@media (max-width: 1000px) {
  .competition-home .competition-card-grid,
  .result-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .competition-project-facts {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .case-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-band article:nth-child(2) {
    border-right: 0;
  }

  .result-band article:nth-child(-n + 2) {
    border-bottom: 1px solid #e2e8f0;
  }
}

@media (max-width: 720px) {
  body.competition-page {
    font-size: 16px;
  }

  body.competition-page .content-wrap {
    padding: 2rem 1.25rem 4rem;
  }

  body.competition-page h1 {
    font-size: clamp(1.8rem, 8vw, 2.35rem);
  }

  body.competition-page .lead {
    font-size: 1rem;
  }

  body.competition-page .chapter-switcher div {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.competition-page .chapter-switcher a {
    margin: 0;
  }

  .competition-home .competition-card-grid,
  .case-grid,
  .case-summary,
  .case-flow,
  .result-band {
    grid-template-columns: 1fr;
  }

  .competition-home .competition-group {
    padding: 1.5rem 1rem 1.75rem;
  }

  .competition-card {
    min-height: 0;
  }

  .case-summary {
    gap: 1.5rem;
  }

  .result-band article,
  .result-band article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid #e2e8f0;
  }

  .result-band article:last-child {
    border-bottom: 0;
  }
}

/* Drone mocap second implementation: galleries, process flow and measured loop. */
.mocap-second-page .mocap-v2-video {
  margin-top: 1.5rem;
  width: min(100%, 880px);
  margin-inline: auto;
}

.mocap-second-page .mocap-v2-compact-photo {
  width: min(100%, 680px);
  margin-inline: auto;
}

.mocap-second-page .mocap-v2-aruco-photo {
  width: min(100%, 520px);
}

.mocap-second-page .mocap-v2-compact-photo img {
  display: block;
  width: 100%;
  height: auto;
}

.mocap-second-page .diagram-figure {
  padding: clamp(0.65rem, 1.7vw, 1.15rem);
  background: #fff;
  border: 1px solid rgba(18, 35, 52, 0.14);
}

.mocap-second-page .diagram-figure img,
.mocap-second-page .current-ui-figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.mocap-second-page .mocap-v2-standard-figure,
.mocap-second-page .current-ui-figure {
  width: min(100%, 860px);
  margin-inline: auto;
}

.mocap-second-page .mocap-v2-gallery {
  display: grid;
  gap: 0.8rem;
}

.mocap-second-page .mocap-v2-gallery-four,
.mocap-second-page .mocap-v2-cad-grid,
.mocap-second-page .mocap-v2-comparison-grid,
.mocap-second-page .mocap-v2-case-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mocap-second-page .mocap-v2-gallery-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mocap-second-page .mocap-v2-gallery a {
  display: block;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(18, 35, 52, 0.13);
  border-radius: 4px;
  background: #f3f5f7;
}

.mocap-second-page .mocap-v2-gallery img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 0;
  object-fit: contain;
  background: #fff;
}

.mocap-second-page .mocap-v2-gallery-four img,
.mocap-second-page .mocap-v2-gallery-three img {
  height: 100%;
  min-height: 230px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.mocap-second-page .mocap-v2-cad-figure {
  width: min(100%, 720px);
  margin-inline: auto;
}

.mocap-second-page .mocap-v2-prototype-figure,
.mocap-second-page .mocap-v2-case-figure {
  width: min(100%, 820px);
  margin-inline: auto;
}

.mocap-second-page .mocap-v2-comparison-grid a:last-child {
  grid-column: 1 / -1;
}

.mocap-second-page .mocap-v2-ir-contact-figure {
  width: min(100%, 820px);
  margin-inline: auto;
}

.mocap-second-page .mocap-v2-ir-contact-crop {
  display: block;
  aspect-ratio: 16 / 5;
  overflow: hidden;
  border: 1px solid rgba(18, 35, 52, 0.16);
  background: #050708;
}

.mocap-second-page .mocap-v2-ir-contact-crop img {
  display: block;
  width: 100%;
  height: auto;
}

.mocap-second-page .mocap-v2-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 1.5rem 0;
}

.mocap-second-page .mocap-v2-flow article {
  min-width: 0;
  padding: 1rem;
  border-top: 3px solid #b21f2d;
  background: #f3f5f7;
}

.mocap-second-page .mocap-v2-flow span {
  display: block;
  margin-bottom: 0.55rem;
  color: #b21f2d;
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.mocap-second-page .mocap-v2-flow strong {
  display: block;
  margin-bottom: 0.45rem;
}

.mocap-second-page .mocap-v2-flow p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.62;
}

.mocap-second-page .mocap-v2-result-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 1.45rem 0;
  border: 1px solid rgba(18, 35, 52, 0.15);
  background: #fff;
}

.mocap-second-page .mocap-v2-result-band article {
  min-width: 0;
  padding: 1rem;
  border-right: 1px solid rgba(18, 35, 52, 0.12);
}

.mocap-second-page .mocap-v2-result-band article:last-child {
  border-right: 0;
}

.mocap-second-page .mocap-v2-result-band span,
.mocap-second-page .mocap-v2-result-band strong,
.mocap-second-page .mocap-v2-result-band small {
  display: block;
}

.mocap-second-page .mocap-v2-result-band span {
  margin-bottom: 0.4rem;
  color: #b21f2d;
  font-size: 0.78rem;
  font-weight: 700;
}

.mocap-second-page .mocap-v2-result-band strong {
  margin-bottom: 0.35rem;
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 0.92rem;
}

.mocap-second-page .mocap-v2-result-band small {
  color: var(--muted);
  line-height: 1.55;
}

.mocap-second-page .final-note {
  margin-top: 1.5rem;
}

.mocap-second-page .mocap-v2-file-tree {
  margin: 1.25rem auto;
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  border: 1px solid rgba(18, 35, 52, 0.15);
  border-left: 4px solid #b21f2d;
  background: #f6f7f8;
  color: #172333;
  font-size: 0.88rem;
  line-height: 1.72;
}

.mocap-second-page .mocap-v2-file-tree code {
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
}

.mocap-second-page .mocap-v2-code-note,
.mocap-second-page .mocap-v2-reference-note {
  color: var(--muted);
  font-size: 0.94rem;
}

.mocap-second-page .mocap-v2-next-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  margin-top: 1.5rem;
}

.mocap-second-page .mocap-v2-next-grid article {
  min-width: 0;
  padding: 1.1rem;
  border-top: 3px solid #347a73;
  background: #f3f5f7;
}

.mocap-second-page .mocap-v2-next-grid span,
.mocap-second-page .mocap-v2-next-grid strong {
  display: block;
}

.mocap-second-page .mocap-v2-next-grid span {
  margin-bottom: 0.45rem;
  color: #347a73;
  font-family: "Cascadia Mono", "JetBrains Mono", Consolas, monospace;
  font-size: 0.78rem;
}

.mocap-second-page .mocap-v2-next-grid strong {
  margin-bottom: 0.35rem;
}

.mocap-second-page .mocap-v2-next-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .mocap-second-page .mocap-v2-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mocap-second-page .mocap-v2-result-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mocap-second-page .mocap-v2-next-grid {
    grid-template-columns: 1fr;
  }

  .mocap-second-page .mocap-v2-result-band article:nth-child(2) {
    border-right: 0;
  }

  .mocap-second-page .mocap-v2-result-band article:nth-child(-n + 2) {
    border-bottom: 1px solid rgba(18, 35, 52, 0.12);
  }
}

@media (max-width: 680px) {
  .mocap-second-page .mocap-v2-gallery-four,
  .mocap-second-page .mocap-v2-gallery-three,
  .mocap-second-page .mocap-v2-cad-grid,
  .mocap-second-page .mocap-v2-comparison-grid,
  .mocap-second-page .mocap-v2-case-grid,
  .mocap-second-page .mocap-v2-flow,
  .mocap-second-page .mocap-v2-result-band {
    grid-template-columns: 1fr;
  }

  .mocap-second-page .mocap-v2-gallery img {
    min-height: 0;
  }

  .mocap-second-page .mocap-v2-comparison-grid a:last-child {
    grid-column: auto;
  }

  .mocap-second-page .mocap-v2-ir-contact-crop {
    aspect-ratio: 16 / 6;
  }

  .mocap-second-page .mocap-v2-result-band article,
  .mocap-second-page .mocap-v2-result-band article:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid rgba(18, 35, 52, 0.12);
  }

  .mocap-second-page .mocap-v2-result-band article:last-child {
    border-bottom: 0;
  }
}
