html[data-doc-theme="light"] {
  --bg-primary: #f3f4f2;
  --bg-secondary: #e8eae7;
  --bg-card: #ffffff;
  --bg-elevated: #f6f7f5;
  --text-primary: #171a1b;
  --text-secondary: #555d60;
  --text-muted: #788184;
  --border-color: #d3d8d6;
  --border-light: #bbc2bf;
  --accent-orange: #be5d17;
  --accent-orange-hover: #a94d0e;
  --accent-red: #c21e22;
}

.docs-app {
  --docs-sidebar-width: 248px;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.docs-app [hidden] {
  display: none !important;
}

.docs-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 1100;
  display: flex;
  width: var(--docs-sidebar-width);
  flex-direction: column;
  padding: 1.15rem 0.8rem 0.75rem;
  border-right: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.docs-sidebar-brand,
.docs-brand-link,
.docs-theme-button,
.docs-topbar,
.docs-top-nav,
.docs-top-actions,
.docs-top-identity,
.docs-sidebar-bottom {
  display: flex;
  align-items: center;
}

.docs-sidebar-brand {
  justify-content: space-between;
  gap: 0.5rem;
  min-height: 40px;
  margin-bottom: 1rem;
}

.docs-brand-link {
  min-width: 0;
  gap: 0.65rem;
  font: 700 calc(1rem + 2px) var(--font-heading);
}

.docs-brand-link > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-brand-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-primary);
  object-fit: cover;
}

.docs-theme-button {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius-subtle);
  color: var(--text-secondary);
  font-size: calc(1.2rem + 2px);
  transition: var(--transition);
}

.docs-theme-button:hover {
  border-color: var(--border-color);
  background: var(--bg-elevated);
  color: var(--accent-orange);
}

.docs-theme-light-icon,
html[data-doc-theme="light"] .docs-theme-dark-icon {
  display: none;
}

html[data-doc-theme="light"] .docs-theme-light-icon {
  display: inline;
}

.docs-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 40px;
  padding: 0 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background: var(--bg-primary);
  color: var(--text-muted);
}

.docs-search > span {
  font-size: calc(1.15rem + 2px);
}

.docs-search input {
  width: 100%;
  min-width: 0;
  color: var(--text-primary);
  font-size: calc(0.72rem + 2px);
}

.docs-search input::placeholder {
  color: var(--text-muted);
}

.docs-search kbd {
  flex: 0 0 auto;
  padding: 0.08rem 0.3rem;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-muted);
  font: calc(0.62rem + 2px) var(--font-mono);
}

.docs-search-empty {
  padding: 0.7rem 0.6rem;
  color: var(--text-muted);
  font-size: calc(0.7rem + 2px);
}

.docs-side-nav {
  display: grid;
  align-content: start;
  gap: 0.2rem;
  margin-top: 1rem;
  overflow-y: auto;
}

.docs-nav-label {
  margin: 0.85rem 0 0.25rem;
  padding: 0 0.6rem;
  color: var(--text-muted);
  font: 600 calc(0.62rem + 2px) var(--font-mono);
  letter-spacing: 0.08em;
}

.docs-nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0.55rem 0.65rem;
  border-radius: 5px;
  color: var(--text-secondary);
  font-size: calc(0.78rem + 2px);
  transition: var(--transition);
}

.docs-nav-link > span {
  width: 18px;
  color: var(--text-muted);
  font-size: calc(0.95rem + 2px);
  text-align: center;
}

.docs-nav-link:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.docs-nav-link.active {
  background: color-mix(in srgb, var(--accent-orange) 12%, var(--bg-elevated));
  color: var(--accent-orange);
  font-weight: 600;
}

.docs-nav-link.active > span {
  color: var(--accent-orange);
}

.docs-sidebar-bottom {
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 42px;
  margin-top: auto;
  padding: 0.75rem 0.3rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font: 600 calc(0.6rem + 2px) var(--font-mono);
}

.docs-sidebar-bottom a {
  margin-left: auto;
  color: var(--text-secondary);
  font: calc(0.7rem + 2px) var(--font-body);
}

.docs-sidebar-bottom a:hover {
  color: var(--accent-orange);
}

.docs-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
}

.docs-status-dot.is-online {
  background: var(--accent-orange);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-orange) 14%, transparent);
}

.docs-main {
  min-height: 100vh;
  margin-left: var(--docs-sidebar-width);
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 2rem;
  border-bottom: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--bg-primary) 94%, transparent);
  backdrop-filter: blur(12px);
}

.docs-top-nav {
  align-self: stretch;
  gap: 1.3rem;
}

.docs-top-nav a {
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: calc(0.72rem + 2px);
}

.docs-top-nav a:hover,
.docs-top-nav a.is-current {
  color: var(--text-primary);
}

.docs-top-nav a.is-current {
  border-bottom-color: var(--accent-orange);
}

.docs-top-actions {
  gap: 0.85rem;
}

.docs-top-identity {
  min-width: 0;
  gap: 0.45rem;
  color: var(--text-secondary);
  font-size: calc(0.7rem + 2px);
}

