/* Zapt Docs — home chrome (top bar + sidebar) */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@500&display=swap");
@import url("ui.css");

:root {
  --chrome-topbar-height: 56px;
  --chrome-sidebar-width: 88px;
  --chrome-font: "Plus Jakarta Sans", "Segoe UI", sans-serif;

  --chrome-bg: #f4f5f7;
  --chrome-surface: #ffffff;
  --chrome-sidebar-bg: #fafafa;
  --chrome-sidebar-border: #e5e7eb;
  --chrome-border: #e6e8ee;
  --chrome-text: #1a1d26;
  --chrome-text-muted: #6b7280;
  --chrome-accent: #4f6ef7;
  --chrome-accent-soft: #e8ecfe;
  --chrome-icon-muted: #8b93a7;
  --chrome-hover: #e8eaef;
  --chrome-focus-ring: rgba(79, 110, 247, 0.35);
  --chrome-nav-muted: #6b7b8d;
  --chrome-nav-active-bg: #d9e3ff;
  --chrome-nav-active-fg: #0757c8;
  --chrome-scrollbar: #c5cbd6;
  --chrome-scrollbar-hover: #9aa3b2;
  color-scheme: light;

  /* Spacing: 2, 4, 6, 8, 12, 16, 20, 24, then multiples of 8 */
  --space-2: 2px;
  --space-4: 4px;
  --space-6: 6px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
}

html[data-theme="dark"] {
  --chrome-bg: #12141a;
  --chrome-surface: #1a1d26;
  --chrome-sidebar-bg: #161b22;
  --chrome-sidebar-border: #30363d;
  --chrome-border: #2a2e3a;
  --chrome-text: #f3f4f6;
  --chrome-text-muted: #9ca3af;
  --chrome-accent: #7b93ff;
  --chrome-accent-soft: #2a3358;
  --chrome-icon-muted: #8b93a7;
  --chrome-hover: #252833;
  --chrome-focus-ring: rgba(123, 147, 255, 0.4);
  --chrome-nav-muted: #8b949e;
  --chrome-nav-active-bg: #1b67d0;
  --chrome-nav-active-fg: #ffffff;
  --chrome-scrollbar: rgba(255, 255, 255, 0.14);
  --chrome-scrollbar-hover: rgba(255, 255, 255, 0.24);
  color-scheme: dark;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--chrome-scrollbar) transparent;
}

*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: var(--chrome-scrollbar);
  border-radius: 8px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--chrome-scrollbar-hover);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

body.chrome-body {
  font-family: var(--chrome-font);
  background: var(--chrome-bg);
  color: var(--chrome-text);
  -webkit-font-smoothing: antialiased;
}

.chrome-topbar {
  view-transition-name: zapt-topbar;
}

.chrome-sidebar {
  view-transition-name: zapt-sidebar;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.12s;
  animation-timing-function: ease-out;
}

/* —— Top bar —— */
.chrome-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--chrome-topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 0 0;
  background: var(--chrome-surface);
  border-bottom: 1px solid var(--chrome-border);
}

.chrome-topbar__left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.chrome-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 12px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--chrome-text-muted);
  cursor: pointer;
  flex-shrink: 0;
}

.chrome-menu-toggle:hover {
  background: var(--chrome-hover);
  color: var(--chrome-text);
}

.chrome-menu-toggle:focus-visible {
  outline: 2px solid var(--chrome-focus-ring);
  outline-offset: 2px;
}

