:where(:root) {
  --md-ref-typeface-plain: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --md-ref-typeface-mono: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  --md-sys-color-surface-container: #f0ece9;
  --md-sys-color-on-surface: #1f1b16;
  --md-sys-color-primary: #6750A4;
  --md-sys-color-surface: #fffbf7;
  --md-sys-color-surface-container-highest: #e2ddd9;
  --md-sys-color-surface-variant: #e7e0ec;
  --md-sys-color-on-surface-variant: #49454f;
  --md-sys-color-outline: #79747e;
  --md-sys-color-outline-variant: #cac4d0;
  --md-sys-color-secondary-container: #e8def8;
  --md-sys-color-on-secondary-container: #1d192b;
  --md-sys-color-primary-container: #ead9ff;
  --md-sys-color-on-primary-container: #21005e;
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error-container: #410e0b;
  --md-sys-color-secondary: #625b71;
  --md-sys-color-tertiary: #7d5260;
  --md-sys-color-on-surface-bright: #1f1b16;
  --md-sys-color-on-surface-dim: #1f1b16;
  --md-sys-color-inverse-surface: #312f2b;
  --md-sys-color-inverse-on-surface: #f4efeb;
  --catalog-display-xl-font-size: 88px;
  --catalog-display-m-font-size: 45px;
  --catalog-title-l-font-size: 22px;
  --catalog-title-m-font-size: 16px;
  --catalog-title-s-font-size: 14px;
  --catalog-body-l-font-size: 16px;
  --catalog-body-m-font-size: 14px;
  --catalog-headline-s-font-size: 24px;
  --catalog-label-s-font-size: 11px;
  --catalog-shape-xl: 28px;
  --catalog-shape-l: 16px;
  --catalog-shape-m: 12px;
  --catalog-shape-s: 8px;
  --catalog-shape-xs: 4px;
  --catalog-spacing-xl: 28px;
  --catalog-spacing-l: 16px;
  --catalog-spacing-m: 12px;
  --catalog-spacing-s: 8px;
  --catalog-top-app-bar-height: calc(48px + 2 * var(--catalog-spacing-m));
  --catalog-active-top-app-bar-height: var(--catalog-top-app-bar-height);
  --catalog-drawer-width: 240px;
  --catalog-toc-width: 300px;
  scroll-padding-block-start: calc(var(--catalog-active-top-app-bar-height) + var(--catalog-top-app-bar-padding-block, 0px) * 2);
}

@media (prefers-color-scheme: dark) {
  :where(:root) {
    --md-sys-color-surface-container: #302c28;
    --md-sys-color-on-surface: #e6e1dd;
    --md-sys-color-primary: #d0bcff;
    --md-sys-color-surface: #181410;
    --md-sys-color-surface-container-highest: #44403b;
    --md-sys-color-surface-variant: #49454f;
    --md-sys-color-on-surface-variant: #cac4d0;
    --md-sys-color-outline: #938f99;
    --md-sys-color-outline-variant: #49454f;
    --md-sys-color-secondary-container: #4a4458;
    --md-sys-color-on-secondary-container: #e8def8;
    --md-sys-color-primary-container: #4f378b;
    --md-sys-color-on-primary-container: #ead9ff;
    --md-sys-color-error-container: #8c1d18;
    --md-sys-color-on-error-container: #f9dedc;
    --md-sys-color-secondary: #ccc2dc;
    --md-sys-color-tertiary: #efb8c8;
    --md-sys-color-on-surface-bright: #e6e1dd;
    --md-sys-color-on-surface-dim: #e6e1dd;
    --md-sys-color-inverse-surface: #e6e1dd;
    --md-sys-color-inverse-on-surface: #1f1b16;
  }
}

@media screen and (max-width: 600px) {
  :root {
    --catalog-display-xl-font-size: 55px;
    --catalog-title-l-font-size: 16px;
    --catalog-body-l-font-size: 14px;
    --catalog-body-m-font-size: 12px;
    --catalog-spacing-xl: 16px;
    --catalog-spacing-l: 12px;
  }
}

strong { -webkit-font-smoothing: antialiased; }

/* Inline emoji icons (⭐ → star, 🌟👑 → crown) */
.md-emoji-icon {
  font-size: 1.75em !important;
  vertical-align: middle;
  color: var(--md-sys-color-primary);
  filter: drop-shadow(0 0 4px var(--md-sys-color-primary-container));
}

body {
  margin: 0;
  font-family: var(--site-font-family, var(--md-ref-typeface-plain));
  font-size: calc(var(--catalog-body-l-font-size) * var(--site-font-scale, 1));
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  overflow: hidden;
  height: 100dvh;
}

a { color: var(--md-sys-color-primary); text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }

/* ===== LAYOUT ===== */
.root {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ===== TOP APP BAR ===== */
.top-app-bar {
  position: fixed; inset: 0 0 auto 0;
  display: flex; align-items: center;
  box-sizing: border-box;
  padding: var(--catalog-spacing-m) var(--catalog-spacing-l);
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  z-index: 12;
  height: var(--catalog-top-app-bar-height);
  transition: transform 0.4s cubic-bezier(0.3, 0, 0, 1), opacity 0.4s cubic-bezier(0.3, 0, 0, 1);
}
.top-app-bar-content { width: 100%; display: flex; align-items: center; }
.top-app-bar-start { display: flex; align-items: center; }
.top-app-bar-start .menu-button { display: none; }
#home-title {
  font-size: max(var(--catalog-title-l-font-size), 22px);
  text-decoration: none; padding-inline: 12px;
  position: relative; outline: none; vertical-align: middle; white-space: nowrap;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(120deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary), var(--md-sys-color-primary));
  background-size: 200% auto;
  animation: gradient-move 6s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes gradient-move {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}
