/*
 * QZ shared design system
 * 1240px holds the product shell. 720px holds the primary task or reading line.
 * Components stay neutral so every page can keep one clear visual center.
 */

:root {
  color-scheme: light;

  /* Color */
  --qz-canvas: #f7f8fa;
  --qz-surface: #ffffff;
  --qz-surface-muted: #eef3f9;
  --qz-surface-strong: #e8ebef;
  --qz-ink: #172033;
  --qz-ink-secondary: #667085;
  --qz-ink-tertiary: #68707c;
  --qz-accent: #2563eb;
  --qz-accent-hover: #1d4ed8;
  --qz-accent-soft: rgba(37, 99, 235, .08);
  --qz-on-accent: #ffffff;
  --qz-danger: #b42318;
  --qz-success: #067647;
  --qz-line: #e5e7eb;
  --qz-line-strong: rgba(23, 25, 29, .18);
  --qz-overlay: rgba(20, 23, 29, .42);
  --qz-focus: #2563eb;

  /* Type */
  --qz-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --qz-font-size-12: .75rem;
  --qz-font-size-14: .875rem;
  --qz-font-size-16: 1rem;
  --qz-font-size-20: 1.25rem;
  --qz-font-size-24: 1.5rem;
  --qz-font-size-32: 2rem;
  --qz-font-size-28: clamp(1.5rem, 2.2vw, 1.75rem);
  --qz-font-size-40: clamp(1.5rem, 2.8vw, 2rem);
  --qz-page-title: clamp(1.75rem, 2.6vw, 2.25rem);
  --qz-leading-tight: 1.16;
  --qz-leading-body: 1.68;
  --qz-tracking-tight: -.015em;

  /* Space */
  --qz-space-1: .25rem;
  --qz-space-2: .5rem;
  --qz-space-3: .75rem;
  --qz-space-4: 1rem;
  --qz-space-6: 1.5rem;
  --qz-space-8: 2rem;
  --qz-space-12: 3rem;
  --qz-space-16: 4rem;
  --qz-space-24: 6rem;

  /* Geometry */
  --qz-container: 77.5rem;
  --qz-reading: 45rem;
  --qz-gutter: clamp(1rem, 4vw, 1.5rem);
  --qz-control: 2.75rem;
  --qz-nav-height: 3.75rem;
  --qz-header-height: 4rem;
  --qz-radius-control: .625rem;
  --qz-radius-surface: .875rem;
  --qz-radius-pill: 999px;
  --qz-stroke: 1px;

  /* Depth and motion */
  --qz-shadow-menu: 0 18px 48px rgba(40, 47, 58, .12);
  --qz-shadow-float: 0 12px 30px rgba(40, 47, 58, .1);
  --qz-ease-out: cubic-bezier(.16, 1, .3, 1);
  --qz-ease-spring: cubic-bezier(.2, .8, .2, 1);
  --qz-duration-fast: 140ms;
  --qz-duration: 220ms;
  --qz-duration-material: 420ms;
  --qz-layer-nav: 80;
  --qz-layer-menu: 100;
  --qz-layer-dialog: 120;
}

html.dark,
html[data-theme="dark"] {
  color-scheme: dark;
  --qz-canvas: #111318;
  --qz-surface: #171a20;
  --qz-surface-muted: #20242c;
  --qz-surface-strong: #292e38;
  --qz-ink: #f1f3f6;
  --qz-ink-secondary: #b8bec8;
  --qz-ink-tertiary: #929aa7;
  --qz-accent: #58a8f7;
  --qz-accent-hover: #78b9f9;
  --qz-accent-soft: rgba(88, 168, 247, .12);
  --qz-on-accent: #111318;
  --qz-danger: #fda29b;
  --qz-success: #75e0a7;
  --qz-line: rgba(241, 243, 246, .11);
  --qz-line-strong: rgba(241, 243, 246, .2);
  --qz-overlay: rgba(5, 7, 11, .68);
  --qz-focus: #78b9f9;
  --qz-shadow-menu: 0 20px 52px rgba(4, 6, 10, .46);
  --qz-shadow-float: 0 14px 34px rgba(4, 6, 10, .38);
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body.qz-shell {
  min-width: 20rem;
  margin: 0;
  background: var(--qz-canvas);
  color: var(--qz-ink);
  font-family: var(--qz-font-sans);
  font-size: var(--qz-font-size-16);
  line-height: var(--qz-leading-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.qz-shell *,
.qz-shell *::before,
.qz-shell *::after {
  box-sizing: border-box;
}

.qz-shell a { color: inherit; text-decoration: none; }
.qz-shell button,
.qz-shell input,
.qz-shell select,
.qz-shell textarea { font: inherit; }
.qz-shell button { color: inherit; }

.qz-shell ::selection { background: var(--qz-accent-soft); color: var(--qz-ink); }
.qz-shell :focus-visible,
.qz-header :focus-visible,
.qz-mobile-menu :focus-visible,
.qz-command-overlay :focus-visible {
  outline: 2px solid var(--qz-focus);
  outline-offset: 3px;
}

.qz-shell ::-webkit-scrollbar { width: 10px; height: 10px; }
.qz-shell ::-webkit-scrollbar-track { background: transparent; }
.qz-shell ::-webkit-scrollbar-thumb {
  border: 3px solid var(--qz-canvas);
  border-radius: var(--qz-radius-pill);
  background: var(--qz-line-strong);
}

.qz-skip-link,
.skip-link {
  position: fixed;
  z-index: calc(var(--qz-layer-dialog) + 1);
  top: var(--qz-space-3);
  left: var(--qz-space-3);
  padding: .625rem .875rem;
  border-radius: var(--qz-radius-control);
  background: var(--qz-ink);
  color: var(--qz-surface);
  font-size: var(--qz-font-size-14);
  font-weight:600;
  transform: translateY(calc(-100% - 1.5rem));
  transition: transform var(--qz-duration-fast) var(--qz-ease-out);
}

.qz-skip-link:focus,
.skip-link:focus { transform: translateY(0); }

/* Layout */
.qz-container {
  width: min(100% - (2 * var(--qz-gutter)), var(--qz-container));
  margin-inline: auto;
}

.qz-reading {
  width: min(100%, var(--qz-reading));
  margin-inline: auto;
}

.qz-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--qz-reading)) minmax(15rem, 1fr);
  gap: clamp(2.5rem, 7vw, 5rem);
  align-items: start;
}