.chrome-menu-toggle__bars,
.chrome-menu-toggle__bars::before,
.chrome-menu-toggle__bars::after {
  display: block;
  width: 16px;
  height: 1.5px;
  border-radius: 1px;
  background: currentColor;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.chrome-menu-toggle__bars {
  position: relative;
}

.chrome-menu-toggle__bars::before,
.chrome-menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.chrome-menu-toggle__bars::before {
  top: -5px;
}

.chrome-menu-toggle__bars::after {
  top: 5px;
}

body.is-chrome-nav-open .chrome-menu-toggle__bars,
body.is-docs-nav-open .chrome-menu-toggle__bars {
  background: transparent;
}

body.is-chrome-nav-open .chrome-menu-toggle__bars::before,
body.is-docs-nav-open .chrome-menu-toggle__bars::before {
  top: 0;
  transform: rotate(45deg);
}

body.is-chrome-nav-open .chrome-menu-toggle__bars::after,
body.is-docs-nav-open .chrome-menu-toggle__bars::after {
  top: 0;
  transform: rotate(-45deg);
}

.chrome-sidebar__header,
.chrome-sidebar__footer {
  display: none;
}

.chrome-drawer__close {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 44px;
  height: var(--chrome-topbar-height);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--chrome-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.chrome-drawer__close:hover {
  background: var(--chrome-hover);
  color: var(--chrome-text);
}

.chrome-drawer__close:focus-visible {
  outline: 2px solid var(--chrome-focus-ring);
  outline-offset: 2px;
}

.chrome-drawer__close-icon {
  position: relative;
  display: block;
  width: 18px;
  height: 18px;
}

.chrome-drawer__close-icon::before,
.chrome-drawer__close-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 2px;
  margin-left: -9px;
  margin-top: -1px;
  border-radius: 1px;
  background: currentColor;
}

.chrome-drawer__close-icon::before {
  transform: rotate(45deg);
}

.chrome-drawer__close-icon::after {
  transform: rotate(-45deg);
}

.chrome-nav-backdrop {
  display: none;
}

.chrome-topbar__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--chrome-sidebar-width);
  height: var(--chrome-topbar-height);
  flex-shrink: 0;
  text-decoration: none;
}

.chrome-topbar__logo img {
  width: 32px;
  height: 32px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

.chrome-topbar__logo img.chrome-topbar__logo-img--dark {
  display: none;
}

html[data-theme="dark"] .chrome-topbar__logo img.chrome-topbar__logo-img--light {
  display: none;
}

html[data-theme="dark"] .chrome-topbar__logo img.chrome-topbar__logo-img--dark {
  display: block;
}

.chrome-topbar__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--chrome-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chrome-topbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  height: 32px;
}

.chrome-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  color: var(--chrome-text-muted);
  transition: background 0.15s ease;
}

.chrome-theme-toggle:hover {
  background: var(--chrome-hover);
}

.chrome-theme-toggle:focus-visible {
  outline: 2px solid var(--chrome-focus-ring);
  outline-offset: 2px;
}

.chrome-theme-toggle img {
  width: 16px;
  height: 16px;
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

html[data-theme="dark"] .chrome-theme-toggle {
  background: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .chrome-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.16);
}

html[data-theme="dark"] .chrome-theme-toggle img,
html[data-theme="dark"] #theme-toggle-icon {
  filter: brightness(0) invert(1);
}

/* —— Sidebar —— */
.chrome-sidebar {
  position: fixed;
  top: var(--chrome-topbar-height);
  left: 0;
  bottom: 0;
  z-index: 90;
  width: var(--chrome-sidebar-width);
  background: var(--chrome-sidebar-bg);
  border-right: 1px solid var(--chrome-sidebar-border);
  padding: 16px 6px;
  overflow-y: auto;
  overflow-x: hidden;
}

.chrome-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chrome-nav > li {
  width: 100%;
  display: flex;
  justify-content: center;
}

.chrome-nav > li[hidden] {
  display: none;
}

.chrome-nav__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  height: 72px;
  padding: 6px 4px 4px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--chrome-nav-muted);
  transition: background 0.15s ease, color 0.15s ease;
}

.chrome-nav__link:hover {
  background: var(--chrome-hover);
  color: var(--chrome-text);
}

.chrome-nav__link:focus-visible {
  outline: 2px solid var(--chrome-focus-ring);
  outline-offset: 2px;
}

.chrome-nav__icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  display: block;
  background-color: currentColor;
  -webkit-mask: var(--chrome-nav-icon) center / 24px 24px no-repeat;
  mask: var(--chrome-nav-icon) center / 24px 24px no-repeat;
}

