:root {
  --bg: #08101f;
  --bg-soft: #11192d;
  --panel: rgba(10, 18, 36, 0.88);
  --panel-strong: rgba(14, 24, 46, 0.96);
  --panel-alt: rgba(255, 255, 255, 0.03);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e9eefb;
  --muted: #9aa8c7;
  --accent: #ff6b35;
  --accent-2: #ffd166;
  --accent-cool: #59e1c2;
  --danger: #ff7b7b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 107, 53, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(89, 225, 194, 0.12), transparent 24%),
    linear-gradient(160deg, #06101d 0%, #0a1528 44%, #111f3e 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 92%);
}

/* ─── Developer Portal (index.html) ─── */
.portal-page {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
}

.portal-shell.app-shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: grid;
  --portal-sidebar-w: minmax(280px, 320px);
  grid-template-columns: var(--portal-sidebar-w) minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.portal-shell.portal-shell--sidebar-collapsed.app-shell {
  --portal-sidebar-w: 64px;
}

.portal-page .sidebar.portal-sidebar {
  position: relative;
  top: auto;
  align-self: stretch;
  height: auto;
  min-height: 100vh;
}

.portal-sidebar-surface {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(14, 22, 42, 0.97) 0%, rgba(8, 14, 28, 0.98) 100%);
  border-right: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 8px 0 40px rgba(0, 0, 0, 0.2);
}

.portal-sidebar-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 10px 10px 0;
  flex-shrink: 0;
}

.portal-sidebar-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 200ms ease;
}

.portal-sidebar-toggle:hover,
.portal-sidebar-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(89, 225, 194, 0.35);
  outline: none;
}

.portal-sidebar-toggle:focus-visible {
  box-shadow: 0 0 0 2px rgba(89, 225, 194, 0.25);
}

.portal-sidebar-toggle-icon {
  display: block;
  width: 10px;
  height: 10px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 3px;
  transition: transform 200ms ease;
}

.portal-shell--sidebar-collapsed .portal-sidebar-toggle-icon {
  transform: rotate(225deg);
  margin-left: 0;
  margin-right: 3px;
}

.portal-sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  flex: 1;
  padding: 8px 12px 20px;
  overflow-y: auto;
  overflow-x: hidden;
}

.portal-sidebar-body > * + * {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.portal-account-compact {
  padding: 12px 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    linear-gradient(145deg, rgba(255, 107, 53, 0.12), rgba(89, 225, 194, 0.05)),
    rgba(10, 18, 36, 0.65);
  box-shadow: none;
}

.portal-account-compact-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.account-avatar--compact {
  width: 40px;
  height: 40px;
  border-radius: 12px;
}

.account-avatar--compact .account-avatar-mark {
  padding: 3px;
}

.portal-account-compact-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.portal-account-compact-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cool);
}

.portal-account-compact-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.25;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-account-compact-uid {
  display: block;
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-account-compact-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--muted);
}

.portal-account-compact-meta {
  margin-top: 8px;
  font-size: 0.78rem;
  color: var(--muted);
}

.portal-account-mode .meta-label {
  margin-right: 4px;
}

.portal-account-compact-actions {
  margin-top: 12px;
  gap: 8px;
}

.button-compact {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.portal-sidebar-brand {
  padding: 16px 14px 18px;
  border-radius: 18px;
  background:
    radial-gradient(ellipse 90% 80% at 100% 0%, rgba(255, 107, 53, 0.1), transparent 55%),
    linear-gradient(165deg, rgba(14, 24, 46, 0.98), rgba(10, 18, 36, 0.92));
  border: 1px solid rgba(148, 163, 184, 0.14);
}

.portal-brand-link--collapsed {
  display: none;
  justify-content: center;
  line-height: 0;
  margin-bottom: 0;
}

.portal-brand-mark-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}

.portal-shell--sidebar-collapsed .portal-brand-link--expanded {
  display: none;
}

.portal-shell--sidebar-collapsed .portal-brand-link--collapsed {
  display: flex;
}

.portal-shell--sidebar-collapsed .portal-brand-meta,
.portal-shell--sidebar-collapsed .portal-brand-tagline {
  display: none;
}

.portal-nav-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.portal-nav-heading {
  margin-bottom: 2px;
}

.portal-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.portal-sidebar-nav a::after {
  display: none;
  content: attr(data-short);
  font-size: 0.7rem;
  font-weight: 700;
  width: 1.75rem;
  height: 1.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-2);
}