.home-link-icon { color: var(--md-sys-color-primary); font-size: 28px; display: flex; align-items: center; }
.top-nav-menu {
  display: flex;
  gap: 20px;
  margin-left: 24px;
  align-items: center;
}
.top-nav-link {
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none !important;
  font-weight: 500;
  font-size: 14px;
  transition: color 0.2s;
}
.top-nav-link:hover {
  color: var(--md-sys-color-primary);
}
@media (max-width: 768px) {
  .top-nav-menu {
    display: none !important;
  }
}
.top-app-bar-end { flex-grow: 1; display: flex; justify-content: flex-end; gap: 4px; align-items: center; }
.nav-separator {
  width: 1px;
  height: 24px;
  background-color: var(--md-sys-color-outline-variant);
  margin-inline: 12px;
  align-self: center;
}
@media (max-width: 768px) {
  .nav-separator {
    display: none !important;
  }
}
#skip-to-main {
  padding: var(--catalog-spacing-s);
  border-radius: var(--catalog-shape-m);
  background-color: var(--md-sys-color-inverse-surface);
  color: var(--md-sys-color-inverse-on-surface);
  opacity: 0; position: absolute; pointer-events: none;
}
#skip-to-main:focus-visible { opacity: 1; pointer-events: auto; }
md-icon-button:not(:defined),
md-icon:not(:defined),
md-menu:not(:defined),
md-slider:not(:defined),
md-divider:not(:defined) {
  visibility: hidden;
}
md-icon-button:not(:defined) { width: 40px; height: 40px; display: flex; visibility: visible; opacity: 0; }



/* Custom Segmented Button Set */
.segmented-button-set {
  display: flex; flex-direction: row;
  border-radius: 20px; border: 1px solid var(--md-sys-color-outline);
  overflow: hidden; height: 40px; width: 100%;
}
.segmented-button {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none;
  border-right: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface); cursor: pointer;
  padding: 0 8px; gap: 4px;
  transition: background-color 0.2s, color 0.2s;
  font-family: var(--md-ref-typeface-plain);
}
.segmented-button:last-child { border-right: none; }
.segmented-button:hover { background-color: var(--md-sys-color-surface-variant); }
.segmented-button.selected {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}
.segmented-button .check-icon { display: none; font-size: 18px; }
.segmented-button.selected .check-icon { display: inline-flex; }
.segmented-button md-icon { font-size: 18px; }


/* ===== BODY ===== */
.body { display: flex; flex-grow: 1; padding-top: var(--catalog-active-top-app-bar-height); transition: padding-top 0.28s cubic-bezier(0.2, 0, 0, 1); }

/* ===== DRAWER ===== */
.spacer { position: relative; transition: min-width 0.45s cubic-bezier(0.2, 0, 0, 1), max-width 0.45s cubic-bezier(0.2, 0, 0, 1), opacity 0.4s cubic-bezier(0.3, 0, 0, 1); }
.spacer, .drawer { min-width: var(--catalog-drawer-width); max-width: var(--catalog-drawer-width); }
.drawer {
  transition: transform 0.5s cubic-bezier(0.3, 0, 0, 1),
              opacity 0.4s cubic-bezier(0.3, 0, 0, 1),
              min-width 0.45s cubic-bezier(0.2, 0, 0, 1),
              max-width 0.45s cubic-bezier(0.2, 0, 0, 1),
              inset 0.45s cubic-bezier(0.2, 0, 0, 1),
              border-radius 0.45s cubic-bezier(0.2, 0, 0, 1);
  position: fixed; isolation: isolate;
  inset: var(--catalog-active-top-app-bar-height) 0 0 0;
  z-index: 12;
  background-color: var(--md-sys-color-surface-container);
  overflow: hidden;
  border-inline-end: none;
  display: flex;
  flex-direction: column;
}
.drawer-scroll-wrapper {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  border-radius: inherit;
  box-sizing: border-box;
  padding: 12px 0;
  scrollbar-color: color-mix(in srgb, var(--md-sys-color-primary) 75%, transparent) transparent;
  scrollbar-width: thin;
}
.drawer-scroll-wrapper::-webkit-scrollbar {
  width: 6px;
}
.drawer-scroll-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.drawer-scroll-wrapper::-webkit-scrollbar-thumb {
  background-color: color-mix(in srgb, var(--md-sys-color-primary) 75%, transparent);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}
.drawer-scroll-wrapper md-list { display: block; }

/* ===== NAV LIST ===== */
.nav-list {
  display: flex;
  flex-direction: column;
  padding: 0;
  gap: 2px;
}
.nav-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--md-sys-color-on-surface-variant);
  padding: 16px 24px 8px;
  opacity: 0.65;
}
.nav-list .nav-section-title:first-of-type {
  padding-top: 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0 16px;
  margin-inline: 12px;
  border-radius: 20px;
  font-family: var(--md-ref-typeface-plain);
  font-size: 14px;
  font-weight: 450;
  color: var(--md-sys-color-on-surface);
  text-decoration: none;
  transition: background-color 0.3s cubic-bezier(0.2, 0, 0, 1),
              color 0.3s cubic-bezier(0.2, 0, 0, 1),
              width 0.45s cubic-bezier(0.2, 0, 0, 1),
              height 0.45s cubic-bezier(0.2, 0, 0, 1),
              padding 0.45s cubic-bezier(0.2, 0, 0, 1),
              margin 0.45s cubic-bezier(0.2, 0, 0, 1),
              border-radius 0.45s cubic-bezier(0.2, 0, 0, 1),
              gap 0.45s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
}
.nav-icon {
  font-size: 20px !important;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--md-sys-color-on-surface-variant);
  transition: color 0.2s,
              width 0.28s cubic-bezier(0.2, 0, 0, 1),
              height 0.28s cubic-bezier(0.2, 0, 0, 1),
              font-size 0.28s cubic-bezier(0.2, 0, 0, 1);
}
.nav-item-icon {
  font-size: 20px !important;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--md-sys-color-on-surface-variant);
  transition: color 0.2s,
              width 0.28s cubic-bezier(0.2, 0, 0, 1),
              height 0.28s cubic-bezier(0.2, 0, 0, 1),
              font-size 0.28s cubic-bezier(0.2, 0, 0, 1);
}
.nav-item.selected .nav-icon {
  color: var(--md-sys-color-on-secondary-container);
}
.nav-item.selected .nav-item-icon {
  color: var(--md-sys-color-on-secondary-container);
}
.nav-item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1;
}
.nav-item:hover, .nav-item:focus-visible {
  background-color: var(--md-sys-color-surface-container-highest);
  text-decoration: none;
}
.nav-item.selected {
  background-color: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 550;
}
.nav-item.selected::before {
  content: '';
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 20px;
  border-radius: 0 4px 4px 0;
  background-color: var(--md-sys-color-primary);
}
.nav-divider {
  border: none;
  border-top: 1px solid var(--md-sys-color-outline-variant);
  margin: 8px 24px;
  opacity: 0.4;
}