.chrome-nav__icon--home {
  --chrome-nav-icon: url("../assets/icons/nav-home.svg");
}

.chrome-nav__icon--products {
  --chrome-nav-icon: url("../assets/icons/nav-products.svg");
}

.chrome-nav__icon--updates {
  --chrome-nav-icon: url("../assets/icons/nav-updates.svg");
}

.chrome-nav__icon--dev {
  --chrome-nav-icon: url("../assets/icons/nav-dev.svg");
}

.chrome-nav__icon--internal {
  --chrome-nav-icon: url("../assets/icons/nav-internal.svg");
}

.chrome-nav__label {
  font-family: Inter, var(--chrome-font);
  font-size: 9px;
  font-weight: 500;
  line-height: 12px;
  text-align: center;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chrome-nav__link.is-active {
  background: var(--chrome-nav-active-bg);
  color: var(--chrome-nav-active-fg);
}

.chrome-nav__link.is-active:hover {
  background: var(--chrome-nav-active-bg);
  color: var(--chrome-nav-active-fg);
}

/* —— Main —— */
.chrome-main {
  margin-left: var(--chrome-sidebar-width);
  margin-top: var(--chrome-topbar-height);
  min-height: calc(100vh - var(--chrome-topbar-height));
  background: var(--chrome-bg);
}

/* —— Home hero banner —— */
.home-hero {
  --hero-gradient: linear-gradient(
    105deg,
    #f7ebe8 0%,
    #f3eef6 42%,
    #e8eef8 100%
  );
  background: var(--hero-gradient);
  padding: 32px 32px 40px;
  position: relative;
  overflow: hidden;
}

html[data-theme="dark"] .home-hero {
  --hero-gradient: linear-gradient(
    105deg,
    #0a0c12 0%,
    #141824 42%,
    #1c2234 78%,
    #12141a 100%
  );
  background: var(--hero-gradient);
}

html[data-theme="dark"] .home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 62% 92% at 78% 48%, rgba(79, 110, 247, 0.2), transparent 64%),
    radial-gradient(ellipse 46% 72% at 54% 88%, rgba(180, 96, 72, 0.1), transparent 58%);
}

.home-hero__inner {
  display: flex;
  align-items: center;
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.home-hero__copy {
  flex: 0 1 34%;
  min-width: 220px;
  max-width: 380px;
  position: relative;
  z-index: 2;
}

.home-hero__title {
  margin: 0 0 16px;
  font-size: clamp(1.45rem, 2.1vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  color: #1a2744;
}

html[data-theme="dark"] .home-hero__title {
  color: #ffffff;
}

.home-hero__description {
  margin: 0;
  font-size: clamp(0.9rem, 1.05vw, 1rem);
  font-weight: 400;
  line-height: 1.55;
  color: #6b7280;
}

html[data-theme="dark"] .home-hero__description {
  color: #9ca3af;
}

.home-hero__visual {
  flex: 1 1 60%;
  min-width: 0;
}

.home-hero__mosaic {
  display: flex;
  gap: 10px;
  height: 260px;
}

.home-hero__col {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  height: 100%;
}

.home-hero__tile {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  flex-shrink: 0;
}

.home-hero__tile--grow {
  flex: 1 1 0;
  min-height: 0;
}

.home-hero__tile--sm {
  height: 80px;
}

.home-hero__tile--xs {
  height: 70px;
}

.home-hero__tile img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.home-hero__tile img.home-hero__tile-img--dark {
  display: none;
}

html[data-theme="dark"] .home-hero__tile img.home-hero__tile-img--light {
  display: none;
}

html[data-theme="dark"] .home-hero__tile img.home-hero__tile-img--dark {
  display: block;
}

/* —— Home shortcut cards —— */
.home-shortcuts {
  padding: 24px 32px 20px;
  background: var(--chrome-bg);
}

.home-shortcuts__inner {
  max-width: 1280px;
  margin: 0 auto;
}

.home-shortcuts__title {
  margin: 0 0 12px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--chrome-text-muted);
}

.home-shortcuts__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.home-shortcut {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--chrome-border);
  border-radius: 12px;
  background: var(--chrome-surface);
  box-shadow: var(--ui-shadow);
  color: inherit;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.home-shortcut:hover {
  background: var(--chrome-hover);
  border-color: color-mix(in srgb, var(--chrome-accent) 28%, var(--chrome-border));
}

.home-shortcut:focus-visible {
  outline: 2px solid var(--chrome-focus-ring);
  outline-offset: 2px;
}

.home-shortcut[hidden] {
  display: none;
}

.home-shortcut__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--chrome-accent);
  -webkit-mask-size: 20px 20px;
  mask-size: 20px 20px;
}

