:root {
  --docs-sidebar-width: 312px;
  --docs-font-sans: "Manrope", "Avenir Next", "Noto Sans", sans-serif;
  --docs-code-font:
    var(--font-family-mono, "SFMono-Regular"), Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  --docs-surface-0: #f5f7fb;
  --docs-surface-1: #ffffff;
  --docs-surface-2: #eef2f8;
  --docs-border: #d9e1ec;
  --docs-border-strong: #c8d3e1;
  --docs-text-0: #0d1522;
  --docs-text-1: #4a5a70;
  --docs-accent: #2563eb;
  --docs-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.08);
  --docs-shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--docs-font-sans);
  color: var(--docs-text-0);
  background:
    radial-gradient(circle at 12% 0%, #edf5ff 0%, transparent 36%),
    radial-gradient(circle at 88% 100%, #f4f8f2 0%, transparent 30%),
    var(--docs-surface-0);
}

.docs-shell {
  display: grid;
  grid-template-columns: var(--docs-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}

.docs-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid var(--docs-border);
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fc 100%);
  padding: 20px 16px 28px;
}

.docs-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 9px 12px;
  border: 1px solid var(--docs-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--docs-shadow-sm);
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--docs-text-0);
  letter-spacing: 0.01em;
  text-decoration: none;
}

.docs-nav {
  display: grid;
  gap: 20px;
}

/* ─── Collapsible nav groups ─── */
.docs-nav-top {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
}

.docs-nav-group {
  margin: 0;
}

.docs-nav-group details {
  border: 0;
}

.docs-nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  font-size: 0.69rem;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.docs-nav-group-toggle::-webkit-details-marker {
  display: none;
}

.docs-nav-group-toggle::before {
  content: "";
  display: inline-block;
  width: 0.55em;
  height: 0.55em;
  border-inline-end: 2px solid currentColor;
  border-block-end: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 150ms ease;
  flex-shrink: 0;
}

details[open] > .docs-nav-group-toggle::before {
  transform: rotate(45deg);
}

.docs-nav-group ul {
  list-style: none;
  margin: 4px 0 12px;
  padding: 0;
  display: grid;
  gap: 2px;
}

.docs-nav-section h2,
.docs-nav-group h2 {
  margin: 0;
  font-size: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  font-weight: inherit;
  color: inherit;
}

.docs-nav-section ul,
.docs-nav-top ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.docs-nav-section a,
.docs-nav-group a,
.docs-nav-top a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--docs-text-1);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 120ms ease;
}

.docs-nav-section a:hover,
.docs-nav-group a:hover,
.docs-nav-top a:hover {
  border-color: var(--docs-border);
  background: #fff;
  color: var(--docs-text-0);
}

.docs-nav-section a[aria-current="page"],
.docs-nav-group a[aria-current="page"],
.docs-nav-top a[aria-current="page"] {
  border-color: var(--docs-border-strong);
  background: #fff;
  color: var(--docs-text-0);
  box-shadow: var(--docs-shadow-sm);
  font-weight: 700;
}

.docs-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.docs-content {
  max-width: 1120px;
  padding: 34px 32px 48px;
}

.docs-content > * + * {
  margin-top: 2rem;
}

.docs-content > h1 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.75rem, 2.1vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}


.docs-breadcrumb {
  margin: 0 0 14px;
}

.docs-breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--docs-text-1);
}

.docs-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.docs-breadcrumb li + li::before {
  content: "/";
  opacity: 0.52;
}

.docs-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.page-intro {
  margin: 10px 0 22px;
  color: var(--docs-text-1);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 72ch;
}

.docs-page-actions {
  margin: -2px 0 20px;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.docs-page-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--docs-border);
  background: #fff;
  color: var(--docs-text-0);
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 700;
}

.docs-page-link:hover {
  border-color: #b8c7db;
  box-shadow: var(--docs-shadow-sm);
}

.docs-page-link--playground::before {
  content: "";
  display: inline-block;
  width: 1em;
  height: 1em;
  mask-image: url("/assets/icons/play-circled.svg");
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  -webkit-mask-image: url("/assets/icons/play-circled.svg");
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  background: currentColor;
  vertical-align: -0.12em;
}

.docs-page-link-separator {
  color: var(--docs-text-1);
}

.mode-toggle {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 0;
}

.docs-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  margin-bottom: 28px;
}

.docs-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--docs-border);
  border-radius: 14px;
  text-decoration: none;
  color: inherit;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.docs-card:hover {
  transform: translateY(-2px);
  border-color: var(--docs-border-strong);
  box-shadow: var(--docs-shadow-md);
}

.docs-card h2 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.docs-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--docs-text-1);
}

.docs-link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  display: grid;
  gap: 10px;
}

.docs-link-list li {
  display: grid;
  gap: 4px;
}

.docs-link-list a {
  text-decoration: none;
  color: var(--docs-text-0);
  font-weight: 700;
}

.docs-link-list span {
  color: var(--docs-text-1);
  font-size: 0.9rem;
}

.docs-table-wrap {
  overflow: auto;
  border: 1px solid var(--docs-border);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--docs-shadow-sm);
}

.docs-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 0 0 12px;
}

.docs-filter {
  display: grid;
  gap: 4px;
}

