/* ═══════════════════════════════════════════════════════════════════
   FAILOVER DOCS v4 — Dark-first. Indigo brand. Material-aligned.
   Tokens → Global → Layout → Anims → Header → Nav →
   Banner → Typography → Tables → Code → Admonitions → Footer →
   Components → Hero → Responsive
   ═══════════════════════════════════════════════════════════════════ */

/* ── Display font — section headings ───────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@700;800&display=swap');

/* ─── 1. DESIGN TOKENS ─────────────────────────────────────────── */

/* Dark (slate — first palette = default) */
[data-md-color-scheme="slate"] {
  --fo-bg:       #0e0e18;
  --fo-sur:      #15151f;
  --fo-sur2:     #1d1d2c;
  --fo-brd:      #262638;
  --fo-brd2:     #373752;
  --fo-br:       #818cf8;        /* indigo-400: readable on dark */
  --fo-br2:      #a5b4fc;        /* indigo-300 */
  --fo-br-d:     rgba(129,140,248,.1);
  --fo-br-d2:    rgba(129,140,248,.18);
  --fo-tx:       #f0f0fa;
  --fo-tx2:      #9090b4;
  --fo-tx3:      #56567a;
  --fo-sh:       0 1px 4px rgba(0,0,0,.55);
  --fo-shm:      0 4px 20px rgba(0,0,0,.65);
  --fo-shl:      0 12px 48px rgba(0,0,0,.75);

  /* Material variable overrides */
  --md-default-bg-color:          #0e0e18;
  --md-default-fg-color:          #f0f0fa;
  --md-default-fg-color--light:   #9090b4;
  --md-default-fg-color--lighter: #56567a;
  --md-default-fg-color--lightest:#373752;
  --md-primary-fg-color:          #818cf8;
  --md-primary-fg-color--light:   #a5b4fc;
  --md-primary-fg-color--dark:    #6366f1;
  --md-primary-bg-color:          #ffffff;
  --md-accent-fg-color:           #818cf8;
  --md-accent-fg-color--transparent: rgba(129,140,248,.12);
  --md-code-bg-color:             #15151f;
  --md-code-fg-color:             #e0e0f2;
}

/* Light (default scheme) */
[data-md-color-scheme="default"] {
  --fo-bg:       #ffffff;
  --fo-sur:      #f7f8fc;
  --fo-sur2:     #eef0f9;
  --fo-brd:      #e0e4f0;
  --fo-brd2:     #c8cce0;
  --fo-br:       #4f46e5;        /* indigo-600 */
  --fo-br2:      #4338ca;        /* indigo-700 */
  --fo-br-d:     rgba(79,70,229,.08);
  --fo-br-d2:    rgba(79,70,229,.14);
  --fo-tx:       #0f172a;
  --fo-tx2:      #64748b;
  --fo-tx3:      #94a3b8;
  --fo-sh:       0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  --fo-shm:      0 4px 20px rgba(0,0,0,.08),0 2px 8px rgba(0,0,0,.04);
  --fo-shl:      0 12px 48px rgba(0,0,0,.10),0 4px 16px rgba(0,0,0,.05);

  --md-default-bg-color:          #ffffff;
  --md-default-fg-color:          #0f172a;
  --md-default-fg-color--light:   #64748b;
  --md-default-fg-color--lighter: #94a3b8;
  --md-default-fg-color--lightest:#e2e8f0;
  --md-primary-fg-color:          #4f46e5;
  --md-primary-fg-color--light:   #818cf8;
  --md-primary-fg-color--dark:    #4338ca;
  --md-primary-bg-color:          #ffffff;
  --md-accent-fg-color:           #4f46e5;
  --md-accent-fg-color--transparent: rgba(79,70,229,.1);
  --md-code-bg-color:             #f7f8fc;
  --md-code-fg-color:             #334155;
}

/* ─── 2. GLOBAL ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body,
.md-header, .md-tabs, .md-nav, .md-sidebar,
.md-content, .md-footer, .md-typeset * {
  transition: color .18s ease, background .18s ease,
              border-color .18s ease, box-shadow .18s ease;
}

::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--fo-br-d2); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--fo-br); }
::selection { background: var(--fo-br-d2); color: var(--fo-br); }
:focus-visible { outline: 2px solid var(--fo-br); outline-offset: 3px; border-radius: 4px; }

/* ─── 3. LAYOUT ─────────────────────────────────────────────────── */

/* Widen Material's default grid (61rem ~976px) to use more screen on wide viewports */
.md-grid { max-width: 84rem; }

/* ─── 4. ANIMATIONS ─────────────────────────────────────────────── */

