.matdem-sitebar {
  position: relative;
  z-index: 5;
  color: #fff;
  background: #082b4f;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.matdem-sitebar__inner {
  width: min(100% - 2rem, 86rem);
  min-height: 4rem;
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.matdem-sitebar__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}

.matdem-sitebar__brand img {
  width: 2.8rem;
  height: 2.8rem;
  object-fit: contain;
}

.matdem-sitebar__brand span {
  display: grid;
  line-height: 1.05;
}

.matdem-sitebar__brand strong {
  font-size: 1.18rem;
  letter-spacing: 0.02em;
}

.matdem-sitebar__brand small {
  margin-top: 0.25rem;
  color: #b9d6ed;
  font-size: 0.72rem;
}

.matdem-sitebar__links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem;
}

.matdem-sitebar__links a,
.matdem-language-toggle {
  min-height: 2.55rem;
  padding: 0.65rem 0.82rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #e8f3fb;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.65rem;
  font: inherit;
  font-size: 0.79rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.matdem-sitebar__links a:hover,
.matdem-sitebar__links a:focus-visible,
.matdem-language-toggle:hover,
.matdem-language-toggle:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.matdem-sitebar__links .matdem-sitebar__apply {
  margin-left: 0.35rem;
  color: #082b4f;
  background: #f3b33d;
}

.matdem-sitebar__links .matdem-sitebar__apply:hover,
.matdem-sitebar__links .matdem-sitebar__apply:focus-visible {
  color: #061a31;
  background: #ffd47d;
}

.matdem-language-toggle {
  min-width: 2.8rem;
  border-color: rgba(255, 255, 255, 0.28);
}

.matdem-sitebar :focus-visible,
.matdem-help-search:focus-visible,
.matdem-path-card:focus-visible,
.matdem-docs-footer a:focus-visible {
  outline: 3px solid #72d5ca;
  outline-offset: 3px;
}

.md-page-hero--search {
  min-height: 21rem;
  display: grid;
  place-items: center;
  padding: 2.8rem 1rem;
  color: #fff;
  background:
    radial-gradient(circle at 76% 18%, rgba(24, 169, 153, 0.26), transparent 34rem),
    linear-gradient(135deg, #071e34, #0b5cab);
}

.md-page-hero--search .md-page-hero__inner {
  width: min(100%, 52rem);
  margin-inline: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  text-align: center;
}

.md-page-hero--search .md-page-hero__eyebrow {
  margin: 0 0 0.8rem;
  color: #6ee7d8;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.md-page-hero--search h1 {
  max-width: 38rem;
  margin: 0 auto;
  color: #fff;
  font-size: clamp(1.9rem, 3.2vw, 2.65rem);
  line-height: 1.16;
}

.md-page-hero--search .md-page-hero__desc {
  max-width: 42rem;
  margin: 0.85rem auto 1.2rem;
  color: #d7e9f6;
  font-size: 0.94rem;
}

.matdem-help-search {
  width: min(100%, 43rem);
  min-height: 3.55rem;
  margin: 0 auto;
  padding: 0.85rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  color: #53667c;
  background: #fff;
  border: 0;
  border-radius: 0.9rem;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.24);
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: text;
}

.matdem-help-search > span:first-child {
  color: #0b5cab;
  font-size: 1.8rem;
  line-height: 1;
}

.matdem-help-search kbd {
  min-width: 2rem;
  padding: 0.25rem 0.45rem;
  color: #607086;
  background: #eef3f8;
  border: 1px solid #d9e2ec;
  border-radius: 0.4rem;
  font: inherit;
  font-size: 0.75rem;
  text-align: center;
}

.md-page-hero--search .md-page-hero__actions {
  margin-top: 1.15rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.md-page-hero--search .md-page-hero__actions .md-button {
  min-width: 9.4rem;
  padding: 0.78rem 1.45rem;
  font-size: 0.98rem;
  line-height: 1.2;
}

.md-page-hero--search .md-button--outline {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.5);
}

.matdem-language-notice {
  margin-bottom: 1.3rem;
  padding: 0.9rem 1rem;
  color: #173b5f;
  background: #e9f6ff;
  border: 1px solid #b8d9ef;
  border-radius: 0.7rem;
}

.matdem-language-notice strong {
  margin-right: 0.55rem;
}

[data-md-color-scheme="slate"] .matdem-language-notice {
  color: #d7e9f6;
  background: #14314b;
  border-color: #315a77;
}

.matdem-home-intro {
  max-width: 54rem;
  margin-inline: auto;
  text-align: center;
}

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

.matdem-path-card {
  min-height: 12rem;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  color: var(--matdem-ink) !important;
  background: var(--matdem-panel);
  border: 1px solid var(--matdem-line);
  border-radius: 1rem;
  box-shadow: var(--matdem-card-shadow);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.matdem-path-card:hover {
  transform: translateY(-3px);
  border-color: var(--matdem-accent);
  box-shadow: var(--matdem-shadow);
}

.matdem-path-card__index {
  color: var(--matdem-accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.matdem-path-card strong {
  margin-top: 0.8rem;
  color: var(--matdem-brand-dark);
  font-size: 1.25rem;
}

[data-md-color-scheme="slate"] .matdem-path-card strong {
  color: #e2e8f0;
}

.matdem-path-card p {
  margin: 0.65rem 0 0;
  color: var(--matdem-muted);
  font-size: 0.88rem;
}

.matdem-path-card em {
  margin-top: auto;
  color: var(--matdem-brand);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
}

.matdem-quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.matdem-quick-links > div {
  padding: 1rem;
  background: var(--matdem-panel);
  border: 1px solid var(--matdem-line);
  border-radius: 0.75rem;
}

.matdem-docs-footer {
  color: #d7e9f6;
  background: #071e34;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.matdem-docs-footer__inner {
  width: min(100% - 2rem, 76rem);
  margin-inline: auto;
  padding: 2rem 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 2rem;
  align-items: start;
}

.matdem-docs-footer strong {
  color: #fff;
  font-size: 1.25rem;
}

.matdem-docs-footer p {
  margin: 0.25rem 0 0;
  color: #9fc0d8;
}

.matdem-docs-footer__links {
  display: flex;
  gap: 0.5rem 1.2rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.matdem-docs-footer a {
  color: #d7e9f6;
}

.matdem-docs-footer a:hover {
  color: #6ee7d8;
}

.matdem-docs-footer__legal {
  grid-column: 1 / -1;
  padding-top: 1rem;
  display: flex;
  gap: 0.5rem 1.2rem;
  flex-wrap: wrap;
  color: #7fa4be;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
}

@media (max-width: 70rem) {
  .matdem-sitebar__inner {
    align-items: flex-start;
    padding-block: 0.65rem;
  }

  .matdem-sitebar__links {
    overflow-x: auto;
    justify-content: flex-start;
    padding-bottom: 0.2rem;
    scrollbar-width: thin;
  }

  .matdem-sitebar__links a,
  .matdem-language-toggle {
    white-space: nowrap;
  }
}

@media (max-width: 48rem) {
  .matdem-sitebar__inner {
    width: min(100% - 1rem, 86rem);
    display: block;
  }

  .matdem-sitebar__brand {
    margin-bottom: 0.55rem;
  }

  .matdem-sitebar__links {
    width: 100%;
  }

  .matdem-sitebar__links a,
  .matdem-language-toggle {
    min-height: 2.25rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.72rem;
  }

  .md-page-hero--search {
    min-height: 19rem;
    padding-block: 2.2rem;
  }

  .md-page-hero--search h1 {
    font-size: clamp(1.75rem, 8vw, 2.2rem);
  }

  .md-page-hero--search .md-page-hero__actions .md-button {
    min-width: 8.8rem;
    padding: 0.72rem 1.15rem;
    font-size: 0.92rem;
  }

  .matdem-path-grid,
  .matdem-quick-links {
    grid-template-columns: 1fr;
  }

  .matdem-docs-footer__inner {
    grid-template-columns: 1fr;
  }

  .matdem-docs-footer__links {
    justify-content: flex-start;
  }
}

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

  .matdem-path-card {
    transition: none;
  }
}