.docs-filter span {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--docs-text-1);
}

.docs-filter select {
  min-width: 180px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  background: #fff;
  color: var(--docs-text-0);
}

.token-filter-summary {
  margin-top: 0;
}

.docs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 640px;
}

.docs-table th,
.docs-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--docs-border);
}

.docs-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-text-1);
  background: var(--docs-surface-2);
  position: sticky;
  top: 0;
}

.docs-table tbody tr:hover td {
  background: #f8fbff;
}

.docs-table tbody tr:last-child td {
  border-bottom: 0;
}

.docs-calendar-states-table {
  min-width: 720px;
}

.docs-calendar-states-table td:first-child {
  width: 180px;
}

.docs-calendar-day-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--uif-calendar-cell-gap);
  min-inline-size: 48px;
}

.docs-calendar-day-preview--range {
  min-inline-size: 144px;
  gap: 0;
}

.docs-calendar-anatomy-subject {
  inline-size: fit-content;
}

.docs-calendar-anatomy-target {
  position: absolute;
  z-index: 1;
  border: 1px dashed var(--docs-accent);
  border-radius: 6px;
  pointer-events: none;
}

.docs-calendar-anatomy-target--container {
  inset: -4px;
}

.docs-calendar-anatomy-target--header {
  inset-block-start: 12px;
  inset-inline: 12px;
  block-size: 40px;
}

.docs-calendar-anatomy-target--weekdays {
  inset-block-start: 58px;
  inset-inline: 12px;
  block-size: 32px;
}

.docs-calendar-anatomy-target--day {
  inset-block-start: 188px;
  inset-inline-start: calc(50% - 20px);
  inline-size: 40px;
  block-size: 40px;
  border-radius: var(--uif-calendar-cell-border-radius);
}

.docs-calendar-anatomy-callout--container {
  left: 50%;
  transform: translateX(-50%);
}

.docs-calendar-anatomy-callout--header {
  top: 32px;
  transform: translateY(-50%);
}

.docs-calendar-anatomy-callout--weekdays {
  top: 74px;
  transform: translateY(-50%);
}

.docs-calendar-anatomy-callout--day {
  left: 50%;
  transform: translateX(-50%);
}

.docs-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 1rem;
  border-radius: 12px;
  background: var(--color-fill-surface, #fff);
}

.example-form-shell {
  max-inline-size: 28rem;
}

.playground-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: minmax(320px, auto) auto;
  grid-template-areas:
    "preview controls"
    "code controls";
  gap: 16px;
  margin: 16px 0;
  align-items: start;
}

.playground-panel {
  border-radius: 14px;
  border: 1px solid var(--docs-border);
  background: #fff;
  box-shadow: var(--docs-shadow-sm);
  padding: 12px;
}

.playground-preview {
  grid-area: preview;
  height: 100%;
  background: var(--docs-surface-2);
  border: 1px solid var(--docs-border-strong);
  box-shadow: var(--docs-shadow-md);
}

.playground-stage {
  min-height: 96px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  background: var(--color-fill-surface, #fff);
  isolation: isolate;
  position: relative;
}

.playground-controls-panel {
  grid-area: controls;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-self: stretch;
  min-height: 0;
}

.playground-controls {
  display: grid;
  gap: 10px;
  align-content: start;
  overflow: auto;
  min-height: 0;
  padding-right: 4px;
}

.playground-actions {
  display: flex;
  gap: 8px;
  padding-top: 4px;
}

.playground-field {
  display: grid;
  gap: 4px;
}

.playground-field span {
  font-size: 0.72rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--docs-text-1);
  font-weight: 700;
}

.playground-field input:not(.uif-input):not(.input),
.playground-field select {
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  background: #fff;
  color: var(--docs-text-0);
  padding: 8px 10px;
}

.playground-color-inline {
  display: flex;
  align-items: center;
  gap: 8px;
}

.playground-color-inline > input[type="text"] {
  flex: 1;
}

.playground-color-pick {
  white-space: nowrap;
}

.playground-color-inline > input[type="color"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.playground-check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.playground-check span {
  letter-spacing: normal;
  text-transform: none;
  font-size: 0.875rem;
}

.playground-code-panel {
  grid-area: code;
  border-radius: 14px;
  border: 1px solid #2a3340;
  background: #0f141b;
  padding: 12px;
}

.playground-code-panel .code-tabs {
  margin: 0;
}

.playground-code-panel .code-tabs-bar.button-group {
  border-color: #303a48;
  background: #1a2230;
}

.playground-code-panel .code-tabs-bar.button-group > .button {
  color: #8899aa;
}

.playground-code-panel .code-tabs-bar.button-group > .button:hover {
  border-color: #303a48;
  background: #222d3d;
  color: #cdd6f4;
}

.playground-tokens {
  margin-top: 16px;
  border-top: 1px solid #303a48;
  padding-top: 12px;
}

.playground-tokens-title {
  margin: 0 0 8px;
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: #8899aa;
}

.playground-tokens .docs-table-wrap {
  border-color: #303a48;
  background: #1a2230;
}

.playground-tokens .docs-table th {
  background: #222d3d;
  color: #8899aa;
  border-color: #303a48;
}

.playground-tokens .docs-table td {
  color: #cdd6f4;
  border-color: #303a48;
}

.playground-tokens .docs-table tbody tr:hover td {
  background: #222d3d;
}

.playground-code {
  margin: 0;
  overflow: auto;
  border-radius: var(--size-radius-200, 0.25rem);
  border: 1px solid #303a48;
  background: #0a0f15;
  padding: 12px;
}

.playground-code code {
  display: block;
  font-family: var(--docs-code-font);
}

/* Override Prism's default light pre/code background inside the playground panel. */
pre.playground-code[class*="language-"],
pre.playground-code[class*="language-"] > code[class*="language-"] {
  background: #0a0f15;
}

pre {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 14px;
  font-family: var(--docs-code-font);
  box-shadow: var(--docs-shadow-sm);
}

code {
  font-family: var(--docs-code-font);
  color: inherit;
}

.palette {
  margin-top: 24px;
}

.typography {
  margin-top: 24px;
}

.type-grid {
  display: grid;
  gap: var(--size-spacing-200, 0.5rem);
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.type-card {
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: #fff;
  padding: 12px;
  box-shadow: var(--docs-shadow-sm);
}

.type-meta {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-text-1);
}

.type-sample {
  margin: 8px 0 0;
}

.type-scale {
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--docs-shadow-sm);
}