.qz-stage {
  display: grid;
  min-height: min(42rem, calc(100dvh - var(--qz-nav-height)));
  place-items: center;
  padding-block: clamp(var(--qz-space-16), 9vw, var(--qz-space-24));
}

.qz-stage > :first-child { width: min(100%, var(--qz-reading)); }

.qz-section { padding-block: clamp(var(--qz-space-12), 7vw, var(--qz-space-24)); }
.qz-section + .qz-section { border-top: var(--qz-stroke) solid var(--qz-line); }

.qz-section-head {
  display: grid;
  width: min(100%, var(--qz-reading));
  gap: var(--qz-space-3);
  margin-bottom: clamp(var(--qz-space-8), 5vw, var(--qz-space-12));
}

.qz-section-head h1,
.qz-section-head h2,
.qz-hero h1 {
  max-width: 15ch;
  margin: 0;
  color: var(--qz-ink);
  font-size: var(--qz-font-size-40);
  font-weight:600;
  line-height: var(--qz-leading-tight);
  letter-spacing: var(--qz-tracking-tight);
  text-wrap: balance;
}

.qz-section-head h2 { font-size: var(--qz-font-size-28); }
.qz-section-head p,
.qz-hero p,
.qz-copy {
  max-width: 66ch;
  margin: 0;
  color: var(--qz-ink-secondary);
}

.qz-hero {
  display: grid;
  width: min(100%, var(--qz-reading));
  gap: var(--qz-space-6);
  padding-block: clamp(var(--qz-space-16), 9vw, var(--qz-space-24));
}

.qz-hero-actions { display: flex; flex-wrap: wrap; gap: var(--qz-space-3); }

/* Shared navigation */
.qz-site-nav,
.site-nav,
.gn {
  position: sticky;
  z-index: var(--qz-layer-nav);
  top: 0;
  height: var(--qz-nav-height);
  border-bottom: var(--qz-stroke) solid var(--qz-line);
  background: color-mix(in srgb, var(--qz-canvas) 94%, transparent);
  -webkit-backdrop-filter: saturate(130%) blur(16px);
  backdrop-filter: saturate(130%) blur(16px);
}

.qz-nav-inner,
.nav-inner,
.gn-in {
  display: flex;
  align-items: center;
  width: min(100% - (2 * var(--qz-gutter)), var(--qz-container));
  height: 100%;
  margin-inline: auto;
  gap: clamp(var(--qz-space-4), 3vw, var(--qz-space-8));
}

.qz-brand,
.brand {
  display: inline-flex;
  min-width: max-content;
  align-items: center;
  gap: .625rem;
  color: var(--qz-ink);
  font-size: var(--qz-font-size-16);
  font-weight:600;
  line-height: 1.1;
  letter-spacing: -.01em;
}

.qz-brand-mark,
.brand .leaf,
.gn .leaf { width: 1.625rem; height: 1.625rem; flex: 0 0 auto; color: var(--qz-accent); }

.qz-brand small,
.brand small {
  display: block;
  margin-top: .125rem;
  color: var(--qz-ink-tertiary);
  font-size:var(--qz-font-size-14);
  font-weight:600;
  letter-spacing: .08em;
}

.qz-nav-links,
.nav-links,
.gn-links {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: clamp(.5rem, 1.5vw, 1.125rem);
  color: var(--qz-ink-secondary);
  font-size:var(--qz-font-size-14);
}

.qz-nav-links > a,
.qz-nav-links > button,
.nav-links > a,
.nav-links > button,
.gn-links > a,
.gn-links > button {
  position: relative;
  display: inline-flex;
  min-width: var(--qz-control);
  min-height: var(--qz-control);
  padding-inline: .25rem;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--qz-duration-fast) ease;
}

.qz-nav-links > :where(a, button):hover,
.nav-links > :where(a, button):hover,
.gn-links > :where(a, button):hover { color: var(--qz-ink); }

.qz-nav-links [aria-current="page"],
.nav-links [aria-current="page"],
.gn-links [aria-current="page"] { color: var(--qz-ink); font-weight:600; }

.qz-nav-links [aria-current="page"]::after,
.nav-links [aria-current="page"]::after,
.gn-links [aria-current="page"]::after {
  position: absolute;
  right: .25rem;
  bottom: -1px;
  left: .25rem;
  height: 2px;
  background: var(--qz-accent);
  content: "";
}