.home-shortcut__text {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.home-shortcut__label {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--chrome-text);
}

.home-shortcut__desc {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.35;
  color: var(--chrome-text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.home-shortcut__chevron {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.45;
}

html[data-theme="dark"] .home-shortcut__chevron {
  filter: invert(1);
}

/* —— Home updates —— */
.home-updates {
  padding: 8px 32px 48px;
  background: var(--chrome-bg);
}

.home-updates__inner {
  max-width: 1280px;
  margin: 0 auto;
}

.home-updates__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
}

.home-updates__title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--chrome-text);
}

.home-updates__all {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--chrome-accent);
  text-decoration: none;
  white-space: nowrap;
}

.home-updates__all:hover {
  text-decoration: underline;
}

.home-updates__cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.home-card {
  background: var(--chrome-surface);
  border: 1px solid var(--chrome-border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.home-card__media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: #1a1d26;
  overflow: hidden;
}

.home-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-card__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #1a1d26;
  font-size: 11px;
  font-weight: 600;
}

html[data-theme="dark"] .home-card__tag {
  background: rgba(26, 29, 38, 0.92);
  color: #f3f4f6;
}

.home-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.home-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.home-card__title a {
  color: var(--chrome-text);
  text-decoration: none;
}

.home-card__title a:hover {
  color: var(--chrome-accent);
}

.home-card__summary {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--chrome-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.home-card__footer {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.home-card__author {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.home-card__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.85), transparent 58%),
    var(--chrome-accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chrome-accent) 22%, transparent);
}

html[data-theme="dark"] .home-card__avatar {
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.16), transparent 58%),
    var(--chrome-accent-soft);
}

.home-card__avatar img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.home-card__avatar img.home-card__avatar-img--dark {
  display: none;
}

html[data-theme="dark"] .home-card__avatar img.home-card__avatar-img--light {
  display: none;
}

html[data-theme="dark"] .home-card__avatar img.home-card__avatar-img--dark {
  display: block;
}

.home-card__author-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--chrome-text);
}

.home-card__meta {
  font-size: 11px;
  color: var(--chrome-text-muted);
}

.home-card__more {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--chrome-accent);
  text-decoration: none;
  white-space: nowrap;
}

.home-card__more:hover {
  text-decoration: underline;
}

@media (max-width: 1100px) {
  .home-shortcuts__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-updates__cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .home-hero {
    padding: 24px 20px 24px;
  }

  .home-shortcuts {
    padding: 20px 20px 16px;
  }

  .home-hero__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 20px;
  }

  .home-hero__copy {
    flex: none;
    max-width: none;
  }

  .home-hero__mosaic {
    height: 200px;
  }

  .home-updates {
    padding: 16px 20px 32px;
  }
}