.type-scale-row {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 10px 12px;
  border-bottom: 1px solid var(--docs-border);
}

.type-scale-row:last-child {
  border-bottom: none;
}

.type-scale-label {
  width: 120px;
  font-size: 0.75rem;
  color: var(--docs-text-1);
}

.palette-group + .palette-group {
  margin-top: 16px;
}

html[data-brand="a"] .palette-group[data-brand-scope="b"],
html[data-brand="a"] .palette-group[data-brand-scope="c"] {
  display: none;
}

html[data-brand="b"] .palette-group[data-brand-scope="a"],
html[data-brand="b"] .palette-group[data-brand-scope="c"] {
  display: none;
}

html[data-brand="c"] .palette-group[data-brand-scope="a"],
html[data-brand="c"] .palette-group[data-brand-scope="b"] {
  display: none;
}

.palette-note {
  margin: 0 0 10px;
  color: var(--docs-text-1);
  font-size: 0.9rem;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--size-spacing-200, 0.5rem);
}

.swatch {
  position: relative;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  padding: 12px;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 2px;
  background: linear-gradient(135deg, rgba(0 0 0 / 0.04), rgba(0 0 0 / 0))
    var(--swatch-color);
  color: var(--docs-text-0);
  box-shadow: var(--docs-shadow-sm);
}

.swatch-name {
  font-size: 0.75rem;
  font-weight: 600;
}

.swatch-meta {
  font-size: 0.68rem;
  line-height: 1.2;
  opacity: 0.85;
  font-family: var(--font-family-mono, monospace);
}

@media (max-width: 980px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--docs-border);
    padding: 14px 14px 18px;
  }

  .docs-content {
    padding: 24px 16px 36px;
  }

  .mode-toggle {
    max-inline-size: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .playground-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "preview"
      "code"
      "controls";
  }

  .playground-controls {
    max-height: none;
    overflow: visible;
  }
}

/* Code tabs */
.code-tabs {
  margin: 16px 0;
}

/* Code-tab bar: docs-only chrome, not bound to brand theming */
.code-tabs-bar.button-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--docs-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--docs-shadow-sm);
}

.code-tabs-bar.button-group[data-attached="true"] {
  gap: 6px;
}

.code-tabs-bar.button-group[data-attached="true"] > .button {
  border-radius: 999px;
}

.code-tabs-bar.button-group > .button {
  min-block-size: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--docs-text-1);
  font-size: 0.79rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: none;
  transition: all 120ms ease;
}

.code-tabs-bar.button-group > .button.outline,
.code-tabs-bar.button-group > .button.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--docs-text-1);
}

.code-tabs-bar.button-group > .button:hover,
.code-tabs-bar.button-group > .button.outline:hover,
.code-tabs-bar.button-group > .button.ghost:hover {
  border-color: var(--docs-border);
  background: #f3f7fc;
  color: var(--docs-text-0);
}

.code-tabs-bar.button-group > .button.is-active,
.code-tabs-bar.button-group > .button[aria-pressed="true"],
.code-tabs-bar.button-group > .button:active {
  border-color: #1d4ed8;
  background: linear-gradient(180deg, #3472ff 0%, #1d4ed8 100%);
  color: #fff;
}

.code-tabs-bar.button-group > .button:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.code-tabs-panel {
  display: none;
}

.code-tabs-panel.is-active {
  display: block;
}

/* CSS-only tab switching via anchor scroll */
.code-tabs-panels {
  display: flex;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.code-tabs-panels > .code-tabs-panel {
  display: block;
  flex: 0 0 100%;
  min-inline-size: 100%;
  scroll-snap-align: start;
}

.code-tabs-panel pre {
  margin-top: 0;
  margin-bottom: 1rem;
  border-top-left-radius: 0;
}

/* ─── Spectrum-style component hero ─── */
.docs-hero {
  display: grid;
  gap: 16px;
  padding-block-end: 28px;
  border-block-end: 1px solid var(--docs-border);
  margin-block-end: 28px;
}

.docs-hero-preview {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 16px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-2);
  box-shadow:
    var(--docs-shadow-sm),
    inset 0 1px 0 rgba(255, 255, 255, 0.7);
  overflow: visible;
}

.docs-hero-preview-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-block-end: 1px solid var(--docs-border);
  border-start-start-radius: 16px;
  border-start-end-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--docs-text-1);
}

