/* Documentation pages (/docs/<section>/<page>): sidebar, article, terminal blocks, screenshots.
   Built on the dark home tokens (home.css) and the v1 components (v1.css), so it loads after both. */

body.home .dx-hero.v1-page-hero { padding-bottom: clamp(36px, 4vw, 56px); }
.dx-hero h1 { max-width: 24ch; }
.dx-hero .v1-proof code { font-family: var(--hd-mono, ui-monospace, monospace); font-size: 12px; color: #fafaf9; }
.dx-crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: #85858c; }
.dx-crumbs a { color: #d4d4d8; text-decoration: none; }
.dx-crumbs a:hover { color: #4ade80; }

/* Sidebar + article */
body.home .dx-sec { padding-top: clamp(32px, 4vw, 56px); }
.dx-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 56px; align-items: start; }
.dx-side { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.dx-side a { color: var(--df-ink-soft); text-decoration: none; padding: 5px 10px; border-radius: 6px; line-height: 1.4; }
.dx-side a:hover { color: var(--df-ink); background: rgba(250, 250, 249, 0.04); }
.dx-side a[aria-current="page"] { color: #4ade80; background: rgba(74, 222, 128, 0.08); }
.dx-side a.dx-side-sub { margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--df-line, #2a2d34); border-radius: 0 6px 6px 0; font-size: 13px; }
.dx-side .dx-side-home { color: #85858c; margin-bottom: 10px; padding-left: 0; }
.dx-side-group { margin: 16px 0 4px; font-family: var(--hd-mono, ui-monospace, monospace); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6e7681; }

.dx-article { max-width: 78ch; }
.dx-article h2 { margin: 48px 0 12px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; letter-spacing: -0.015em; color: var(--df-ink); scroll-margin-top: 96px; }
.dx-article > h2:first-child { margin-top: 0; }
.dx-article h3 { scroll-margin-top: 96px; }
.dx-article .v1-table-wrap { margin: 4px 0 16px; }
.dx-article .v1-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.dx-article .v1-table tr:last-child td { border-bottom: 0; }

/* Terminal / console tabs */
.dx-tabs { margin: 18px 0 8px; border: 1px solid var(--df-line-strong); border-radius: 12px; overflow: hidden; }
.dx-tablist { padding: 6px 6px 0; background: #0b0d11; }
.dx-panel { padding: 8px 22px 18px; }
.dx-panel[hidden] { display: none; }
.dx-steps { list-style: none; counter-reset: dx; padding: 0 !important; margin: 0 !important; }
.dx-steps > li { counter-increment: dx; position: relative; padding: 18px 0 6px 44px; margin: 0 !important; border-bottom: 1px solid var(--df-line); }
.dx-steps > li:last-child { border-bottom: 0; }
.dx-steps > li::before { content: counter(dx); position: absolute; left: 0; top: 18px; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--hd-mono, ui-monospace, monospace); font-size: 13px; color: #4ade80; background: rgba(74, 222, 128, 0.1); }
.dx-steps h3 { margin: 2px 0 6px !important; font-size: 17px !important; }

/* Real terminal output */
.v1-prose pre.dx-term { font-size: 12.5px; line-height: 1.65; }
.dx-term .p { color: #4ade80; user-select: none; }
.dx-term .add { color: #7ee2a8; }
.dx-term .del { color: #f39c9c; }

.dx-note { margin: 14px 0 0; padding: 12px 16px; border-left: 3px solid #4ade80; background: rgba(74, 222, 128, 0.06); border-radius: 0 10px 10px 0; font-size: 14.5px; }

/* Screenshots and diagrams */
.dx-shot, .dx-fig { margin: 10px 0 18px; }
.dx-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--df-line-strong); border-radius: 10px; background: #0b0d11; }
.dx-fig svg { display: block; width: 100%; height: auto; border: 1px solid var(--df-line); border-radius: 12px; background: #0f1115; }
.dx-shot figcaption, .dx-fig figcaption { margin-top: 8px; font-size: 13px; color: #85858c; }

.dx-related { margin-top: 56px; padding-top: 8px; border-top: 1px solid var(--df-line); }

@media (max-width: 900px) {
  .dx-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .dx-side { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 6px; }
  .dx-side-group, .dx-side .dx-side-home { width: 100%; }
  .dx-panel { padding: 6px 14px 14px; }
  .dx-steps > li { padding-left: 38px; }
}

/* Option and value columns stay on one line */
.dx-article .v1-table td:first-child code, .dx-article .v1-table th:first-child code { white-space: nowrap; }
.dx-article .v1-table td:first-child { white-space: nowrap; }

/* On this page */
.dx-toc { margin: 0 0 32px; padding: 14px 18px; border: 1px solid var(--df-line); border-radius: 10px; background: rgba(250, 250, 249, 0.02); }
.dx-toc-h { font-family: var(--hd-mono, ui-monospace, monospace); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6e7681; margin-bottom: 6px; }
.v1-prose .dx-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; font-size: 14.5px; }
.v1-prose .dx-toc li { margin: 3px 0; break-inside: avoid; }
.v1-prose .dx-toc a { color: var(--df-ink-soft); text-decoration: none; }
.v1-prose .dx-toc a:hover { color: #4ade80; }
@media (max-width: 720px) { .v1-prose .dx-toc ol { columns: 1; } }

/* Console and terminal map: four columns, every one allowed to wrap */
.dx-article .v1-table.dx-map td:first-child { white-space: normal; min-width: 150px; }
.dx-article .v1-table.dx-map td:nth-child(2) { min-width: 170px; }
.dx-article .v1-table.dx-map td:nth-child(2) code { white-space: normal; word-break: break-word; }
.dx-article .v1-table.dx-map td:nth-child(3) code { white-space: nowrap; }
.dx-article .v1-table.dx-map td:nth-child(4) { min-width: 240px; }
/* Tall, narrow screenshots (a sidebar, a phone-width panel): shown at their own width, centred. */
.dx-shot.dx-shot--narrow { max-width: 360px; margin-inline: auto; }

/* The docs hub (/docs): a full index on the left, the sections of cards on the right (2026-11-27). */
body.home .dx-hub-wrap { padding-top: clamp(32px, 4vw, 56px); }
.dx-hub-side { max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; }
.dx-hub-side a.dx-side-group { display: block; margin: 18px 0 4px; padding: 4px 10px; border-radius: 6px; color: #6e7681; text-decoration: none; }
.dx-hub-side a.dx-side-group:first-child { margin-top: 0; }
.dx-hub-side a.dx-side-group:hover, .dx-hub-side a.dx-side-group[aria-current] { color: #4ade80; background: rgba(74, 222, 128, 0.08); }
.dx-hub-main { min-width: 0; }
.dx-hub-sec { scroll-margin-top: 96px; }
.dx-hub-sec + .dx-hub-sec { margin-top: clamp(48px, 5vw, 72px); padding-top: clamp(40px, 4vw, 56px); border-top: 1px solid var(--df-line); }
.dx-hub-sec .v1-shead { margin-bottom: 20px; }
@media (max-width: 1100px) { .dx-hub .v1-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  /* Phones and tablets: the index shrinks to its section names, as chips; the cards below list the pages. */
  .dx-hub-side { max-height: none; overflow: visible; padding-right: 0; }
  .dx-hub-side a:not(.dx-side-group) { display: none; }
  .dx-hub-side a.dx-side-group { width: auto; margin: 0; padding: 6px 12px; border: 1px solid var(--df-line); border-radius: 999px;
    font-size: 11px; color: #a1a1aa; }
  .dx-hub .v1-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Community rules page: category jump links, counts beside category headings, and rule tables that wrap. */
.dx-article .dx-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 20px; }
.dx-article .dx-jump a { padding: 4px 10px; border: 1px solid var(--df-line); border-radius: 999px; font-size: 12.5px; color: var(--df-ink-soft); text-decoration: none; }
.dx-article .dx-jump a:hover { color: #4ade80; border-color: rgba(74, 222, 128, 0.4); }
.dx-article h3 .dx-count { margin-left: 8px; font-family: var(--hd-mono, ui-monospace, monospace); font-size: 12px; font-weight: 400; color: #85858c; }
.dx-article h3[id^="pm-"], .dx-article h3[id^="rt-"] { scroll-margin-top: 96px; }
.dx-article .v1-table.dx-rules { font-size: 13.5px; }
.dx-article .v1-table.dx-rules td:first-child { white-space: normal; min-width: 200px; }
.dx-article .v1-table.dx-rules td:first-child code { display: inline-block; margin-top: 3px; font-size: 11.5px; color: #85858c; white-space: normal; word-break: break-word; }
.dx-article .v1-table.dx-rules td:nth-child(2) { min-width: 110px; }
.dx-article .v1-table.dx-rules td:nth-child(3) { min-width: 220px; }
@media (max-width: 640px) {
  /* Phones: each rule is a stacked block (name and id, then languages or data, then what it catches). */
  .dx-article .v1-table.dx-rules thead { display: none; }
  .dx-article .v1-table.dx-rules, .dx-article .v1-table.dx-rules tbody, .dx-article .v1-table.dx-rules tr,
  .dx-article .v1-table.dx-rules td { display: block; width: auto; min-width: 0 !important; }
  .dx-article .v1-table.dx-rules tr { padding: 12px 14px; border-bottom: 1px solid var(--df-line); }
  .dx-article .v1-table.dx-rules tr:last-child { border-bottom: 0; }
  .dx-article .v1-table.dx-rules td { padding: 0; border: 0; }
  .dx-article .v1-table.dx-rules td:nth-child(2) { margin-top: 6px; font-size: 12px; color: #85858c; }
  .dx-article .v1-table.dx-rules td:nth-child(3) { margin-top: 4px; }
}