/* ===== MODERN EMOJI LEGEND RAIL ===== */
/* ===== MD3 LEGEND ===== */
.md-legend {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  flex-direction: column;
}
.md-legend-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--md-sys-color-on-surface-variant);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background 0.15s;
  text-align: left;
  order: 1;
}
.md-legend-trigger:hover {
  background: var(--md-sys-color-surface-container-highest);
}
.md-legend-trigger-icon {
  font-size: 16px !important;
  color: var(--md-sys-color-primary);
}
.md-legend-trigger-label {
  flex: 1;
}
.md-legend-trigger-chevron {
  font-size: 18px !important;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}
.md-legend-trigger[aria-expanded="true"] .md-legend-trigger-chevron {
  transform: rotate(180deg);
}
.md-legend-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.2, 0, 0, 1);
  order: 0;
  overflow: hidden;
}
.md-legend:has(.md-legend-trigger[aria-expanded="true"]) .md-legend-body {
  grid-template-rows: 1fr;
}
.md-legend-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 16px;
  min-height: 0;
}
.md-legend-card::before { content: ''; display: block; height: 8px; flex-shrink: 0; }
.md-legend-card::after { content: ''; display: block; height: 4px; flex-shrink: 0; }
.md-legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 16px;
  background: var(--md-sys-color-surface-container-high);
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  transition: background 0.15s;
}
.md-legend-item:hover {
  background: var(--md-sys-color-surface-container-highest);
}
.md-legend-item-icon {
  font-size: 16px !important;
  color: var(--md-sys-color-primary);
}

/* Swup Transitions */
html.is-changing .transition-fade {
  opacity: 0;
  transform: translateY(12px);
}
.transition-fade {
  transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1), transform 0.3s cubic-bezier(0.2, 0, 0, 1);
  opacity: 1;
  transform: translateY(0);
  will-change: opacity, transform;
}

/* ===== CONTENT AREA ===== */
.content-area {
  display: flex;
  flex: 1;
  min-width: 0;
  padding-inline-end: 0;
  gap: 0;
  transition: padding-inline-end 0.45s cubic-bezier(0.2, 0, 0, 1);
}

.pane.content-pane {
  flex: 1;
  min-width: 0;
  box-sizing: border-box;
  overflow: auto;
  height: calc(100dvh - var(--catalog-active-top-app-bar-height) - var(--catalog-spacing-m));
  background-color: var(--md-sys-color-surface);
  border-radius: var(--catalog-shape-xl) 0 0 var(--catalog-shape-xl);
  transition: 0.5s cubic-bezier(0.3, 0, 0, 1);
  transition-property: height, border-radius;
}

.pane .scroll-wrapper { padding-block: var(--catalog-spacing-xl); }
.scroll-wrapper { overflow-y: auto; max-height: 100%; border-radius: inherit; box-sizing: border-box; }

.content {
  box-sizing: border-box;
  padding-inline: var(--catalog-spacing-xl);
  width: 100%;
  max-width: none;
  margin-inline: 0;
}

/* ===== TOC RAIL ===== */
.toc-rail {
  width: var(--catalog-toc-width);
  flex-shrink: 0;
  padding-block: var(--catalog-spacing-xl);
  padding-inline-end: 4px;
  position: sticky;
  top: var(--catalog-active-top-app-bar-height);
  height: calc(100dvh - var(--catalog-active-top-app-bar-height));
  overflow-y: auto;
  box-sizing: border-box;
}