.docs-hero-preview-controls .docs-hero-switch {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
}

.docs-hero-preview-controls .docs-hero-select {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  color: var(--docs-text-0);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.docs-hero-switch button {
  all: unset;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--docs-text-1);
  cursor: pointer;
  transition: all 120ms ease;
}

.docs-hero-switch button[aria-pressed="true"] {
  background: var(--docs-accent);
  color: #fff;
}

.docs-hero-switch button:hover:not([aria-pressed="true"]) {
  background: var(--docs-surface-2);
}

.docs-hero-preview-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 180px;
  padding: 40px 32px;
  overflow: visible;
  border-end-start-radius: 16px;
  border-end-end-radius: 16px;
  background: var(--color-fill-surface, #fff);
  transition: background 200ms ease, color 200ms ease;
}

.docs-hero-preview-stage > * {
  flex-shrink: 0;
}

.docs-hero-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: var(--docs-text-1);
}

.docs-version {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-2);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--docs-text-1);
}

.docs-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.docs-status[data-status="stable"] {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.docs-status[data-status="beta"] {
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
}

.docs-status[data-status="draft"] {
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

/* ─── On-page table of contents (inline, hidden when sidebar TOC exists) ─── */
.docs-toc {
  display: none;
}

.docs-toc-title {
  margin: 0 0 10px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
}

.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  columns: 2;
  column-gap: 24px;
}

.docs-toc-list li {
  break-inside: avoid;
}

.docs-toc-list a {
  display: inline-block;
  padding: 4px 0;
  text-decoration: none;
  color: var(--docs-text-1);
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 120ms ease;
}

.docs-toc-list a:hover {
  color: var(--docs-accent);
}

/* ─── Right-side sticky TOC (auto-generated) ─── */
.docs-toc-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
  width: 200px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 24px 16px 32px 0;
  border-inline-start: 1px solid var(--docs-border);
  padding-inline-start: 16px;
  margin-inline-start: 8px;
}

.docs-toc-sidebar-title {
  margin: 0 0 10px;
  font-size: 0.69rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
}

.docs-toc-sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
}

.docs-toc-sidebar-list a {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--docs-text-1);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
  transition: color 120ms ease, background 120ms ease;
}

.docs-toc-sidebar-list a:hover {
  color: var(--docs-text-0);
  background: var(--docs-surface-2);
}

.docs-toc-sidebar-list a.is-active {
  color: var(--docs-accent);
  background: rgba(37, 99, 235, 0.06);
}

/* ─── Do / Don't guideline blocks ─── */
.docs-guideline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.docs-guideline-item {
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  overflow: hidden;
  box-shadow: var(--docs-shadow-sm);
}

.docs-guideline-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--docs-surface-2);
  border-block-end: 3px solid transparent;
  min-height: 80px;
}

.docs-guideline-item[data-type="do"] .docs-guideline-preview {
  border-block-end-color: #16a34a;
}

.docs-guideline-item[data-type="dont"] .docs-guideline-preview {
  border-block-end-color: #dc2626;
}

.docs-guideline-item[data-type="caution"] .docs-guideline-preview {
  border-block-end-color: #d97706;
}

.docs-guideline-body {
  padding: 12px 16px;
}

.docs-guideline-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 6px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-guideline-item[data-type="do"] .docs-guideline-label {
  color: #16a34a;
}

.docs-guideline-item[data-type="dont"] .docs-guideline-label {
  color: #dc2626;
}

.docs-guideline-item[data-type="caution"] .docs-guideline-label {
  color: #d97706;
}

.docs-guideline-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--docs-text-1);
  line-height: 1.5;
}

/* ─── Options table (property / values / default) ─── */
.docs-options-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  margin: 16px 0;
}

.docs-options-table th,
.docs-options-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--docs-border);
}

.docs-options-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-text-1);
  background: var(--docs-surface-2);
  font-weight: 800;
}

.docs-options-table tbody tr:last-child td {
  border-bottom: 0;
}

.docs-options-table code {
  font-size: 0.84rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--docs-surface-2);
}

/* ─── Keyboard interaction table ─── */
.docs-keyboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  margin: 16px 0;
}

.docs-keyboard-table th,
.docs-keyboard-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 14px;
  border-bottom: 1px solid var(--docs-border);
}

.docs-keyboard-table th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--docs-text-1);
  background: var(--docs-surface-2);
  font-weight: 800;
}

.docs-keyboard-table tbody tr:last-child td {
  border-bottom: 0;
}

.docs-keyboard-table kbd {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--docs-border-strong);
  background: var(--docs-surface-2);
  font-family: var(--docs-code-font);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 1px 0 var(--docs-border);
}

/* ─── Design checklist ─── */
.docs-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.docs-checklist-item {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
}

.docs-checklist-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  margin-top: 1px;
}

.docs-checklist-item[data-done="true"] .docs-checklist-icon {
  background: #dcfce7;
  color: #16a34a;
  border: 1px solid #bbf7d0;
}

