/* ---- Accent (links, hover, active states), brand purple, per scheme ---- */
[data-md-color-scheme="default"] {
  --md-primary-fg-color:        #7848df;
  --md-primary-fg-color--light: #7f5be8;
  --md-primary-fg-color--dark:  #5e34c0;
  --md-accent-fg-color:         #7f5be8;
  --md-typeset-a-color:         #7848df;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color:        #7f5be8;
  --md-primary-fg-color--light: #a694f1;
  --md-primary-fg-color--dark:  #4a4470;
  --md-accent-fg-color:         #a694f1;
  --md-typeset-a-color:         #a694f1;
}

/* Light */
[data-md-color-scheme="default"] .md-header,
[data-md-color-scheme="default"] .md-tabs,
[data-md-color-scheme="default"] .md-nav--primary .md-nav__title[for="__drawer"] {
  background-color: #ffffff;
  color: #2e383d;
}
[data-md-color-scheme="default"] .md-nav__source {
  background-color: rgba(0, 0, 0, 0.05);
  color: #2e383d;
}

/* Dark */
[data-md-color-scheme="slate"] .md-header,
[data-md-color-scheme="slate"] .md-tabs,
[data-md-color-scheme="slate"] .md-nav--primary .md-nav__title[for="__drawer"] {
  background-color: #1e1f22;
  color: #e6edf3;
}
[data-md-color-scheme="slate"] .md-nav__source {
  background-color: rgba(255, 255, 255, 0.06);
  color: #e6edf3;
}

.md-header {
  box-shadow: 0 0 0.2rem rgba(0, 0, 0, 0.1), 0 0.2rem 0.4rem rgba(0, 0, 0, 0.1);
}

/* Search field contrast on the neutral header */
.md-search__input {
  background-color: rgba(128, 128, 128, 0.12);
}
[data-md-color-scheme="default"] .md-search__input,
[data-md-color-scheme="default"] .md-search__input::placeholder,
[data-md-color-scheme="default"] .md-search__icon {
  color: #2e383d;
}
[data-md-color-scheme="slate"] .md-search__input,
[data-md-color-scheme="slate"] .md-search__input::placeholder,
[data-md-color-scheme="slate"] .md-search__icon {
  color: #e6edf3;
}
.md-search__input::placeholder {
  opacity: 0.6;
}

/* ---- Theme-aware logo swap (header bar + mobile drawer) ----
   `content` on a replaced <img> element swaps the rendered image per scheme. */
.md-header__button.md-logo img,
.md-nav__button.md-logo img {
  content: url("../assets/images/logo-light.svg");
}
[data-md-color-scheme="slate"] .md-header__button.md-logo img,
[data-md-color-scheme="slate"] .md-nav__button.md-logo img {
  content: url("../assets/images/logo-dark.svg");
}