@keyframes fo-up {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fo-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes fo-pop {
  from { opacity: 0; transform: scale(.95); }
  to   { opacity: 1; transform: scale(1); }
}

.md-content__inner { animation: fo-up .32s cubic-bezier(.22,1,.36,1) both; }

.fo-feat-card:nth-child(1) { animation: fo-pop .32s .05s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(2) { animation: fo-pop .32s .10s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(3) { animation: fo-pop .32s .15s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(4) { animation: fo-pop .32s .20s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(5) { animation: fo-pop .32s .25s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(6) { animation: fo-pop .32s .30s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(7) { animation: fo-pop .32s .35s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(8) { animation: fo-pop .32s .40s cubic-bezier(.22,1,.36,1) both; }
.fo-feat-card:nth-child(9) { animation: fo-pop .32s .45s cubic-bezier(.22,1,.36,1) both; }

/* ─── 5. HEADER ─────────────────────────────────────────────────── */

.md-header {
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--fo-brd);
  box-shadow: none;
}
[data-md-color-scheme="slate"] .md-header  { background: rgba(14,14,24,.9) !important; }
[data-md-color-scheme="default"] .md-header { background: rgba(255,255,255,.92) !important; color: var(--fo-tx) !important; }

/* Light mode: force dark text/icons — Material defaults to --md-primary-bg-color (#fff) which is invisible on white header */
[data-md-color-scheme="default"] .md-header__title,
[data-md-color-scheme="default"] .md-header__button,
[data-md-color-scheme="default"] .md-header .md-icon,
[data-md-color-scheme="default"] .md-header label { color: var(--fo-tx) !important; }

.md-header__title { font-weight: 700; letter-spacing: -.02em; font-size: .82rem; }

/* Announcement bar — explicit bg so text is visible in both themes */
.md-announce {
  background: var(--fo-br);
}
[data-md-color-scheme="default"] .md-announce {
  background: var(--fo-br);
}
.md-announce__inner {
  color: #fff !important;
  font-size: .74rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  flex-wrap: wrap;
}
.md-announce__inner a {
  color: #fff !important;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .9;
  transition: opacity .15s;
}
.md-announce__inner a:hover { opacity: 1; }

.fo-ann-badge {
  display: inline-block;
  background: rgba(255,255,255,.22);
  color: #fff;
  font-size: .60rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .08rem .48rem;
  border-radius: 4px;
  margin-right: .2rem;
  border: 1px solid rgba(255,255,255,.3);
}

/* Lock header title to site name — never slide in the page title */
[data-md-component="header-topic"] {
  opacity: 0 !important;
  pointer-events: none;
}
.md-header__title--active .md-header__topic:first-child {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Search */
.md-search__input {
  border-radius: 8px;
  background: var(--fo-br-d);
  border: 1px solid var(--fo-brd);
  font-size: .78rem;
  transition: border-color .18s, box-shadow .18s;
}
.md-search__input:focus {
  border-color: var(--fo-br);
  box-shadow: 0 0 0 3px var(--fo-br-d);
}
.md-search__input::placeholder { color: var(--fo-tx2); }

/* Tabs */
.md-tabs { border-bottom: 1px solid var(--fo-brd); }
[data-md-color-scheme="slate"] .md-tabs   { background: rgba(14,14,24,.9) !important; }
[data-md-color-scheme="default"] .md-tabs { background: rgba(255,255,255,.92) !important; }

.md-tabs__link {
  font-size: .75rem;
  font-weight: 600;
  opacity: .55;
  letter-spacing: .01em;
  transition: opacity .18s, color .18s;
}
.md-tabs__link:hover   { opacity: .85; }
.md-tabs__link--active { opacity: 1; color: var(--fo-br) !important; }

/* Light mode tab links: dark text (Material inherits white from primary-bg-color) */
[data-md-color-scheme="default"] .md-tabs__link { color: var(--fo-tx) !important; }

/* ─── 6. NAVIGATION ─────────────────────────────────────────────── */

.md-sidebar { background: transparent; }

.md-nav__link {
  font-size: .75rem;
  border-radius: 6px;
  padding: .22rem .5rem;
  color: var(--fo-tx2);
  transition: background .15s, color .15s, padding-left .15s;
}
.md-nav__link:hover {
  background: var(--fo-br-d);
  color: var(--fo-br);
  padding-left: .75rem;
}
.md-nav__link--active,
.md-nav__link--active:hover {
  font-weight: 700;
  color: var(--fo-br) !important;
  background: var(--fo-br-d2);
  padding-left: .75rem;
}
.md-nav__title {
  font-size: .62rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 700;
  color: var(--fo-tx2);
  opacity: .6;
  padding: .45rem .5rem .15rem;
}
.md-nav__item--active > .md-nav__link:not([href]) { color: var(--fo-br); font-weight: 700; }
.md-nav--secondary .md-nav__link { font-size: .72rem; line-height: 1.5; }
.md-nav--secondary .md-nav__link--active {
  border-left: 2px solid var(--fo-br);
  padding-left: calc(.5rem - 2px);
}

/* ─── 7. PAGE BANNER ─────────────────────────────────────────────── */

.fo-page-banner {
  position: relative;
  overflow: hidden;
  padding: 1.6rem 1.6rem 1.4rem 1.9rem;
  margin: 0 0 2.25rem;
  background: var(--fo-sur);
  border: 1px solid var(--fo-brd);
  border-radius: 14px;
}

/* Left accent stripe */
.fo-page-banner::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--fo-br) 0%, var(--fo-br2) 100%);
  border-radius: 14px 0 0 14px;
}

/* Dot-grid texture + radial glow combined */
.fo-page-banner::after {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle, var(--fo-brd2) 1px, transparent 1px),
    radial-gradient(ellipse at 0% 110%, var(--fo-br-d2) 0%, transparent 60%);
  background-size: 22px 22px, 100% 100%;
  opacity: .5;
  pointer-events: none;
}

@media (min-width: 76.25em) {
  .fo-page-banner { margin: 0 0 2.5rem; padding: 1.9rem 2.4rem 1.65rem 2.2rem; }
}

/* Background watermark icon — large, faded, top-right */
.fo-page-banner-watermark {
  position: absolute;
  right: 1.5rem; top: 50%;
  transform: translateY(-50%);
  width: 6.5rem; height: 6.5rem;
  line-height: 0; font-size: 0;
  opacity: .055;
  pointer-events: none;
  z-index: 0;
}
.fo-page-banner-watermark svg {
  display: block;
  width: 100%; height: 100%;
  fill: var(--fo-br);
}

.fo-page-banner-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.fo-page-banner-text { display: flex; flex-direction: column; gap: .28rem; }

.fo-page-banner-icon {
  flex-shrink: 0;
  width: 3.2rem; height: 3.2rem;
  background: linear-gradient(135deg, var(--fo-br-d2) 0%, var(--fo-br-d) 100%);
  border: 1px solid var(--fo-brd2);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  line-height: 0; font-size: 0;
  box-shadow:
    0 0 0 3px var(--fo-br-d),
    0 4px 12px rgba(0,0,0,.25);
  transition: box-shadow .2s, transform .2s;
}
.fo-page-banner-icon:hover {
  box-shadow:
    0 0 0 4px var(--fo-br-d2),
    0 6px 18px rgba(0,0,0,.35);
  transform: translateY(-1px);
}
.fo-page-banner-icon svg {
  display: block;
  width: 1.8rem; height: 1.8rem;
  fill: var(--fo-br);
  filter: drop-shadow(0 1px 3px rgba(129,140,248,.35));
}

/* Section pill / chip */
.fo-page-banner-section {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: .18rem .55rem;
  background: var(--fo-br-d);
  border: 1px solid var(--fo-brd2);
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .13em;
  color: var(--fo-br);
  line-height: 1.6;
}

.fo-page-banner-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
  margin: 0;
  border: none;
  display: block !important;
  background: linear-gradient(120deg, var(--fo-tx) 55%, var(--fo-br2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ─── 8. TYPOGRAPHY ─────────────────────────────────────────────── */

.md-typeset {
  font-size: .9rem;
  line-height: 1.78;
  color: var(--fo-tx);
}

/* H1 — hidden on all content pages, replaced by banner */
.md-typeset h1     { display: none; }
.fo-hero h1        { display: block !important; }

.md-typeset h2 {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -.025em;
  color: var(--fo-tx);
  border: none;
  border-left: 3px solid var(--fo-br);
  padding: 0 0 0 .65rem;
  margin: 2.5rem 0 .75rem;
  line-height: 1.3;
}

.md-typeset h3 {
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--fo-br);
  margin: 1.6rem 0 .5rem;
}

.md-typeset h4 {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--fo-tx2);
  margin: 1.3rem 0 .4rem;
}

.md-typeset p { margin: 0 0 .875rem; }

.md-typeset a {
  color: var(--fo-br);
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-color: transparent;
  transition: text-decoration-color .18s, color .18s;
}
.md-typeset a:hover {
  color: var(--fo-br2);
  text-decoration-color: var(--fo-br2);
}

.md-typeset code {
  background: var(--fo-br-d);
  color: var(--fo-br);
  border-radius: .3em;
  padding: .1em .38em;
  font-size: .79em;
  border: 1px solid var(--fo-br-d2);
  font-feature-settings: "zero","ss01","cv01";
}

.md-typeset blockquote {
  border-left: 3px solid var(--fo-br);
  background: var(--fo-br-d);
  border-radius: 0 6px 6px 0;
  padding: .8rem 1.1rem;
  margin: 1rem 0;
  color: var(--fo-tx2);
  font-style: italic;
}

.md-typeset ul li::marker { color: var(--fo-br); }
.md-typeset ol li::marker { color: var(--fo-br); font-weight: 700; }

.md-typeset hr {
  border: none; height: 1px;
  background: linear-gradient(90deg, transparent, var(--fo-brd2) 30%, var(--fo-brd2) 70%, transparent);
  margin: 2.25rem 0;
}

.md-typeset kbd {
  background: var(--fo-sur2);
  border: 1px solid var(--fo-brd2);
  border-radius: .3em;
  box-shadow: 0 2px 0 var(--fo-brd2);
  font-size: .72em;
  padding: .12em .4em;
}

/* Edit button */
.md-content__button { opacity: .4; border-radius: 6px; }
.md-content__button:hover { opacity: 1; }

/* ─── 9. TABLES ─────────────────────────────────────────────────── */

.md-typeset table:not([class]) {
  font-size: .79rem;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  border: 1px solid var(--fo-brd);
  overflow: hidden;
  display: table;
  box-shadow: var(--fo-sh);
}
.md-typeset table:not([class]) th {
  background: var(--fo-br-d);
  color: var(--fo-br);
  font-size: .67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--fo-brd);
  white-space: nowrap;
}
.md-typeset table:not([class]) td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--fo-brd);
  vertical-align: top;
  line-height: 1.55;
}
.md-typeset table:not([class]) tr:last-child td { border-bottom: none; }
.md-typeset table:not([class]) tbody tr:nth-child(even) td { background: var(--fo-br-d); }
.md-typeset table:not([class]) tbody tr:hover td { background: var(--fo-br-d2); }

/* ─── 10. CODE BLOCKS ───────────────────────────────────────────── */

.md-typeset .highlight,
.md-typeset pre {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--fo-brd);
  box-shadow: var(--fo-sh);
}
.md-typeset .highlight .filename {
  background: var(--fo-sur);
  border-bottom: 1px solid var(--fo-brd);
  padding: .45rem .9rem;
  font-size: .72rem;
  font-weight: 600;
  color: var(--fo-tx2);
}
.md-clipboard {
  color: var(--fo-tx2);
  border-radius: 0 10px 0 6px;
  transition: color .15s, background .15s;
}
.md-clipboard:hover { color: var(--fo-br); background: var(--fo-br-d); }

/* Tabs (pymdownx) */
.md-typeset .tabbed-labels > label {
  font-size: .75rem;
  font-weight: 600;
  border-radius: 6px 6px 0 0;
  padding: .45rem .85rem;
  color: var(--fo-tx2);
  transition: color .15s, background .15s;
}
.md-typeset .tabbed-labels > label:hover  { color: var(--fo-br); }
.md-typeset .tabbed-labels > label:checked { color: var(--fo-br); }
.md-typeset .tabbed-set .tabbed-content {
  border: 1px solid var(--fo-brd);
  border-radius: 0 10px 10px 10px;
}

/* ─── 11. ADMONITIONS ───────────────────────────────────────────── */

.md-typeset .admonition,
.md-typeset details {
  border-radius: 10px;
  overflow: hidden;
  border: none;
  box-shadow: 0 0 0 1px var(--fo-brd);
}
.md-typeset .admonition-title,
.md-typeset summary {
  font-size: .75rem;
  font-weight: 700;
  padding: .6rem .9rem .6rem 2.6rem;
  letter-spacing: .01em;
}
.md-typeset .admonition.note    { box-shadow: 0 0 0 1px rgba(59,130,246,.4); }
.md-typeset .admonition.tip     { box-shadow: 0 0 0 1px rgba(16,185,129,.4); }
.md-typeset .admonition.warning { box-shadow: 0 0 0 1px rgba(245,158,11,.4); }
.md-typeset .admonition.danger  { box-shadow: 0 0 0 1px rgba(239,68,68,.4); }

/* ─── 12. FOOTER ────────────────────────────────────────────────── */

.md-footer { border-top: 1px solid var(--fo-brd); background: var(--fo-sur); }
.md-footer-meta { opacity: .55; }
.md-footer__link { border-radius: 6px; padding: .45rem; }
.md-footer__link:hover { background: var(--fo-br-d); color: var(--fo-br); }
.md-footer__title     { font-weight: 700; font-size: .76rem; }
.md-footer__direction { font-size: .66rem; }

/* Light mode: Material defaults footer text to --md-primary-bg-color (#fff) — invisible on our near-white footer */
[data-md-color-scheme="default"] .md-footer,
[data-md-color-scheme="default"] .md-footer__link,
[data-md-color-scheme="default"] .md-footer__title,
[data-md-color-scheme="default"] .md-footer__direction,
[data-md-color-scheme="default"] .md-footer .md-icon,
[data-md-color-scheme="default"] .md-footer-meta,
[data-md-color-scheme="default"] .md-footer-meta a,
[data-md-color-scheme="default"] .md-copyright,
[data-md-color-scheme="default"] .md-copyright__highlight,
[data-md-color-scheme="default"] .md-social__link { color: var(--fo-tx) !important; }
[data-md-color-scheme="default"] .md-social__link svg { fill: var(--fo-tx) !important; }

/* ─── 13. COMPONENTS ────────────────────────────────────────────── */