.portal-shell--sidebar-collapsed .portal-sidebar-nav a::after {
  display: inline-flex;
}

.portal-shell--sidebar-collapsed .portal-sidebar-nav .sidebar-nav-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.portal-shell--sidebar-collapsed .portal-sidebar-nav a {
  justify-content: center;
  padding: 10px 6px;
}

.portal-shell--sidebar-collapsed .portal-nav-heading {
  display: none;
}

.portal-shell--sidebar-collapsed .portal-account-compact-hint,
.portal-shell--sidebar-collapsed .portal-account-compact-meta,
.portal-shell--sidebar-collapsed .portal-account-compact-actions,
.portal-shell--sidebar-collapsed .portal-availability-block {
  display: none !important;
}

.portal-shell--sidebar-collapsed .portal-account-compact {
  padding: 10px 8px;
}

.portal-shell--sidebar-collapsed .portal-account-compact-main {
  justify-content: center;
}

.portal-shell--sidebar-collapsed .portal-account-compact-text {
  display: none;
}

.portal-shell--sidebar-collapsed .portal-sidebar-toolbar {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.portal-main.content-shell {
  min-width: 0;
  padding: clamp(20px, 3vw, 36px) clamp(20px, 3vw, 40px) 48px;
}

.portal-sidebar .availability-card {
  border: none;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
}

.portal-brand-link {
  display: block;
  line-height: 0;
  margin-bottom: 14px;
  border-radius: 12px;
  transition: opacity 180ms ease, transform 180ms ease;
}

.portal-brand-link:hover,
.portal-brand-link:focus-visible {
  opacity: 0.92;
  transform: translateY(-1px);
}

.portal-brand-link:focus-visible {
  outline: 2px solid rgba(89, 225, 194, 0.45);
  outline-offset: 3px;
}

.portal-brand-logo {
  width: 100%;
  max-width: 248px;
  height: auto;
  display: block;
}

.portal-brand-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.portal-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(89, 225, 194, 0.12);
  color: var(--accent-cool);
}

.portal-badge--muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.portal-brand-tagline {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}

.portal-hero {
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background:
    radial-gradient(ellipse 70% 60% at 100% 0%, rgba(255, 107, 53, 0.14), transparent 50%),
    linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(89, 225, 194, 0.07)),
    var(--panel-strong);
}

.portal-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.portal-hero-lead {
  max-width: 62ch;
}

.app-shell {
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 40px;
  display: grid;
  grid-template-columns: 308px minmax(0, 1fr);
  gap: 22px;
}

.sidebar {
  position: sticky;
  top: 16px;
  align-self: start;
  height: calc(100vh - 32px);
}

.sidebar-top,
.content-shell {
  display: grid;
  gap: 18px;
}

.sidebar-card,
.panel {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.sidebar-card,
.panel {
  padding: 22px;
}

.brand-card h1,
.hero-copy h2,
.section-head h2 {
  margin: 10px 0 0;
  letter-spacing: -0.04em;
}

.brand-card h1 {
  font-size: 1.8rem;
}

.brand-card p,
.hero-copy p,
.section-copy,
.doc-card p,
.timeline-item p,
.client-meta,
.feedback,
#sessionHint,
.shortcut-list,
.metric p {
  color: var(--muted);
  line-height: 1.65;
}

.eyebrow,
.status-label,
.metric-label,
.meta-label {
  display: inline-block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--accent-cool);
}

.account-card {
  background:
    linear-gradient(145deg, rgba(255, 107, 53, 0.14), rgba(89, 225, 194, 0.06)),
    var(--panel-strong);
}

.account-head {
  display: flex;
  gap: 14px;
  align-items: center;
}

.account-avatar {
  position: relative;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff955f);
  color: #180e08;
  font-weight: 700;
  font-size: 1.15rem;
}

.account-avatar-mark {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
}