.docs-checklist-item[data-done="false"] .docs-checklist-icon {
  background: var(--docs-surface-2);
  color: var(--docs-text-1);
  border: 1px solid var(--docs-border);
}

.docs-checklist-text {
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--docs-text-0);
}

.docs-checklist-text strong {
  display: block;
  font-weight: 700;
  margin-bottom: 2px;
}

.docs-checklist-text span {
  color: var(--docs-text-1);
  font-size: 0.84rem;
}

/* ─── Changelog ─── */
.docs-changelog {
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  margin: 16px 0;
}

.docs-changelog-entry {
  display: grid;
  grid-template-columns: 140px 80px 1fr;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--docs-border);
  font-size: 0.88rem;
}

.docs-changelog-entry:last-child {
  border-bottom: 0;
}

.docs-changelog-date {
  color: var(--docs-text-1);
  font-weight: 600;
}

.docs-changelog-version {
  font-family: var(--docs-code-font);
  font-size: 0.82rem;
  color: var(--docs-text-1);
}

.docs-changelog-notes {
  color: var(--docs-text-0);
}

.docs-changelog-notes ul {
  margin: 0;
  padding-inline-start: 18px;
}

/* ─── Section anchors ─── */
.docs-content h2[id] {
  scroll-margin-top: 80px;
}

.docs-content h2[id] a.docs-anchor {
  color: var(--docs-text-1);
  text-decoration: none;
  opacity: 0;
  margin-inline-start: 6px;
  font-weight: 400;
  transition: opacity 120ms ease;
}

.docs-content h2[id]:hover a.docs-anchor {
  opacity: 1;
}

/* ─── Anatomy diagram ─── */
.docs-anatomy {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 16px 0;
}

.docs-anatomy-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-2);
  min-height: 120px;
}

.docs-anatomy-subject {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin: 32px 48px;
}

.docs-anatomy-outline {
  position: absolute;
  inset: -4px;
  border: 1px dashed var(--docs-accent);
  border-radius: 4px;
  pointer-events: none;
}

.docs-anatomy-callout {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  z-index: 1;
}

.docs-anatomy-callout-line {
  background: var(--docs-accent);
  flex-shrink: 0;
}

/* Top: badge on top, line below pointing down to component */
.docs-anatomy-callout[data-dir="top"] {
  flex-direction: column;
  bottom: calc(100% + 4px);
}

.docs-anatomy-callout[data-dir="top"] .docs-anatomy-callout-line {
  width: 1px;
  height: 16px;
}

/* Bottom: line on top, badge below */
.docs-anatomy-callout[data-dir="bottom"] {
  flex-direction: column;
  top: calc(100% + 4px);
}

.docs-anatomy-callout[data-dir="bottom"] .docs-anatomy-callout-line {
  width: 1px;
  height: 16px;
}

/* Left: badge on left, line pointing right to component */
.docs-anatomy-callout[data-dir="left"] {
  flex-direction: row;
  right: calc(100% + 4px);
}

.docs-anatomy-callout[data-dir="left"] .docs-anatomy-callout-line {
  height: 1px;
  width: 16px;
}

/* Right: line on left, badge on right */
.docs-anatomy-callout[data-dir="right"] {
  flex-direction: row;
  left: calc(100% + 4px);
}

.docs-anatomy-callout[data-dir="right"] .docs-anatomy-callout-line {
  height: 1px;
  width: 16px;
}

.docs-anatomy-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--docs-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.docs-anatomy-footnotes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px 20px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.docs-anatomy-footnotes li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--docs-text-1);
  line-height: 1.4;
}

.docs-anatomy-footnotes .docs-anatomy-badge-inline {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--docs-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1;
}

/* ─── Behavior items (2-col: example + description) ─── */
.docs-behavior-list {
  display: grid;
  gap: 20px;
  margin: 16px 0;
}

.docs-behavior-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: stretch;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
}

.docs-behavior-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 10px;
  background: var(--docs-surface-2);
  min-height: 56px;
  overflow: hidden;
}

.docs-behavior-body h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.docs-behavior-body p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--docs-text-1);
  line-height: 1.5;
}

@media (max-width: 980px) {
  .docs-behavior-item {
    grid-template-columns: 1fr;
  }
}

/* ─── Theming section (inline brand/mode switches + scoped preview) ─── */
.docs-theme-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin: 0 0 16px;
}

.docs-theme-controls-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
  margin-inline-end: 4px;
}

.docs-theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

/* ─── Theming demo ─── */
.docs-theme-demo {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

.docs-theme-demo-card {
  border-radius: 14px;
  border: 1px solid var(--docs-border);
  overflow: hidden;
  box-shadow: var(--docs-shadow-sm);
}

.docs-theme-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--docs-surface-2);
  border-block-end: 1px solid var(--docs-border);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--docs-text-1);
}

.docs-theme-demo-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 20px;
  background: var(--color-fill-surface, #fff);
}

.docs-token-layer-diagram {
  display: grid;
  gap: 0;
  margin: 16px 0;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  overflow: hidden;
  box-shadow: var(--docs-shadow-sm);
}

.docs-token-layer {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-block-end: 1px solid var(--docs-border);
  font-size: 0.88rem;
}