/* ── Section card grid ─────────────────────────────────────── */
.fo-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: .9rem;
  margin: 1.25rem 0 2.25rem;
}
.fo-sec-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.2rem 1.1rem 1rem;
  background: var(--fo-sur);
  border: 1px solid var(--fo-brd);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s;
}
.fo-sec-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--fo-shm);
  border-color: var(--fo-br);
  text-decoration: none; color: inherit;
}
.fo-sec-card-icon {
  width: 2.25rem; height: 2.25rem;
  border-radius: 6px;
  background: var(--fo-br-d2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0;
}
.fo-sec-card h3 { font-size: .82rem; font-weight: 700; margin: 0; color: var(--fo-tx); line-height: 1.25; }
.fo-sec-card p  { font-size: .74rem; color: var(--fo-tx2); margin: 0; line-height: 1.5; flex: 1; }
.fo-sec-card-arrow { font-size: .70rem; font-weight: 700; color: var(--fo-br); margin-top: .1rem; }

/* ── Step cards ────────────────────────────────────────────── */
.fo-steps {
  display: flex; flex-direction: column; gap: 0;
  margin: 1.25rem 0 2.25rem; position: relative;
}
.fo-steps::before {
  content: ""; position: absolute;
  left: 1.1rem; top: 2rem; bottom: 2rem;
  width: 1px;
  background: linear-gradient(to bottom, var(--fo-br), var(--fo-brd));
}
.fo-step { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem 1rem 1rem 0; }
.fo-step-num {
  width: 2.2rem; height: 2.2rem;
  background: var(--fo-br); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .74rem; font-weight: 800;
  flex-shrink: 0; position: relative; z-index: 1;
  box-shadow: 0 0 0 4px var(--md-default-bg-color);
}
.fo-step-body h3 { margin: 0 0 .22rem; color: var(--fo-tx); font-size: .82rem; }
.fo-step-body p  { margin: 0; font-size: .75rem; color: var(--fo-tx2); line-height: 1.5; }

/* ── Feature cards ─────────────────────────────────────────── */
.fo-feat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 2.5rem;
}
.fo-feat-card {
  background: var(--fo-sur);
  border: 1px solid var(--fo-brd);
  border-radius: 10px;
  padding: 1.2rem;
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s;
  cursor: default;
}
.fo-feat-card:hover { transform: translateY(-2px); box-shadow: var(--fo-shm); border-color: var(--fo-br); }

.fo-feat-icon {
  width: 2.4rem; height: 2.4rem;
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; margin-bottom: .75rem;
}
.fo-feat-icon.purple { background: rgba(99,102,241,.12); }
.fo-feat-icon.blue   { background: rgba(59,130,246,.12); }
.fo-feat-icon.green  { background: rgba(34,197,94,.12);  }
.fo-feat-icon.orange { background: rgba(249,115,22,.12); }
.fo-feat-icon.pink   { background: rgba(236,72,153,.12); }
.fo-feat-icon.teal   { background: rgba(20,184,166,.12); }
.fo-feat-icon.amber  { background: rgba(245,158,11,.12); }
.fo-feat-icon.red    { background: rgba(239,68,68,.12);  }

.fo-feat-card h3 { font-size: .80rem; font-weight: 700; margin: 0 0 .35rem; color: var(--fo-tx); line-height: 1.3; }
.fo-feat-card p  { font-size: .74rem; color: var(--fo-tx2); margin: 0; line-height: 1.5; }

/* ── Before/After comparison ───────────────────────────────── */
.fo-compare {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin: 1.25rem 0 2.5rem;
}
.fo-compare-panel {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--fo-brd); box-shadow: var(--fo-sh);
}
.fo-compare-header {
  display: flex; align-items: center; gap: .45rem;
  padding: .55rem .9rem; font-size: .72rem; font-weight: 700;
}
.fo-compare-panel.before .fo-compare-header {
  background: rgba(239,68,68,.09); color: #ef4444;
  border-bottom: 1px solid rgba(239,68,68,.18);
}
.fo-compare-panel.after .fo-compare-header {
  background: rgba(34,197,94,.09); color: #22c55e;
  border-bottom: 1px solid rgba(34,197,94,.18);
}
[data-md-color-scheme="default"] .fo-compare-panel.after .fo-compare-header { color: #16a34a; }
.fo-compare-panel .highlight,
.fo-compare-panel pre { margin: 0 !important; border-radius: 0 !important; border: none !important; box-shadow: none !important; }

/* ── Stats strip ───────────────────────────────────────────── */
.fo-stats {
  display: flex; justify-content: center; flex-wrap: wrap;
  background: var(--fo-sur);
  border: 1px solid var(--fo-brd);
  border-radius: 12px;
  margin: 1.75rem 0 2.5rem;
  overflow: hidden; box-shadow: var(--fo-sh);
}
.fo-stat {
  flex: 1; min-width: 130px;
  padding: 1.2rem 1rem;
  text-align: center;
  border-right: 1px solid var(--fo-brd);
}
.fo-stat:last-child { border-right: none; }
.fo-stat-num {
  display: block;
  font-size: 1.1rem; font-weight: 800;
  color: var(--fo-br); line-height: 1; margin-bottom: .22rem;
  font-feature-settings: "tnum";
}
.fo-stat-label {
  font-size: .66rem; text-transform: uppercase;
  letter-spacing: .1em; font-weight: 600; color: var(--fo-tx2);
}

/* ── Section heading ───────────────────────────────────────── */
.fo-section {
  margin: 3.5rem 0 1.4rem;
  position: relative;
  padding-top: .35rem;
}
.fo-section::before {
  content: '';
  position: absolute; top: 0; left: 0;
  width: 2.5rem; height: 2px; border-radius: 1px;
  background: linear-gradient(90deg, var(--fo-br) 0%, transparent 100%);
}

/* legacy eyebrow (used inside fo-md-content rendered from markdown) */
.fo-section-eyebrow {
  font-size: .64rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .12em;
  color: var(--fo-br); margin-bottom: .25rem;
}

/* ── Eyebrow chips ──────────────────────────────────────────── */
.fo-eyebrow {
  display: inline-flex; align-items: center; gap: .45em;
  width: fit-content; align-self: flex-start;
  padding: .28em .85em .28em .6em;
  border-radius: 99px;
  font-size: .62rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase;
  margin-bottom: .6rem; border: 1px solid; line-height: 1;
}
.fo-ey-icon { font-size: .88rem; line-height: 1; display: flex; }

/* per-section hue tokens */
.fo-ey-problem   { --ey-h: 22;  }
.fo-ey-internals { --ey-h: 213; }
.fo-ey-context   { --ey-h: 168; }
.fo-ey-challenge { --ey-h: 4;   }
.fo-ey-solution  { --ey-h: 142; }
.fo-ey-impact    { --ey-h: 35;  }
.fo-ey-observe   { --ey-h: 258; }
.fo-ey-caps      { --ey-h: 198; }
.fo-ey-integr    { --ey-h: 192; }
.fo-ey-arch      { --ey-h: 280; }
.fo-ey-docs      { --ey-h: 154; }

[data-md-color-scheme="slate"] .fo-eyebrow {
  background:   hsla(var(--ey-h), 70%, 58%, .13);
  color:        hsl( var(--ey-h), 88%, 78%);
  border-color: hsla(var(--ey-h), 70%, 62%, .30);
}
[data-md-color-scheme="default"] .fo-eyebrow {
  background:   hsla(var(--ey-h), 70%, 50%, .09);
  color:        hsl( var(--ey-h), 58%, 36%);
  border-color: hsla(var(--ey-h), 65%, 50%, .22);
}

/* h2/h3 gradient handled in home.html extrahead <style> block */
.fo-section h2::after { display: none !important; }
.fo-section p { font-size: .93rem; line-height: 1.72; margin: 0; max-width: 60ch; }

/* ── fo-md-content: page-content h2 + eyebrow (no fo-section wrapper) ── */
.fo-md-content h2 {
  font-size: 1.35rem; font-weight: 800;
  letter-spacing: -.025em; margin: 0 0 .35rem;
  border: none; padding: 0; line-height: 1.2;
}
.fo-md-content h2::after { display: none; }
.fo-md-content h2 + p   { color: var(--fo-tx2); font-size: .82rem; margin: 0 0 1.25rem; }
.fo-md-content > .fo-section-eyebrow { margin-top: 3rem; }

/* ── Two-column diagram grid ───────────────────────────────── */
.fo-diagram-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.25rem 0 1rem;
}
.fo-diagram-grid .fo-flow-wrap { margin: 0; }
@media (max-width: 760px) {
  .fo-diagram-grid { grid-template-columns: 1fr; }
}
.fo-diagram-label {
  font-size: .68rem !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--fo-br);
  margin: 0 0 .6rem !important;
}

/* ── Flow diagram wrapper ──────────────────────────────────── */
.fo-flow-wrap {
  background: var(--fo-sur);
  border: 1px solid var(--fo-brd);
  border-radius: 12px;
  padding: 1.35rem;
  margin: 1.25rem 0 2.5rem;
  box-shadow: var(--fo-sh);
  overflow: auto;  /* scroll if diagram overflows box */
}
.fo-flow-caption {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .9rem; margin-top: 1.1rem;
}
.fo-flow-item  { display: flex; gap: .65rem; align-items: flex-start; }
.fo-flow-dot   { width: .6rem; height: .6rem; border-radius: 50%; margin-top: .42rem; flex-shrink: 0; }
.fo-flow-dot.success { background: #22c55e; }
.fo-flow-dot.failure { background: #ef4444; }
.fo-flow-item p      { margin: 0; font-size: .75rem; line-height: 1.5; color: var(--fo-tx2); }
.fo-flow-item strong { color: var(--fo-tx); }

/* ── Module tree ───────────────────────────────────────────── */
.fo-module-tree {
  background: var(--fo-sur);
  border-radius: 12px;
  padding: 1.35rem 1.75rem;
  font-family: var(--md-code-font), monospace;
  font-size: .77rem; line-height: 1.9;
  border: 1px solid var(--fo-brd);
  margin: 1.25rem 0 2.5rem;
  overflow-x: auto; box-shadow: var(--fo-sh);
}
.fo-module-tree .starter { font-weight: 800; color: var(--fo-br); font-size: .82rem; }
.fo-module-tree .tag     { opacity: .42; font-size: .69rem; }

/* ── Integration badges ────────────────────────────────────── */
.fo-integrations {
  display: flex; flex-wrap: wrap; gap: .55rem;
  margin: .9rem 0 2.5rem;
}
.fo-int-badge {
  display: inline-flex; align-items: center; gap: .38rem;
  background: var(--fo-sur);
  border: 1px solid var(--fo-brd);
  border-radius: 6px;
  padding: .38rem .8rem;
  font-size: .74rem; font-weight: 600;
  color: var(--fo-tx);
  transition: border-color .15s, box-shadow .15s;
}
.fo-int-badge:hover { border-color: var(--fo-br); box-shadow: var(--fo-sh); }
.fo-int-badge .dot  { width: .48rem; height: .48rem; border-radius: 50%; background: #22c55e; }

/* ── Origin quote ──────────────────────────────────────────── */
.fo-origin {
  background: var(--fo-br-d);
  border: 1px solid var(--fo-br-d2);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 1.25rem 0 2.5rem;
  position: relative;
}
.fo-origin::before {
  content: "\201C"; position: absolute; top: -.35rem; left: 1.35rem;
  font-size: 3.5rem; line-height: 1;
  color: var(--fo-br); opacity: .2; font-family: Georgia, serif;
}
.fo-origin p    { margin: 0 0 .6rem 1.75rem; font-size: .82rem; font-style: italic; line-height: 1.7; color: var(--fo-tx); }
.fo-origin cite { margin-left: 1.75rem; font-size: .72rem; font-style: normal; font-weight: 600; color: var(--fo-tx2); }

/* ── CTA cards ─────────────────────────────────────────────── */
.fo-cta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .9rem; margin: 1.25rem 0 2.5rem;
}
.fo-cta-card {
  border: 1px solid var(--fo-brd);
  border-radius: 10px;
  padding: 1.15rem 1.1rem .85rem;
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--fo-sur);
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s;
}
.fo-cta-card:hover { transform: translateY(-2px); box-shadow: var(--fo-shm); border-color: var(--fo-br); }
.fo-cta-icon    { font-size: 1.35rem; }
.fo-cta-card h3 { margin: 0; font-size: .80rem; font-weight: 700; color: var(--fo-tx); }
.fo-cta-card p  { margin: 0; font-size: .73rem; color: var(--fo-tx2); line-height: 1.45; flex: 1; }
.fo-cta-link    { font-size: .71rem; font-weight: 700; color: var(--fo-br); text-decoration: none; }
.fo-cta-link:hover { text-decoration: underline; }

/* ─── 14. HERO ──────────────────────────────────────────────────── */

.fo-hero {
  position: relative;
  padding: 4.5rem 2rem 4rem;
  text-align: center;
  /* Always dark — intentional contrast against page background */
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.22) 0%, transparent 58%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.16) 0%, transparent 52%),
    linear-gradient(150deg, #090914 0%, #18163f 45%, #0d1e38 100%);
  border-radius: 16px;
  overflow: hidden;
}
.fo-hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 26px 26px; pointer-events: none;
}
.fo-hero::after {
  content: ""; position: absolute; bottom: 0; left: 0; right: 0; height: 70px;
  background: linear-gradient(to bottom, transparent, var(--md-default-bg-color));
  pointer-events: none;
}
.fo-hero-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