.account-avatar--guest {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.account-avatar--guest .account-avatar-mark {
  display: block;
  padding: 4px;
  object-fit: contain;
}

.account-avatar--guest .account-avatar-letter {
  display: none;
}

.account-avatar-letter {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.account-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.account-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.account-meta div {
  padding: 12px;
  border-radius: 16px;
  background: var(--panel-alt);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.account-meta code,
.account-meta span:last-child {
  display: block;
  margin-top: 6px;
  color: var(--text);
  word-break: break-word;
}

.sidebar-nav {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sidebar-nav a {
  padding: 12px 14px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible {
  transform: translateX(2px);
  border-color: rgba(255, 209, 102, 0.22);
  background: rgba(255, 255, 255, 0.05);
}

.shortcut-list {
  margin: 12px 0 0;
  padding-left: 18px;
}

.shortcut-list li + li {
  margin-top: 8px;
}

.content-shell {
  padding-bottom: 12px;
}

.hero-panel {
  min-height: 220px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(89, 225, 194, 0.08)),
    var(--panel-strong);
}

.hero-copy h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 0.98;
}

.hero-actions,
.status-actions,
.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.module-grid {
  display: grid;
  gap: 18px;
}

.module-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.module-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact {
  gap: 14px;
}

.metric strong {
  display: block;
  margin: 8px 0 10px;
  font-size: 1.4rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 10px;
}

.button {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 12px 18px;
  font: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform 180ms ease, background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent), #ff915e);
  color: #180e08;
  font-weight: 700;
}

.button-secondary {
  background: rgba(255, 209, 102, 0.08);
  color: var(--accent-2);
  border-color: rgba(255, 209, 102, 0.22);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  border-color: var(--border);
}

.hidden {
  display: none;
}

.collection {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.collection-empty,
.client-card,
.doc-card,
.timeline-item,
.code-block {
  border: 1px solid rgba(148, 163, 184, 0.15);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 18px;
}

.collection-empty {
  padding: 2px;
}

.client-card {
  padding: 18px;
  cursor: pointer;
}

.client-card:hover,
.client-card.active {
  border-color: rgba(255, 107, 53, 0.5);
  background: rgba(255, 107, 53, 0.07);
}

.client-card-header,
.client-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
}

.client-card h3,
.doc-card h3 {
  margin: 0;
}

.mono,
code,
textarea,
.code-block,
.account-meta code {
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: rgba(89, 225, 194, 0.12);
  color: var(--accent-cool);
}

.pill.warn {
  background: rgba(255, 209, 102, 0.12);
  color: var(--accent-2);
}

.pill.danger {
  background: rgba(255, 123, 123, 0.12);
  color: var(--danger);
}

.stack {
  display: grid;
  gap: 16px;
}

label,
fieldset {
  display: grid;
  gap: 8px;
}

fieldset {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
}

legend {
  padding: 0 8px;
  color: var(--accent-2);
}

input,
textarea {
  width: 100%;
  padding: 13px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(7, 13, 28, 0.86);
  color: var(--text);
  resize: vertical;
}

input:focus,
textarea:focus {
  outline: 2px solid rgba(89, 225, 194, 0.25);
  border-color: rgba(89, 225, 194, 0.4);
}

.checkbox {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.scope-grid,
.doc-stack,
.timeline {
  display: grid;
  gap: 12px;
}

.doc-card,
.timeline-item {
  padding: 18px;
}

.code-block {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.feedback {
  min-height: 1.5em;
  margin: 0;
  color: var(--accent-cool);
}

.feedback.error {
  color: var(--danger);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .portal-shell.app-shell {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .portal-page .sidebar.portal-sidebar {
    min-height: 0;
  }

  .portal-sidebar-surface {
    min-height: auto;
    border-right: none;
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-radius: 0 0 20px 20px;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 900px) {
  .module-grid-3,
  .module-grid-2,
  .account-meta {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 16px, 1440px);
    padding-top: 12px;
  }

  .sidebar-card,
  .panel {
    padding: 18px;
  }

  .hero-copy h2 {
    font-size: 1.9rem;
  }
}
/* ─── Developer docs page (docs.html) ─── */
.docs-page {
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  font-optical-sizing: auto;
}

.docs-skip {
  position: absolute;
  left: -9999px;
  z-index: 9999;
  padding: 12px 16px;
  background: var(--accent);
  color: #180e08;
  font-weight: 600;
  border-radius: 8px;
}

.docs-skip:focus {
  left: 16px;
  top: 16px;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(6, 14, 28, 0.82);
  backdrop-filter: blur(16px);
}

.docs-topbar-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
}

.docs-brand-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), #ff955f);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.25);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-sizing: border-box;
  padding: 3px;
}

.docs-brand-mark img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.docs-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.docs-brand-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.docs-brand-sub {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.docs-topbar-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.docs-topbar-link {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.docs-topbar-link:hover,
.docs-topbar-link:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(148, 163, 184, 0.15);
}

.docs-topbar-link--accent {
  color: var(--accent-cool);
  border-color: rgba(89, 225, 194, 0.25);
  background: rgba(89, 225, 194, 0.06);
}

.docs-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 72px;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 72px;
  align-self: start;
}

.docs-sidebar-inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.docs-sidebar-heading {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.docs-toc {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-toc a {
  display: block;
  padding: 8px 12px;
  margin-left: -12px;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.docs-toc a:hover,
.docs-toc a:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.docs-toc a[aria-current="page"] {
  color: var(--accent-cool);
  border-left-color: var(--accent-cool);
  background: rgba(89, 225, 194, 0.06);
}

.docs-sidebar-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.docs-sidebar-card-label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}

.docs-sidebar-card-value {
  display: block;
  font-size: 1.1rem;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.docs-sidebar-card-text {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.docs-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 6vw, 72px);
}

.docs-hero--modern {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.85fr);
  gap: 28px;
  padding: clamp(28px, 4vw, 40px);
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background:
    radial-gradient(ellipse 80% 60% at 100% 0%, rgba(255, 107, 53, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(89, 225, 194, 0.1), transparent 50%),
    var(--panel-strong);
  box-shadow: var(--shadow);
}

.docs-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.docs-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(89, 225, 194, 0.12);
  color: var(--accent-cool);
}

.docs-badge--muted {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.04em;
}

.docs-hero-main h1 {
  margin: 0 0 16px;
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.docs-lead {
  margin: 0 0 24px;
  max-width: 52ch;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.docs-lead strong {
  color: var(--text);
  font-weight: 600;
}

.docs-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.docs-hero-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(0, 0, 0, 0.2);
}

.docs-stat-grid {
  display: grid;
  gap: 12px;
}

.docs-stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.08);
}

.docs-stat-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 4px;
}

.docs-stat-value {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text);
  font-family: "IBM Plex Mono", Consolas, monospace;
}