/* ===== USER-CONTROLLED SHELL COMPACT MODES ===== */
@media (min-width: 1501px) {
  .sidepanel-autohide {
    --catalog-drawer-width: 72px;
  }

  .sidepanel-autohide .drawer {
    border-inline-end: none;
    box-shadow: none;
  }

  .sidepanel-autohide.sidepanel-peek .drawer,
  .sidepanel-autohide .drawer:hover,
  .sidepanel-autohide .drawer:focus-within,
  .sidepanel-autohide.sidepanel-peek .spacer,
  .sidepanel-autohide .spacer:hover,
  .sidepanel-autohide .spacer:focus-within {
    min-width: 240px;
    max-width: 240px;
    box-shadow: none;
    border-radius: 0;
  }

  .sidepanel-autohide .drawer-scroll-wrapper {
    padding-block: 12px;
    scrollbar-width: none;
  }

  .sidepanel-autohide .drawer-scroll-wrapper::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  .sidepanel-autohide .nav-list {
    align-items: center;
  }

  .sidepanel-autohide.sidepanel-peek .nav-list,
  .sidepanel-autohide .drawer:hover .nav-list,
  .sidepanel-autohide .drawer:focus-within .nav-list {
    align-items: stretch;
  }

  .sidepanel-autohide .nav-item-text,
  .sidepanel-autohide .nav-item-label {
    max-width: 0;
    opacity: 0;
    visibility: hidden;
    white-space: nowrap;
    overflow: hidden;
    transition: max-width 0.45s cubic-bezier(0.2, 0, 0, 1),
                opacity 0.35s cubic-bezier(0.2, 0, 0, 1),
                visibility 0.45s;
  }

  .sidepanel-autohide .nav-section-title {
    opacity: 0;
    visibility: hidden;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    overflow: hidden;
    margin: 0;
    transition: max-height 0.45s cubic-bezier(0.2, 0, 0, 1),
                opacity 0.35s cubic-bezier(0.2, 0, 0, 1),
                padding 0.45s cubic-bezier(0.2, 0, 0, 1),
                margin 0.45s cubic-bezier(0.2, 0, 0, 1),
                visibility 0.45s;
  }

  .sidepanel-autohide .nav-divider {
    opacity: 0;
    visibility: hidden;
    margin: 4px 12px;
    transition: margin 0.45s cubic-bezier(0.2, 0, 0, 1),
                opacity 0.35s cubic-bezier(0.2, 0, 0, 1),
                visibility 0.45s;
  }

  .sidepanel-autohide .md-legend-trigger-label,
  .sidepanel-autohide .md-legend-trigger-chevron {
    max-width: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.45s cubic-bezier(0.2, 0, 0, 1),
                opacity 0.35s cubic-bezier(0.2, 0, 0, 1),
                visibility 0.45s;
  }

  .sidepanel-autohide .md-legend-body {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s cubic-bezier(0.2, 0, 0, 1),
                visibility 0.45s;
  }

  .sidepanel-autohide .nav-item {
    width: 48px;
    height: 48px;
    justify-content: center;
    padding: 0;
    margin: 2px 0;
    border-radius: 24px;
    gap: 0;
  }

  .sidepanel-autohide .nav-icon {
    width: 24px;
    height: 24px;
    font-size: 24px !important;
  }

  .sidepanel-autohide .nav-item-icon {
    width: 24px;
    height: 24px;
    font-size: 24px !important;
  }

  .sidepanel-autohide .nav-item.selected::before {
    left: -12px;
  }

  .sidepanel-autohide .md-legend-trigger {
    justify-content: center;
    padding: 12px 0;
    gap: 0;
    transition: padding 0.45s cubic-bezier(0.2, 0, 0, 1),
                gap 0.45s cubic-bezier(0.2, 0, 0, 1);
  }

  /* Expanded / Hovered states */
  .sidepanel-autohide.sidepanel-peek .nav-item-text,
  .sidepanel-autohide.sidepanel-peek .nav-item-label,
  .sidepanel-autohide .drawer:hover .nav-item-text,
  .sidepanel-autohide .drawer:hover .nav-item-label,
  .sidepanel-autohide .drawer:focus-within .nav-item-text,
  .sidepanel-autohide .drawer:focus-within .nav-item-label {
    max-width: 160px;
    opacity: 1;
    visibility: visible;
  }

  .sidepanel-autohide.sidepanel-peek .nav-section-title,
  .sidepanel-autohide .drawer:hover .nav-section-title,
  .sidepanel-autohide .drawer:focus-within .nav-section-title {
    opacity: 0.65;
    visibility: visible;
    max-height: 40px;
    padding: 16px 24px 8px;
  }

  .sidepanel-autohide.sidepanel-peek .nav-list .nav-section-title:first-of-type,
  .sidepanel-autohide .drawer:hover .nav-list .nav-section-title:first-of-type,
  .sidepanel-autohide .drawer:focus-within .nav-list .nav-section-title:first-of-type {
    padding-top: 4px;
  }

  .sidepanel-autohide.sidepanel-peek .nav-divider,
  .sidepanel-autohide .drawer:hover .nav-divider,
  .sidepanel-autohide .drawer:focus-within .nav-divider {
    opacity: 0.4;
    visibility: visible;
    margin: 8px 24px;
  }

  .sidepanel-autohide.sidepanel-peek .md-legend-trigger-label,
  .sidepanel-autohide.sidepanel-peek .md-legend-trigger-chevron,
  .sidepanel-autohide .drawer:hover .md-legend-trigger-label,
  .sidepanel-autohide .drawer:hover .md-legend-trigger-chevron,
  .sidepanel-autohide .drawer:focus-within .md-legend-trigger-label,
  .sidepanel-autohide .drawer:focus-within .md-legend-trigger-chevron {
    max-width: 150px;
    opacity: 1;
    visibility: visible;
  }

  .sidepanel-autohide.sidepanel-peek .md-legend-body,
  .sidepanel-autohide .drawer:hover .md-legend-body,
  .sidepanel-autohide .drawer:focus-within .md-legend-body {
    opacity: 1;
    visibility: visible;
  }

  .sidepanel-autohide.sidepanel-peek .nav-item,
  .sidepanel-autohide .drawer:hover .nav-item,
  .sidepanel-autohide .drawer:focus-within .nav-item {
    width: auto;
    height: 40px;
    justify-content: flex-start;
    padding: 0 16px;
    margin-inline: 12px;
    border-radius: 20px;
    gap: 12px;
  }

  .sidepanel-autohide.sidepanel-peek .nav-icon,
  .sidepanel-autohide.sidepanel-peek .nav-item-icon,
  .sidepanel-autohide .drawer:hover .nav-icon,
  .sidepanel-autohide .drawer:hover .nav-item-icon,
  .sidepanel-autohide .drawer:focus-within .nav-icon,
  .sidepanel-autohide .drawer:focus-within .nav-item-icon {
    width: 20px;
    height: 20px;
    font-size: 20px !important;
  }

  .sidepanel-autohide.sidepanel-peek .md-legend-trigger,
  .sidepanel-autohide .drawer:hover .md-legend-trigger,
  .sidepanel-autohide .drawer:focus-within .md-legend-trigger {
    justify-content: flex-start;
    padding: 10px 20px;
    gap: 8px;
  }
}

.toc-label {
  font-size: var(--catalog-label-s-font-size);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0 0 4px 0;
}

.toc-content-wrapper {
  padding-inline: 16px;
}

.settings-content-wrapper {
  padding-inline: 16px;
}

.toc-title {
  font-size: var(--catalog-headline-s-font-size);
  font-weight: 500;
  margin: 0 0 var(--catalog-spacing-m) 0;
  line-height: 1.3;
}

.toc ol {
  list-style-type: none;
  font-size: var(--catalog-body-m-font-size);
  padding: 0;
  margin: 0;
}

.toc > ol ol {
  padding-inline-start: var(--catalog-spacing-l);
}

.toc ol li {
  margin-block: var(--catalog-spacing-s);
  line-height: 1.4;
}

.toc a {
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  display: block;
  padding: 2px 0;
  border-left: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}

.toc a:hover,
.toc a.active {
  color: var(--md-sys-color-primary);
  border-left-color: var(--md-sys-color-primary);
  padding-left: 8px;
}

/* ===== ANCHOR LINKS ===== */
.anchor-link {
  opacity: 0;
  text-decoration: none !important;
  position: absolute;
  left: -24px;
  padding-right: 4px;
  font-size: 0.85em;
  font-weight: 400;
  color: var(--md-sys-color-primary);
  transition: opacity 0.2s;
}

h2, h3, h4 {
  position: relative;
}

h2:hover .anchor-link,
h3:hover .anchor-link,
h4:hover .anchor-link,
h2:focus-within .anchor-link,
h3:focus-within .anchor-link,
h4:focus-within .anchor-link {
  opacity: 1;
}