@media (max-width: 520px) {
  .home-shortcuts__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  :root {
    --chrome-sidebar-width: 0px;
    --chrome-drawer-width: min(280px, 86vw);
  }

  .chrome-menu-toggle {
    display: inline-flex;
  }

  body.is-chrome-nav-open .chrome-menu-toggle__bars,
  body.is-docs-nav-open .chrome-menu-toggle__bars {
    background: currentColor;
  }

  body.is-chrome-nav-open .chrome-menu-toggle__bars::before,
  body.is-docs-nav-open .chrome-menu-toggle__bars::before {
    top: -6px;
    transform: none;
  }

  body.is-chrome-nav-open .chrome-menu-toggle__bars::after,
  body.is-docs-nav-open .chrome-menu-toggle__bars::after {
    top: 6px;
    transform: none;
  }

  .chrome-topbar {
    padding: 0 12px;
  }

  .chrome-topbar__logo {
    display: none;
  }

  .chrome-topbar .chrome-auth {
    display: none;
  }

  .chrome-topbar__title {
    font-size: 14px;
  }

  .chrome-drawer__close {
    display: inline-flex;
  }

  .chrome-sidebar {
    z-index: 130;
    top: 0;
    bottom: 0;
    width: var(--chrome-drawer-width);
    height: 100vh;
    height: 100dvh;
    padding: 0;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    overflow: hidden;
    background: var(--chrome-sidebar-bg);
    display: flex;
    flex-direction: column;
  }

  body.is-chrome-nav-open .chrome-sidebar {
    transform: translateX(0);
  }

  .chrome-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    gap: 8px;
    height: var(--chrome-topbar-height);
    padding: 0 4px 0 16px;
    border-bottom: 1px solid var(--chrome-sidebar-border);
    background: var(--chrome-sidebar-bg);
  }

  .chrome-sidebar__logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: auto;
    height: auto;
    flex: 1;
    min-width: 0;
    text-decoration: none;
  }

  .chrome-sidebar__logo img {
    width: 32px;
    height: 32px;
  }

  .chrome-sidebar__logo img.chrome-topbar__logo-img--dark {
    display: none;
  }

  html[data-theme="dark"] .chrome-sidebar__logo img.chrome-topbar__logo-img--light {
    display: none;
  }

  html[data-theme="dark"] .chrome-sidebar__logo img.chrome-topbar__logo-img--dark {
    display: block;
  }

  .chrome-sidebar > nav {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px 12px;
  }

  .chrome-sidebar__footer {
    display: block;
    flex-shrink: 0;
    padding: 12px 16px 16px;
    border-top: 1px solid var(--chrome-sidebar-border);
    background: var(--chrome-sidebar-bg);
  }

  .chrome-sidebar .chrome-auth {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 0;
  }

  .chrome-sidebar .chrome-auth--drawer {
    gap: 10px;
  }

  .chrome-sidebar .chrome-auth__drawer-email {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--chrome-text);
    word-break: break-all;
  }

  .chrome-sidebar .chrome-auth__login,
  .chrome-sidebar .chrome-auth__logout {
    width: 100%;
  }

  .chrome-nav {
    align-items: stretch;
    gap: 4px;
  }

  .chrome-nav > li {
    justify-content: stretch;
  }

  .chrome-nav__link {
    flex-direction: row;
    justify-content: flex-start;
    height: 44px;
    padding: 8px 12px;
    gap: 12px;
  }

  .chrome-nav__label {
    font-size: 14px;
    line-height: 20px;
    text-align: left;
    white-space: nowrap;
  }

  .chrome-main {
    margin-left: 0;
  }

  .chrome-nav-backdrop {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 125;
    background: rgba(17, 24, 39, 0.4);
  }

  body.is-chrome-nav-open .chrome-nav-backdrop,
  body.is-docs-nav-open .chrome-nav-backdrop {
    display: block;
  }

  body.is-chrome-nav-open,
  body.is-docs-nav-open {
    overflow: hidden;
  }
}

@media (max-width: 640px) {
  .home-hero {
    padding: 20px 16px 24px;
  }

  .home-hero__title {
    font-size: 1.35rem;
  }

  .home-hero__mosaic {
    height: 168px;
    gap: 8px;
  }

  .home-hero__col {
    gap: 8px;
  }

  .home-hero__tile {
    border-radius: 12px;
  }

  .home-hero__tile--sm {
    height: 64px;
  }

  .home-hero__tile--xs {
    height: 56px;
  }

  .home-updates {
    padding: 20px 16px 32px;
  }

  .home-updates__cards {
    grid-template-columns: 1fr;
  }
}

