:root {
  --md-primary-fg-color: #13182f;
  --md-accent-fg-color: #ff576a;
  --md-typeset-a-color: #c93649;
  --ofx-text: #0f1728;
  --ofx-muted: #526179;
  --ofx-border: #eadedb;
  --ofx-surface: #ffffff;
  --ofx-red: #ff576a;
  --ofx-blue: #4b7cff;
  --ofx-green: #31a173;
  --ofx-orange: #ff7045;
}

.md-main {
  background: #fbfaf9;
}

.md-header,
.md-tabs {
  background: #ffffff;
  color: var(--ofx-text);
  border-bottom: 1px solid var(--ofx-border);
}

.md-tabs__link--active,
.md-tabs__link:hover,
.md-nav__link--active,
.md-nav__link:hover {
  color: var(--ofx-red);
}

.md-typeset h1 {
  color: var(--ofx-text);
  font-weight: 800;
  letter-spacing: 0;
}

.md-typeset h2,
.md-typeset h3 {
  color: var(--ofx-text);
  letter-spacing: 0;
}

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

.ofx-card {
  overflow: hidden;
  border: 1px solid var(--ofx-border);
  border-radius: 0.75rem;
  background: var(--ofx-surface);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.ofx-card-media {
  display: flex;
  height: 10.5rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--ofx-border);
  background:
    radial-gradient(circle at 24px 24px, rgba(246, 248, 252, 0.12) 1px, transparent 1px),
    #181d2b;
  background-size: 12px 12px;
}

.ofx-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ofx-orange .ofx-card-media img {
  object-fit: cover;
  opacity: 0.72;
}

.ofx-card-body {
  padding: 1rem 1.1rem 1.15rem;
}

.ofx-card-body h2 {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  margin: 0 0 0.4rem;
  font-size: 1rem;
  line-height: 1.3;
}

.ofx-card-body h2::before {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--card-accent);
  content: "";
}

