.site-navbar-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: var(--bs-body-bg);
  transition: box-shadow 0.2s ease-out;
}

.site-navbar-header.is-scrolled {
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .site-navbar-header.is-scrolled {
  box-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

.site-navbar-header.is-scrolled .site-navbar {
  background-color: rgba(var(--bs-body-bg-rgb), 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.site-navbar {
  background-color: var(--bs-body-bg);
  transition: background-color 0.2s ease-out;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  background-color: transparent !important;
}

#global-content {
  flex: 1 0 auto;
}

.site-footer {
  flex-shrink: 0;
  background-color: var(--bs-body-bg);
}

.site-footer__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.site-footer__text {
  font-size: 0.8125rem;
  color: var(--bs-secondary-color);
  line-height: 1.4;
  text-align: center;
}

.site-footer__text a {
  color: inherit;
  text-decoration: none;
}

.site-footer__text a:hover {
  color: var(--fun-accent);
  text-decoration: underline;
  background-color: transparent;
}

.site-footer__sep {
  margin: 0 0.35rem;
  color: var(--bs-border-color);
}

.site-navbar__avatar {
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(var(--fun-accent-rgb), 0.15);
}

.site-navbar__title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.site-navbar .navbar-brand,
.site-navbar .navbar-brand:hover,
.site-navbar .navbar-brand:focus {
  color: var(--bs-emphasis-color);
  text-decoration: none;
}

.site-navbar .navbar-nav .nav-link {
  color: var(--bs-navbar-color);
  font-size: 0.9375rem;
  font-weight: 500;
  padding-bottom: 0.65rem;
  position: relative;
  text-decoration: none;
}

.site-navbar .navbar-nav .nav-link:hover,
.site-navbar .navbar-nav .nav-link:focus {
  background-color: transparent;
  color: var(--fun-accent-hover);
  text-decoration: none;
}

.site-navbar .navbar-nav .nav-link.active {
  color: var(--fun-accent);
  font-weight: 600;
}

.site-navbar .navbar-nav .nav-link.active::after {
  background-color: var(--fun-accent);
  border-radius: 1px;
  bottom: 0.2rem;
  content: "";
  height: 2px;
  left: 0.75rem;
  position: absolute;
  right: 0.75rem;
}

.site-navbar__actions {
  align-items: center;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-left: auto;
  padding-bottom: 0.75rem;
  padding-top: 0.35rem;
}

@media (min-width: 992px) {
  .site-navbar__actions {
    gap: 0.75rem;
    padding-bottom: 0;
    padding-top: 0;
  }
}

.site-navbar .theme-toggle {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  padding: 0;
}

.theme-toggle .btn-group .btn {
  min-width: 2.25rem;
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  color: var(--bs-secondary-color);
  border-color: var(--bs-border-color);
}

.theme-toggle .btn-group .btn:hover {
  color: var(--bs-emphasis-color);
  background-color: var(--bs-tertiary-bg);
  border-color: var(--bs-border-color);
}

.theme-toggle .btn-group .btn.theme-toggle__btn--selected,
.theme-toggle .btn-group .btn.active,
[data-theme-preference="light"] .theme-toggle [data-theme-mode="light"],
[data-theme-preference="dark"] .theme-toggle [data-theme-mode="dark"],
[data-theme-preference="system"] .theme-toggle [data-theme-mode="system"] {
  z-index: 2;
  color: #fff !important;
  background-color: var(--fun-accent) !important;
  border-color: var(--fun-accent) !important;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.theme-toggle .btn-group .btn.theme-toggle__btn--selected:hover,
.theme-toggle .btn-group .btn.active:hover,
[data-theme-preference="light"] .theme-toggle [data-theme-mode="light"]:hover,
[data-theme-preference="dark"] .theme-toggle [data-theme-mode="dark"]:hover,
[data-theme-preference="system"] .theme-toggle [data-theme-mode="system"]:hover {
  color: #fff !important;
  background-color: var(--fun-accent-hover) !important;
  border-color: var(--fun-accent-hover) !important;
}

.theme-toggle .btn:focus-visible {
  z-index: 3;
  box-shadow: 0 0 0 0.2rem rgba(var(--fun-accent-rgb), 0.35);
}

/* Sidebar */
.sidebar-card {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  border-radius: var(--bs-border-radius-lg);
  margin-bottom: 0.5rem;
  padding: 0.85rem 1rem;
}

.sidebar-card__title {
  color: var(--bs-secondary-color);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-top: calc(1.75rem / 6);
  margin-bottom: 0.375rem;
  text-transform: uppercase;
}

.sidebar-nav {
  display: grid;
  gap: 0.15rem;
}

.sidebar-nav__item {
  align-items: center;
  border-radius: var(--bs-border-radius-sm);
  display: flex;
  font-size: 0.925rem;
  gap: 0.45rem;
  line-height: 1.35;
  padding: 0.35rem 0.45rem;
  transition: background-color 0.15s ease-out;
}

.sidebar-nav__item:hover {
  background-color: var(--fun-link-hover-bg);
}

.sidebar-nav__item--current {
  background-color: rgba(var(--fun-accent-rgb), 0.12);
  color: var(--fun-accent);
  font-weight: 600;
}

.sidebar-nav__item .bi:first-child {
  color: var(--fun-accent);
  flex-shrink: 0;
  opacity: 0.85;
  width: 1.1rem;
}

.sidebar-nav__item a {
  color: inherit;
  flex: 1;
  text-decoration: none;
}

.sidebar-nav__item a:hover {
  color: var(--fun-accent-hover);
  text-decoration: underline;
}

.sidebar-nav__check {
  color: var(--fun-accent);
  flex-shrink: 0;
  font-size: 0.75rem;
  margin-left: auto;
}

/* Section index (sidebar) */
.section-index__list {
  display: grid;
  gap: 0.15rem;
}

.section-index__link,
.section-index__current {
  align-items: center;
  border-radius: var(--bs-border-radius-sm);
  display: inline-flex;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  text-decoration: none;
  width: 100%;
}

.section-index__link:hover {
  background-color: var(--fun-link-hover-bg);
  text-decoration: none;
}

.section-index__link.active {
  background-color: rgba(var(--fun-accent-rgb), 0.12);
  color: var(--fun-accent);
  font-weight: 600;
}

.section-index__current {
  background-color: rgba(var(--fun-accent-rgb), 0.12);
  color: var(--fun-accent);
  font-weight: 600;
}

.section-index__link .bi,
.section-index__current .bi {
  color: var(--fun-accent);
  flex-shrink: 0;
  opacity: 0.85;
}

.section-index__count {
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: auto;
}

/* Homepage */
.home-quick-links {
  margin-bottom: 1.5rem;
}

.home-quick-link {
  align-items: center;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  border-radius: var(--bs-border-radius-lg);
  color: var(--fun-body-color);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  height: 100%;
  padding: 0.85rem 0.5rem;
  text-align: center;
  text-decoration: none;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out, transform 0.15s ease-out;
}

.home-quick-link .bi {
  color: var(--fun-accent);
  font-size: 1.35rem;
}

.home-quick-link span {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
}

.home-quick-link:hover {
  border-color: rgba(var(--fun-accent-rgb), 0.35);
  box-shadow: 0 4px 12px rgba(var(--fun-accent-rgb), 0.12);
  color: var(--fun-accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
}

.home-highlights {
  margin-bottom: 1.5rem;
}

.home-highlight-card {
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color-translucent, var(--bs-border-color));
  border-radius: var(--bs-border-radius-lg);
  color: inherit;
  display: block;
  height: 100%;
  padding: 1rem 1.1rem;
  text-decoration: none;
  transition: border-color 0.15s ease-out, box-shadow 0.15s ease-out;
}

.home-highlight-card strong {
  color: var(--fun-heading);
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.home-highlight-card span {
  color: var(--bs-secondary-color);
  display: block;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.home-highlight-card:hover {
  border-color: rgba(var(--fun-accent-rgb), 0.35);
  box-shadow: 0 4px 12px rgba(var(--fun-accent-rgb), 0.1);
  text-decoration: none;
}

.home-highlight-card:hover strong {
  color: var(--fun-accent-hover);
}

.site-navbar__cta {
  --bs-btn-bg: var(--fun-accent);
  --bs-btn-border-color: var(--fun-accent);
  --bs-btn-color: #fff;
  --bs-btn-hover-bg: var(--fun-accent-hover);
  --bs-btn-hover-border-color: var(--fun-accent-hover);
  --bs-btn-hover-color: #fff;
  --bs-btn-active-bg: var(--fun-accent-hover);
  --bs-btn-active-border-color: var(--fun-accent-hover);
  --bs-btn-active-color: #fff;
  font-weight: 600;
  white-space: nowrap;
}

.site-navbar a.btn.site-navbar__cta,
.site-navbar a.btn.site-navbar__cta:link,
.site-navbar a.btn.site-navbar__cta:visited,
.site-navbar a.btn.site-navbar__cta:hover,
.site-navbar a.btn.site-navbar__cta:focus,
.site-navbar a.btn.site-navbar__cta:active {
  background-color: var(--fun-accent);
  border-color: var(--fun-accent);
  color: #fff !important;
  text-decoration: none;
}

.site-navbar a.btn.site-navbar__cta:hover,
.site-navbar a.btn.site-navbar__cta:focus {
  background-color: var(--fun-accent-hover);
  border-color: var(--fun-accent-hover);
  color: #fff !important;
}

.site-navbar__cta.active {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
  opacity: 1;
}

[data-bs-theme="dark"] .site-navbar a.btn.site-navbar__cta,
[data-bs-theme="dark"] .site-navbar a.btn.site-navbar__cta:link,
[data-bs-theme="dark"] .site-navbar a.btn.site-navbar__cta:visited,
[data-bs-theme="dark"] .site-navbar a.btn.site-navbar__cta:hover,
[data-bs-theme="dark"] .site-navbar a.btn.site-navbar__cta:focus,
[data-bs-theme="dark"] .site-navbar a.btn.site-navbar__cta:active {
  color: #1a1624 !important;
}

[data-bs-theme="dark"] .site-navbar__cta.active {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

[data-bs-theme="dark"] .site-navbar .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35);
}

[data-bs-theme="dark"] .site-navbar .theme-toggle .btn-group .btn {
  color: var(--bs-emphasis-color);
  border-color: rgba(255, 255, 255, 0.32);
}

[data-bs-theme="dark"] .site-navbar .theme-toggle .btn-group .btn:hover {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.45);
}

[data-bs-theme="dark"] .theme-toggle .btn-group .btn.theme-toggle__btn--selected,
[data-bs-theme="dark"] .theme-toggle .btn-group .btn.active,
[data-bs-theme="dark"][data-theme-preference="light"] .theme-toggle [data-theme-mode="light"],
[data-bs-theme="dark"][data-theme-preference="dark"] .theme-toggle [data-theme-mode="dark"],
[data-bs-theme="dark"][data-theme-preference="system"] .theme-toggle [data-theme-mode="system"] {
  color: #1a1624 !important;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

[data-bs-theme="dark"] .theme-toggle .btn-group .btn.theme-toggle__btn--selected:hover,
[data-bs-theme="dark"] .theme-toggle .btn-group .btn.active:hover,
[data-bs-theme="dark"][data-theme-preference="light"] .theme-toggle [data-theme-mode="light"]:hover,
[data-bs-theme="dark"][data-theme-preference="dark"] .theme-toggle [data-theme-mode="dark"]:hover,
[data-bs-theme="dark"][data-theme-preference="system"] .theme-toggle [data-theme-mode="system"]:hover {
  color: #121218 !important;
}

/* Main content + sidebar layout */
.fun-layout {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: minmax(0, 1fr);
}

.fun-layout__main,
.fun-layout__sidebar {
  min-width: 0;
}

@media (min-width: 992px) {
  .fun-layout {
    align-items: start;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  }

  .fun-layout__main {
    grid-column: 1;
    grid-row: 1;
  }

  .fun-layout__sidebar {
    grid-column: 2;
    grid-row: 1;
  }

  .fun-layout__sidebar > .row:first-of-type {
    margin-top: 0;
  }

  div.side-bar > div:first-child {
    margin-top: 0 !important;
  }
}

.fun-toast {
  background: var(--bs-emphasis-color);
  border-radius: var(--bs-border-radius);
  box-shadow: var(--bs-box-shadow);
  color: var(--bs-body-bg);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: min(20rem, calc(100vw - 2rem));
  padding: 0.65rem 0.9rem;
  pointer-events: none;
  position: fixed;
  z-index: 1080;
}

.fun-toast[hidden] {
  display: none !important;
}

.fun-toast.success {
  background-color: rgba(var(--bs-success-rgb), 0.15);
  border: 1px solid var(--bs-success);
  color: var(--bs-success-text-emphasis, var(--bs-success));
}