.qz-nav-actions,
.nav-actions,
.gn-r {
  display: flex;
  margin-left: auto;
  align-items: center;
  gap: .125rem;
}

.qz-icon-button,
.theme-button,
.menu-button,
.nav-icon,
.gn-theme-btn,
.gn-search-btn,
.gn-catalog-mobile {
  display: grid;
  width: var(--qz-control);
  height: var(--qz-control);
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--qz-radius-pill);
  background: transparent;
  color: var(--qz-ink-secondary);
  cursor: pointer;
  transition: background-color var(--qz-duration-fast) ease, color var(--qz-duration-fast) ease, transform var(--qz-duration-fast) ease;
}

.qz-icon-button:hover,
.theme-button:hover,
.menu-button:hover,
.nav-icon:hover,
.gn-theme-btn:hover,
.gn-search-btn:hover,
.gn-catalog-mobile:hover { background: var(--qz-surface-muted); color: var(--qz-ink); }

.qz-icon-button:active,
.theme-button:active,
.menu-button:active,
.nav-icon:active,
.gn-theme-btn:active,
.gn-search-btn:active,
.gn-catalog-mobile:active { transform: scale(.96); }

.qz-icon-button svg,
.theme-button svg,
.menu-button svg,
.nav-icon svg,
.gn-theme-btn svg,
.gn-search-btn svg,
.gn-catalog-mobile svg { width: 1.125rem; height: 1.125rem; }

.theme-button svg,
.gn-theme-btn svg { grid-area: 1 / 1; transition: opacity var(--qz-duration) var(--qz-ease-out), transform var(--qz-duration) var(--qz-ease-out); }
.theme-button .theme-sun,
.gn-theme-btn .theme-sun { opacity: 0; transform: rotate(-28deg) scale(.76); }
html.dark .theme-button .theme-moon,
html[data-theme="dark"] .theme-button .theme-moon,
html.dark .gn-theme-btn .theme-moon,
html[data-theme="dark"] .gn-theme-btn .theme-moon { opacity: 0; transform: rotate(28deg) scale(.76); }
html.dark .theme-button .theme-sun,
html[data-theme="dark"] .theme-button .theme-sun,
html.dark .gn-theme-btn .theme-sun,
html[data-theme="dark"] .gn-theme-btn .theme-sun { opacity: 1; transform: none; }

.qz-mobile-menu,
.mobile-menu {
  position: fixed;
  z-index: var(--qz-layer-menu);
  top: calc(var(--qz-nav-height) + .75rem);
  right: var(--qz-gutter);
  width: min(22rem, calc(100vw - (2 * var(--qz-gutter))));
  padding: var(--qz-space-2);
  border: var(--qz-stroke) solid var(--qz-line);
  border-radius: var(--qz-radius-surface);
  background: var(--qz-surface);
  box-shadow: var(--qz-shadow-menu);
}

.qz-mobile-menu[hidden],
.mobile-menu[hidden] { display: none; }

.qz-mobile-menu > :where(a, button),
.mobile-menu > :where(a, button) {
  display: flex;
  width: 100%;
  min-height: 3rem;
  padding-inline: var(--qz-space-4);
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-radius: var(--qz-radius-control);
  background: transparent;
  color: var(--qz-ink-secondary);
  cursor: pointer;
  font-size: var(--qz-font-size-14);
  font-weight:600;
  text-align: left;
}

.qz-mobile-menu > :where(a, button):hover,
.mobile-menu > :where(a, button):hover,
.qz-mobile-menu > [aria-current="page"],
.mobile-menu > [aria-current="page"] { background: var(--qz-surface-muted); color: var(--qz-accent); }

/* QZ leaf-coordinate header. This is the only owner of qz-header overlays. */
.qz-header {
  position: sticky;
  box-sizing: border-box;
  z-index: var(--qz-layer-nav);
  top: 0;
  height: var(--qz-header-height);
  border-bottom: var(--qz-stroke) solid var(--qz-line);
  background: color-mix(in srgb, var(--qz-canvas) 96%, transparent);
  -webkit-backdrop-filter: saturate(120%) blur(12px);
  backdrop-filter: saturate(120%) blur(12px);
  color: var(--qz-ink);
  font-family: var(--qz-font-sans);
}

.qz-header *,
.qz-header *::before,
.qz-header *::after,
.qz-category-panel *,
.qz-mobile-menu *,
.qz-command-overlay * { box-sizing: border-box; }

.qz-header a,
.qz-mobile-menu a,
.qz-command-overlay a { color: inherit; text-decoration: none; }

.qz-header button,
.qz-mobile-menu button,
.qz-command-overlay button,
.qz-command-overlay input { font: inherit; }

.qz-header-inner {
  display: flex;
  width: min(100% - 3rem, var(--qz-container));
  height: 100%;
  margin-inline: auto;
  align-items: center;
  gap: 1.75rem;
}

.qz-header-brand {
  display: inline-flex;
  min-width: max-content;
  min-height: 2.75rem;
  align-items: center;
  gap: .625rem;
  border-radius: var(--qz-radius-control);
  line-height: 1.05;
}

.qz-header-leaf {
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
  color: var(--qz-accent);
  transition: transform var(--qz-duration-fast) var(--qz-ease-out);
}

