/* SolU Python Docs — page-owned Calm Technical Workbench layout. */

.python-docs-page {
  height: auto;
  min-height: 100%;
  background: #fff;
}

.python-docs-page code {
  font-family: "IBM Plex Mono", Consolas, monospace;
  font-variant-ligatures: none;
}

.python-docs__header-location {
  color: var(--wb-primary);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.python-docs {
  --docs-reading-width: 75ch;
  --docs-toc-width: 282px;
  min-width: 0;
  padding: 0;
  display: grid;
  grid-template-columns: var(--docs-toc-width) minmax(520px, 1fr);
  gap: 0;
  align-items: stretch;
  background: #fff;
}

.python-docs :is(h1, h2, h3, p, dl, ol) {
  margin: 0;
}

.python-docs :is(a, summary) {
  text-underline-offset: 3px;
}

.python-docs :is(.python-docs__hero, .python-docs__section) {
  scroll-margin-top: var(--wb-space-5);
}

.python-docs__guide :is(h2, h3)[id] {
  scroll-margin-top: var(--wb-space-5);
}

.python-docs__toc-shell {
  min-width: 0;
  background: #fff;
}

.python-docs__toc-shell {
  border-right: 1px solid var(--wb-line);
}

@media (min-width: 900px) {
  body.python-docs-page > .workbench-rail {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--wb-rail-width);
    height: 100dvh;
  }

  body.python-docs-page > .topbar {
    position: fixed;
    z-index: 8;
    top: 0;
    right: 0;
    left: var(--wb-rail-width);
    height: var(--wb-header-height);
  }

  .python-docs :is(.python-docs__hero, .python-docs__section),
  .python-docs__guide :is(h2, h3)[id] {
    scroll-margin-top: calc(var(--wb-header-height) + var(--wb-space-5));
  }

  .python-docs__toc-shell {
    position: fixed;
    z-index: 7;
    top: var(--wb-header-height);
    bottom: 0;
    left: var(--wb-rail-width);
    width: var(--docs-toc-width);
    height: calc(100dvh - var(--wb-header-height));
    max-height: calc(100dvh - var(--wb-header-height));
    overflow: hidden;
  }

  .python-docs__content {
    grid-column: 2;
  }

  .python-docs__toc-disclosure {
    height: 100%;
  }

  .python-docs__toc-shell > .python-docs__toc-disclosure {
    position: relative;
  }

  .python-docs__toc-disclosure > .python-docs__nav {
    height: calc(100dvh - var(--wb-header-height));
    max-height: calc(100dvh - var(--wb-header-height));
    overflow-y: auto;
    scrollbar-width: none;
  }

  .python-docs__toc-disclosure > .python-docs__nav::-webkit-scrollbar {
    display: none;
  }
}

.python-docs__toc-disclosure {
  position: static;
  max-height: none;
  overflow: visible;
}

.python-docs__toc-disclosure > summary {
  display: none;
}