.docs-top-identity img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  object-fit: cover;
}

.docs-top-identity span {
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-dashboard-button {
  min-height: 34px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font: 600 calc(0.62rem + 2px) var(--font-mono);
  letter-spacing: 0.04em;
}

.docs-dashboard-button:hover {
  border-color: var(--accent-orange);
  color: var(--accent-orange);
}

.docs-dashboard-button span {
  margin-left: 0.25rem;
  color: var(--accent-orange);
}

.docs-menu-button,
.docs-theme-mobile {
  display: none;
}

.docs-content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 175px;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 1440px;
  margin: 0 auto;
  padding: 1.55rem clamp(1.5rem, 3vw, 2.5rem) 4rem;
}

.docs-content {
  min-width: 0;
  max-width: 1000px;
}

.docs-breadcrumb,
.docs-eyebrow,
.docs-section-count {
  color: var(--accent-orange);
  font: 600 calc(0.65rem + 2px) var(--font-mono);
  letter-spacing: 0.055em;
}

.docs-breadcrumb {
  margin: 0 0 0.65rem;
  color: var(--text-muted);
  letter-spacing: 0;
}

.docs-breadcrumb span {
  padding: 0 0.3rem;
  color: var(--accent-orange);
}

.docs-section {
  padding: 1.45rem 0;
  border-bottom: 1px solid var(--border-color);
  scroll-margin-top: 78px;
}

.docs-section:first-of-type {
  padding-top: 0.35rem;
}

.docs-section h1 {
  font-size: calc(clamp(1.7rem, 3vw, 2.35rem) + 2px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.docs-section h2 {
  margin-bottom: 0.4rem;
  font-size: calc(1.15rem + 2px);
  letter-spacing: -0.025em;
}

.docs-section p {
  color: var(--text-secondary);
  font-size: calc(0.8rem + 2px);
  line-height: 1.75;
}

.docs-section .docs-lead {
  max-width: 900px;
  margin-top: 0.55rem;
  font-size: calc(0.84rem + 2px);
}

.docs-section em {
  color: var(--text-primary);
  font-style: normal;
  font-weight: 600;
}

.docs-inline-link {
  color: var(--accent-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.docs-section code,
.docs-command-list code {
  padding: 0.12rem 0.32rem;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background: var(--bg-secondary);
  color: var(--accent-orange);
  font-size: calc(0.88em + 2px);
}

.docs-callout {
  display: flex;
  gap: 0.7rem;
  margin-top: 1rem;
  padding: 0.8rem 0.9rem;
  border-left: 2px solid var(--accent-orange);
  background: var(--bg-elevated);
}

.docs-callout-mark {
  display: grid;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  place-items: center;
  border: 1px solid var(--accent-orange);
  color: var(--accent-orange);
  font: 700 calc(0.72rem + 2px) var(--font-mono);
}

.docs-callout strong {
  font-size: calc(0.76rem + 2px);
}

.docs-callout p {
  margin-top: 0.2rem;
  font-size: calc(0.74rem + 2px);
}

.docs-steps {
  display: grid;
  gap: 0;
  margin: 0.85rem 0 0;
  padding: 0;
  list-style: none;
}

.docs-steps li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.7rem 0;
  border-top: 1px solid var(--border-color);
}

.docs-steps li > span {
  color: var(--accent-orange);
  font: 600 calc(0.68rem + 2px) var(--font-mono);
}

.docs-steps strong {
  display: block;
  margin-bottom: 0.15rem;
  font-size: calc(0.78rem + 2px);
}

.docs-steps p {
  font-size: calc(0.74rem + 2px);
}

.docs-step-figure {
  max-width: 760px;
  margin-top: 0.8rem;
}

.docs-step-image {
  display: block;
  width: 100%;
  max-height: 520px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background: var(--bg-secondary);
  object-fit: contain;
  object-position: left center;
}

.docs-step-figure figcaption {
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: calc(0.68rem + 2px);
  line-height: 1.5;
}

.docs-section-heading,
.docs-tutorial-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.docs-section-heading h2 {
  margin-top: 0.25rem;
}

.docs-section-count {
  color: var(--text-muted);
}

.docs-module-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.docs-module-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 0.65rem;
  min-height: 72px;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  background: var(--bg-card);
  transition: var(--transition);
}

.docs-module-card:hover {
  border-color: var(--accent-orange);
  background: var(--bg-elevated);
  transform: translateY(-1px);
}

.docs-module-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border-color);
  color: var(--accent-orange);
  font-size: calc(0.95rem + 2px);
}

.docs-module-card strong,
.docs-module-card small {
  display: block;
}

.docs-module-card strong {
  font-size: calc(0.75rem + 2px);
}

.docs-module-card small {
  margin-top: 0.2rem;
  color: var(--text-secondary);
  font-size: calc(0.67rem + 2px);
  line-height: 1.45;
}

.docs-card-arrow {
  color: var(--text-muted);
}

.docs-tutorial-title {
  justify-content: flex-start;
  margin-bottom: 0.55rem;
}

.docs-tutorial-title h2 {
  margin: 0.15rem 0 0;
  font-size: calc(1.35rem + 2px);
}