.qz-header-leaf-nodes { opacity: .76; transition: opacity var(--qz-duration-fast) ease; }
.qz-header-brand:hover .qz-header-leaf { transform: translateY(-1px); }
.qz-header-brand:hover .qz-header-leaf-nodes { opacity: 1; }
.qz-header-brand:active .qz-header-leaf { transform: scale(.97); transition-duration: 80ms; }

.qz-header-brand-copy { display: grid; gap: .125rem; }
.qz-header-brand-copy strong { font-size: var(--qz-font-size-16); font-weight:600; letter-spacing: -.01em; }
.qz-header-brand-copy small { color: var(--qz-ink-tertiary); font-size:var(--qz-font-size-14); font-weight:600; letter-spacing: .04em; }

.qz-current-label {
  display: none;
  min-width: 0;
  overflow: hidden;
  color: var(--qz-ink-secondary);
  font-size: var(--qz-font-size-14);
  font-weight:600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qz-primary-nav {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: .25rem;
}

.qz-find-module {
  display: inline-flex;
  align-items: center;
  border-radius: .5rem;
}

.qz-find-module .qz-module-link { border-radius: .5rem 0 0 .5rem; }
.qz-category-disclosure,
.qz-mobile-category-toggle {
  display: inline-grid;
  width: 2.75rem;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 0 .5rem .5rem 0;
  background: transparent;
  color: var(--qz-ink-secondary);
  cursor: pointer;
}
.qz-category-disclosure:hover,
.qz-mobile-category-toggle:hover { background: var(--qz-surface-muted); color: var(--qz-ink); }
.qz-category-disclosure svg,
.qz-mobile-category-toggle svg { width: .875rem; height: .875rem; transition: transform 180ms var(--qz-ease-out); }
.qz-category-disclosure[aria-expanded="true"] svg,
.qz-mobile-category-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.qz-module-link {
  position: relative;
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding-inline: .625rem;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--qz-ink-secondary);
  cursor: pointer;
  font-size:var(--qz-font-size-14);
  white-space: nowrap;
  transition: background-color var(--qz-duration-fast) ease, color var(--qz-duration-fast) ease, transform 80ms ease;
}

.qz-module-link > svg { width: .875rem; height: .875rem; }
.qz-module-link > svg:last-child { width: .75rem; height: .75rem; transition: transform 180ms var(--qz-ease-out); }
.qz-module-link:hover { background: var(--qz-surface-muted); color: var(--qz-ink); }
.qz-module-link:active { transform: translateY(1px); }
.qz-module-link[aria-expanded="true"] { background: var(--qz-accent-soft); color: var(--qz-accent); }
.qz-module-link[aria-expanded="true"] > svg:last-child { transform: rotate(180deg); }
.qz-module-link[aria-current="page"] { color: var(--qz-ink); font-weight:600; }
.qz-module-link[aria-current="page"]::after {
  position: absolute;
  bottom: -1px;
  left: 50%;
  width: 1.375rem;
  height: 2px;
  border-radius: 1px;
  background: var(--qz-accent);
  content: "";
  transform: translateX(-50%);
}

.qz-recommend { position: relative; }
.qz-recommend > summary { list-style: none; }
.qz-recommend > summary::-webkit-details-marker { display: none; }
.qz-recommend[open] > summary { background: var(--qz-surface-muted); color: var(--qz-ink); }
.qz-recommend[open] > summary > svg { transform: rotate(180deg); }
.qz-recommend-menu {
  position: absolute;
  z-index: var(--qz-layer-menu);
  top: calc(100% - .25rem);
  right: 0;
  display: grid;
  width: 16rem;
  gap: .125rem;
  padding: .45rem;
  border: var(--qz-stroke) solid var(--qz-line);
  border-radius: var(--qz-radius-surface);
  background: var(--qz-surface);
  box-shadow: var(--qz-shadow-menu);
}
.qz-recommend-link { display: grid; gap: .1rem; padding: .7rem .75rem; border-radius: .5rem; }
.qz-recommend-link:hover { background: var(--qz-surface-muted); }
.qz-recommend-link strong { color: var(--qz-ink); font-size:var(--qz-font-size-14); font-weight:600; }
.qz-recommend-link span { color: var(--qz-ink-tertiary); font-size:var(--qz-font-size-14); line-height: 1.45; }

.qz-header-actions { display: flex; margin-left: auto; align-items: center; gap: .125rem; }
.qz-header-action,
.qz-command-close {
  position: relative;
  display: inline-grid;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: var(--qz-radius-control);
  background: transparent;
  color: var(--qz-ink-secondary);
  cursor: pointer;
  transition: background-color var(--qz-duration-fast) ease, color var(--qz-duration-fast) ease, transform 80ms ease;
}

.qz-header-action:hover,
.qz-command-close:hover { background: var(--qz-surface-muted); color: var(--qz-ink); }
.qz-header-action:active,
.qz-command-close:active { transform: translateY(1px); }
.qz-header-action > svg,
.qz-header-action > span > svg,
.qz-command-close svg { width: 1.125rem; height: 1.125rem; }

.qz-command-trigger { display: inline-flex; width: 4.375rem; gap: .5rem; }
.qz-command-trigger kbd { border: 0; background: transparent; color: var(--qz-ink-tertiary); font-family: inherit; font-size:var(--qz-font-size-14); }
.qz-theme-action > span { display: grid; grid-area: 1 / 1; place-items: center; transition: opacity 180ms ease, transform 180ms var(--qz-ease-out); }
.qz-theme-action .theme-sun { opacity: 0; transform: scale(.76); }
html.dark .qz-theme-action .theme-moon,
html[data-theme="dark"] .qz-theme-action .theme-moon { opacity: 0; transform: scale(.76); }
html.dark .qz-theme-action .theme-sun,
html[data-theme="dark"] .qz-theme-action .theme-sun { opacity: 1; transform: none; }