.docs-token-layer:last-child {
  border-block-end: 0;
}

.docs-token-layer-name {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--docs-text-0);
}

.docs-token-layer-desc {
  color: var(--docs-text-1);
  font-size: 0.84rem;
}

.docs-token-layer[data-active] {
  background: rgba(37, 99, 235, 0.06);
}

.docs-token-layer[data-active] .docs-token-layer-name {
  color: var(--docs-accent);
}

/* ─── Richer homepage ─── */
.docs-home-hero {
  padding: 48px 0 36px;
  text-align: center;
}

.docs-home-hero h1 {
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 12px;
}

.docs-home-hero p {
  max-width: 56ch;
  margin: 0 auto;
  color: var(--docs-text-1);
  font-size: 1.1rem;
  line-height: 1.6;
}

.docs-home-section {
  margin: 36px 0;
}

.docs-home-section h2 {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
  margin: 0 0 14px;
}

/* ─── Resource links (Spectrum-style) ─── */
.docs-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.docs-resource-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.docs-resource-card:hover {
  transform: translateY(-2px);
  border-color: var(--docs-border-strong);
  box-shadow: var(--docs-shadow-md);
}

.docs-resource-card strong {
  font-size: 0.95rem;
}

.docs-resource-card span {
  font-size: 0.86rem;
  color: var(--docs-text-1);
  line-height: 1.5;
}

/* ─── Principle cards ─── */
.docs-principle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.docs-principle-card {
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
}

.docs-principle-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.docs-principle-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--docs-text-1);
  line-height: 1.5;
}

/* ─── Docs utility classes (replace inline styles) ─── */

.docs-states-grid {
  display: grid;
  grid-template-columns: repeat(var(--docs-states-cols, 5), 1fr);
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  margin: 16px 0;
}

.docs-states-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 20px 12px 14px;
  border-inline-end: 1px solid var(--docs-border);
  border-block-end: 1px solid var(--docs-border);
}

.docs-states-grid-row-header {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  grid-column: 1 / -1;
  border-block-end: 1px solid var(--docs-border);
  background: var(--docs-surface-2);
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--docs-text-1);
}

.docs-states-grid-item-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
}

.docs-states-grid-item-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--docs-text-1);
}

@media (max-width: 980px) {
  .docs-states-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

.docs-component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.docs-component-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.docs-component-card:hover {
  transform: translateY(-2px);
  border-color: var(--docs-border-strong);
  box-shadow: var(--docs-shadow-md);
}

.docs-component-card-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 16px;
  background: var(--docs-surface-2);
  border-block-end: 1px solid var(--docs-border);
  min-height: 72px;
}

.docs-component-card-body {
  padding: 14px 16px;
}

.docs-component-card-body h2 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.docs-component-card-body p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--docs-text-1);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docs-narrow-stack {
  max-inline-size: 28rem;
}

.docs-medium-stack {
  max-inline-size: 34rem;
}

.docs-icon-line-height {
  line-height: 24px;
}

.docs-guideline-spacer {
  display: inline-block;
  width: 40px;
}

.docs-dont-custom-color {
  background: #eab308;
  border-color: #eab308;
}

.docs-icon-color-brand {
  color: var(--color-text-brand, #0057b8);
}

.docs-icon-color-danger {
  color: var(--color-text-danger, #d81b60);
}

/* ─── Responsive adjustments for new patterns ─── */
@media (max-width: 980px) {
  .docs-search-results {
    position: fixed;
    left: 16px;
    right: 16px;
    top: auto;
  }

  .docs-toc-list {
    columns: 1;
  }

  .docs-guideline {
    grid-template-columns: 1fr;
  }

  .docs-changelog-entry {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .docs-checklist {
    grid-template-columns: 1fr;
  }
}

/* ─── Docs search ─── */
.docs-search {
  position: relative;
  margin: 0 0 16px;
}

.docs-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--docs-border);
  border-radius: 10px;
  background: var(--docs-surface-1);
  color: var(--docs-text-0);
  font-family: var(--docs-font-sans);
  font-size: 0.88rem;
  outline: none;
  box-sizing: border-box;
}

.docs-search-input::placeholder {
  color: var(--docs-text-1);
}

.docs-search-input:focus {
  border-color: var(--docs-accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.docs-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-md);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}

.docs-search-result {
  margin: 0;
  padding: 0;
}

.docs-search-result a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--docs-text-0);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.4;
}

.docs-search-result a:hover,
.docs-search-result[aria-selected="true"] a {
  background: var(--docs-surface-2);
}

.docs-search-type {
  flex-shrink: 0;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--docs-surface-2);
  color: var(--docs-text-1);
}

.docs-search-empty {
  padding: 12px 10px;
  font-size: 0.88rem;
  color: var(--docs-text-1);
}