.docs-command-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.docs-command-list > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  font-size: calc(0.72rem + 2px);
}

.docs-command-list span:last-child {
  margin-left: auto;
  color: var(--text-secondary);
}

.docs-command-list small {
  color: var(--text-muted);
}

.docs-troubleshoot-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.8rem;
}

.docs-troubleshoot-list details {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.docs-troubleshoot-list summary {
  position: relative;
  min-height: 44px;
  padding: 0.75rem 2.2rem 0.75rem 0.8rem;
  cursor: pointer;
  font-size: calc(0.76rem + 2px);
  font-weight: 600;
  list-style: none;
}

.docs-troubleshoot-list summary::-webkit-details-marker {
  display: none;
}

.docs-troubleshoot-list summary::after {
  position: absolute;
  top: 50%;
  right: 0.8rem;
  color: var(--accent-orange);
  content: "+";
  font: calc(1rem + 2px) var(--font-mono);
  transform: translateY(-50%);
}

.docs-troubleshoot-list details[open] summary::after {
  content: "−";
}

.docs-troubleshoot-list details p {
  padding: 0 0.8rem 0.8rem;
  font-size: calc(0.74rem + 2px);
}

.docs-help-link {
  margin-top: 1rem;
}

.docs-help-link a {
  color: var(--accent-orange);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.docs-next {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  padding-top: 1.5rem;
}

.docs-next a {
  display: grid;
  gap: 0.25rem;
  padding: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  transition: var(--transition);
}

.docs-next .docs-next-previous {
  text-align: left;
}

.docs-next .docs-next-link {
  text-align: right;
}

.docs-next a:hover {
  border-color: var(--accent-orange);
}

.docs-next a > span:first-child {
  color: var(--text-muted);
  font: calc(0.62rem + 2px) var(--font-mono);
}

.docs-next strong {
  font-size: calc(0.76rem + 2px);
}

.docs-toc {
  position: sticky;
  top: 82px;
  display: flex;
  align-self: start;
  flex-direction: column;
  gap: 0.7rem;
  padding-top: 0.25rem;
}

.docs-toc > strong {
  margin-bottom: 0.15rem;
  color: var(--text-primary);
  font: 600 calc(0.62rem + 2px) var(--font-mono);
  letter-spacing: 0.07em;
}

.docs-toc > a {
  color: var(--text-secondary);
  font-size: calc(0.68rem + 2px);
  line-height: 1.4;
}

.docs-toc > a:hover {
  color: var(--accent-orange);
}

.docs-toc-help {
  display: grid;
  gap: 0.25rem;
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font: calc(0.61rem + 2px) var(--font-mono);
}

.docs-toc-help span {
  overflow-wrap: anywhere;
  color: var(--text-secondary);
  font-family: var(--font-body);
}

.docs-no-results {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px dashed var(--border-light);
  color: var(--text-secondary);
  font-size: calc(0.8rem + 2px);
}

.docs-mobile-scrim {
  display: none;
}

@media (max-width: 1100px) {
  .docs-content-layout {
    grid-template-columns: minmax(0, 1fr);
    max-width: 940px;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 760px) {
  .docs-app {
    --docs-sidebar-width: 0px;
  }

  .docs-sidebar {
    width: min(300px, calc(100vw - 52px));
    padding-top: max(1rem, env(safe-area-inset-top));
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-mobile-scrim.is-open {
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: block;
    background: rgb(0 0 0 / 65%);
  }

  .docs-main {
    margin-left: 0;
  }

  .docs-topbar {
    min-height: 54px;
    gap: 0.6rem;
    padding: 0 0.75rem;
  }

  .docs-menu-button {
    display: flex;
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
  }

  .docs-menu-button span {
    width: 16px;
    height: 1px;
    background: var(--text-primary);
  }

  .docs-top-nav {
    gap: 0.8rem;
  }

  .docs-top-nav a {
    font-size: calc(0.68rem + 2px);
  }

  .docs-top-actions {
    gap: 0.3rem;
  }

  .docs-top-identity {
    display: none;
  }

  .docs-theme-mobile {
    display: flex;
    width: 36px;
    height: 36px;
  }

  .docs-dashboard-button {
    min-height: 34px;
    padding: 0.4rem 0.48rem;
    font-size: calc(0.55rem + 2px);
  }

  .docs-content-layout {
    padding: 1rem 1rem calc(2rem + env(safe-area-inset-bottom));
  }

  .docs-section {
    padding: 1.2rem 0;
    scroll-margin-top: 64px;
  }

  .docs-module-grid {
    grid-template-columns: 1fr;
  }

  .docs-next {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .docs-top-nav a:nth-child(2) {
    display: none;
  }

  .docs-dashboard-button {
    max-width: 115px;
    overflow: hidden;
    white-space: nowrap;
  }

  .docs-section h1 {
    font-size: calc(1.65rem + 2px);
  }

  .docs-command-list span:last-child {
    flex-basis: 100%;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .docs-sidebar,
  .docs-module-card,
  .docs-nav-link,
  .docs-theme-button {
    transition: none;
  }
}