.qz-favorite-badge {
  position: absolute;
  top: .1875rem;
  right: .125rem;
  display: grid;
  min-width: 1rem;
  height: 1rem;
  padding-inline: .1875rem;
  place-items: center;
  border: 2px solid var(--qz-canvas);
  border-radius: var(--qz-radius-pill);
  background: var(--qz-accent);
  color: #f8fbff;
  font-size:var(--qz-font-size-14);
  font-weight:600;
  line-height: 1;
}

.qz-favorite-badge[hidden] { display: none; }
.qz-mobile-trigger { display: none; }
.qz-mobile-close-icon { display: none; }
.qz-mobile-trigger[aria-expanded="true"] > svg:first-child { display: none; }
.qz-mobile-trigger[aria-expanded="true"] .qz-mobile-close-icon { display: grid; }

.qz-category-panel {
  position: absolute;
  z-index: var(--qz-layer-menu);
  top: 100%;
  right: 0;
  left: 0;
  border-bottom: var(--qz-stroke) solid var(--qz-line);
  border-radius: 0 0 var(--qz-radius-surface) var(--qz-radius-surface);
  background: var(--qz-surface);
  box-shadow: var(--qz-shadow-menu);
}

.qz-category-panel[hidden],
.qz-mobile-menu[hidden],
.qz-command-overlay[hidden],
.qz-mobile-category-list[hidden] { display: none; }

.qz-category-panel[data-state="open"] { animation: qz-panel-in 180ms var(--qz-ease-out) both; }
.qz-category-panel-inner { width: min(100% - 3rem, var(--qz-container)); margin-inline: auto; padding: 1rem 0 1.25rem; }
.qz-category-panel-head { display: flex; min-height: 2.75rem; align-items: center; justify-content: space-between; gap: 1rem; font-size: var(--qz-font-size-14); }
.qz-category-panel-head strong { font-weight:600; }
.qz-category-panel-head a { min-height: 2.75rem; display: inline-flex; align-items: center; color: var(--qz-accent); font-size:var(--qz-font-size-14); font-weight:600; }
.qz-category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .125rem 1rem; }
.qz-category-link,
.qz-mobile-category-link {
  display: flex;
  min-width: 0;
  min-height: 2.75rem;
  padding-inline: .625rem;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border-radius: .5rem;
  color: var(--qz-ink-secondary);
  font-size:var(--qz-font-size-14);
}
.qz-category-link:hover,
.qz-mobile-category-link:hover { background: var(--qz-surface-muted); color: var(--qz-ink); }
.qz-category-link[aria-current="page"],
.qz-mobile-category-link[aria-current="page"] { background: var(--qz-accent-soft); color: var(--qz-accent); font-weight:600; }
.qz-category-count { flex: 0 0 auto; color: var(--qz-ink-tertiary); font-variant-numeric: tabular-nums; }
.qz-category-all { display: inline-flex; min-height: 2.75rem; margin-top: .5rem; align-items: center; color: var(--qz-accent); font-size:var(--qz-font-size-14); font-weight:600; }

.qz-mobile-menu {
  position: fixed;
  z-index: var(--qz-layer-menu);
  top: calc(var(--qz-header-height) + .5rem);
  right: 1.25rem;
  width: min(35rem, calc(100vw - 2.5rem));
  max-height: calc(100dvh - var(--qz-header-height) - 1.25rem);
  overflow: auto;
  padding: .5rem;
  border: var(--qz-stroke) solid var(--qz-line);
  border-radius: var(--qz-radius-surface);
  background: var(--qz-surface);
  box-shadow: var(--qz-shadow-menu);
  color: var(--qz-ink);
  font-family: var(--qz-font-sans);
}