.docs-hero-aside-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--muted);
}

.docs-section {
  scroll-margin-top: 96px;
}

.docs-section-header {
  margin-bottom: clamp(20px, 3vw, 28px);
}

.docs-section-kicker {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-cool);
  margin-bottom: 8px;
}

.docs-section-kicker--on-dark {
  color: rgba(255, 255, 255, 0.75);
}

.docs-section-header h2 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 2.5vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.docs-section-deck {
  margin: 0;
  max-width: 60ch;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--muted);
}

.docs-module-grid {
  display: grid;
  gap: 18px;
}

.docs-module-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-module-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.docs-module {
  position: relative;
  padding: 22px 22px 22px 22px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}

.docs-module:hover {
  border-color: rgba(89, 225, 194, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.docs-module--numbered {
  padding-top: 28px;
}

.docs-module-step {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #180e08;
  background: linear-gradient(135deg, var(--accent), #ff955f);
}

.docs-module-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(89, 225, 194, 0.1);
  border: 1px solid rgba(89, 225, 194, 0.2);
}

.docs-module-icon--orbit {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 107, 53, 0.35), transparent 55%),
    rgba(89, 225, 194, 0.08);
}

.docs-module-icon--layers {
  background: linear-gradient(160deg, rgba(255, 209, 102, 0.2), transparent 60%),
    rgba(255, 255, 255, 0.04);
}

.docs-module-title {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.docs-module-body {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--muted);
}

.docs-module-body strong {
  color: var(--text);
  font-weight: 600;
}

.docs-flow {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.docs-flow::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(
    180deg,
    rgba(89, 225, 194, 0.45),
    rgba(255, 107, 53, 0.25),
    transparent
  );
  border-radius: 2px;
}

.docs-flow-item {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 0 18px 0;
}

.docs-flow-marker {
  position: relative;
  z-index: 1;
  width: 32px;
  height: 32px;
  margin-top: 4px;
  border-radius: 50%;
  background: var(--bg-soft);
  border: 2px solid rgba(89, 225, 194, 0.45);
  box-shadow: 0 0 0 4px rgba(6, 14, 28, 0.9);
}

.docs-flow-body {
  padding: 18px 20px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.docs-flow-title {
  margin: 0 0 8px;
  font-size: 1.02rem;
  font-weight: 600;
}

.docs-flow-body p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
  color: var(--muted);
}