/* ===== THEME PICKER ===== */
.theme-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.theme-picker > * { margin-block-end: var(--catalog-spacing-l); }
.theme-picker > *:last-child { margin-block-end: 0; }
#head-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.theme-picker-title {
  margin: 0;
  text-align: center;
  font-size: var(--catalog-headline-s-font-size);
  height: 24px;
  line-height: 24px;
}
#copy-theme-btn {
  --md-icon-button-icon-size: 24px;
  --md-icon-button-state-layer-width: 40px;
  --md-icon-button-state-layer-height: 40px;
}
.sliders, #hex {
  padding-inline: var(--catalog-spacing-m);
  border-radius: var(--catalog-shape-l);
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  --md-slider-inactive-track-color: var(--md-sys-color-on-surface-variant);
}
.hct-slider {
  display: block;
}
.hct-label {
  display: block;
  margin-inline: calc(var(--md-slider-handle-width, 20px) / 2);
  margin-block-end: 6px;
}
#hex {
  display: flex;
  padding: 10px 12px;
  align-items: center;
  gap: 10px;
}
#hex .label { flex-grow: 1; }
#hex .input-wrapper {
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border: 2px solid var(--md-sys-color-outline-variant);
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
#hex .overflow {
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
#hex input {
  border: none;
  background: none;
  min-width: 200%;
  min-height: 200%;
  cursor: pointer;
  padding: 0;
  margin: 0;
}
.gradient {
  height: 5px;
  border-radius: 3px;
  border: none;
  box-sizing: border-box;
  margin-inline: calc(var(--md-slider-handle-width, 20px) / 2);
}
.gradient.chroma { will-change: background; }

/* Theme Presets */
.theme-presets-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-inline: var(--catalog-spacing-m);
  margin-block-end: var(--catalog-spacing-l);
}
.presets-label {
  font-size: var(--catalog-label-s-font-size);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
  margin-bottom: 2px;
}
.theme-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}


/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .toc-rail { display: none; }
}

@media (max-width: 1500px) {
  .top-app-bar-start .menu-button { display: flex; }
  .spacer { min-width: 0px; }
  .content { max-width: 100vw; padding-inline: var(--catalog-spacing-xl); }
  .scrim {
    position: fixed; inset: 0;
    background-color: rgba(0, 0, 0, 0.32);
    opacity: 0; pointer-events: none;
    z-index: 11;
    transition: opacity 0.3s cubic-bezier(0.2, 0, 0, 1);
  }
  .scrim.open { opacity: 1; pointer-events: auto; }
  .drawer { transition: transform 0.4s cubic-bezier(0.2, 0, 0, 1), opacity 0.35s cubic-bezier(0.2, 0, 0, 1); transform: translateX(-24px); opacity: 0; border-radius: 0 var(--catalog-shape-l) var(--catalog-shape-l) 0; }
  .drawer.open { transform: translateX(0); opacity: 1; }
  .drawer .nav-list { opacity: 0; transition: opacity 0.3s; }
  .drawer.open .nav-list { opacity: 1; }
}

@media (max-width: 600px) {
  .pane { border-end-start-radius: 0; border-end-end-radius: 0; }
  .content-area { padding-inline-end: 0; gap: 0; }
  .pane { height: calc(100dvh - var(--catalog-active-top-app-bar-height)); }
}

@media (forced-colors: active) {
  .pane { border: 1px solid CanvasText; }
  @media (max-width: 1500px) {
    .drawer { box-sizing: border-box; border: 1px solid CanvasText; }
  }
}

@media (pointer: fine) {
  :root { --_scrollbar-width: 8px; }
  .scroll-wrapper { scrollbar-color: var(--md-sys-color-primary) transparent; scrollbar-width: thin; }
  .content { padding-inline-end: calc(var(--catalog-spacing-xl) - var(--_scrollbar-width)); }
  .scroll-wrapper::-webkit-scrollbar { background-color: transparent; width: var(--_scrollbar-width); }
  .scroll-wrapper::-webkit-scrollbar-thumb { background-color: var(--md-sys-color-primary); border-radius: calc(var(--_scrollbar-width) / 2); }
  @media (forced-colors: active) {
    .scroll-wrapper { scrollbar-color: CanvasText transparent; }
    .scroll-wrapper::-webkit-scrollbar-thumb { background-color: CanvasText; }
  }
}

/* ===== SEARCH BUTTON ===== */
.search-box {
  margin-left: 24px;
}
.search-btn {
  display: flex;
  align-items: center;
  background-color: var(--md-sys-color-surface-container-high);
  border: none;
  color: var(--md-sys-color-on-surface-variant);
  padding: 0 16px;
  height: 40px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: background-color 0.2s, box-shadow 0.2s;
  width: 220px;
  justify-content: flex-start;
  gap: 10px;
}
.search-btn:hover {
  background-color: var(--md-sys-color-surface-container-highest);
}
.search-btn:focus-visible {
  outline: 2px solid var(--md-sys-color-primary);
  outline-offset: 2px;
}
.search-btn .search-icon {
  font-size: 20px;
  width: 20px;
  height: 20px;
  color: var(--md-sys-color-primary);
}
.search-btn-placeholder {
  flex-grow: 1;
  text-align: left;
  opacity: 0.8;
}
.search-btn-key {
  font-size: 11px;
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-family: var(--md-ref-typeface-mono);
}

@media (max-width: 960px) {
  .search-btn-placeholder, .search-btn-key {
    display: none;
  }
  .search-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .search-box {
    margin-left: 12px;
  }
}