.fo-hero-icon {
  width: 72px; height: 72px;
  object-fit: contain;
  margin-bottom: .5rem;
}
.fo-hero-brand {
  font-size: 1rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: #a5b4fc;
  margin-bottom: .35rem;
}

.fo-hero-eyebrow {
  display: inline-block;
  background: rgba(99,102,241,.2);
  border: 1px solid rgba(99,102,241,.4);
  color: #a5b4fc;
  font-size: .69rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  padding: .26rem .88rem; border-radius: 99px;
  margin-bottom: 1.4rem;
  animation: fo-in .6s .1s both;
}

.fo-hero h1 {
  display: block !important;
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 900; letter-spacing: -.04em; line-height: 1.08;
  margin: 0 0 1rem; border: none;
  background: linear-gradient(135deg, #e0e7ff 0%, #a5b4fc 50%, #7dd3fc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fo-up .6s .15s cubic-bezier(.22,1,.36,1) both;
}

.fo-hero-sub {
  font-size: .875rem; color: rgba(255,255,255,.66);
  max-width: 540px; width: 100%;
  margin: 0 auto 2rem !important; /* !important overrides .md-typeset p { margin } */
  line-height: 1.7; text-align: center;
  animation: fo-up .6s .25s cubic-bezier(.22,1,.36,1) both;
}

.fo-badges {
  display: flex; gap: .45rem; justify-content: center; flex-wrap: wrap;
  margin-bottom: 1.9rem;
  animation: fo-in .6s .35s both;
}
.fo-badges img { height: 22px; }

.fo-hero-btns {
  display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap;
  animation: fo-up .5s .45s cubic-bezier(.22,1,.36,1) both;
}
.fo-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .62rem 1.4rem; border-radius: 8px;
  font-weight: 700; font-size: .82rem;
  text-decoration: none !important;
  transition: transform .18s ease, box-shadow .18s ease;
}
.fo-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(0,0,0,.4); }
.fo-btn-primary { background: #fff; color: #1e1b4b !important; }
.fo-btn-accent  { background: #6366f1; color: #fff !important; border: 1px solid #818cf8; }
.fo-btn-ghost   { background: rgba(255,255,255,.09); color: #fff !important; border: 1px solid rgba(255,255,255,.2); }
.fo-btn-ghost:hover { background: rgba(255,255,255,.16); }

/* ─── 15. RESPONSIVE ─────────────────────────────────────────────── */

@media (max-width: 700px) {
  .fo-hero         { padding: 3rem 1.25rem 2.75rem; }
  .fo-compare      { grid-template-columns: 1fr; }
  .fo-flow-caption { grid-template-columns: 1fr; }
  .fo-section-grid { grid-template-columns: 1fr; }
  .fo-feat-grid    { grid-template-columns: 1fr; }
  .fo-cta-grid     { grid-template-columns: 1fr 1fr; }
  .fo-stat-num     { font-size: 1.2rem; }
}

/* ─── 16. FONT SCALE ─────────────────────────────────────────────── */
/* font-size.js sets html { font-size } inline via JS — all rem units scale globally.
   .fo-fontsize-ctrl / .fo-fontsize-btn removed (replaced by .font-size-toolbar). */

/* ─── 17. SHOWCASE + IMAGE CARDS ────────────────────────────────── */

/* ── Showcase row: text + image side-by-side ── */
.fo-showcase {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  align-items: center;
  margin: 1.25rem 0 2.5rem;
}
.fo-showcase-rev { grid-template-columns: 1.5fr 1fr; }

.fo-showcase-text { display: flex; flex-direction: column; gap: .6rem; }
/* showcase h3 gradient handled in home.html extrahead <style> block */
.fo-showcase-text h3 {
  margin: 0; letter-spacing: -.03em; line-height: 1.25; text-wrap: balance;
}
.fo-showcase-text p  { margin: 0; font-size: .82rem; color: var(--fo-tx2); line-height: 1.6; }
.fo-showcase-text ul { margin: .35rem 0 0; padding-left: 1.15rem; }
.fo-showcase-text li { font-size: .80rem; color: var(--fo-tx2); line-height: 1.65; margin-bottom: .18rem; }
.fo-showcase-text li::marker { color: var(--fo-br); }

/* ── Image card ── */
.fo-img-card {
  background: var(--fo-sur);
  border: 1px solid var(--fo-brd);
  border-radius: 12px;
  padding: 1.1rem;
  box-shadow: var(--fo-sh);
  overflow: hidden;
}
.fo-img-card img { width: 100%; height: auto; display: block; border-radius: 8px; }
.fo-img-card-wide { margin: 1.25rem 0 2.5rem; }
.fo-img-card-mb   { margin-bottom: 1rem; }

.md-typeset .fo-img-caption {
  font-size: .71rem; color: var(--fo-tx2);
  margin: .55rem 0 0; line-height: 1.45; text-align: center;
}

/* Dark mode: standard card background — HTML diagrams need no brightness adjustment */
[data-md-color-scheme="slate"] .fo-img-card { background: var(--fo-sur); border-color: var(--fo-brd2); }

/* ── Two-image grid ── */
.fo-two-img-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1rem; margin: 1.25rem 0 2.5rem;
}

/* ── Monitoring charts grid ── */
.fo-monitor-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1rem; margin: 1rem 0 2.5rem;
}

@media (max-width: 900px) {
  .fo-showcase, .fo-showcase-rev { grid-template-columns: 1fr; }
  .fo-two-img-grid               { grid-template-columns: 1fr; }
  .fo-monitor-grid               { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .fo-monitor-grid               { grid-template-columns: 1fr; }
}

/* ─── 18. MERMAID DARK MODE ──────────────────────────────────────── */

/* CSS fallback — JS also patches inline styles after Mermaid renders */
[data-md-color-scheme="slate"] .mermaid svg .labelBox {
  fill: var(--fo-sur2) !important;
  stroke: var(--fo-brd2) !important;
}
[data-md-color-scheme="slate"] .mermaid svg .labelText,
[data-md-color-scheme="slate"] .mermaid svg .labelText > tspan,
[data-md-color-scheme="slate"] .mermaid svg .loopText,
[data-md-color-scheme="slate"] .mermaid svg .loopText > tspan {
  fill: var(--fo-br2) !important;
}
[data-md-color-scheme="slate"] .mermaid svg .loopLine {
  stroke: var(--fo-brd2) !important;
}
/* Catch-all: any SVG text with hardcoded black fill */
[data-md-color-scheme="slate"] .mermaid svg text[fill="#000"],
[data-md-color-scheme="slate"] .mermaid svg text[fill="#000000"],
[data-md-color-scheme="slate"] .mermaid svg text[fill="black"],
[data-md-color-scheme="slate"] .mermaid svg tspan[fill="#000"],
[data-md-color-scheme="slate"] .mermaid svg tspan[fill="#000000"] {
  fill: var(--fo-tx) !important;
}


/* ─── 18. MERMAID PAN-ZOOM ───────────────────────────────────────── */

/* Wrapper — the clipping viewport */
.fo-mz-wrap {
  position: relative;
  overflow: hidden;
  cursor: grab;
  border-radius: 8px;
  min-height: 80px;
  user-select: none;
}
.fo-mz-wrap:active { cursor: grabbing; }

/* SVG inside must not be constrained */
.fo-mz-wrap .mermaid svg {
  max-width: none !important;
  display: block;
}

/* Toolbar — fades in on hover */
.fo-mz-bar {
  position: absolute;
  top: .45rem;
  right: .45rem;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--fo-sur2);
  border: 1px solid var(--fo-brd2);
  border-radius: 6px;
  padding: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
  box-shadow: var(--fo-sh);
}
.fo-mz-wrap:hover .fo-mz-bar {
  opacity: 1;
  pointer-events: auto;
}

.fo-mz-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--fo-tx);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 700;
  padding: .22rem .55rem;
  line-height: 1;
  font-family: inherit;
  transition: background .12s, color .12s;
  min-width: 1.6rem;
  text-align: center;
}
.fo-mz-btn:hover { background: var(--fo-br-d); color: var(--fo-br); }
.fo-mz-r { font-size: .63rem; font-weight: 600; min-width: auto; padding: .22rem .5rem; }