/* ---- Inline architecture diagrams (SVG, theme-aware) ---- */
.dg {
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
  margin: 1.4em auto;
}
.dg-card { fill: #ffffff; stroke: #e4e4ec; stroke-width: 1.5; }
.dg-card-host { fill: #7848df; }
.dg-title { fill: #2e383d; font-weight: 700; }
.dg-sub { fill: #6b7280; }
.dg-title-on { fill: #ffffff; font-weight: 700; }
.dg-sub-on { fill: #ece6fb; }
.dg-ctrl { stroke: #b4b4c0; stroke-width: 2; stroke-dasharray: 5 6; fill: none; }
.dg-p2p { stroke: #7848df; stroke-width: 3; fill: none; }
.dg-arrow { fill: #7848df; }
.dg-v { fill: #7848df; }
.dg-v-on { fill: #ffffff; }
.dg-ico { stroke: #7848df; stroke-width: 2; fill: none; }
.dg-ico-on { stroke: #ffffff; stroke-width: 2; }
.dg-led { fill: #7848df; }
.dg-lblbox { fill: rgba(255, 255, 255, 0.92); stroke: #e8e8ef; stroke-width: 1; }
.dg-lbl { fill: #5b5566; }
.dg-lbl-strong { fill: #5e34c0; font-weight: 600; }
.dg-legend { fill: #6b7280; }

[data-md-color-scheme="slate"] .dg-card { fill: #26262b; stroke: #3a3d42; }
[data-md-color-scheme="slate"] .dg-card-host { fill: #7f5be8; }
[data-md-color-scheme="slate"] .dg-title { fill: #e6edf3; }
[data-md-color-scheme="slate"] .dg-sub { fill: #9aa4ad; }
[data-md-color-scheme="slate"] .dg-ctrl { stroke: #55555f; }
[data-md-color-scheme="slate"] .dg-p2p { stroke: #a694f1; }
[data-md-color-scheme="slate"] .dg-arrow { fill: #a694f1; }
[data-md-color-scheme="slate"] .dg-v { fill: #a694f1; }
[data-md-color-scheme="slate"] .dg-ico { stroke: #a694f1; }
[data-md-color-scheme="slate"] .dg-led { fill: #a694f1; }
[data-md-color-scheme="slate"] .dg-lblbox { fill: rgba(38, 38, 43, 0.92); stroke: #3a3d42; }
[data-md-color-scheme="slate"] .dg-lbl { fill: #c4c4cf; }
[data-md-color-scheme="slate"] .dg-lbl-strong { fill: #c3b5f7; }
[data-md-color-scheme="slate"] .dg-legend { fill: #9aa4ad; }

/* ---- Connection-flow stepper (security/architecture) ---- */
.fl-link { stroke: #cfcfd8; stroke-width: 2.5; fill: none; }
.fl-link.fl-hot { stroke: #7848df; stroke-width: 3.5; }
.fl-route { stroke: #7848df; stroke-width: 3; fill: none; stroke-dasharray: 7 7; stroke-linecap: round; }
.fl-arrow { fill: #7848df; }
.fl-node.fl-dim { opacity: 0.38; }
.fl-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #ffffff;
  background: #7848df;
  border-radius: 999px;
  padding: 0.2rem 0.62rem;
}
[data-md-color-scheme="slate"] .fl-link { stroke: #44444e; }
[data-md-color-scheme="slate"] .fl-link.fl-hot { stroke: #a694f1; }
[data-md-color-scheme="slate"] .fl-route { stroke: #a694f1; }
[data-md-color-scheme="slate"] .fl-arrow { fill: #a694f1; }
[data-md-color-scheme="slate"] .fl-badge { background: #7f5be8; }

/* ---- Collapsible FAQ: use accent instead of green ---- */
:root .md-typeset details.question,
:root .md-typeset .admonition.question {
  border-color: var(--md-accent-fg-color);
}
:root .md-typeset details.question > summary,
:root .md-typeset .admonition.question > .admonition-title {
  background-color: color-mix(in srgb, var(--md-accent-fg-color) 10%, transparent);
}
:root .md-typeset details.question > summary::before,
:root .md-typeset .admonition.question > .admonition-title::before {
  background-color: var(--md-accent-fg-color);
}
:root .md-typeset details.question > summary::after {
  color: var(--md-accent-fg-color);
}

/* ---- Release changelog: category pill in front of each item ---- */
.md-typeset .cl-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.5;
  color: #ffffff;
  border-radius: 999px;
  padding: 0.05em 0.6em;
  margin-right: 0.25em;
  vertical-align: 0.08em;
  white-space: nowrap;
}
.md-typeset .cl-added    { background: #2e7d32; }
.md-typeset .cl-changed  { background: #1565c0; }
.md-typeset .cl-removed  { background: #5b6470; }
.md-typeset .cl-fixed    { background: #a35a00; }
.md-typeset .cl-security { background: #c62828; }

[data-md-color-scheme="slate"] .md-typeset .cl-added    { background: #2f8438; }
[data-md-color-scheme="slate"] .md-typeset .cl-changed  { background: #1f6fd2; }
[data-md-color-scheme="slate"] .md-typeset .cl-removed  { background: #69727f; }
[data-md-color-scheme="slate"] .md-typeset .cl-fixed    { background: #a86206; }
[data-md-color-scheme="slate"] .md-typeset .cl-security { background: #d03434; }

/* No bullets on the release list: the pill opens each line */
.md-typeset .cl-list ul {
  list-style: none;
  margin-left: 0;
}
.md-typeset .cl-list ul li {
  margin-left: 0;
  margin-bottom: 0.3em;
}

/* Version headings on the release pages */
.md-typeset h2.cl-version {
  color: var(--md-accent-fg-color);
  font-weight: 700;
}