/* ===== SEARCH MODAL ===== */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.2, 0, 0, 1);
}
.search-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.search-modal-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  z-index: 1;
}
.search-modal-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 600px;
  background-color: var(--md-sys-color-surface-container-high);
  border: none;
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  max-height: 520px;
  overflow: hidden;
  margin-inline: 16px;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
  transform: translateY(-20px);
}
.search-modal.open .search-modal-box {
  transform: translateY(0);
}
.search-modal-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
  gap: 16px;
}
.search-input-icon {
  color: var(--md-sys-color-primary);
  font-size: 24px;
}
#search-input {
  flex-grow: 1;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 16px;
  outline: none;
  padding: 8px 0;
}
#search-input::placeholder {
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.7;
}
.search-esc-key, .search-clear-btn {
  font-size: 11px;
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 600;
  font-family: var(--md-ref-typeface-mono);
}
.search-clear-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 50%;
  transition: background-color 0.2s;
}
.search-clear-btn:hover {
  background-color: var(--md-sys-color-surface-variant);
}
.search-clear-btn md-icon {
  font-size: 20px;
}
.search-modal-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.search-no-results {
  text-align: center;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 14px;
  padding: 48px 0;
}
.search-results-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.search-result-item {
  border-radius: 16px;
  overflow: hidden;
}
.search-result-link {
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  background-color: var(--md-sys-color-surface-container-low);
  border: none;
  border-radius: inherit;
  color: inherit;
  text-decoration: none !important;
  transition: background-color 0.2s, transform 0.2s;
}
.search-result-item.active .search-result-link,
.search-result-link:hover {
  background-color: var(--md-sys-color-surface-variant);
}
.search-result-item.active .search-result-link {
  background-color: var(--md-sys-color-secondary-container);
}
.search-result-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--md-sys-color-primary);
  margin-bottom: 6px;
}
.search-result-item.active .search-result-title {
  color: var(--md-sys-color-on-secondary-container);
}
.search-result-excerpt {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.6;
}
.search-result-item.active .search-result-excerpt {
  color: var(--md-sys-color-on-secondary-container);
  opacity: 0.9;
}
.search-result-excerpt mark {
  background-color: rgba(103, 80, 164, 0.25);
  color: var(--md-sys-color-on-surface);
  border-radius: 4px;
  padding-inline: 4px;
  font-weight: 500;
}
.search-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  padding: 12px 24px;
  border-top: 1px solid var(--md-sys-color-surface-variant);
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  background-color: var(--md-sys-color-surface-container-low);
}
.search-modal-footer kbd {
  background-color: var(--md-sys-color-surface-variant);
  padding: 2px 6px;
  border-radius: 4px;
  margin-inline: 2px;
  font-weight: 700;
  font-family: var(--md-ref-typeface-mono);
}

/* ===== INTEGRATED APPEARANCE PANEL ===== */
.toc-rail {
  width: var(--catalog-toc-width);
  flex-shrink: 0;
  padding-block: var(--catalog-spacing-xl);
  padding-inline-end: 4px;
  position: sticky;
  top: var(--catalog-active-top-app-bar-height);
  height: calc(100dvh - var(--catalog-active-top-app-bar-height));
  overflow-y: auto;
  box-sizing: border-box;
  transition: width 0.3s cubic-bezier(0.2, 0, 0, 1), background-color 0.3s, border-color 0.3s, padding 0.3s;
}

/* Widescreen Desktop Inline settings expand transition */
.toc-rail.settings-active {
  width: var(--catalog-toc-width) !important;
  padding-inline-start: 16px;
}

.font-chip {
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1) !important;
}

.font-chip.selected {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--md-sys-color-primary);
}

/* Tablet / Mobile Floating settings slide-out panel */
@media (max-width: 1024px) {
  .toc-rail.settings-active {
    display: block !important;
    position: fixed;
    top: var(--catalog-active-top-app-bar-height) !important;
    right: 0;
    bottom: 0;
    width: var(--catalog-toc-width) !important;
    max-width: 100vw;
    height: calc(100dvh - var(--catalog-active-top-app-bar-height)) !important;
    background-color: var(--md-sys-color-surface-container);
    box-shadow: 0px 8px 10px 1px rgba(0,0,0,0.14), 0px 3px 14px 2px rgba(0,0,0,0.12);
    z-index: 10000;
    padding: 24px !important;
    animation: drawerSlideIn 0.3s cubic-bezier(0.2, 0, 0, 1) forwards;
  }
}



@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

/* Settings Menu Item Styling */
.settings-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 20px;
  background-color: transparent;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  text-align: left;
  color: var(--md-sys-color-on-surface);
  box-sizing: border-box;
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1), transform 0.2s cubic-bezier(0.2, 0, 0, 1);
  margin-bottom: 4px;
}

.settings-menu-item:hover, .settings-menu-item:focus-visible {
  background-color: var(--md-sys-color-surface-container-highest);
}

.settings-menu-item md-icon {
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1);
}

.settings-menu-item:hover md-icon:last-of-type {
  transform: translateX(4px);
  color: var(--md-sys-color-primary) !important;
}

/* ===== SETTINGS ACCORDION ===== */
.accordion-trigger {
  transition: background-color 0.2s cubic-bezier(0.2, 0, 0, 1);
  border-radius: 12px;
  padding: 12px !important;
  margin-inline: -12px;
}

.accordion-trigger:hover {
  background-color: var(--md-sys-color-surface-container-highest) !important;
}

.accordion-trigger.expanded md-icon {
  transform: rotate(-180deg);
  color: var(--md-sys-color-primary) !important;
}

/* ===== PREMIUM PRESET CHIP BUTTONS ===== */
.preset-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background-color: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 8px; /* Sharp, modern rectangle with low corner radius */
  cursor: pointer;
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  font-size: 12px;
  transition: all 0.25s cubic-bezier(0.2, 0, 0, 1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.preset-chip:hover {
  background-color: var(--md-sys-color-surface-container-highest);
  border-color: var(--preset-color, var(--md-sys-color-primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.preset-chip.selected {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
  border-color: var(--preset-color, var(--md-sys-color-primary));
  border-width: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

md-filter-chip {
  margin: 2px;
  --md-filter-chip-container-shape: 12px;
  --md-filter-chip-outline-color: var(--md-sys-color-outline-variant);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}
md-filter-chip:hover {
  --md-filter-chip-outline-color: var(--preset-color, var(--md-sys-color-primary));
}
md-filter-chip[selected] {
  --md-filter-chip-selected-outline-color: var(--preset-color, var(--md-sys-color-primary));
  --md-filter-chip-selected-container-color: var(--md-sys-color-primary-container);
  --md-filter-chip-selected-label-text-color: var(--md-sys-color-on-primary-container);
  --md-filter-chip-selected-leading-icon-color: var(--md-sys-color-on-primary-container);
}

/* ===== SETTINGS PANEL ===== */
.settings-panel {
  box-sizing: border-box;
  width: 100%;
  padding: 0 12px 16px;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  margin-top: 4px;
}
.settings-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--md-sys-color-on-surface);
}
.settings-header-icon {
  color: var(--md-sys-color-primary);
  font-size: 20px;
}
.settings-header-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}
.settings-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.settings-page {
  width: 100%;
}
.settings-page[style*="display: flex"] {
  align-items: stretch;
}
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
}
.settings-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--md-sys-color-on-surface-variant);
  text-transform: uppercase;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.settings-row-icon {
  color: var(--md-sys-color-primary);
  font-size: 20px;
}
.settings-row-text {
  font-weight: 500;
  font-size: 14px;
}
.settings-desc {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
  line-height: 1.5;
}