.fo-mz-pct {
  font-size: .62rem;
  font-weight: 600;
  color: var(--fo-tx2);
  padding: 0 .3rem;
  min-width: 2.4rem;
  text-align: center;
  pointer-events: none;
}

/* Hint: drag icon top-left */
.fo-mz-wrap::before {
  content: "⠿ drag · scroll to zoom";
  position: absolute;
  bottom: .4rem;
  left: .5rem;
  font-size: .58rem;
  color: var(--fo-tx2);
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
  z-index: 10;
  letter-spacing: .03em;
}
.fo-mz-wrap:hover::before { opacity: .55; }

/* ─── Javadoc iframe container ─────────────────────────────────── */
.fo-javadoc-wrap {
  border: 1px solid var(--fo-brd);
  border-radius: 8px;
  overflow: hidden;
  margin: 1.5rem 0;
  box-shadow: var(--fo-shm);
}
.fo-javadoc-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .5rem 1rem;
  background: var(--fo-sur2);
  border-bottom: 1px solid var(--fo-brd);
  font-size: .8rem;
  color: var(--fo-tx2);
}
.fo-javadoc-toolbar a {
  color: var(--fo-br);
  text-decoration: none;
  font-size: 1rem;
  line-height: 1;
}
.fo-javadoc-toolbar a:hover { color: var(--fo-br2); }
.fo-javadoc-frame {
  display: block;
  width: 100%;
  height: 80vh;
  min-height: 600px;
  border: none;
  background: #fff;
}

/* ─── FONT SIZE TOOLBAR ─────────────────────────────────────────── */
/* font-size.js sets html { font-size } directly — all rem units scale site-wide.
   No --font-size-override variable needed. */

.font-size-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 .5rem 0 0;
  border-right: 1px solid rgba(255,255,255,.15);
  flex-shrink: 0;
}
[data-md-color-scheme="default"] .font-size-toolbar {
  border-right-color: rgba(0,0,0,.1);
}

.font-size-btn {
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 4px 6px;
  transition: background .15s, color .15s;
  white-space: nowrap;
  font-family: inherit;
  /* Dark mode: match header icon colour */
  color: rgba(255,255,255,.7);
}
.font-size-btn:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.font-size-btn.active {
  background: rgba(255,255,255,.2);
  color: #fff;
}

/* Light mode */
[data-md-color-scheme="default"] .font-size-btn {
  color: var(--fo-tx) !important;
  opacity: .65;
}
[data-md-color-scheme="default"] .font-size-btn:hover {
  background: rgba(0,0,0,.06) !important;
  opacity: 1;
}
[data-md-color-scheme="default"] .font-size-btn.active {
  background: rgba(0,0,0,.10) !important;
  opacity: 1;
}

/* ─── DOMAIN BADGE ──────────────────────────────────────────────── */
.fo-domain-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: .2rem .6rem; border-radius: 99px; border: 1px solid var(--fo-br-d2);
  background: var(--fo-br-d); color: var(--fo-br); white-space: nowrap;
}
.fo-domain-pill {
  display: inline-block; padding: .15rem .5rem; border-radius: 4px;
  font-family: var(--md-code-font-family); font-size: .75rem;
  background: var(--fo-br-d); color: var(--fo-br2);
  border: 1px solid var(--fo-br-d2);
}

/* ═══════════════════════════════════════════════════════════════════
   FAILOVER DOCS v4.1 — FRONTEND-DESIGN ENHANCEMENTS
   Aurora · Glassmorphism depth · Glow effects · Terminal code
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 20. KEYFRAMES ──────────────────────────────────────────────── */

@keyframes fo-aurora {
  0%   { background-position: 0% 50%,  100% 0%,   50% 100%, 0% 0%; }
  25%  { background-position: 100% 50%, 0% 100%, 100% 50%,  0% 0%; }
  50%  { background-position: 50% 0%,  50%  50%,   0% 50%,  0% 0%; }
  75%  { background-position: 0% 100%, 100% 50%,  50%  0%,  0% 0%; }
  100% { background-position: 0% 50%,  100%  0%,  50% 100%, 0% 0%; }
}

@keyframes fo-banner-stripe {
  0%   { background-position: 0% 0%;   }
  50%  { background-position: 0% 100%; }
  100% { background-position: 0% 0%;   }
}

@keyframes fo-brand-shimmer {
  0%   { background-position: 0%   50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}

/* ─── 20a. HERO AURORA ───────────────────────────────────────────── */

[data-md-color-scheme="slate"] .fo-hero {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,.30) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(59,130,246,.22) 0%, transparent 50%),
    radial-gradient(ellipse at 55% 85%, rgba(167,139,250,.18) 0%, transparent 45%),
    linear-gradient(150deg, #090914 0%, #18163f 45%, #0d1e38 100%);
  background-size: 240% 240%, 240% 240%, 240% 240%, 100% 100%;
  animation: fo-aurora 22s ease-in-out infinite;
}

/* ─── 20b. GLASSMORPHISM CARDS ───────────────────────────────────── */