/* Footer */
.docs-footer {
  padding-block: var(--size-spacing-400, 1rem);
  padding-inline: var(--size-spacing-600, 1.5rem);
  margin-block-start: var(--size-spacing-900, 3rem);
  border-block-start: 1px solid var(--docs-border, #d9e1ec);
  font-size: 0.82rem;
  color: var(--docs-text-1, #6b7a90);
  text-align: center;
}

.docs-footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.docs-footer a:hover {
  color: var(--docs-text-0, #1a2233);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Color Palette Page — Spectrum-inspired layout
   ═══════════════════════════════════════════════════════════════════════════ */

.palette-nav {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  margin-bottom: 2rem;
}

.palette-nav a {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--docs-text-1);
  transition: all 120ms ease;
}

.palette-nav a:hover {
  background: var(--docs-surface-2);
  color: var(--docs-text-0);
}

.section-description {
  margin: 0 0 1.5rem;
  color: var(--docs-text-1);
  font-size: 0.92rem;
  max-width: 72ch;
}

/* ─── Color family block ─── */
.color-family {
  margin-bottom: 2.5rem;
}

.color-family h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

/* ─── Horizontal color ramp bar ─── */
.color-ramp {
  display: flex;
  border-radius: 10px;
  overflow: hidden;
  height: 48px;
  border: 1px solid var(--docs-border);
  box-shadow: var(--docs-shadow-sm);
  margin-bottom: 1rem;
}

.color-ramp-step {
  flex: 1;
  min-width: 0;
  transition: flex 180ms ease;
}

.color-ramp-step:hover {
  flex: 2;
}

/* ─── Token data table ─── */
.color-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
}

.color-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.84rem;
}

.color-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
  background: var(--docs-surface-2);
  border-bottom: 1px solid var(--docs-border);
  position: sticky;
  top: 0;
  z-index: 1;
}

.color-table .th-hint {
  font-weight: 600;
  opacity: 0.7;
}

.color-table td {
  padding: 7px 12px;
  border-bottom: 1px solid var(--docs-border);
  vertical-align: middle;
}

.color-table tbody tr:last-child td {
  border-bottom: 0;
}

.color-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.03);
}

/* Preview dot */
.color-table-preview {
  width: 40px;
  padding-right: 0;
}

.color-dot {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  vertical-align: middle;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

/* Columns */
.color-table-name {
  font-weight: 600;
  white-space: nowrap;
}

.color-table-token code {
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--docs-surface-2);
  word-break: break-all;
}

.color-table-contrast {
  font-family: var(--docs-code-font);
  font-size: 0.78rem;
  color: var(--docs-text-1);
  white-space: nowrap;
}

.color-table-hex code {
  font-size: 0.78rem;
  color: var(--docs-text-1);
}

/* ─── Brand sections toggle ─── */
.brand-section[hidden] {
  display: none;
}

/* ─── Responsive ─── */
@media (max-width: 980px) {
  .color-ramp {
    height: 36px;
  }

  .color-table {
    font-size: 0.78rem;
    min-width: 580px;
  }

  .palette-nav {
    flex-wrap: wrap;
  }
}

/* ─── TOC sidebar nested sublist for color families ─── */
.docs-toc-sidebar-sublist {
  list-style: none;
  margin: 4px 0 4px 12px;
  padding: 0;
  display: grid;
  gap: 1px;
  border-inline-start: 1px solid var(--docs-border);
  padding-inline-start: 8px;
}

.docs-toc-sidebar-sublist a {
  display: block;
  padding: 3px 6px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--docs-text-1);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.4;
  transition: color 120ms ease, background 120ms ease;
}

.docs-toc-sidebar-sublist a:hover {
  color: var(--docs-text-0);
  background: var(--docs-surface-2);
}

.docs-toc-sidebar-sublist a.is-active {
  color: var(--docs-accent);
  background: rgba(37, 99, 235, 0.06);
}

/* ═══════════════════════════════════════════════════════════════════════════
   Typography Page — Spectrum-inspired layout
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Typeface specimens ─── */
.type-specimens {
  display: grid;
  gap: 16px;
}

.type-specimen {
  border-radius: 14px;
  border: 1px solid var(--docs-border);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  overflow: hidden;
}

.type-specimen-sample {
  padding: 32px 24px 24px;
  background: var(--docs-surface-2);
  border-bottom: 1px solid var(--docs-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.type-specimen-sample * {
  font-family: inherit;
}

.type-specimen-large {
  font-size: 4rem;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.02em;
}

.type-specimen-alphabet {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--docs-text-1);
  letter-spacing: 0.02em;
  word-break: break-all;
}

.type-specimen-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 24px;
}

.type-specimen-name {
  font-size: 0.92rem;
  font-weight: 700;
}

.type-specimen-token {
  font-size: 0.78rem;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--docs-surface-2);
  color: var(--docs-text-1);
}

/* ─── Type scale tables (heading + text) ─── */
.type-scale-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--docs-border);
  border-radius: 14px;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
}

.type-scale-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.type-scale-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
  background: var(--docs-surface-2);
  border-bottom: 1px solid var(--docs-border);
}

.type-scale-table td {
  padding: 16px;
  border-bottom: 1px solid var(--docs-border);
  vertical-align: middle;
}

.type-scale-table tbody tr:last-child td {
  border-bottom: 0;
}

.type-scale-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.02);
}

.type-scale-table-size {
  width: 80px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--docs-text-1);
  white-space: nowrap;
}

.type-scale-table-class {
  width: 240px;
  white-space: nowrap;
}

.type-scale-table-class code {
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--docs-surface-2);
}

.type-scale-table-sample {
  color: var(--docs-text-0);
}