.ofx-card-body p {
  margin: 0 0 0.75rem;
  color: var(--ofx-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.ofx-card-body ul {
  margin: 0;
}

.ofx-card-body a {
  color: var(--ofx-red);
  text-underline-offset: 3px;
}

.ofx-card-body a:hover {
  color: var(--ofx-blue);
}

.ofx-red {
  --card-accent: var(--ofx-red);
}

.ofx-blue {
  --card-accent: var(--ofx-blue);
}

.ofx-green {
  --card-accent: var(--ofx-green);
}

.ofx-orange {
  --card-accent: var(--ofx-orange);
}

@media screen and (max-width: 960px) {
  .ofx-card-grid {
    grid-template-columns: 1fr;
  }
}

[data-md-color-scheme="slate"] {
  --ofx-text: #eef7fb;
  --ofx-muted: #b7c6d6;
  --ofx-border: rgba(218, 234, 244, 0.14);
  --ofx-surface: #121f31;
  --md-default-bg-color: #0d1624;
  --md-default-fg-color: #eef7fb;
  --md-typeset-a-color: #ff8290;
}

[data-md-color-scheme="slate"] .md-main {
  background: #0d1624;
}

[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="slate"] .md-tabs {
  color: #eef7fb;
  border-bottom-color: rgba(218, 234, 244, 0.12);
  background: #07111f;
}

.ofx-docs-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(20rem, 0.9fr) minmax(27rem, 1.1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  align-items: center;
  overflow: hidden;
  margin: -0.25rem 0 2rem;
  border: 1px solid rgba(0, 212, 255, 0.16);
  border-radius: 1rem;
  padding: clamp(1.5rem, 4vw, 3.25rem);
  color: #eaf6ff;
  background:
    radial-gradient(circle at 78% 22%, rgba(0, 212, 255, 0.14), transparent 22rem),
    radial-gradient(circle at 24% 84%, rgba(139, 92, 246, 0.1), transparent 18rem),
    linear-gradient(145deg, #050a12, #081626 58%, #102033);
}

.ofx-docs-hero__copy {
  position: relative;
  z-index: 2;
}

.ofx-docs-hero h1 {
  max-width: 44rem;
  margin: 0;
  color: #f4fbff;
  font-size: clamp(2rem, 3.6vw, 3.1rem);
  line-height: 1.02;
}

.ofx-docs-hero__visual {
  position: relative;
  z-index: 1;
  min-width: 0;
  margin: -2rem -3rem -2.6rem -2rem;
}

.ofx-docs-hero__visual::before {
  content: "";
  position: absolute;
  inset: 18% 12%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.18), transparent 68%);
  filter: blur(1.4rem);
}

.ofx-docs-hero__visual img {
  display: block;
  width: 118%;
  max-width: none;
  height: auto;
  margin-left: -8%;
  filter: saturate(0.9) contrast(1.04) drop-shadow(0 1.2rem 2.4rem rgba(0, 0, 0, 0.38));
  -webkit-mask-image: radial-gradient(ellipse 76% 84% at 52% 50%, #000 70%, transparent 100%);
  mask-image: radial-gradient(ellipse 76% 84% at 52% 50%, #000 70%, transparent 100%);
}

.ofx-docs-hero__visual figcaption {
  position: absolute;
  right: 12%;
  bottom: 8%;
  left: 12%;
  padding: 0.55rem 0.7rem;
  border: 1px solid rgba(234, 246, 255, 0.12);
  border-radius: 0.45rem;
  color: rgba(234, 246, 255, 0.68);
  background: rgba(3, 10, 18, 0.72);
  font-size: 0.62rem;
  font-weight: 760;
  letter-spacing: 0.05em;
  text-align: center;
  text-transform: uppercase;
  backdrop-filter: blur(0.5rem);
}

.ofx-docs-hero p {
  max-width: 43rem;
  margin: 1rem 0 0;
  color: rgba(226, 242, 250, 0.74);
  font-size: 0.95rem;
  line-height: 1.7;
}

.ofx-kicker {
  display: block;
  margin-bottom: 0.6rem;
  color: #00d8c6;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ofx-docs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.4rem;
}

.ofx-docs-actions a {
  display: inline-flex;
  min-height: 2.5rem;
  align-items: center;
  border: 1px solid rgba(234, 246, 255, 0.18);
  border-radius: 0.55rem;
  padding: 0 0.9rem;
  color: #eefbff;
  font-size: 0.76rem;
  font-weight: 800;
}

.ofx-docs-actions a:first-child {
  border-color: transparent;
  color: #031018;
  background: linear-gradient(135deg, #67ddff, #00e5b8);
}

.ofx-docs-actions a:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.ofx-docs-actions a:first-child:hover {
  color: #031018;
}

.ofx-content-map {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1.5rem 0 2.5rem;
}

.ofx-content-map a {
  display: block;
  min-height: 8rem;
  border: 1px solid var(--ofx-border);
  border-radius: 0.7rem;
  padding: 1rem;
  color: var(--ofx-text);
  background: var(--ofx-surface);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.ofx-content-map a:hover {
  border-color: #00b8a4;
  color: var(--ofx-text);
  transform: translateY(-2px);
}

.ofx-content-map strong,
.ofx-content-map span {
  display: block;
}

.ofx-content-map strong {
  margin: 0.8rem 0 0.35rem;
}

.ofx-content-map span {
  color: var(--ofx-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.ofx-content-map i {
  display: block;
  width: 1.7rem;
  height: 0.2rem;
  background: linear-gradient(90deg, #00d4ff, #00e5b8);
}

.ofx-case-network,
.ofx-frontier {
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid var(--ofx-border);
  border-radius: 0.9rem;
  background: #07111f;
}

.ofx-case-network svg {
  display: block;
  width: 100%;
  height: auto;
}

.ofx-network-grid path {
  fill: none;
  stroke: rgba(226, 242, 250, 0.05);
}

.ofx-network-link {
  fill: none;
  stroke: rgba(0, 212, 255, 0.18);
  stroke-width: 1.5;
}

.ofx-network-route {
  fill: none;
  stroke: url(#ofx-network-path);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 8 9;
  filter: url(#ofx-network-glow);
  animation: ofx-route 12s linear infinite;
}

.ofx-node {
  stroke: rgba(234, 246, 255, 0.56);
  stroke-width: 2;
}

.ofx-node-plant { fill: #1268e8; }
.ofx-node-grinding { fill: #00d4ff; }
.ofx-node-dc { fill: #00e5b8; }

.ofx-network-labels {
  fill: rgba(226, 242, 250, 0.55);
  font: 700 11px system-ui, sans-serif;
  letter-spacing: 0.08em;
}

@keyframes ofx-route {
  to { stroke-dashoffset: -136; }
}

.ofx-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--ofx-border);
  border-radius: 0.75rem;
  background: var(--ofx-border);
}

.ofx-evidence-grid > div {
  min-height: 6.5rem;
  padding: 1rem;
  background: var(--ofx-surface);
}

.ofx-evidence-grid strong,
.ofx-evidence-grid span {
  display: block;
}

.ofx-evidence-grid strong {
  color: #008f80;
  font-size: 1.45rem;
}

[data-md-color-scheme="slate"] .ofx-evidence-grid strong {
  color: #62e7d6;
}

.ofx-case-criteria {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin: 1rem 0 1.5rem;
}

.ofx-case-criteria article {
  min-height: 11rem;
  border: 1px solid var(--ofx-border);
  border-top: 2px solid #00b8a4;
  border-radius: 0.7rem;
  padding: 1rem;
  background: var(--ofx-surface);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.ofx-case-criteria span,
.ofx-case-criteria strong {
  display: block;
}

.ofx-case-criteria span {
  color: #008f80;
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.ofx-case-criteria strong {
  margin-top: 0.75rem;
  color: var(--ofx-text);
  font-size: 0.85rem;
}

.ofx-case-criteria p {
  margin: 0.55rem 0 0;
  color: var(--ofx-muted);
  font-size: 0.7rem;
  line-height: 1.5;
}

[data-md-color-scheme="slate"] .ofx-case-criteria span {
  color: #62e7d6;
}

.ofx-evidence-grid span {
  margin-top: 0.25rem;
  color: var(--ofx-muted);
  font-size: 0.72rem;
}

.ofx-frontier {
  padding: clamp(0.9rem, 3vw, 1.5rem);
  color: #eaf6ff;
}

.ofx-frontier-header,
.ofx-frontier-controls,
.ofx-chart-legend,
.ofx-chart-legend span {
  display: flex;
  align-items: center;
}

.ofx-frontier-header {
  justify-content: space-between;
  gap: 1rem;
}

.ofx-frontier-header p {
  max-width: 34rem;
  margin: 0;
  color: rgba(226, 242, 250, 0.65);
  font-size: 0.75rem;
}

.ofx-chart-legend {
  flex-wrap: wrap;
  gap: 0.8rem;
  color: rgba(226, 242, 250, 0.72);
  font-size: 0.68rem;
}

.ofx-chart-legend span { gap: 0.35rem; }
.ofx-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; }
.ofx-dot-cycle { background: #00e5b8; }
.ofx-dot-fill { background: #67ddff; }

.ofx-chart {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.7rem 0 0;
}

.ofx-chart-grid { stroke: rgba(226, 242, 250, 0.08); }
.ofx-axis-label { fill: rgba(226, 242, 250, 0.45); font: 10px system-ui, sans-serif; }
.ofx-chart-area { stroke: none; }
.ofx-cycle-line, .ofx-fill-line { fill: none; stroke-width: 3; stroke-linecap: round; }
.ofx-cycle-line { stroke: #00e5b8; }
.ofx-fill-line { stroke: #67ddff; }
.ofx-marker-line { stroke: rgba(255, 207, 49, 0.5); stroke-dasharray: 4 5; }
.ofx-cycle-marker { fill: #00e5b8; }
.ofx-fill-marker { fill: #67ddff; }

.ofx-frontier-controls {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) auto minmax(14rem, 0.9fr);
  gap: 1rem;
  border-top: 1px solid rgba(226, 242, 250, 0.1);
  padding-top: 1rem;
}

.ofx-frontier-controls label span {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.72rem;
  font-weight: 750;
}

.ofx-frontier-controls input { width: 100%; accent-color: #00d8c6; }
.ofx-frontier-controls output { color: #ffcf31; font-weight: 800; }
.ofx-frontier-controls dl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin: 0; }
.ofx-frontier-controls dl div { border-left: 1px solid rgba(226, 242, 250, 0.12); padding-left: 0.7rem; }
.ofx-frontier-controls dt { color: rgba(226, 242, 250, 0.55); font-size: 0.62rem; }
.ofx-frontier-controls dd { margin: 0.2rem 0 0; font-size: 1rem; font-weight: 800; }
.ofx-disclaimer { margin: 0.8rem 0 0; color: rgba(226, 242, 250, 0.45); font-size: 0.62rem; line-height: 1.5; }

.ofx-maturity-path {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem;
  overflow: hidden;
  margin: 1.5rem 0;
  border: 1px solid rgba(0, 212, 255, 0.16);
  border-radius: 0.9rem;
  padding: 1rem;
  color: #eaf6ff;
  background:
    radial-gradient(circle at 86% 18%, rgba(139, 92, 246, 0.13), transparent 18rem),
    linear-gradient(145deg, #050a12, #081626 58%, #102033);
}

.ofx-maturity-path::before {
  position: absolute;
  top: 2.25rem;
  right: 7%;
  left: 7%;
  height: 1px;
  background: linear-gradient(90deg, #00d4ff, #00e5b8 54%, #1268e8);
  content: "";
  opacity: 0.55;
}

.ofx-maturity-stage {
  position: relative;
  z-index: 1;
  min-height: 12.5rem;
  border: 1px solid rgba(226, 242, 250, 0.11);
  border-radius: 0.7rem;
  padding: 0.85rem;
  background: rgba(7, 17, 31, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}

.ofx-maturity-stage span,
.ofx-maturity-stage strong,
.ofx-maturity-stage small {
  display: block;
}

.ofx-maturity-stage span {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(0, 229, 184, 0.55);
  border-radius: 50%;
  color: #72f0da;
  background: #07111f;
  font: 800 0.65rem/1.9rem system-ui, sans-serif;
  text-align: center;
}

.ofx-maturity-stage strong {
  margin-top: 1rem;
  color: #f4fbff;
  font-size: 0.9rem;
}

.ofx-maturity-stage p {
  margin: 0.55rem 0 0.8rem;
  color: rgba(226, 242, 250, 0.7);
  font-size: 0.72rem;
  line-height: 1.5;
}

.ofx-maturity-stage small {
  border-top: 1px solid rgba(226, 242, 250, 0.1);
  padding-top: 0.65rem;
  color: #73dfff;
  font-size: 0.62rem;
  line-height: 1.45;
}

@media screen and (max-width: 960px) {
  .ofx-docs-hero { grid-template-columns: 1fr; }
  .ofx-docs-hero__visual {
    width: min(44rem, 112%);
    margin: -1rem auto -2.5rem;
  }
  .ofx-content-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ofx-maturity-path { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ofx-maturity-path::before { display: none; }
  .ofx-maturity-stage { min-height: 10.5rem; }
}

@media screen and (max-width: 640px) {
  .md-header__topic[data-md-component="header-topic"] {
    display: none;
  }

  .md-path {
    scrollbar-width: none;
  }

  .md-path::-webkit-scrollbar {
    display: none;
  }

  .md-typeset__table:has(th:nth-child(3)) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .md-typeset__table:has(th:nth-child(3)) table {
    min-width: 38rem;
  }

  .md-typeset__table:has(th:nth-child(4)) table {
    min-width: 44rem;
  }

  .ofx-docs-hero { padding: 1.4rem; }
  .ofx-docs-hero__visual {
    width: 125%;
    margin-right: -12.5%;
    margin-left: -12.5%;
  }
  .ofx-docs-hero__visual figcaption {
    right: 15%;
    left: 15%;
    font-size: 0.54rem;
  }
  .ofx-content-map,
  .ofx-evidence-grid,
  .ofx-case-criteria { grid-template-columns: 1fr; }
  .ofx-maturity-path { grid-template-columns: 1fr; }
  .ofx-frontier-header { align-items: flex-start; flex-direction: column; }
  .ofx-frontier-controls { grid-template-columns: 1fr auto; }
  .ofx-frontier-controls dl { grid-column: 1 / -1; }
  .ofx-network-labels { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ofx-network-route { animation: none; }
  .ofx-docs-actions a,
  .ofx-content-map a { transition: none; }
}