.python-docs__nav {
  position: static;
  min-width: 0;
  max-height: none;
  padding: 20px 14px 58px;
  display: grid;
  gap: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.python-docs__nav-heading {
  padding: 0 8px 12px;
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  color: var(--wb-muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.python-docs__nav-heading svg {
  width: 18px;
  height: 18px;
}

.python-docs__nav-group {
  min-width: 0;
  padding: 0 0 12px;
  display: grid;
  gap: var(--wb-space-1);
  border-bottom: 1px solid var(--wb-line);
}

.python-docs__nav-group + .python-docs__nav-group {
  padding-top: 12px;
}

.python-docs__nav-group:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.python-docs__nav-group h2 {
  padding: 0 8px 4px;
  color: var(--wb-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.python-docs__nav a {
  min-height: 38px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  color: var(--wb-ink);
  border-left: 3px solid transparent;
  border-radius: var(--wb-radius-sm);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
}

.python-docs__nav-more {
  display: none;
}

@media (min-width: 900px) {
  .python-docs__nav-more:not([hidden]) {
    position: absolute;
    z-index: 1;
    right: 14px;
    bottom: 8px;
    left: 14px;
    min-height: 44px;
    display: grid;
    place-items: end center;
    padding: 8px 0 4px;
    border: 0;
    border-top: 1px solid var(--wb-line);
    border-radius: 0;
    color: var(--wb-primary);
    background: linear-gradient(to bottom, transparent, #fff 42%);
    cursor: pointer;
  }

  .python-docs__nav-more svg {
    width: 22px;
    height: 22px;
    stroke-width: 2;
  }

  .python-docs__nav-more:hover {
    color: color-mix(in oklch, var(--wb-primary) 80%, var(--wb-ink));
  }

  .python-docs__nav-more:focus-visible {
    outline: 2px solid var(--wb-primary);
    outline-offset: -2px;
  }
}

.python-docs__nav a span {
  margin-left: 0.3em;
  color: var(--wb-muted);
  font-size: 0.82rem;
}

.python-docs__nav a:hover {
  color: var(--wb-primary);
  background: color-mix(in oklch, var(--wb-primary) 5%, white);
}

.python-docs__nav a:focus-visible {
  color: var(--wb-primary);
  background: color-mix(in oklch, var(--wb-primary) 7%, white);
  outline: 3px solid color-mix(in oklch, var(--wb-primary) 72%, white);
  outline-offset: 1px;
}

.python-docs__nav a:is([aria-current="location"], [aria-current="page"]) {
  color: var(--wb-primary);
  border-left-color: var(--wb-primary);
  background: color-mix(in oklch, var(--wb-primary) 9%, white);
  font-weight: 700;
}

.python-docs__content {
  min-width: 0;
  display: block;
  border-right: 0;
  background: #fff;
}

.python-docs__hero,
.python-docs__section {
  min-width: 0;
  padding: 24px clamp(28px, 3vw, 48px);
  display: grid;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--wb-line);
  border-radius: 0;
  background: #fff;
}

.python-docs__hero {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  padding-top: 24px;
}

.python-docs .panel-label {
  padding: 0;
  display: flex;
  align-items: center;
  gap: var(--wb-space-2);
  color: var(--wb-primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.python-docs .panel-label svg {
  width: 18px;
  height: 18px;
}

.python-docs h2 {
  max-width: var(--docs-reading-width);
  color: var(--wb-ink);
  font-size: clamp(1.16rem, 1.6vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.16;
}

.python-docs__guide > h1 {
  max-width: var(--docs-reading-width);
  color: var(--wb-ink);
  font-size: clamp(1.16rem, 1.6vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
}

.python-docs__guide > h2 {
  margin-top: var(--wb-space-5);
  padding-top: var(--wb-space-6);
  border-top: 1px solid var(--wb-line);
}

.python-docs__guide > h3 {
  margin-top: var(--wb-space-2);
}

.python-docs__guide :is(ul, ol) {
  max-width: var(--docs-reading-width);
  margin: 0;
  padding-left: var(--wb-space-6);
  color: color-mix(in oklch, var(--wb-ink) 78%, white);
  line-height: 1.6;
}

.python-docs__guide li + li {
  margin-top: 6px;
}

.python-docs__guide :is(p, li) a {
  color: var(--wb-primary);
  font-weight: 600;
}

.python-docs__guide blockquote {
  max-width: var(--docs-reading-width);
  margin: 0;
  padding: 14px 16px;
  border-left: 4px solid color-mix(in oklch, var(--wb-primary) 42%, white);
  background: color-mix(in oklch, var(--wb-primary) 5%, white);
  color: color-mix(in oklch, var(--wb-ink) 78%, white);
}

.python-docs h3 {
  color: var(--wb-ink);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.python-docs .python-docs__nav-group h2 {
  padding: 0 10px 6px;
  color: var(--wb-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 1.4;
  text-transform: uppercase;
}

.python-docs p {
  max-width: var(--docs-reading-width);
  color: color-mix(in oklch, var(--wb-ink) 76%, white);
  font-size: 1rem;
  line-height: 1.65;
}

.python-docs p a {
  color: var(--wb-primary);
  font-weight: 600;
}

.python-docs__steps {
  max-width: var(--docs-reading-width);
  padding-left: 1.5rem;
  color: color-mix(in oklch, var(--wb-ink) 76%, white);
  line-height: 1.6;
}

.python-docs__steps li + li {
  margin-top: var(--wb-space-2);
}

.python-docs__workflow {
  padding: 18px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none;
  border-block: 1px solid var(--wb-line);
}

.python-docs__workflow li {
  position: relative;
  min-width: 0;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: 10px;
  align-items: center;
}

.python-docs__workflow li:first-child {
  padding-left: 0;
}

.python-docs__workflow li + li {
  border-left: 1px solid var(--wb-line);
}

.python-docs__workflow li > span {
  grid-row: 1 / 3;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in oklch, var(--wb-primary) 42%, white);
  border-radius: 50%;
  color: var(--wb-primary);
  font: 600 0.76rem/1 "IBM Plex Mono", Consolas, monospace;
}

.python-docs__workflow strong {
  color: var(--wb-ink);
  font-size: 0.96rem;
}

.python-docs__workflow small {
  color: var(--wb-muted);
  font-size: 0.78rem;
}

.python-docs__code-frame {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  background: var(--wb-canvas);
}

.python-docs__code-shell {
  position: relative;
  min-width: 0;
}

.python-docs__copy {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border: 1px solid #647b94;
  border-radius: 7px;
  color: #d9e4f2;
  background: #172536;
  box-shadow: 0 2px 8px rgb(0 0 0 / 18%);
  cursor: pointer;
}

.python-docs__copy:hover {
  color: #fff;
  border-color: #8aa6c4;
  background: #21354b;
}

.python-docs__copy:focus-visible {
  outline: 3px solid var(--wb-focus);
  outline-offset: 2px;
}

.python-docs__copy[data-copy-state="copied"] {
  color: #b8f2d0;
  border-color: #4da875;
}

.python-docs__copy[data-copy-state="error"] {
  color: #ffd0cb;
  border-color: #cf6258;
}

.python-docs__copy svg {
  width: 17px;
  height: 17px;
}

.python-docs__code-frame > .python-docs__copy {
  top: 48px;
}

.python-docs__code-caption {
  min-height: 38px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--wb-line);
  color: var(--wb-muted);
  font: 500 0.78rem/1.3 "IBM Plex Mono", Consolas, monospace;
}

.python-docs__code {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 15px 56px 15px 16px;
  overflow-x: auto;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  background: var(--wb-canvas);
  color: var(--wb-ink);
  font: 0.86rem/1.65 "IBM Plex Mono", Consolas, monospace;
  tab-size: 2;
}

.python-docs__code-frame .python-docs__code {
  border: 0;
  border-radius: 0;
}

.python-docs__code code {
  color: inherit;
  white-space: pre;
}

.python-docs__callout {
  min-width: 0;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 1px solid color-mix(in oklch, var(--wb-primary) 36%, white);
  border-left-width: 4px;
  border-radius: var(--wb-radius-sm);
  background: color-mix(in oklch, var(--wb-primary) 5%, white);
}

.python-docs__callout > svg {
  width: 22px;
  height: 22px;
}

.python-docs__callout > div,
.python-docs__callout:not(:has(> div)) {
  align-content: start;
}

.python-docs__callout:not(:has(> div)) {
  grid-template-columns: minmax(0, 1fr);
}

.python-docs__callout strong,
.python-docs__callout span {
  display: block;
}

.python-docs__callout strong {
  color: var(--wb-primary);
  font-size: 0.94rem;
}

.python-docs__callout span {
  margin-top: 3px;
  color: color-mix(in oklch, var(--wb-ink) 78%, white);
  line-height: 1.5;
}

.python-docs__callout--warn {
  color: var(--wb-warning-ink);
  border-color: color-mix(in oklch, var(--wb-warning) 76%, white);
  background: color-mix(in oklch, var(--wb-warning) 8%, white);
}

.python-docs__callout--warn strong {
  color: var(--wb-warning-ink);
}

.python-docs__example-link,
.python-docs__reference-link {
  width: fit-content;
  display: inline-flex;
  align-items: center;
  gap: var(--wb-space-2);
  color: var(--wb-primary);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
  text-decoration: none;
}

.python-docs__example-link:hover,
.python-docs__reference-link:hover {
  text-decoration: underline;
}

.python-docs__example-link svg {
  width: 18px;
  height: 18px;
}

.python-docs__quick-error {
  padding-top: 18px;
  border-top: 1px solid var(--wb-line);
}

.python-docs__quick-error summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--wb-ink);
  font-weight: 600;
  cursor: pointer;
}

.python-docs__quick-error p {
  padding: 4px 0 0 24px;
}

.python-docs__grid,
.python-docs__api-list,
.python-docs__examples {
  min-width: 0;
  display: grid;
  gap: 0;
  border-top: 1px solid var(--wb-line);
}

.python-docs__grid--two,
.python-docs__grid--three,
.python-docs__api-list,
.python-docs__examples {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.python-docs__card,
.python-docs__api-card,
.python-docs__examples > section {
  min-width: 0;
  padding: 18px 18px 18px 0;
  display: grid;
  align-content: start;
  gap: var(--wb-space-2);
  border: 0;
  border-bottom: 1px solid var(--wb-line);
  border-radius: 0;
  background: transparent;
}

.python-docs__card:nth-child(even),
.python-docs__api-card:nth-child(even),
.python-docs__examples > section:nth-child(even) {
  padding-left: 18px;
  padding-right: 0;
  border-left: 1px solid var(--wb-line);
}

.python-docs__api-card h3 code {
  white-space: normal;
}

.python-docs__tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--wb-muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.python-docs__tokens code {
  padding: 4px 7px;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
  background: var(--wb-canvas);
  color: var(--wb-ink);
}

.python-docs__table-wrap {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--wb-line);
  border-radius: var(--wb-radius-sm);
}

.python-docs__table {
  width: 100%;
  min-width: 680px;
  border: 0;
  border-collapse: collapse;
  border-radius: 0;
  background: #fff;
}

.python-docs__table th,
.python-docs__table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--wb-line);
  text-align: left;
  vertical-align: top;
}

.python-docs__table th {
  color: var(--wb-muted);
  background: var(--wb-canvas);
  font-size: 0.75rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.python-docs__table tr:last-child td {
  border-bottom: 0;
}

.python-docs__reference-block {
  width: 100%;
  max-width: var(--docs-reading-width);
  padding-top: 18px;
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--wb-line);
}

.python-docs__reference-block > h3 {
  font-size: 0.88rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.python-docs__limits,
.python-docs__commands {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.python-docs__limits div,
.python-docs__commands div {
  min-width: 0;
  padding: 10px 2px;
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--wb-line);
  border-radius: 0;
  background: transparent;
}

.python-docs__limits dt,
.python-docs__limits dd,
.python-docs__commands dt,
.python-docs__commands dd {
  min-width: 0;
  margin: 0;
  color: var(--wb-ink);
  font-size: 0.86rem;
  line-height: 1.4;
}

.python-docs__limits dd,
.python-docs__commands dd {
  font-variant-numeric: tabular-nums;
}

.python-docs__limits span {
  color: inherit;
  font: inherit;
  font-weight: inherit;
}

.python-docs__commands dt code {
  color: var(--wb-primary);
  font-size: 0.78rem;
  font-weight: 600;
  overflow-wrap: normal;
  white-space: nowrap;
}

.python-docs__commands div {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.python-docs__reference-link {
  margin-top: 18px;
}

.python-docs__reference-note {
  margin-top: 8px !important;
  color: var(--wb-muted) !important;
  font-size: 0.82rem !important;
  line-height: 1.45 !important;
}

.python-docs-page > .bottombar {
  min-height: 48px;
}

@media (min-width: 900px) and (max-width: 1279px) {
  .python-docs {
    --docs-toc-width: 230px;
    grid-template-columns: var(--docs-toc-width) minmax(0, 1fr);
  }

  .python-docs__nav {
    padding: 18px 12px 56px;
  }

  .python-docs__hero,
  .python-docs__section {
    padding-inline: clamp(24px, 4vw, 42px);
  }

}

@media (min-width: 768px) and (max-width: 899px) {
  body.python-docs-page > .topbar {
    min-height: 64px;
    padding-inline: 16px;
  }

  body.python-docs-page > .topbar .topbar__brand {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }

  body.python-docs-page > .topbar .topbar__title {
    font-size: 1.08rem;
  }

  body.python-docs-page > .topbar .topbar__subtitle {
    display: none;
  }

  .python-docs__header-location {
    display: none;
  }

  .python-docs {
    padding: 12px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 12px;
    background: var(--wb-canvas);
  }

  .python-docs__toc-shell {
    grid-row: 1;
    border: 1px solid var(--wb-line);
    border-radius: var(--wb-radius-sm);
  }

  .python-docs__toc-disclosure {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .python-docs__toc-disclosure > summary {
    min-height: 52px;
    padding: 10px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    color: var(--wb-ink);
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }

  .python-docs__toc-disclosure > summary::-webkit-details-marker {
    display: none;
  }

  .python-docs__toc-disclosure > summary svg {
    width: 20px;
    height: 20px;
    transition: transform 120ms ease;
  }

  .python-docs__toc-disclosure[open] > summary svg {
    transform: rotate(180deg);
  }

  .python-docs__nav-current {
    min-width: 0;
    overflow: hidden;
    color: var(--wb-primary);
    font-size: 0.84rem;
    font-weight: 600;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .python-docs__nav {
    padding: 0 12px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 16px;
    border-top: 1px solid var(--wb-line);
  }

  .python-docs__nav-heading {
    display: none;
  }

  .python-docs__nav-group,
  .python-docs__nav-group + .python-docs__nav-group {
    padding: 14px 0;
    border-bottom: 1px solid var(--wb-line);
  }

  .python-docs__nav-group:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .python-docs__nav a {
    min-height: 40px;
    font-size: 0.9rem;
  }

  .python-docs__content {
    grid-column: 1;
    grid-row: 2;
    border: 1px solid var(--wb-line);
    border-radius: var(--wb-radius-sm);
  }

  .python-docs__hero,
  .python-docs__section {
    padding: 24px;
  }

  .python-docs__workflow li {
    padding-inline: 10px;
  }

  .python-docs__workflow small {
    display: none;
  }

  .python-docs__grid--two,
  .python-docs__grid--three,
  .python-docs__api-list,
  .python-docs__examples {
    grid-template-columns: minmax(0, 1fr);
  }

  .python-docs__card:nth-child(even),
  .python-docs__api-card:nth-child(even),
  .python-docs__examples > section:nth-child(even) {
    padding-left: 0;
    padding-right: 18px;
    border-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .python-docs__toc-disclosure > summary svg {
    transition: none;
  }
}