.qz-mobile-menu[data-state="open"] { animation: qz-panel-in 180ms var(--qz-ease-out) both; }
.qz-mobile-modules { display: grid; gap: .125rem; }
.qz-mobile-support { border-top: var(--qz-stroke) solid var(--qz-line); margin-top: .25rem; padding-top: .25rem; }
.qz-mobile-support > summary {
  display: flex;
  min-height: 3.25rem;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .45rem .75rem;
  border-radius: var(--qz-radius-control);
  color: var(--qz-ink-secondary);
  cursor: pointer;
  list-style: none;
}
.qz-mobile-support > summary::-webkit-details-marker { display: none; }
.qz-mobile-support > summary:hover { background: var(--qz-surface-muted); }
.qz-mobile-support > summary span { display: grid; gap: .05rem; }
.qz-mobile-support > summary strong { color: var(--qz-ink); font-size:var(--qz-font-size-14); font-weight:600; }
.qz-mobile-support > summary small { color: var(--qz-ink-tertiary); font-size:var(--qz-font-size-14); }
.qz-mobile-support > summary svg { width: .875rem; height: .875rem; transition: transform 180ms var(--qz-ease-out); }
.qz-mobile-support[open] > summary svg { transform: rotate(180deg); }
.qz-mobile-support-links { display: grid; gap: .125rem; padding: .125rem 0 .25rem .65rem; }
.qz-mobile-support-links a { display: flex; min-height: 2.75rem; align-items: center; padding: 0 .75rem; border-radius: .5rem; color: var(--qz-ink-secondary); font-size:var(--qz-font-size-14); }
.qz-mobile-support-links a:hover { background: var(--qz-surface-muted); color: var(--qz-accent); }
.qz-mobile-find-module { display: grid; grid-template-columns: minmax(0, 1fr) 2.75rem; align-items: center; border-radius: .5rem; }
.qz-mobile-find-module[data-current="true"] { background: var(--qz-accent-soft); }
.qz-mobile-find-module[data-current="true"] .qz-mobile-module { color: var(--qz-accent); }
.qz-mobile-module {
  display: flex;
  width: 100%;
  min-height: 2.75rem;
  padding-inline: .875rem;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border: 0;
  border-radius: .5rem;
  background: transparent;
  color: var(--qz-ink-secondary);
  cursor: pointer;
  font-size: var(--qz-font-size-14);
  font-weight:600;
  text-align: left;
}
.qz-mobile-module > span { display: inline-flex; align-items: center; gap: .5rem; }
.qz-mobile-module svg { width: .875rem; height: .875rem; }
.qz-mobile-module > svg { transition: transform 180ms var(--qz-ease-out); }
.qz-mobile-module:hover { background: var(--qz-surface-muted); color: var(--qz-ink); }
.qz-mobile-module[data-current="true"] { color: var(--qz-accent); }
.qz-mobile-module[aria-expanded="true"] { background: var(--qz-accent-soft); color: var(--qz-accent); }
.qz-mobile-module[aria-expanded="true"] > svg { transform: rotate(180deg); }
.qz-mobile-category-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: .375rem; padding-top: .375rem; border-top: var(--qz-stroke) solid var(--qz-line); }

.qz-command-overlay {
  position: fixed;
  z-index: var(--qz-layer-dialog);
  inset: 0;
  overflow: auto;
  padding: clamp(1rem, 5vw, 4rem) 1rem 2rem;
  background: var(--qz-canvas);
  color: var(--qz-ink);
  font-family: var(--qz-font-sans);
}
.qz-command-panel {
  width: min(52rem, calc(100vw - 2rem));
  max-height: none;
  margin-inline: auto;
  overflow: visible;
  padding: clamp(1rem, 3vw, 2rem);
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: qz-panel-in 180ms var(--qz-ease-out) both;
}
.qz-command-head { display: flex; align-items: start; justify-content: space-between; gap: 1rem; }
.qz-command-head h2 { margin: 0; font-size: var(--qz-font-size-20); font-weight: 700; line-height: 1.25; }
.qz-command-head p { margin: .125rem 0 0; color: var(--qz-ink-tertiary); font-size: var(--qz-font-size-14); }
.qz-command-field { display: flex; min-height: 2.75rem; margin-top: 1rem; padding-inline: .75rem; align-items: center; gap: .625rem; border: var(--qz-stroke) solid var(--qz-line-strong); border-radius: var(--qz-radius-control); background: var(--qz-canvas); transition: border-color var(--qz-duration-fast) ease, box-shadow var(--qz-duration-fast) ease, background-color var(--qz-duration-fast) ease; }
.qz-command-field:focus-within { border-color: color-mix(in srgb, var(--qz-accent) 52%, var(--qz-line-strong)); background: var(--qz-surface); box-shadow: 0 8px 24px rgba(40, 47, 58, .08), inset 0 0 0 .5px color-mix(in srgb, var(--qz-accent) 22%, transparent); }
.qz-command-field > svg { width: 1.125rem; height: 1.125rem; flex: 0 0 auto; color: var(--qz-ink-tertiary); }
.qz-command-field input { width: 100%; min-width: 0; height: 2.75rem; padding: 0; border: 0; outline: 0; background: transparent; color: var(--qz-ink); font-size: var(--qz-font-size-14); }
.qz-command-field input:focus-visible { outline: 0; }
.qz-command-field input::placeholder { color: var(--qz-ink-tertiary); }
.qz-command-status { min-height: 2.25rem; padding: .625rem .25rem .25rem; color: var(--qz-ink-tertiary); font-size: var(--qz-font-size-14); }
.qz-command-results { display: grid; gap: .5rem; }
.qz-command-group { display: grid; gap: .125rem; }
.qz-command-group + .qz-command-group { padding-top: .5rem; border-top: var(--qz-stroke) solid var(--qz-line); }
.qz-command-group-title { margin: 0; padding: .125rem .625rem; color: var(--qz-ink-tertiary); font-size: var(--qz-font-size-14); font-weight:600; letter-spacing: .04em; }
.qz-command-result { display: grid; min-height: 3.5rem; padding: .5rem .625rem; grid-template-columns: 2rem minmax(0, 1fr); align-items: center; gap: .75rem; border-radius: .5rem; }
.qz-command-result:hover { background: var(--qz-surface-muted); }
.qz-command-result-mark { display: grid; width: 2rem; height: 2rem; place-items: center; border-radius: .5rem; background: var(--qz-accent-soft); color: var(--qz-accent); font-size: var(--qz-font-size-14); font-weight:600; }
.qz-command-result-copy { min-width: 0; }
.qz-command-result-copy strong,
.qz-command-result-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qz-command-result-copy strong { font-size: var(--qz-font-size-14); font-weight:600; }
.qz-command-result-copy span { color: var(--qz-ink-tertiary); font-size: var(--qz-font-size-14); }
.qz-command-all { display: flex; min-height: 2.75rem; margin-top: .5rem; align-items: center; justify-content: center; border-top: var(--qz-stroke) solid var(--qz-line); color: var(--qz-accent); font-size: var(--qz-font-size-14); font-weight:600; }