.docs-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.docs-panel {
  padding: 22px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.docs-panel--positive {
  background: linear-gradient(145deg, rgba(89, 225, 194, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(89, 225, 194, 0.2);
}

.docs-panel--muted {
  background: rgba(255, 255, 255, 0.02);
}

.docs-panel-title {
  margin: 0 0 14px;
  font-size: 1rem;
  font-weight: 600;
}

.docs-checklist {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.docs-checklist li {
  position: relative;
  padding-left: 26px;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.docs-checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-cool);
  box-shadow: 0 0 0 2px rgba(89, 225, 194, 0.25);
}

.docs-checklist--plain li::before {
  background: var(--muted);
  box-shadow: none;
}

.docs-glossary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.docs-term {
  padding: 18px 20px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.docs-term-word {
  margin: 0 0 8px;
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--accent-2);
}

.docs-term-def {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

.docs-section--cta {
  margin-top: 8px;
}

.docs-cta-panel {
  padding: clamp(28px, 4vw, 40px);
  border-radius: 22px;
  border: 1px solid rgba(255, 107, 53, 0.25);
  background:
    radial-gradient(ellipse 70% 80% at 100% 0%, rgba(255, 107, 53, 0.18), transparent 50%),
    linear-gradient(135deg, rgba(14, 24, 46, 0.98), rgba(10, 18, 36, 0.95));
  box-shadow: var(--shadow);
}

.docs-cta-title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}

.docs-cta-lead {
  margin: 0 0 22px;
  max-width: 56ch;
  font-size: 1rem;
  line-height: 1.6;
  color: rgba(233, 238, 251, 0.82);
}

@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
  }

  .docs-sidebar-inner {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 16px;
  }

  .docs-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .docs-toc a {
    margin-left: 0;
    border-left: none;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.82rem;
  }

  .docs-sidebar-card {
    flex: 1;
    min-width: 200px;
  }
}

@media (max-width: 900px) {
  .docs-hero--modern,
  .docs-module-grid--2,
  .docs-module-grid--3,
  .docs-split,
  .docs-glossary {
    grid-template-columns: 1fr;
  }

  .docs-flow::before {
    left: 11px;
  }

  .docs-flow-item {
    grid-template-columns: 24px minmax(0, 1fr);
  }

  .docs-flow-marker {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 720px) {
  .docs-topbar-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .docs-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .docs-hero-actions .button {
    text-align: center;
  }
}

/* Legacy docs classes (kept for compatibility) */
.docs-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
  display: grid;
  gap: 22px;
}

.docs-hero:not(.docs-hero--modern) {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: stretch;
  background:
    radial-gradient(circle at top right, rgba(255, 209, 102, 0.12), transparent 24%),
    linear-gradient(135deg, rgba(255, 107, 53, 0.12), rgba(89, 225, 194, 0.08)),
    var(--panel-strong);
}

.docs-hero:not(.docs-hero--modern) h1,
.docs-head h2,
.docs-step h3,
.docs-card h3,
.docs-cta:not(.docs-cta-panel) h2 {
  margin: 10px 0 0;
  letter-spacing: -0.04em;
}

.docs-hero:not(.docs-hero--modern) h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 0.98;
}

.docs-hero:not(.docs-hero--modern) p,
.docs-card p,
.docs-step p,
.docs-cta:not(.docs-cta-panel) p,
.docs-hero-note p,
.docs-list {
  color: var(--muted);
  line-height: 1.7;
}

.docs-hero-note,
.docs-card,
.docs-step,
.docs-cta:not(.docs-cta-panel) {
  background: rgba(255, 255, 255, 0.03);
}

.docs-card-soft {
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 20px;
  padding: 20px;
  align-self: end;
}

.docs-hero-note strong,
.docs-step strong {
  display: block;
  color: var(--accent-2);
}

.docs-head {
  margin-bottom: 0;
}

.docs-grid {
  display: grid;
  gap: 18px;
}

.docs-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.docs-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.docs-card,
.docs-step,
.docs-cta:not(.docs-cta-panel) {
  padding: 22px;
}

.docs-timeline {
  display: grid;
  gap: 14px;
}

.docs-list {
  margin: 0;
  padding-left: 18px;
}

.docs-list li + li {
  margin-top: 10px;
}

@media (max-width: 960px) {
  .docs-hero:not(.docs-hero--modern),
  .docs-grid-3,
  .docs-grid-2 {
    grid-template-columns: 1fr;
  }
}