/* —— Auth lock —— */
body.is-auth-locked .chrome-sidebar,
body.is-auth-locked .chrome-main,
body.is-auth-locked .docs-shell {
  display: none;
}

body.is-auth-locked .chrome-topbar {
  display: none;
}

/* —— Topbar auth widget —— */
.chrome-auth {
  display: flex;
  align-items: center;
  margin-right: 8px;
}

.chrome-auth__login {
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--chrome-border);
  border-radius: 8px;
  background: transparent;
  color: var(--chrome-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.chrome-auth__login:hover {
  background: var(--chrome-hover);
}

.chrome-auth__menu {
  position: relative;
}

.chrome-auth__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
  min-height: 32px;
  padding: 4px 8px 4px 4px;
  border: 1px solid var(--chrome-border);
  border-radius: 999px;
  background: var(--chrome-surface);
  color: var(--chrome-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.chrome-auth__trigger:hover {
  background: var(--chrome-hover);
}

.chrome-auth__avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  color: var(--chrome-accent);
  background: var(--chrome-accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chrome-accent) 25%, transparent);
}

.chrome-auth__avatar-icon {
  display: block;
}

.chrome-auth__email {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chrome-auth__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 150;
  min-width: 220px;
  padding: 12px;
  border: 1px solid var(--chrome-border);
  border-radius: 12px;
  background: var(--chrome-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

html[data-theme="dark"] .chrome-auth__panel {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.chrome-auth__panel-name {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--chrome-text);
}

.chrome-auth__panel-email {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--chrome-text-muted);
  word-break: break-all;
}

.chrome-auth__logout {
  width: 100%;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--chrome-border);
  border-radius: 8px;
  background: transparent;
  color: var(--chrome-text);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.chrome-auth__logout:hover {
  background: var(--chrome-hover);
}

/* —— Login screen —— */
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  background: var(--chrome-bg);
  overflow: hidden;
}

.login-screen[hidden] {
  display: none !important;
}

.login-screen__hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  overflow: hidden;
  background: #0b1220;
}

.login-screen__hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(79, 110, 247, 0.35), transparent 45%),
    radial-gradient(circle at 80% 70%, rgba(7, 87, 200, 0.25), transparent 40%),
    linear-gradient(145deg, #0b1220 0%, #111827 55%, #0f172a 100%);
}

.login-screen__vectors {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.35;
  pointer-events: none;
}

.login-screen__glow {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(600px, 80%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.login-screen__glow img {
  width: 100%;
  height: auto;
  display: block;
}

.login-screen__headline {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  max-width: 420px;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #ffffff;
  text-align: center;
}

.login-screen__headline span {
  display: block;
  white-space: nowrap;
}

.login-screen__panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--chrome-surface);
  border-left: 1px solid var(--chrome-border);
}

.login-screen__toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 0;
}

.login-screen__stack {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 80px;
  padding: 24px 40px 48px;
}

.login-screen__logo-wrap {
  display: flex;
  justify-content: flex-start;
}

.login-screen__logo {
  width: min(203px, 70%);
  height: auto;
  display: block;
}

.login-screen__logo--dark {
  display: none;
}

html[data-theme="dark"] .login-screen__logo--light {
  display: none;
}

html[data-theme="dark"] .login-screen__logo--dark {
  display: block;
}

.login-screen__content {
  width: 100%;
  max-width: 360px;
  margin: 0;
}

.login-screen__header {
  margin-bottom: 24px;
}

.login-screen__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--chrome-text);
}

.login-screen__lead {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--chrome-text-muted);
}

.login-screen__form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-screen__fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-screen__field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.login-screen__forgot {
  font-size: 12px;
  font-weight: 500;
  color: var(--chrome-accent);
  text-decoration: none;
  white-space: nowrap;
}

.login-screen__forgot:hover {
  text-decoration: underline;
}

.login-screen__alert[hidden] {
  display: none;
}

@media (max-width: 900px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-screen__hero {
    display: none;
  }

  .login-screen__panel {
    border-left: none;
  }

  .login-screen__stack {
    padding: 24px 24px 40px;
  }
}