@keyframes qz-panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* Buttons and controls */
.qz-button {
  display: inline-flex;
  min-height: var(--qz-control);
  padding: 0 1rem;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border: var(--qz-stroke) solid transparent;
  border-radius: var(--qz-radius-control);
  background: var(--qz-surface-muted);
  color: var(--qz-ink);
  cursor: pointer;
  font-size: var(--qz-font-size-14);
  font-weight:600;
  line-height: 1;
  white-space: nowrap;
  transition: background-color var(--qz-duration-fast) ease, border-color var(--qz-duration-fast) ease, color var(--qz-duration-fast) ease, transform var(--qz-duration-fast) ease;
}

.qz-button:hover { background: var(--qz-surface-strong); }
.qz-button:active { transform: scale(.98); }
.qz-button.is-primary { background: var(--qz-accent); color: #f8fbff; }
.qz-button.is-primary:hover { background: var(--qz-accent-hover); }
html.dark .qz-button.is-primary, html[data-theme="dark"] .qz-button.is-primary { color: #111318; }
.qz-button.is-quiet { border-color: var(--qz-line); background: var(--qz-surface); }
.qz-button:disabled,
.qz-button[aria-disabled="true"] { opacity: .46; cursor: not-allowed; transform: none; }

.qz-field {
  width: 100%;
  min-height: var(--qz-control);
  padding: .625rem .875rem;
  border: var(--qz-stroke) solid var(--qz-line);
  border-radius: var(--qz-radius-control);
  outline: 0;
  background: var(--qz-surface);
  color: var(--qz-ink);
  transition: border-color var(--qz-duration-fast) ease, box-shadow var(--qz-duration-fast) ease;
}

.qz-field::placeholder { color: var(--qz-ink-tertiary); }
.qz-field:focus { border-color: color-mix(in srgb, var(--qz-accent) 52%, var(--qz-line-strong)); box-shadow: 0 7px 20px rgba(40, 47, 58, .07), inset 0 0 0 .5px color-mix(in srgb, var(--qz-accent) 22%, transparent); }

.qz-chip {
  display: inline-flex;
  min-height: 2.25rem;
  padding-inline: .875rem;
  align-items: center;
  justify-content: center;
  border: var(--qz-stroke) solid transparent;
  border-radius: var(--qz-radius-pill);
  background: var(--qz-surface-muted);
  color: var(--qz-ink-secondary);
  cursor: pointer;
  font-size: var(--qz-font-size-14);
  font-weight:600;
  white-space: nowrap;
}

.qz-chip:hover { color: var(--qz-ink); }
.qz-chip[aria-pressed="true"],
.qz-chip.is-active { border-color: color-mix(in srgb, var(--qz-accent) 30%, transparent); background: var(--qz-accent-soft); color: var(--qz-accent); }

/* Surfaces. Use these only when the boundary explains hierarchy. */
.qz-surface {
  border: var(--qz-stroke) solid var(--qz-line);
  border-radius: var(--qz-radius-surface);
  background: var(--qz-surface);
}

.qz-list { margin: 0; padding: 0; list-style: none; }
.qz-list > * { padding-block: var(--qz-space-4); }
.qz-list > * + * { border-top: var(--qz-stroke) solid var(--qz-line); }

.qz-toolbar {
  display: flex;
  min-height: var(--qz-control);
  align-items: center;
  justify-content: space-between;
  gap: var(--qz-space-3);
}

.qz-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--qz-space-3); }
.qz-stack { display: grid; gap: var(--qz-space-6); }
.qz-muted { color: var(--qz-ink-secondary); }
.qz-hairline { border: 0; border-top: var(--qz-stroke) solid var(--qz-line); }
.qz-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

@media (max-width: 900px) {
  :root { --qz-nav-height: 3.5rem; --qz-header-height: 3.75rem; --qz-gutter: 1rem; }

  .qz-layout { grid-template-columns: minmax(0, 1fr); gap: var(--qz-space-12); }
  .qz-stage { min-height: auto; padding-block: var(--qz-space-16); }
  .qz-section { padding-block: var(--qz-space-16); }
  .qz-hero { padding-block: var(--qz-space-16); }
  .qz-section-head h1,
  .qz-hero h1 { max-width: 13ch; }

  .qz-nav-links,
  .nav-links,
  .gn-links { display: none; }

  .qz-nav-actions,
  .nav-actions,
  .gn-r { margin-left: auto; }

  .qz-header-inner { width: calc(100% - 2.5rem); gap: 1.25rem; }
  .qz-primary-nav { display: none; }
  .qz-current-label { display: flex; flex: 1 1 auto; align-items: center; gap: .625rem; font-weight:600; }
  .qz-header-actions { flex: 0 0 auto; }
  .qz-current-label::before { width: 1px; height: 1rem; flex: 0 0 auto; background: var(--qz-line-strong); content: ""; }
  .qz-command-trigger { width: 2.75rem; min-width: 2.75rem; padding: 0; }
  .qz-command-trigger kbd { display: none; }
  .qz-command-trigger .qz-action-label { display: none; }
  .qz-mobile-trigger { display: inline-grid; }
  .qz-category-panel { display: none !important; }

  .menu-button { display: grid; }
  .gn-catalog-mobile { display: grid; }
  .qz-toolbar { align-items: stretch; flex-direction: column; }
  .qz-hero-actions > * { flex: 1 1 auto; }
}