/* ===== FEEDBACK BUTTON ===== */
#feedback-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 50;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}
#feedback-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
}
#feedback-btn md-icon {
  font-size: 24px;
}

.feedback-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.feedback-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.feedback-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(0,0,0,0.4);
  z-index: 1;
}
.feedback-box {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 420px;
  background-color: var(--md-sys-color-surface-container-high);
  border-radius: 20px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  margin-inline: 16px;
  overflow: hidden;
  transform: translateY(-20px);
  transition: transform 0.25s;
}
.feedback-modal.open .feedback-box {
  transform: translateY(0);
}
.feedback-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--md-sys-color-surface-variant);
}
.feedback-header-icon {
  color: var(--md-sys-color-primary);
  font-size: 22px;
}
.feedback-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}
.feedback-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: background-color 0.2s;
}
.feedback-close:hover {
  background-color: var(--md-sys-color-surface-variant);
}
.feedback-body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.feedback-select {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}
.feedback-select:focus {
  border-color: var(--md-sys-color-primary);
}
.fb-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
}
.fb-textarea:focus {
  border-color: var(--md-sys-color-primary);
}
.fb-textarea-sm {
  min-height: 60px;
}
.fb-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.fb-input:focus {
  border-color: var(--md-sys-color-primary);
}
.fb-select-sm {
  padding: 10px 12px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  background-color: var(--md-sys-color-surface);
  color: var(--md-sys-color-on-surface);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  cursor: pointer;
}
.fb-rating-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.fb-rating-row .fb-select-sm {
  flex-shrink: 0;
  min-width: 0;
  max-width: 120px;
}
.fb-rating-row .fb-input {
  flex: 1;
}
.fb-contact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fb-contact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fb-contact-or {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 600;
  flex-shrink: 0;
}
.fb-contact-hint {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
}
.fb-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}
.fb-charcount {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
}
.fb-submit {
  padding: 8px 20px;
  border-radius: 20px;
  border: none;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.fb-submit:disabled {
  opacity: 0.4;
  cursor: default;
}
.fb-submit:not(:disabled):hover {
  opacity: 0.85;
}
.fb-msg {
  margin-top: 4px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}
.fb-success {
  background-color: var(--md-sys-color-primary-container);
  color: var(--md-sys-color-on-primary-container);
}
.fb-error {
  background-color: var(--md-sys-color-error-container);
  color: var(--md-sys-color-on-error-container);
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  margin-inline: 2px;
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  transition: color 0.2s, transform 0.2s;
  vertical-align: middle;
}

.social-link:hover {
  text-decoration: none;
  transform: scale(1.1);
}

.social-link svg {
  width: 20px;
  height: 20px;
  display: block;
}

.social-link--discord:hover { color: #5865F2; }
.social-link--github:hover { color: #4078c0; }
.social-link--youtube:hover { color: #FF0000; }
.social-link--instagram:hover,
.social-link--insta:hover { color: #E4405F; }
.social-link--facebook:hover { color: #1877F2; }
.social-link--reddit:hover { color: #FF4500; }
.social-link--x:hover { color: #000; }
.social-link--telegram:hover { color: #0088CC; }

@media (prefers-color-scheme: dark) {
  .social-link--github:hover { color: #e6edf3; }
  .social-link--x:hover { color: #e7e9ea; }
}

/* Tooltip Styles */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  cursor: help;
  outline: none;
  color: var(--md-sys-color-primary);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), color 0.2s ease;
  margin: 0 4px;
}

.tooltip-trigger:hover,
.tooltip-trigger:focus-visible {
  transform: scale(1.18);
  color: var(--md-sys-color-primary-container);
}

.tooltip-icon {
  font-size: 1.15rem !important;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Custom Tooltip Popup (Glassmorphic) */
.custom-tooltip-popup {
  position: absolute;
  z-index: 10000;
  max-width: 320px;
  background: var(--md-sys-color-surface-container-high);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 12px;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.15);
  padding: 14px 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(8px) scale(0.96);
  transition: opacity 0.15s cubic-bezier(0.2, 0, 0, 1), transform 0.15s cubic-bezier(0.2, 0, 0, 1);
  pointer-events: none;
}

/* When dark class is active, add higher shadow contrast */
.dark .custom-tooltip-popup {
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.65), 0 8px 10px -6px rgba(0, 0, 0, 0.45);
}

.custom-tooltip-popup.show {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Tooltip Content Formatting */
.tooltip-content h1,
.tooltip-content h2,
.tooltip-content h3,
.tooltip-content h4 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  font-size: 1.05rem;
  font-family: var(--site-font-family), sans-serif;
}

.tooltip-content p {
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface-variant);
  font-family: var(--site-font-family), sans-serif;
}

.tooltip-content ul {
  margin: 0;
  padding-left: 1.25rem;
  list-style-type: disc;
  color: var(--md-sys-color-on-surface-variant);
}

.tooltip-content li {
  margin-bottom: 0.25rem;
  line-height: 1.3;
  font-size: 0.85rem;
  font-family: var(--site-font-family), sans-serif;
}

.tooltip-content a {
  color: var(--md-sys-color-primary);
  text-decoration: none;
}

.tooltip-content a:hover {
  text-decoration: underline;
}

.tooltip-content > :last-child {
  margin-bottom: 0;
}

/* Page Header Styles */
.page-header {
  display: flex;
  flex-direction: column;
  margin-bottom: 2rem;
  width: 100%;
}

.page-title {
  font-size: clamp(2.5rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  font-family: 'Outfit', 'Inter', sans-serif;
  margin: 0;
  line-height: 1.15;
  background: linear-gradient(120deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary), var(--md-sys-color-primary));
  background-size: 200% auto;
  animation: gradient-move 6s linear infinite;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.page-title-icon {
  font-size: 1em !important;
  vertical-align: middle;
  line-height: 1;
}

.page-subtitle {
  font-size: 1.15rem;
  color: var(--md-sys-color-on-surface-variant);
  line-height: 1.5;
  margin-top: 0.5rem;
  margin-bottom: 0;
  font-weight: 400;
  font-family: 'Inter', sans-serif;
  max-width: 700px;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--md-sys-color-on-surface-variant);
  font-family: 'Inter', sans-serif;
  align-items: center;
}

.post-editor, .post-date {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--md-sys-color-surface-container-high);
  color: var(--md-sys-color-on-surface-variant);
  text-decoration: none;
  transition: all 0.15s ease;
  cursor: default;
}

.post-editor:hover, .post-date:hover {
  background: var(--md-sys-color-surface-container-highest);
  color: var(--md-sys-color-on-surface);
}

.post-editor:hover, .post-date:hover {
  transform: translateY(-1px);
  background: var(--md-sys-color-surface-container-high);
  border-color: var(--md-sys-color-outline);
}

.post-meta-icon {
  font-size: 1rem !important;
  color: var(--md-sys-color-primary);
  vertical-align: middle;
}

.post-meta-text {
  font-weight: 500;
}

/* Contributors Styles */
.contributors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

@media (max-width: 480px) {
  .contributors-grid {
    grid-template-columns: 1fr;
  }
}

.contributor-card {
  display: flex;
  gap: 1.25rem;
  background-color: var(--md-sys-color-surface-container-low);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 16px;
  padding: 1.25rem;
  transition: transform 0.25s cubic-bezier(0.2, 0, 0, 1), 
              border-color 0.25s cubic-bezier(0.2, 0, 0, 1), 
              box-shadow 0.25s cubic-bezier(0.2, 0, 0, 1), 
              background-color 0.25s cubic-bezier(0.2, 0, 0, 1);
  min-height: 140px;
}

.contributor-card:hover {
  transform: translateY(-2px);
  border-color: var(--md-sys-color-primary);
  background-color: var(--md-sys-color-surface-container-high);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.contributor-card-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.contributor-avatar-container {
  position: relative;
  width: 80px;
  height: 80px;
}

.contributor-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--md-sys-color-outline-variant);
  object-fit: cover;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.contributor-card:hover .contributor-avatar {
  transform: scale(1.05);
}

.contributor-type-badge {
  position: absolute;
  bottom: -4px;
  right: -4px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--md-sys-color-outline-variant);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  z-index: 2;
}

.contributor-aka {
  font-size: 11px;
  font-weight: 600;
  font-style: italic;
  color: var(--md-sys-color-primary);
  text-align: center;
  max-width: 90px;
  word-break: break-word;
  line-height: 1.2;
}

.contributor-card-right {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  min-width: 0;
}

.contributor-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 0.25rem 0;
  font-family: 'Outfit', sans-serif;
  transition: color 0.2s;
}

.contributor-card:hover .contributor-name {
  color: var(--md-sys-color-primary);
}

.contributor-description {
  font-size: 13px;
  color: var(--md-sys-color-on-surface-variant);
  margin: 0;
  line-height: 1.4;
  flex-grow: 1;
  opacity: 0.95;
}

.contributor-socials {
  display: flex;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.5rem;
  justify-content: flex-end;
}

.contributor-social-link {
  --md-icon-button-icon-color: var(--md-sys-color-on-surface-variant);
  --md-icon-button-hover-icon-color: var(--md-sys-color-primary);
  --md-icon-button-focus-icon-color: var(--md-sys-color-primary);
  --md-icon-button-pressed-icon-color: var(--md-sys-color-primary);
  transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.contributor-social-link:hover {
  transform: scale(1.1);
}

.contributor-social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
:root { --catalog-image-border-radius: 22px; }

summary { display: flex; align-items: center; overflow-y: hidden; }
summary::-webkit-details-marker { display: none; }
details[open] summary { margin-block-end: 16px; }
details summary md-outlined-icon-button { margin-inline-end: 8px; }
details:not([open]) #top-app-bar-nav { display: contents; }

.content > p img, .content > img { max-width: 100%; }
img:not(figure *), figure { border-radius: var(--catalog-image-border-radius); min-height: 56px; object-fit: cover; }
.figure-wrapper { display: flex; justify-content: center; }
figure { border: 1px solid var(--md-sys-color-outline); display: inline-flex; padding-inline: 28px; align-items: center; }
p:has(> img) { display: flex; justify-content: center; }

table { border-spacing: 0; max-width: 100%; margin-inline: auto; }
td, th {
  border-block-start: 1px solid var(--md-sys-color-outline-variant);
  border-inline-start: 1px solid var(--md-sys-color-outline-variant);
  padding: 8px 16px;
}
tr:last-of-type td, tr:last-of-type th { border-block-end: 1px solid var(--md-sys-color-outline-variant); }
tr td:last-of-type, tr th:last-of-type { border-inline-end: 1px solid var(--md-sys-color-outline-variant); }
th {
  background-color: var(--md-sys-color-surface-container);
  color: var(--md-sys-color-on-surface);
  font-size: 1.25em;
}
:not(pre) > code {
  display: inline-flex;
  background-color: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface);
  padding: 4px;
  border-radius: 8px;
}
tr th:first-of-type { border-start-start-radius: var(--catalog-shape-xl); }
tr th:last-of-type { border-start-end-radius: var(--catalog-shape-xl); }
tr:last-of-type td:first-of-type { border-end-start-radius: var(--catalog-shape-xl); }
tr:last-of-type td:last-of-type { border-end-end-radius: var(--catalog-shape-xl); }

.heading { align-items: center; position: relative; overflow-x: visible; }
.heading.h2 { font-size: var(--catalog-title-l-font-size); }
.heading.h3 { font-size: var(--catalog-title-m-font-size); }
.heading.h4 { font-size: var(--catalog-title-s-font-size); }

blockquote { margin: var(--catalog-spacing-l); }
.content blockquote {
  padding: var(--catalog-spacing-l);
  border-radius: var(--catalog-shape-l);
  background-color: var(--md-sys-color-secondary-container);
  display: flex; gap: var(--catalog-spacing-s);
}
blockquote .content { flex-grow: 1; }
blockquote .content > *:first-child { margin-block-start: 4px; }
blockquote .content > *:last-child { margin-block-end: 0; }
blockquote, blockquote a { color: var(--md-sys-color-on-secondary-container); }
blockquote a { text-decoration: underline; font-weight: 700; }
blockquote.important { background-color: var(--md-sys-color-primary-container); }
blockquote.important, blockquote.important a { color: var(--md-sys-color-on-primary-container); }
blockquote.warning { background-color: var(--md-sys-color-error-container); }
blockquote.warning, blockquote.warning a { color: var(--md-sys-color-on-error-container); }