.type-scale-table-sample .heading-xxxl,
.type-scale-table-sample .heading-xxl,
.type-scale-table-sample .heading-xl,
.type-scale-table-sample .heading-lg,
.type-scale-table-sample .heading-md,
.type-scale-table-sample .heading-sm {
  margin: 0;
  color: inherit;
}

/* ─── Token tables (sizes, weights, line-heights) ─── */
.type-token-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--docs-border);
  border-radius: 14px;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
}

.type-token-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.type-token-table th {
  text-align: left;
  padding: 10px 16px;
  font-size: 0.69rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--docs-text-1);
  background: var(--docs-surface-2);
  border-bottom: 1px solid var(--docs-border);
}

.type-token-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--docs-border);
  vertical-align: middle;
}

.type-token-table tbody tr:last-child td {
  border-bottom: 0;
}

.type-token-table tbody tr:hover td {
  background: rgba(37, 99, 235, 0.02);
}

.type-token-table td code {
  font-size: 0.78rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--docs-surface-2);
}

.type-token-table-value {
  font-family: var(--docs-code-font);
  font-size: 0.82rem;
  color: var(--docs-text-1);
  white-space: nowrap;
}

.type-token-table-preview {
  color: var(--docs-text-0);
}

/* ─── Pipeline flow diagram (box design) ─── */
.pipeline-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 1.5rem 0;
}

.pipeline-step {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 320px;
  padding: 14px 20px;
  border-radius: 10px;
  border: 1px solid var(--docs-border-strong);
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  text-align: center;
}

.pipeline-step-label {
  font-family: var(--docs-code-font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--docs-text-0);
}

.pipeline-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px 0;
  color: var(--docs-text-1);
}

.pipeline-arrow::before {
  content: "";
  display: block;
  width: 1px;
  height: 12px;
  background: var(--docs-border-strong);
}

.pipeline-arrow span {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--docs-accent);
  padding: 2px 0;
}

.pipeline-arrow::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--docs-border-strong);
}

@media (max-width: 980px) {
  .pipeline-step {
    min-width: 0;
    width: 100%;
  }
}

/* ─── Collapsible color families ─── */
details.color-family {
  margin-bottom: 8px;
  border: 1px solid var(--docs-border);
  border-radius: 12px;
  background: var(--docs-surface-1);
  box-shadow: var(--docs-shadow-sm);
  overflow: hidden;
}

details.color-family[open] {
  margin-bottom: 16px;
}

.color-family-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 120ms ease;
}

.color-family-summary::-webkit-details-marker {
  display: none;
}

.color-family-summary:hover {
  background: var(--docs-surface-2);
}

.color-family-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--docs-text-0);
  min-width: 140px;
}

.color-family-ramp {
  display: flex;
  flex: 1;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.color-family-ramp-step {
  flex: 1;
  min-width: 0;
}

details.color-family > .color-ramp {
  margin: 0 16px 12px;
}

details.color-family > .color-table-wrap {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--docs-border);
  box-shadow: none;
}

/* ─── Section dividers between major color sections ─── */
#primitives,
#brands,
#semantic-light,
#semantic-dark {
  padding-top: 2rem;
  border-top: 2px solid var(--docs-border);
  margin-top: 2rem;
}

#primitives {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

/* ─── Architecture hero table ─── */
.arch-hero-table {
  overflow-x: auto;
  border: 2px solid var(--docs-accent);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.03), transparent);
  box-shadow:
    var(--docs-shadow-sm),
    0 0 0 4px rgba(37, 99, 235, 0.06);
}

.arch-hero-table .docs-table th {
  background: rgba(37, 99, 235, 0.06);
}

.arch-hero-table .docs-table td:first-child {
  font-size: 0.95rem;
}

/* ─── Nested nav sub-group (Design Tokens, Governance) ─── */
.docs-nav-subgroup {
  margin: 0;
  padding: 0;
  border: 0;
}

.docs-nav-subgroup > summary {
  display: block;
  list-style: none;
}

.docs-nav-subgroup > summary::-webkit-details-marker {
  display: none;
}

.docs-nav-subgroup > summary > a {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--docs-text-1);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 120ms ease;
}

.docs-nav-subgroup > summary > a:hover {
  border-color: var(--docs-border);
  background: #fff;
  color: var(--docs-text-0);
}

.docs-nav-subgroup > summary > a[aria-current="page"] {
  border-color: var(--docs-border-strong);
  background: #fff;
  color: var(--docs-text-0);
  box-shadow: var(--docs-shadow-sm);
  font-weight: 700;
}

.docs-nav-subgroup > ul {
  list-style: none;
  margin: 2px 0 2px 14px;
  padding: 0;
  display: grid;
  gap: 2px;
}

.docs-nav-subgroup > ul a {
  display: block;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--docs-text-1);
  font-size: 0.86rem;
  font-weight: 600;
  transition: all 120ms ease;
}

.docs-nav-subgroup > ul a:hover {
  border-color: var(--docs-border);
  background: #fff;
  color: var(--docs-text-0);
}

.docs-nav-subgroup > ul a[aria-current="page"] {
  border-color: var(--docs-border-strong);
  background: #fff;
  color: var(--docs-text-0);
  box-shadow: var(--docs-shadow-sm);
  font-weight: 700;
}