[data-md-color-scheme="slate"] .fo-feat-card,
[data-md-color-scheme="slate"] .fo-cta-card {
  background: rgba(21,21,31,.62);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-color: rgba(129,140,248,.13);
}
[data-md-color-scheme="slate"] .fo-sec-card {
  background: rgba(21,21,31,.68);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
}
[data-md-color-scheme="slate"] .fo-stats {
  background: rgba(21,21,31,.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(129,140,248,.11);
}
[data-md-color-scheme="slate"] .fo-origin {
  background: rgba(129,140,248,.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-color: rgba(129,140,248,.18);
}
[data-md-color-scheme="slate"] .fo-flow-wrap {
  background: rgba(21,21,31,.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-md-color-scheme="slate"] .fo-module-tree {
  background: rgba(12,12,20,.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-color: rgba(129,140,248,.10);
}

/* ─── 20c. GLOW HOVER EFFECTS ────────────────────────────────────── */

[data-md-color-scheme="slate"] .fo-feat-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(129,140,248,.38),
    0 8px 32px rgba(0,0,0,.55),
    0 0 28px rgba(129,140,248,.13);
  border-color: rgba(129,140,248,.42);
}
[data-md-color-scheme="slate"] .fo-cta-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 0 0 1px rgba(129,140,248,.34),
    0 8px 28px rgba(0,0,0,.50),
    0 0 22px rgba(129,140,248,.11);
  border-color: rgba(129,140,248,.42);
}
[data-md-color-scheme="slate"] .fo-sec-card:hover {
  box-shadow:
    0 0 0 1px rgba(129,140,248,.28),
    0 6px 24px rgba(0,0,0,.45),
    0 0 18px rgba(129,140,248,.09);
  border-color: rgba(129,140,248,.40);
}
[data-md-color-scheme="default"] .fo-feat-card:hover,
[data-md-color-scheme="default"] .fo-cta-card:hover {
  box-shadow:
    0 0 0 1px rgba(79,70,229,.22),
    0 8px 28px rgba(79,70,229,.07),
    0 4px 12px rgba(0,0,0,.06);
}

/* ─── 20d. CODE BLOCK TERMINAL DOTS ──────────────────────────────── */

/* Three traffic-light circles via box-shadow on a single ::before dot */
.md-typeset .highlight {
  position: relative;
}
.md-typeset .highlight::before {
  content: "";
  position: absolute;
  top: .72rem;
  left: .90rem;
  width: .48rem;
  height: .48rem;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: .88rem 0 0 #ffbd2e, 1.76rem 0 0 #27c93f;
  z-index: 2;
  pointer-events: none;
}
/* Push code down to clear the dots */
.md-typeset .highlight pre {
  padding-top: 1.85rem !important;
}
/* Undo if there is already a filename header */
.md-typeset .highlight:has(.filename)::before { display: none; }
.md-typeset .highlight:has(.filename) pre { padding-top: .75rem !important; }

/* Dark-mode code block depth */
[data-md-color-scheme="slate"] .md-typeset .highlight,
[data-md-color-scheme="slate"] .md-typeset pre {
  background: rgba(9,9,20,.88);
  border-color: rgba(129,140,248,.11);
}
[data-md-color-scheme="slate"] .md-typeset .highlight:hover {
  border-color: rgba(129,140,248,.22);
  box-shadow: 0 0 0 1px rgba(129,140,248,.09), 0 4px 20px rgba(0,0,0,.5);
}

/* ─── 20e. ADMONITION GRADIENT ACCENTS ───────────────────────────── */

[data-md-color-scheme="slate"] .md-typeset .admonition,
[data-md-color-scheme="slate"] .md-typeset details {
  background: rgba(21,21,31,.70);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.md-typeset .admonition.note    { box-shadow: 0 0 0 1px rgba(59,130,246,.35),  inset 3px 0 0 #3b82f6; }
.md-typeset .admonition.tip     { box-shadow: 0 0 0 1px rgba(16,185,129,.35),  inset 3px 0 0 #10b981; }
.md-typeset .admonition.warning { box-shadow: 0 0 0 1px rgba(245,158,11,.35),  inset 3px 0 0 #f59e0b; }
.md-typeset .admonition.danger  { box-shadow: 0 0 0 1px rgba(239,68,68,.35),   inset 3px 0 0 #ef4444; }
.md-typeset .admonition.example { box-shadow: 0 0 0 1px rgba(139,92,246,.35),  inset 3px 0 0 #8b5cf6; }
.md-typeset .admonition.info    { box-shadow: 0 0 0 1px rgba(6,182,212,.35),   inset 3px 0 0 #06b6d4; }

/* ─── 20f. PAGE BANNER STRIPE PULSE ──────────────────────────────── */

.fo-page-banner::before {
  background: linear-gradient(
    to bottom,
    var(--fo-br2) 0%,
    var(--fo-br)  25%,
    rgba(167,139,250,1) 50%,
    var(--fo-br)  75%,
    var(--fo-br2) 100%
  );
  background-size: 100% 300%;
  animation: fo-banner-stripe 4s ease-in-out infinite;
}

/* ─── 20g. HERO BRAND SHIMMER TEXT ───────────────────────────────── */

[data-md-color-scheme="slate"] .fo-hero-brand {
  background: linear-gradient(90deg, #a5b4fc, #c084fc, #7dd3fc, #a5b4fc);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fo-brand-shimmer 5s linear infinite;
  /* override the plain color set earlier */
  color: transparent;
}

/* ─── 20h. NAV ACTIVE GLOW ───────────────────────────────────────── */

[data-md-color-scheme="slate"] .md-nav__link--active,
[data-md-color-scheme="slate"] .md-nav__link--active:hover {
  box-shadow: 0 0 0 1px rgba(129,140,248,.18), 0 2px 10px rgba(129,140,248,.08);
}

/* ─── 20i. HERO BUTTON GLOW ──────────────────────────────────────── */

.fo-btn-primary:hover {
  box-shadow: 0 0 0 4px rgba(255,255,255,.12), 0 8px 28px rgba(0,0,0,.42);
}
.fo-btn-accent:hover {
  box-shadow: 0 0 0 3px rgba(99,102,241,.30), 0 8px 28px rgba(99,102,241,.28);
}

/* ─── 20j. INTEGRATION BADGE GLOW ────────────────────────────────── */

[data-md-color-scheme="slate"] .fo-int-badge:hover {
  border-color: rgba(129,140,248,.40);
  box-shadow: 0 0 0 1px rgba(129,140,248,.14), 0 4px 12px rgba(129,140,248,.08);
  background: rgba(129,140,248,.06);
}

/* ═══════════════════════════════════════════════════════════════════
   FAILOVER DOCS v4.2 — ANIMATED DIAGRAM COMPONENTS + SCROLL-REVEAL
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 21. SCROLL-REVEAL ──────────────────────────────────────────── */

.fo-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1),
              transform .55s cubic-bezier(.22,1,.36,1);
}
.fo-reveal.fo-visible {
  opacity: 1;
  transform: translateY(0);
}
.fo-reveal.fo-delay-1 { transition-delay: .08s; }
.fo-reveal.fo-delay-2 { transition-delay: .16s; }
.fo-reveal.fo-delay-3 { transition-delay: .24s; }
.fo-reveal.fo-delay-4 { transition-delay: .32s; }

/* ─── 22. SERVICE DEPENDENCY DIAGRAM ─────────────────────────────── */

.fo-svc-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.4rem 1rem 1.1rem;
  gap: .5rem;
  min-height: 172px;
}

.fo-svc-tier      { display: flex; justify-content: center; gap: .75rem; }
.fo-svc-peers     { display: flex; gap: .75rem; justify-content: center; }

.fo-svc-node {
  border-radius: 9px;
  padding: .6rem .95rem;
  display: flex; flex-direction: column; align-items: center;
  gap: .15rem; min-width: 100px; text-align: center;
  border: 1px solid var(--fo-brd); background: var(--fo-sur2);
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s;
}
.fo-svc-node:hover { transform: translateY(-2px); box-shadow: var(--fo-shm); }

.fo-svc-node-app { border-color: rgba(99,102,241,.45); background: rgba(99,102,241,.07); animation: fo-svc-pulse 3s ease-in-out infinite; }
.fo-svc-node-ref { border-color: rgba(249,115,22,.40); background: rgba(249,115,22,.06); }
.fo-svc-node-ext { border-color: rgba(139,92,246,.40); background: rgba(139,92,246,.06); }

@keyframes fo-svc-pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
  50% { box-shadow: 0 0 0 5px rgba(99,102,241,.10); }
}

.fo-svc-icon { font-size: 1.15rem; line-height: 1; }
.fo-svc-name { font-size: .7rem; font-weight: 700; color: var(--fo-tx); }
.fo-svc-sub  { font-size: .61rem; color: var(--fo-tx2); }

.fo-svc-conn-v {
  width: 2px; height: 22px;
  background: linear-gradient(to bottom, var(--fo-br), var(--fo-brd2));
  margin: 0 auto;
  animation: fo-conn-grow .55s .25s both;
}
.fo-svc-conn-h {
  width: 50%; height: 2px;
  background: linear-gradient(to right, transparent, var(--fo-brd2), transparent);
  margin: 0 auto;
  animation: fo-conn-grow-h .45s .45s both;
}

@keyframes fo-conn-grow   { from { height:0; opacity:0; } to { height:22px; opacity:1; } }
@keyframes fo-conn-grow-h { from { width:0;  opacity:0; } to { width:50%; opacity:1; } }

/* ─── 23. CASCADE FAILURE DIAGRAM ────────────────────────────────── */

.fo-cascade {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: .35rem;
  padding: 1.5rem .75rem;
}

.fo-casc-node {
  display: flex; flex-direction: column; align-items: center; gap: .18rem;
  padding: .55rem .75rem; border-radius: 9px; min-width: 72px; text-align: center;
  background: var(--fo-sur2); border: 1px solid rgba(239,68,68,.25);
  animation: fo-casc-flash 2s ease-in-out infinite;
}
.fo-casc-node:nth-child(1) { animation-delay: 0s; }
.fo-casc-node:nth-child(3) { animation-delay: .3s; }
.fo-casc-node:nth-child(5) { animation-delay: .6s; }
.fo-casc-node:nth-child(7) { animation-delay: .9s; }

@keyframes fo-casc-flash {
  0%,100% { border-color: rgba(239,68,68,.20); box-shadow: none; background: var(--fo-sur2); }
  55% { border-color: rgba(239,68,68,.65); box-shadow: 0 0 12px rgba(239,68,68,.18); background: rgba(239,68,68,.05); }
}

.fo-casc-icon  { font-size: 1rem; line-height: 1; }
.fo-casc-name  { font-size: .67rem; font-weight: 700; color: var(--fo-tx); }
.fo-casc-state {
  font-size: .57rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #ef4444; background: rgba(239,68,68,.1); padding: .08rem .38rem; border-radius: 3px;
}

.fo-casc-arr {
  font-size: 1rem; color: #ef4444; font-weight: 800; line-height: 1;
  animation: fo-arr-slide 1.2s ease-in-out infinite;
}
.fo-casc-arr:nth-of-type(2) { animation-delay: .15s; }
.fo-casc-arr:nth-of-type(3) { animation-delay: .30s; }
.fo-casc-arr:nth-of-type(4) { animation-delay: .45s; }

@keyframes fo-arr-slide {
  0%,100% { opacity:.3; transform: translateX(0); }
  50% { opacity:1; transform: translateX(3px); }
}

/* ─── 24. FAILOVER INTERCEPT DIAGRAM ────────────────────────────── */

.fo-intercept-diagram {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.2rem .8rem 1rem; gap: .4rem;
}
.fo-int-row {
  display: flex; align-items: center; justify-content: center; gap: .4rem; width: 100%;
}
.fo-int-node {
  padding: .5rem .75rem; border-radius: 8px;
  font-size: .68rem; font-weight: 700; text-align: center;
  border: 1px solid var(--fo-brd); background: var(--fo-sur2);
  color: var(--fo-tx); min-width: 66px;
  transition: transform .18s, box-shadow .18s;
}
.fo-int-node:hover { transform: translateY(-1px); box-shadow: var(--fo-shm); }
.fo-int-node-app   { border-color: rgba(99,102,241,.42); background: rgba(99,102,241,.07); }
.fo-int-node-store {
  border-color: rgba(34,197,94,.42); background: rgba(34,197,94,.07); color: #16a34a;
  animation: fo-store-glow 2.5s ease-in-out infinite;
}
[data-md-color-scheme="slate"] .fo-int-node-store { color: #22c55e; }
.fo-int-node-up    { border-color: rgba(239,68,68,.35); background: rgba(239,68,68,.06); }

@keyframes fo-store-glow {
  0%,100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
  50% { box-shadow: 0 0 0 4px rgba(34,197,94,.12); }
}

.fo-int-lbl {
  font-size: .6rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--fo-tx2); white-space: nowrap;
}
.fo-int-conn {
  font-size: .75rem; color: var(--fo-tx3); line-height: 1;
}
.fo-int-conn-ok   { color: #22c55e; }
.fo-int-conn-fail { color: #ef4444; }

/* ─── 25. USER EXPERIENCE 3-STATE ────────────────────────────────── */

.fo-ux-states {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: .65rem; padding: .5rem 0 .25rem;
}
@media (max-width: 700px) { .fo-ux-states { grid-template-columns: 1fr; } }

.fo-ux-card {
  border-radius: 10px; padding: .9rem .8rem .75rem;
  border: 1px solid var(--fo-brd); background: var(--fo-sur);
  display: flex; flex-direction: column; gap: .3rem; text-align: center;
  transition: transform .2s cubic-bezier(.22,1,.36,1), box-shadow .2s, border-color .2s;
}
.fo-ux-card:hover { transform: translateY(-2px); box-shadow: var(--fo-shm); }
.fo-ux-card-ok   { border-color: rgba(34,197,94,.35); }
.fo-ux-card-fail { border-color: rgba(239,68,68,.35); animation: fo-fail-pulse 2s ease-in-out infinite; }
.fo-ux-card-save { border-color: rgba(99,102,241,.35); }

@keyframes fo-fail-pulse {
  0%,100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(239,68,68,.10); }
}

.fo-ux-badge {
  width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem; margin: 0 auto .2rem; line-height: 1;
}
.fo-ux-badge-ok   { background: rgba(34,197,94,.12); }
.fo-ux-badge-fail { background: rgba(239,68,68,.12); animation: fo-badge-blink 1.8s ease-in-out infinite; }
.fo-ux-badge-save { background: rgba(99,102,241,.10); }

@keyframes fo-badge-blink {
  0%,100% { background: rgba(239,68,68,.12); }
  50% { background: rgba(239,68,68,.28); box-shadow: 0 0 8px rgba(239,68,68,.22); }
}

.fo-ux-title { font-size: .72rem; font-weight: 700; color: var(--fo-tx); line-height: 1.3; }
.fo-ux-desc  { font-size: .63rem; color: var(--fo-tx2); line-height: 1.4; }
.fo-ux-tag   {
  align-self: center; margin-top: .15rem;
  font-size: .58rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  padding: .1rem .42rem; border-radius: 4px;
}
.fo-ux-tag-ok   { background: rgba(34,197,94,.12); color: #16a34a; }
.fo-ux-tag-fail { background: rgba(239,68,68,.12); color: #ef4444; }
.fo-ux-tag-save { background: rgba(99,102,241,.10); color: var(--fo-br); }
[data-md-color-scheme="slate"] .fo-ux-tag-ok   { color: #22c55e; }
[data-md-color-scheme="slate"] .fo-ux-tag-fail { color: #f87171; }

/* ─── 26. ANIMATED SPARKLINE CHARTS ──────────────────────────────── */

.fo-spark-chart {
  padding: .65rem .65rem .5rem;
}
.fo-spark-header {
  display: flex; align-items: center; gap: .4rem;
  font-size: .67rem; font-weight: 700; color: var(--fo-tx2); margin-bottom: .45rem;
}
.fo-spark-dot { width: .44rem; height: .44rem; border-radius: 50%; flex-shrink: 0; }
.fo-spark-dot-red   { background: #ef4444; }
.fo-spark-dot-green { background: #22c55e; }
.fo-spark-dot-amber { background: #f59e0b; }

.fo-spark-svg { width: 100%; height: 54px; display: block; overflow: visible; }

.fo-spark-area {
  stroke: none;
}
.fo-spark-line {
  fill: none; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
  animation: fo-spark-draw 1.6s cubic-bezier(.22,1,.36,1) .4s both;
  vector-effect: non-scaling-stroke;
}
@keyframes fo-spark-draw { to { stroke-dashoffset: 0; } }

.fo-spark-line-red   { stroke: #ef4444; }
.fo-spark-line-green { stroke: #22c55e; }
.fo-spark-line-amber { stroke: #f59e0b; }
.fo-spark-area-red   { fill: rgba(239,68,68,.07); }
.fo-spark-area-green { fill: rgba(34,197,94,.07); }
.fo-spark-area-amber { fill: rgba(245,158,11,.07); }

/* Dark mode: slightly brighter area fills */
[data-md-color-scheme="slate"] .fo-spark-area-red   { fill: rgba(239,68,68,.10); }
[data-md-color-scheme="slate"] .fo-spark-area-green { fill: rgba(34,197,94,.10); }
[data-md-color-scheme="slate"] .fo-spark-area-amber { fill: rgba(245,158,11,.10); }

/* ─── 27. MATERIAL GRID CARDS OVERRIDES ──────────────────────────── */

/* Material .grid.cards — style to match the fo design system */
.md-typeset .grid.cards > :is(ul, ol) > li,
.md-typeset .grid.cards > :not(ul):not(ol) {
  border-radius: 10px !important;
  border: 1px solid var(--fo-brd) !important;
  background: var(--fo-sur) !important;
  transition: transform .2s cubic-bezier(.22,1,.36,1),
              box-shadow .2s, border-color .2s !important;
}
.md-typeset .grid.cards > :is(ul, ol) > li:hover,
.md-typeset .grid.cards > :not(ul):not(ol):hover {
  transform: translateY(-2px) !important;
  box-shadow: var(--fo-shm) !important;
  border-color: var(--fo-br) !important;
}
[data-md-color-scheme="slate"] .md-typeset .grid.cards > :is(ul, ol) > li {
  background: rgba(21,21,31,.62) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
[data-md-color-scheme="slate"] .md-typeset .grid.cards > :is(ul, ol) > li:hover {
  border-color: rgba(129,140,248,.50) !important;
  box-shadow: 0 0 0 1px rgba(129,140,248,.22), 0 8px 28px rgba(0,0,0,.50) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   FAILOVER DOCS v4.3 — SERVICE LAYERS · CASCADE FLOWS · FLOW DIAGRAMS
   ═══════════════════════════════════════════════════════════════════ */

/* ─── 28. SERVICE DEPENDENCY 3-LAYER ─────────────────────────────── */

/* Grid: col 1 = nodes (fixed, centered), col 2 = scope badges
   Connectors placed only in col 1 → always centered under nodes */
.fo-svc-three-layer {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto auto auto auto;
  align-items: center;
  column-gap: .75rem;
  row-gap: 0;
  padding: 1.1rem 1rem 1rem;
}

/* Node cells — column 1, centered */
.fo-svc-n1 { grid-row: 1; grid-column: 1; justify-self: center; }
.fo-svc-n2 { grid-row: 3; grid-column: 1; justify-self: center; }
.fo-svc-n3 { grid-row: 5; grid-column: 1; justify-self: center; }

/* Badge cells — column 2, vertically centered against the node row */
.fo-svc-b1 { grid-row: 1; grid-column: 2; align-self: center; justify-self: start; }
.fo-svc-b2 { grid-row: 3; grid-column: 2; align-self: center; justify-self: start; }
.fo-svc-b3 { grid-row: 5; grid-column: 2; align-self: center; justify-self: start; }

/* Connector cells — column 1 only, perfectly centered under nodes */
.fo-svc-vc1 { grid-row: 2; grid-column: 1; justify-self: center; }
.fo-svc-vc2 { grid-row: 4; grid-column: 1; justify-self: center; }

.fo-svc-scope {
  font-size: .62rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .15rem .5rem; border-radius: 99px; white-space: nowrap;
  display: inline-block;
}
.fo-svc-scope-you { background: rgba(99,102,241,.12); color: #4f46e5; border: 1px solid rgba(99,102,241,.22); }
.fo-svc-scope-org { background: rgba(245,158,11,.12); color: #d97706; border: 1px solid rgba(245,158,11,.22); }
.fo-svc-scope-ext { background: rgba(239,68,68,.10);  color: #dc2626; border: 1px solid rgba(239,68,68,.18); }
[data-md-color-scheme="slate"] .fo-svc-scope-you { color: #818cf8; }
[data-md-color-scheme="slate"] .fo-svc-scope-org { color: #fbbf24; }
[data-md-color-scheme="slate"] .fo-svc-scope-ext { color: #f87171; }

.fo-svc-vconn-anim {
  width: 2px; height: 26px;
  position: relative; overflow: visible;
  background: linear-gradient(to bottom, var(--fo-br), var(--fo-brd2));
}
/* Arrowhead at bottom of connector */
.fo-svc-vconn-anim::after {
  content: '';
  position: absolute; bottom: -4px;
  left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--fo-brd2);
}
.fo-svc-vdot {
  position: absolute;
  width: 6px; height: 6px; border-radius: 50%;
  left: 50%; transform: translateX(-50%);
  background: var(--fo-br);
  animation: fo-fla-travel-v 1.8s ease-in-out infinite;
}
.fo-svc-vdot-2 { animation-delay: .6s; }

/* ─── 29. CASCADE TWO-FLOW ───────────────────────────────────────── */

.fo-cascade-two {
  display: flex; flex-direction: column; gap: .55rem;
  padding: .75rem .5rem .6rem;
}

.fo-cascade-flow-wrap { display: flex; flex-direction: column; gap: .28rem; }

.fo-cascade-flow-label {
  display: flex; align-items: center; gap: .38rem;
  font-size: .61rem; font-weight: 700; color: var(--fo-tx2);
}
.fo-casc-flow-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.2rem; height: 1.2rem;
  background: var(--fo-br-d2); color: var(--fo-br);
  border-radius: 50%; font-size: .58rem; font-weight: 800; flex-shrink: 0;
}
.fo-casc-scope-pill {
  font-size: .52rem; font-weight: 600;
  padding: .1rem .38rem; border-radius: 4px; white-space: nowrap;
  margin-left: auto;
}
.fo-casc-scope-org { background: rgba(245,158,11,.1); color: #d97706; }
.fo-casc-scope-ext { background: rgba(239,68,68,.1);  color: #ef4444; }
[data-md-color-scheme="slate"] .fo-casc-scope-org { color: #fbbf24; }
[data-md-color-scheme="slate"] .fo-casc-scope-ext { color: #f87171; }

.fo-cascade-flow-sep {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--fo-brd2), transparent);
  margin: .1rem 0;
}
.fo-casc-arr-left  { color: #ef4444; font-weight: 800; }
.fo-casc-node-app  { border-color: rgba(99,102,241,.40); background: rgba(99,102,241,.06); }
.fo-casc-node-ref  { border-color: rgba(249,115,22,.40); background: rgba(249,115,22,.06); }
.fo-casc-node-ext-dn { border-color: rgba(239,68,68,.40); background: rgba(239,68,68,.07); }

/* ─── 30. ANIMATED FLOW DIAGRAMS ─────────────────────────────────── */

@keyframes fo-fla-travel-h {
  0%   { left: 5%;  opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left: 88%; opacity: 0; }
}
@keyframes fo-fla-travel-v {
  0%   { top: 5%;  opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 85%; opacity: 0; }
}

.fo-fla-grid {
  display: grid;
  grid-template-columns: auto minmax(14px, 1fr) auto minmax(14px, 1fr) auto;
  align-items: center;
  justify-items: center;
  column-gap: 0;
  row-gap: .15rem;
  padding: .55rem .4rem .45rem;
}

/* Grid cell placement */
.fo-fla-cell-caller  { grid-column: 1; grid-row: 1; }
.fo-fla-hc-req       { grid-column: 2; grid-row: 1; justify-self: stretch; }
.fo-fla-cell-svc     { grid-column: 3; grid-row: 1; }
.fo-fla-hc-ok        { grid-column: 4; grid-row: 1; justify-self: stretch; }
.fo-fla-hc-fail      { grid-column: 4; grid-row: 1; justify-self: stretch; }
.fo-fla-cell-up      { grid-column: 5; grid-row: 1; }
.fo-fla-cell-vc1     { grid-column: 3; grid-row: 2; }
.fo-fla-cell-int     { grid-column: 3; grid-row: 3; }
.fo-fla-cell-vc2     { grid-column: 3; grid-row: 4; }
.fo-fla-cell-store   { grid-column: 3; grid-row: 5; }
.fo-fla-cell-return  { grid-column: 1 / -1; grid-row: 6; }

/* Nodes */
.fo-fla-node {
  border-radius: 7px; padding: .4rem .5rem;
  text-align: center; border: 1px solid var(--fo-brd);
  background: var(--fo-sur2); min-width: 70px; max-width: 108px;
  flex-shrink: 0;
  transition: transform .18s, box-shadow .18s;
}
.fo-fla-node:hover { transform: translateY(-1px); box-shadow: var(--fo-sh); }

.fo-fla-icon { display: block; font-size: .85rem; line-height: 1.3; }
.fo-fla-name { display: block; font-size: .57rem; font-weight: 700; color: var(--fo-tx); line-height: 1.25; }
.fo-fla-sub  { display: block; font-size: .51rem; color: var(--fo-tx2); margin-top: .1rem; font-weight: 500; }

.fo-fla-caller      { border-color: rgba(99,102,241,.35); background: rgba(99,102,241,.06); }
.fo-fla-svc         { border-color: rgba(99,102,241,.5);  background: rgba(99,102,241,.10); animation: fo-svc-pulse 3s ease-in-out infinite; }
.fo-fla-interceptor { border-color: rgba(245,158,11,.4);  background: rgba(245,158,11,.06); }
.fo-fla-store-node  { border-color: rgba(34,197,94,.4);   background: rgba(34,197,94,.07);  animation: fo-store-glow 2.5s ease-in-out infinite; }
.fo-fla-store-find  { border-color: rgba(245,158,11,.4);  background: rgba(245,158,11,.07); animation: fo-store-glow 2.5s ease-in-out infinite; }
.fo-fla-up-ok       { border-color: rgba(34,197,94,.4);   background: rgba(34,197,94,.07); }
.fo-fla-up-dn       { border-color: rgba(239,68,68,.4);   background: rgba(239,68,68,.07); animation: fo-fail-pulse 1.5s ease-in-out infinite; }

.fo-fla-state { display: block; font-size: .52rem; font-weight: 800; text-transform: uppercase; border-radius: 3px; padding: .04rem .28rem; margin-top: .12rem; }
.fo-fla-state-ok { background: rgba(34,197,94,.15); color: #16a34a; }
.fo-fla-state-dn { background: rgba(239,68,68,.15); color: #ef4444; }
[data-md-color-scheme="slate"] .fo-fla-state-ok { color: #22c55e; }
[data-md-color-scheme="slate"] .fo-fla-state-dn { color: #f87171; }

/* Horizontal connectors */
.fo-fla-hconn {
  position: relative; height: 2px;
  background: var(--fo-brd2); overflow: visible;
  width: 100%;
}
.fo-fla-hc-ok   { background: rgba(34,197,94,.45); }
.fo-fla-hc-fail {
  background: repeating-linear-gradient(
    90deg, rgba(239,68,68,.55) 0, rgba(239,68,68,.55) 4px, transparent 4px, transparent 8px
  );
}
.fo-fla-hl {
  position: absolute; top: -1rem; left: 50%; transform: translateX(-50%);
  font-size: .50rem; font-weight: 600; color: var(--fo-tx2); white-space: nowrap; pointer-events: none;
}

/* Animated dots on horizontal connectors */
.fo-fla-hdot {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  top: 50%; transform: translateY(-50%);
}
.fo-fla-hd-req  { background: #818cf8; animation: fo-fla-travel-h 2s ease-in-out infinite; }
.fo-fla-hd-ok   { background: #22c55e; animation: fo-fla-travel-h 2s ease-in-out .6s infinite; }
.fo-fla-hd-fail { background: #ef4444; animation: fo-fla-travel-h 2s ease-in-out .6s infinite; }

/* Vertical connectors */
.fo-fla-vconn {
  position: relative; width: 2px; height: 14px; overflow: visible;
}
.fo-fla-vc-1   { background: linear-gradient(to bottom, rgba(99,102,241,.5), rgba(245,158,11,.5)); }
.fo-fla-vc-2   { background: linear-gradient(to bottom, rgba(245,158,11,.5), rgba(34,197,94,.5)); }
.fo-fla-vc-rcv { background: rgba(245,158,11,.5); }

/* Animated dots on vertical connectors */
.fo-fla-vdot {
  position: absolute; width: 5px; height: 5px; border-radius: 50%;
  left: 50%; transform: translateX(-50%);
}
.fo-fla-vd-1   { background: #818cf8; animation: fo-fla-travel-v 1.8s ease-in-out infinite; }
.fo-fla-vd-2   { background: #22c55e; animation: fo-fla-travel-v 1.8s ease-in-out .5s infinite; }
.fo-fla-vd-rcv { background: #f59e0b; animation: fo-fla-travel-v 1.8s ease-in-out .5s infinite; }

/* ── Reverse-direction keyframes (response / recover direction) ── */
@keyframes fo-fla-travel-h-rv {
  0%   { left: 88%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { left:  5%; opacity: 0; }
}
@keyframes fo-fla-travel-v-rv {
  0%   { top: 85%; opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top:  5%; opacity: 0; }
}
/* Store flow — all green, response (Upstream→Svc→Caller) + store (Svc→Int→Store) */
.fo-fla-hd-grn-rv  { background: #22c55e; animation: fo-fla-travel-h-rv 2s   ease-in-out 0s   infinite; }
.fo-fla-hd-grn-rv2 { background: #22c55e; animation: fo-fla-travel-h-rv 2s   ease-in-out .4s  infinite; }
.fo-fla-vd-grn     { background: #22c55e; animation: fo-fla-travel-v    1.8s ease-in-out .1s  infinite; }
.fo-fla-vd-grn2    { background: #22c55e; animation: fo-fla-travel-v    1.8s ease-in-out .55s infinite; }
/* Recover flow — orange bottom→top (Store→Int→Svc) + orange right→left (Svc→Caller) */
.fo-fla-vd-org-rv  { background: #f59e0b; animation: fo-fla-travel-v-rv 1.8s ease-in-out 0s   infinite; }
.fo-fla-vd-org-rv2 { background: #f59e0b; animation: fo-fla-travel-v-rv 1.8s ease-in-out .45s infinite; }
.fo-fla-hd-org-rv  { background: #f59e0b; animation: fo-fla-travel-h-rv 2s   ease-in-out .8s  infinite; }

/* Return row */
.fo-fla-return {
  display: flex; align-items: center; justify-content: center;
  gap: .45rem; margin-top: .4rem;
  font-size: .58rem; color: var(--fo-tx2); font-weight: 600;
}
.fo-fla-ret-arr { font-size: .65rem; }
.fo-fla-payload {
  display: inline-flex; align-items: center;
  padding: .16rem .48rem; border-radius: 4px;
  font-size: .56rem; font-family: var(--md-code-font-family, monospace); font-weight: 600;
  white-space: nowrap;
}
.fo-fla-payload-ok  { background: rgba(34,197,94,.12);  color: #16a34a; border: 1px solid rgba(34,197,94,.28); }
.fo-fla-payload-rcv { background: rgba(245,158,11,.12); color: #b45309; border: 1px solid rgba(245,158,11,.28); }
[data-md-color-scheme="slate"] .fo-fla-payload-ok  { color: #22c55e; }
[data-md-color-scheme="slate"] .fo-fla-payload-rcv { color: #f59e0b; }

/* ─── 31. CONFIG DASHBOARD TABLE ──────────────────────────────────── */

.fo-config-table-wrap {
  border-radius: 10px; overflow: hidden;
  border: 1px solid var(--fo-brd); box-shadow: var(--fo-sh);
  margin: .5rem 0 .25rem;
}
.fo-config-table-header {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem;
  background: var(--fo-sur2); border-bottom: 1px solid var(--fo-brd);
  font-size: .72rem; font-weight: 600; color: var(--fo-tx2);
}
.fo-ct-live-dot {
  width: .5rem; height: .5rem; border-radius: 50%;
  background: #22c55e; flex-shrink: 0;
  animation: fo-svc-pulse 2.5s ease-in-out infinite;
}
.fo-ct-title { color: var(--fo-tx); font-weight: 700; }
.fo-ct-count {
  margin-left: auto; font-size: .62rem; font-weight: 600;
  background: var(--fo-br-d); color: var(--fo-br);
  padding: .1rem .42rem; border-radius: 4px;
}

.fo-config-table { width: 100%; border-collapse: collapse; font-size: .72rem; }
.fo-config-table thead tr { background: var(--fo-br-d); }
.fo-config-table th {
  padding: .5rem .8rem; text-align: left;
  font-size: .60rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--fo-br);
  border-bottom: 1px solid var(--fo-brd); white-space: nowrap;
}
.fo-config-table td {
  padding: .5rem .8rem; border-bottom: 1px solid var(--fo-brd);
  color: var(--fo-tx); font-size: .71rem;
}
.fo-config-table td code { font-size: .68rem; }
.fo-config-table tbody tr:last-child td { border-bottom: none; }
.fo-config-table tbody tr:nth-child(even) td { background: var(--fo-br-d); }
.fo-config-table tbody tr:hover td { background: var(--fo-br-d2); transition: background .15s; }

.fo-ct-type, .fo-ct-store {
  display: inline-block; padding: .1rem .42rem; border-radius: 4px;
  font-size: .58rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
}
.fo-ct-basic      { background: rgba(99,102,241,.12); color: #4f46e5; }
.fo-ct-resilience { background: rgba(245,158,11,.12); color: #d97706; }
.fo-ct-jdbc       { background: rgba(59,130,246,.12); color: #2563eb; }
.fo-ct-caffeine   { background: rgba(34,197,94,.12);  color: #16a34a; }
[data-md-color-scheme="slate"] .fo-ct-basic      { color: #818cf8; }
[data-md-color-scheme="slate"] .fo-ct-resilience { color: #fbbf24; }
[data-md-color-scheme="slate"] .fo-ct-jdbc       { color: #60a5fa; }
[data-md-color-scheme="slate"] .fo-ct-caffeine   { color: #22c55e; }