@media (min-width: 901px) {
  .menu-button,
  #menuToggle,
  [data-qz-menu-toggle] { display: none; }
  .qz-mobile-menu,
  .mobile-menu { display: none !important; }
  .qz-mobile-trigger { display: none; }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .qz-module-link { padding-inline: .625rem; }
  .qz-header-brand-copy small { display: none; }
}

@media (max-width: 480px) {
  .qz-brand small,
  .brand small { display: none; }
  .qz-brand,
  .brand { font-size: var(--qz-font-size-14); }
  .qz-brand-mark,
  .brand .leaf,
  .gn .leaf { width: 1.5rem; height: 1.5rem; }
  .qz-header-inner { width: calc(100% - 1.5rem); gap: .25rem; }
  .qz-header-leaf { width: 1.5rem; height: 1.5rem; }
  .qz-header-brand { gap: .375rem; }
  .qz-header-brand-copy small { display: none; }
  .qz-header-brand-copy strong { font-size: var(--qz-font-size-14); }
  .qz-current-label { gap: .375rem; }
  .qz-favorites-action { display: none; }
  .qz-theme-action { display: none; }
  .qz-mobile-menu { right: .75rem; width: calc(100vw - 1.5rem); }
  .qz-mobile-category-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .qz-theme-action { display: none; }
  .qz-current-label { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .qz-header { background: var(--qz-canvas); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { scroll-behavior: auto !important; animation: none !important; transition-duration: 160ms !important; transition-delay: 0ms !important; }
  .qz-category-panel,
  .qz-mobile-menu,
  .qz-command-panel,
  .qz-header-leaf,
  .qz-module-link,
  .qz-header-action,
  .qz-command-close,
  .qz-button { transform: none !important; }
}

@media (prefers-contrast: more) {
  :root { --qz-line: rgba(23, 25, 29, .28); --qz-line-strong: rgba(23, 25, 29, .46); }
  html.dark,
  html[data-theme="dark"] { --qz-line: rgba(241, 243, 246, .3); --qz-line-strong: rgba(241, 243, 246, .5); }
}


.qz-lang-action { font-size:var(--qz-font-size-14); font-weight:600; letter-spacing: .02em; min-width: 2.75rem; }
.qz-lang-action:hover { background: var(--qz-surface-muted); color: var(--qz-ink); }
@media (max-width: 900px) { .qz-lang-action { font-size:var(--qz-font-size-14); } }
/* Visible favorites label is shared by every header consumer. */
.qz-header .qz-favorites-action { display:flex; flex-direction:row; width:auto; min-width:2.75rem; padding-inline:8px; gap:6px; }
.qz-favorites-text { font-size:var(--qz-font-size-14); white-space:nowrap; }
@media(max-width:1100px){.qz-favorites-text{display:none;}}
@media(max-width:480px){.qz-header .qz-favorites-action{display:none;}}

/* Shared typography contract: one UI family, readable labels and stable controls. */
body :where(button,input,select,textarea) { font-family:var(--qz-font-sans); }
body :where(button,select) { line-height:1.5; }
.qz-header :is(.qz-module-link,.qz-header-action,.qz-category-link,.qz-mobile-module) { font-size:var(--qz-font-size-14); font-weight:400; letter-spacing:0; }
.qz-header [aria-current="page"],.qz-header-brand-copy strong { font-weight:600; }
.qz-header .qz-module-link { padding-inline:12px; }
.qz-header .qz-category-count { font-size:var(--qz-font-size-14); }
.qz-header .qz-header-brand-copy strong { font-size:var(--qz-font-size-16); }

/* Learning routes are visible together without duplicating the main navigation. */
.qz-learning-nav {display:flex;align-items:center;gap:8px;margin:0 0 28px;padding-bottom:12px;border-bottom:1px solid var(--qz-line)}
.qz-learning-nav a {display:inline-flex;align-items:center;min-height:44px;padding:8px 14px;color:var(--qz-ink-secondary);border-radius:8px;font-size:14px;text-decoration:none}
.qz-learning-nav a:hover {color:var(--qz-accent);background:var(--qz-accent-soft)}
.qz-learning-nav a[aria-current="page"] {color:var(--qz-accent);background:var(--qz-accent-soft);font-weight:600}

/* Keep the complete module navigation on one line in compact desktop windows. */
@media (min-width:901px) and (max-width:1200px){.qz-header-inner{gap:1rem}.qz-header-brand{flex:0 0 auto;white-space:nowrap}}
/* Longer English labels use the existing menu in compact desktop windows. */
@media (min-width:901px) and (max-width:1200px){
  html[lang="en"] .qz-primary-nav{display:none}
  html[lang="en"] .qz-mobile-trigger{display:inline-grid}
  html[lang="en"] .qz-mobile-menu:not([hidden]){display:block!important}
  html[lang="en"] .qz-current-label{display:flex;flex:1 1 auto;align-items:center;font-weight:600}
  html[lang="en"] .qz-category-panel{display:none!important}
}
