/* =============================================================================
   docs-nx.css — the Documentation area (/docs) in the New Experience.

   WHAT THIS IS
   ------------
   `/docs` is one page for everybody: an anonymous visitor gets the public shell
   (_PublicNav/_PublicFooter), a signed-in reader keeps the app's own chrome, and
   the docs BODY is identical in both (plans/docs-nx-review/decisions.md D2). So
   every docs view sets ViewData["NxPage"], which puts `body.pnx-page` on the page
   and loads public-nx.css — and every token below comes from there. No colour is
   declared here: paper, card, line, hairline, ink, the purple and its two tints,
   the amber band and the green are all --pnx-* (decisions.md D1).

   Every selector is `dnx-` prefixed, so nothing here can reach the app's own
   markup. public-nx.css owns the primitives (.pnx-wrap, .pnx-btn, .pnx-card,
   .pnx-chip, .pnx-nl, .pnx-ui, .pnx-h2, .pnx-lead); what follows is only the
   parts of the docs area those do not already draw.
============================================================================= */

/* =============================================================================
   0. Tokens, for the one place that is not a docs page

   The admin editor's preview pane renders the reader's own body markup so that it
   really is the page a reader gets — but it sits on an admin page, which carries
   neither `body.public-nx` nor `body.pnx-page`, so the --pnx-* tokens those
   declare are out of scope and every colour below would fall back to nothing.
   Re-declared here on `.dnx` itself, from the SAME themes.css variables, so there
   is still exactly one source for each value and no new colour.
============================================================================= */

.dnx {
    --pnx-paper: var(--bg-primary);
    --pnx-card: var(--bg-elevated);
    --pnx-line: var(--border-light);
    --pnx-hairline: #e3ddd5;
    --pnx-ink: var(--text-primary);
    --pnx-ink-2: var(--text-secondary);
    --pnx-ink-3: var(--text-muted);
    --pnx-fill: var(--bg-secondary);
    --pnx-accent: var(--brand-primary);
    --pnx-accent-ink: var(--brand-primary-hover);
    --pnx-accent-wash: #f1ecfb;
    --pnx-accent-edge: #ddd0f5;
    --pnx-amber-bg: #fdf3dc;
    --pnx-amber-edge: #f0c46a;
    --pnx-amber-ink: #92400e;
    --pnx-green: #0f8a5f;
    --pnx-radius: 12px;
    --pnx-gutter: 80px;
    --pnx-ease: cubic-bezier(.2, .8, .2, 1);
}

/* ---- the same tokens, on the night surface -------------------------------
   /docs now joins the marketing pages' look (body.mkt, wwwroot/css/marketing.css).
   Most of the block above already follows, because it reads themes.css variables
   that marketing.css flips. These are the ones written as literals, so they do
   not — and this sheet loads AFTER marketing.css, so they have to be answered on
   `.dnx` itself: custom properties are resolved on the element that declares
   them, and `.dnx` re-declares them below body. Same names, no new components.
-------------------------------------------------------------------------- */
body.mkt .dnx {
    --pnx-hairline: rgba(255, 255, 255, .06);
    --pnx-accent: #8b63ff;
    --pnx-accent-ink: #a183ff;
    --pnx-accent-wash: rgba(139, 99, 255, .12);
    --pnx-accent-edge: rgba(139, 99, 255, .34);
    --pnx-amber-bg: rgba(227, 184, 90, .09);
    --pnx-amber-edge: rgba(227, 184, 90, .3);
    --pnx-amber-ink: #e3b85a;
    --pnx-green: #56e39b;
}

/* =============================================================================
   1. The docs bar — search reachable from every page, not only the home page
============================================================================= */

.dnx-bar {
    border-bottom: 1px solid var(--pnx-line);
    background: var(--pnx-card);
}

.dnx-bar__row {
    min-height: 60px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.dnx-bar__home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
}

.dnx-bar__search {
    flex: 1;
    max-width: 420px;
    margin-left: auto;
}

/* The search field. One shape, three sizes: the bar's 38px, the phone bar's 40px
   and the hero/results 52px. */
.dnx-find {
    display: flex;
    gap: 10px;
}

.dnx-find__box {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 38px;
    padding: 0 13px;
    border: 1px solid var(--pnx-line);
    border-radius: 10px;
    background: var(--pnx-paper);
    box-sizing: border-box;
}

.dnx-find__box:focus-within {
    border-color: var(--pnx-accent);
    box-shadow: 0 0 0 3px var(--pnx-accent-wash);
}

.dnx-find__box svg {
    flex: none;
    color: var(--pnx-ink-2);
}

.dnx-find__input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: var(--pnx-ink);
    font-family: inherit;
}

.dnx-find__input::placeholder {
    color: var(--pnx-ink-3);
}

/* `type="search"` draws its own clear button in Chromium, so the field showed two
   of them side by side — the browser's, which only empties the input, and ours,
   which actually re-runs the search. Ours stays. */
.dnx-find__input::-webkit-search-cancel-button,
.dnx-find__input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

/* A reset button that only shows when there is something to reset. */
.dnx-find__clear {
    flex: none;
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pnx-ink-2);
    border-radius: 8px;
}

.dnx-find__clear:hover {
    color: var(--pnx-ink);
    background: var(--pnx-fill);
}

.dnx-find--lg .dnx-find__box {
    height: 52px;
    padding: 0 16px;
    border-radius: var(--pnx-radius);
    background: var(--pnx-card);
}

.dnx-find--lg .dnx-find__input {
    font-size: 16px;
}

.dnx-find--lg .dnx-btn,
.dnx-find--lg .pnx-btn {
    height: 52px;
}

/* =============================================================================
   2. The home page
============================================================================= */

.dnx-head {
    padding: 64px 0 56px;
    border-bottom: 1px solid var(--pnx-line);
}

.dnx-head__title {
    margin: 0;
    font-size: 56px;
    line-height: 1.04;
    font-weight: 500;
    letter-spacing: -0.03em;
    color: var(--pnx-ink);
}

.dnx-head__lead {
    margin: 12px 0 0;
    font-size: 19px;
    line-height: 1.6;
    color: var(--pnx-ink-2);
    max-width: 58ch;
}

.dnx-head__find {
    margin-top: 30px;
    max-width: 720px;
}

.dnx-head__findlabel {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 9px;
}

.dnx-common {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.dnx-common__label {
    font-size: 13px;
    color: var(--pnx-ink-3);
}

a.dnx-common__chip {
    text-decoration: none;
}

a.dnx-common__chip:hover {
    border-color: var(--pnx-accent);
    color: var(--pnx-accent-ink);
}

.dnx-s {
    padding: 56px 0 0;
}

.dnx-s--last {
    padding-bottom: 72px;
}

.dnx-s__head {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    flex-wrap: wrap;
}

.dnx-s__head > div:first-child {
    flex: 1;
    min-width: 280px;
}

/* ---- the category grid -------------------------------------------------- */

.dnx-cats {
    margin-top: 28px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

a.dnx-cat {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 20px 22px;
}

.dnx-cat__top {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dnx-cat__icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--pnx-accent-wash);
    color: var(--pnx-accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.dnx-cat__name {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--pnx-ink);
    letter-spacing: -0.01em;
}

.dnx-cat__count {
    margin-left: auto;
    flex: none;
}

.dnx-cat__desc {
    margin: 7px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--pnx-ink-2);
}

.dnx-cat__flags {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* A category that needs an account: listed, not hidden, and visibly quieter —
   the point of review Q3 is that the reader learns this BEFORE the click. */
a.dnx-cat--gated {
    background: var(--pnx-paper);
}

.dnx-cat--gated .dnx-cat__icon {
    background: var(--pnx-fill);
    color: var(--pnx-ink-2);
}

.dnx-cat--gated .dnx-cat__name {
    color: var(--pnx-ink-2);
}

/* ---- an article list ---------------------------------------------------- */

.dnx-list {
    margin-top: 24px;
    overflow: hidden;
}

a.dnx-row {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 16px 20px;
    border-top: 1px solid var(--pnx-hairline);
    text-decoration: none;
    color: inherit;
}

a.dnx-row:first-child {
    border-top: 0;
}

a.dnx-row:hover,
a.dnx-row:focus-visible {
    background: var(--pnx-accent-wash);
}

.dnx-row__n {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--pnx-accent-wash);
    color: var(--pnx-accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    font-size: 13px;
    font-weight: 700;
}

.dnx-row--gated .dnx-row__n {
    background: var(--pnx-fill);
    color: var(--pnx-ink-2);
}

.dnx-row__body {
    flex: 1;
    min-width: 0;
}

.dnx-row__title {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--pnx-ink);
}

.dnx-row--gated .dnx-row__title {
    color: var(--pnx-ink-2);
}

.dnx-row__sub {
    display: block;
    margin-top: 3px;
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--pnx-ink-2);
}

.dnx-row__end {
    flex: none;
    align-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dnx-mins {
    font-size: 13px;
    color: var(--pnx-ink-3);
    white-space: nowrap;
}

/* The "needs an account" marker, used on a card, a row and a search hit. */
.dnx-lock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--pnx-amber-bg);
    border: 1px solid var(--pnx-amber-edge);
    color: var(--pnx-amber-ink);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.dnx-open {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--pnx-card);
    border: 1px solid var(--pnx-line);
    color: var(--pnx-ink-2);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.dnx-draft {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--pnx-amber-bg);
    border: 1px solid var(--pnx-amber-edge);
    color: var(--pnx-amber-ink);
    font-size: 11px;
    font-weight: 700;
}

/* =============================================================================
   3. The three-column reading layout
============================================================================= */

.dnx-cols {
    display: flex;
    gap: 44px;
    align-items: flex-start;
    padding-top: 34px;
}

.dnx-side {
    width: 214px;
    flex: none;
    border-right: 1px solid var(--pnx-hairline);
    padding-right: 14px;
    padding-bottom: 40px;
    align-self: stretch;
}

.dnx-main {
    flex: 1;
    min-width: 0;
    max-width: 760px;
    padding-bottom: 56px;
}

.dnx-toc {
    width: 180px;
    flex: none;
    padding-bottom: 40px;
}

/* ---- the sidebar -------------------------------------------------------- */

.dnx-side__home {
    display: block;
    padding: 0 12px 10px;
}

.dnx-side h4 {
    margin: 18px 0 4px;
    padding: 0 12px;
    font-size: 11px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--pnx-ink-3);
    font-weight: 700;
}

.dnx-side h4:first-of-type {
    margin-top: 6px;
}

.dnx-side ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dnx-side a.dnx-side__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: 14px;
    line-height: 1.35;
    color: var(--pnx-ink-2);
    text-decoration: none;
}

.dnx-side a.dnx-side__link:hover {
    color: var(--pnx-accent);
}

.dnx-side a.dnx-side__link.is-current {
    color: var(--pnx-accent-ink);
    border-left-color: var(--pnx-accent);
    font-weight: 650;
    background: var(--pnx-accent-wash);
    border-radius: 0 8px 8px 0;
}

.dnx-side__pad {
    flex: none;
    margin-left: auto;
    color: var(--pnx-ink-3);
    display: inline-flex;
}

/* ---- the article ------------------------------------------------------- */

.dnx-crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--pnx-ink-3);
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dnx-crumb a {
    color: var(--pnx-ink-2);
    text-decoration: none;
    font-weight: 600;
}

.dnx-crumb a:hover {
    color: var(--pnx-accent);
    text-decoration: underline;
}

.dnx-crumb__here {
    color: var(--pnx-ink);
    font-weight: 650;
}

.dnx-art__title {
    margin: 16px 0 0;
    font-size: 42px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--pnx-ink);
}

.dnx-art__lead {
    margin: 12px 0 0;
    font-size: 19px;
    line-height: 1.55;
    color: var(--pnx-ink-2);
}

.dnx-art__meta {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--pnx-hairline);
}

.dnx-art__stamp {
    margin: 26px 0 0;
    font-size: 13.5px;
    color: var(--pnx-ink-3);
}

/* =============================================================================
   4. The article body
============================================================================= */

.dnx-body h2 {
    margin: 44px 0 0;
    font-size: 27px;
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--pnx-ink);
    /* Clears the fixed top bar. The old 1.5rem did not, so every table-of-contents
       click and every shared #anchor landed with the heading hidden under the
       header (review F19). documentation.js scrolls by the same number. */
    scroll-margin-top: 96px;
}

.dnx-body h3 {
    margin: 30px 0 0;
    font-size: 19px;
    font-weight: 650;
    line-height: 1.3;
    color: var(--pnx-ink);
    scroll-margin-top: 96px;
}

.dnx-body h4 {
    margin: 24px 0 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--pnx-ink);
    scroll-margin-top: 96px;
}

.dnx-body p {
    margin: 14px 0 0;
    font-size: 17px;
    line-height: 1.7;
    color: var(--pnx-ink);
}

.dnx-body ul,
.dnx-body ol {
    margin: 14px 0 0;
    padding-left: 24px;
}

.dnx-body li {
    margin: 0 0 9px;
    font-size: 17px;
    line-height: 1.65;
    color: var(--pnx-ink);
}

.dnx-body a {
    color: var(--pnx-accent-ink);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.dnx-body a:hover {
    color: var(--pnx-accent);
}

.dnx-body strong {
    font-weight: 700;
}

.dnx-body blockquote {
    margin: 22px 0 0;
    padding: 14px 18px;
    border-left: 3px solid var(--pnx-accent);
    background: var(--pnx-card);
    border-radius: 0 10px 10px 0;
}

.dnx-body blockquote p {
    margin: 0;
    font-size: 16px;
    line-height: 1.65;
}

.dnx-body blockquote p + p {
    margin-top: 10px;
}

.dnx-body pre {
    margin: 18px 0 0;
    padding: 14px 16px;
    background: var(--pnx-fill);
    border: 1px solid var(--pnx-line);
    border-radius: 10px;
    overflow-x: auto;
}

.dnx-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.9em;
    background: var(--pnx-fill);
    border-radius: 5px;
    padding: 1px 5px;
}

.dnx-body pre code {
    background: transparent;
    padding: 0;
}

.dnx-body hr {
    margin: 32px 0 0;
    border: 0;
    border-top: 1px solid var(--pnx-hairline);
}

/* A table wide enough to overflow scrolls in its own box rather than pushing the
   page sideways. */
.dnx-body table {
    display: block;
    overflow-x: auto;
    width: 100%;
    margin: 18px 0 0;
    border-collapse: collapse;
    font-size: 15px;
}

.dnx-body th,
.dnx-body td {
    border: 1px solid var(--pnx-line);
    padding: 8px 11px;
    text-align: left;
    vertical-align: top;
}

.dnx-body th {
    background: var(--pnx-fill);
    font-weight: 700;
}

/* ---- a screenshot that was never captured (review F3) ------------------- */

/* Eight published production articles carry an <img> with no src. It rendered as
   a broken-image box with the alt text spilling out as body copy, and the
   lightbox script then gave that non-image role="button" and offered it as "view
   full size". The server rewrites it to this instead, keeping the alt text —
   which on all eight describes exactly the screenshot that was planned. */
.dnx-noshot {
    display: block;
    margin: 20px 0 0;
    padding: 13px 16px;
    border: 1px dashed var(--pnx-line);
    border-radius: 10px;
    background: var(--pnx-card);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--pnx-ink-2);
}

.dnx-noshot__tag {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--pnx-ink-3);
    margin-right: 4px;
}

.dnx-noshot__alt {
    font-style: italic;
}

/* ---- a link that needs an account (review F4) --------------------------- */

a.dnx-gatedlink {
    text-decoration-style: dotted;
}

.dnx-gatedlink__mark {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--pnx-amber-bg);
    border: 1px solid var(--pnx-amber-edge);
    color: var(--pnx-amber-ink);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: baseline;
}

/* =============================================================================
   5. A screenshot, framed, with a control that says what it does
============================================================================= */

/* The lightbox existed; its only affordance was a `zoom-in` CURSOR — invisible on
   touch, and nothing told a keyboard user the image was interactive (review F5/F15).
   documentation.js wraps each body image in this frame. */
.dnx-fig {
    margin: 22px 0 0;
}

.dnx-fig__frame {
    border: 1px solid var(--pnx-line);
    border-radius: var(--pnx-radius);
    background: var(--pnx-card);
    overflow: hidden;
}

.dnx-fig__bar {
    min-height: 40px;
    border-bottom: 1px solid var(--pnx-hairline);
    background: var(--pnx-paper);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
}

.dnx-fig__dots {
    display: flex;
    gap: 6px;
    flex: none;
}

.dnx-fig__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--pnx-line);
}

.dnx-fig__name {
    font-size: 12.5px;
    color: var(--pnx-ink-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.dnx-fig__zoom {
    margin-left: auto;
    flex: none;
}

.dnx-fig img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
}

/* ---- the lightbox ------------------------------------------------------- */

.dnx-lb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(44, 40, 37, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    transition: opacity 0.18s var(--pnx-ease);
}

.dnx-lb.is-open {
    opacity: 1;
}

.dnx-lb__img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    border-radius: 10px;
    background: var(--pnx-card);
}

.dnx-lb__cap {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 20px;
    text-align: center;
    font-size: 13.5px;
    line-height: 1.5;
    color: var(--pnx-card);
}

.dnx-lb__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid rgba(250, 248, 245, 0.35);
    background: rgba(44, 40, 37, 0.6);
    /* The lightbox overlay is dark on every surface, so this control is light on
       every surface too — it used to read --pnx-card, which is now dark. */
    color: #faf8f5;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dnx-lb__close:hover {
    background: var(--pnx-ink);
}

@media (prefers-reduced-motion: reduce) {
    .dnx-lb {
        transition: none;
    }
}

/* =============================================================================
   6. On this page
============================================================================= */

.dnx-toc__nav {
    border-left: 1px solid var(--pnx-hairline);
    position: sticky;
    top: 92px;
}

.dnx-toc__title {
    padding: 0 0 6px 13px;
}

.dnx-toc__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dnx-toc__nav a {
    display: block;
    padding: 6px 0 6px 13px;
    margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: 14px;
    line-height: 1.35;
    color: var(--pnx-ink-2);
    text-decoration: none;
}

.dnx-toc__nav a:hover {
    color: var(--pnx-accent);
}

.dnx-toc__nav a.is-current {
    color: var(--pnx-accent-ink);
    border-left-color: var(--pnx-accent);
    font-weight: 650;
}

.dnx-toc__nav a.is-sub {
    padding-left: 25px;
    font-size: 13.5px;
}

/* The phone's table of contents. There was none at all below 992px (review F16):
   a 1,064-word article was one unbroken scroll. */
.dnx-toc-ph {
    margin-top: 18px;
    display: none;
}

.dnx-toc-ph__sum {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--pnx-line);
    border-radius: var(--pnx-radius);
    background: var(--pnx-card);
    font-size: 14.5px;
    font-weight: 650;
    color: var(--pnx-ink);
}

.dnx-toc-ph__sum::-webkit-details-marker {
    display: none;
}

.dnx-toc-ph__sum svg:first-child {
    color: var(--pnx-accent);
    flex: none;
}

.dnx-toc-ph__count {
    margin-left: auto;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--pnx-ink-3);
}

.dnx-toc-ph__chev {
    flex: none;
    color: var(--pnx-ink-2);
    transition: transform 0.15s var(--pnx-ease);
}

.dnx-toc-ph[open] .dnx-toc-ph__chev {
    transform: rotate(180deg);
}

.dnx-toc-ph__panel {
    margin-top: 8px;
    padding: 6px 14px;
    border: 1px solid var(--pnx-hairline);
    border-radius: var(--pnx-radius);
    background: var(--pnx-card);
}

.dnx-toc-ph__panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.dnx-toc-ph__panel a {
    display: block;
    padding: 11px 0;
    border-bottom: 1px solid var(--pnx-hairline);
    font-size: 15px;
    text-decoration: none;
    color: var(--pnx-ink);
}

.dnx-toc-ph__panel li:last-child a {
    border-bottom: 0;
}

.dnx-toc-ph__panel a.is-current {
    color: var(--pnx-accent-ink);
    font-weight: 650;
}

@media (prefers-reduced-motion: reduce) {
    .dnx-toc-ph__chev {
        transition: none;
    }
}

/* =============================================================================
   7. What follows an article
============================================================================= */

/* Nothing did (review F18): it ended at "Last updated …". */
.dnx-next {
    margin-top: 48px;
    padding-top: 26px;
    border-top: 1px solid var(--pnx-hairline);
}

.dnx-next__head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.dnx-next__pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

a.dnx-next__card {
    display: block;
    padding: 16px 18px;
    text-decoration: none;
}

.dnx-next__card--next {
    text-align: right;
}

.dnx-next__kind {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    color: var(--pnx-ink-3);
    font-weight: 650;
}

.dnx-next__card--next .dnx-next__kind {
    justify-content: flex-end;
}

.dnx-next__title {
    display: block;
    margin-top: 6px;
    font-size: 16.5px;
    font-weight: 700;
    color: var(--pnx-ink);
}

/* =============================================================================
   8. A category page (review Q2 — this route used to 404)
============================================================================= */

.dnx-cathead {
    margin-top: 16px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.dnx-cathead__icon {
    width: 48px;
    height: 48px;
    border-radius: var(--pnx-radius);
    background: var(--pnx-accent-wash);
    color: var(--pnx-accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.dnx-cathead__copy {
    flex: 1;
    min-width: 0;
}

.dnx-cathead__title {
    margin: 0;
    font-size: 40px;
    line-height: 1.1;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--pnx-ink);
}

.dnx-cathead__lead {
    margin: 10px 0 0;
    font-size: 18px;
    line-height: 1.55;
    color: var(--pnx-ink-2);
    max-width: 62ch;
}

.dnx-cathead__end {
    margin-top: 8px;
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

/* The note telling a reader these guides need an account. */
.dnx-note {
    margin-top: 16px;
    padding: 13px 17px;
    border: 1px solid var(--pnx-accent-edge);
    background: var(--pnx-accent-wash);
    border-radius: var(--pnx-radius);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.dnx-note__copy {
    margin: 0;
    flex: 1;
    min-width: 340px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--pnx-accent-ink);
}

.dnx-note__copy a {
    color: var(--pnx-accent-ink);
    font-weight: 650;
}

.dnx-foot {
    margin-top: 34px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* =============================================================================
   9. Search (review Q1 — none of this existed)
============================================================================= */

.dnx-search {
    padding-top: 44px;
    padding-bottom: 56px;
}

.dnx-search__title {
    margin: 0 0 16px;
    font-size: 34px;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--pnx-ink);
}

.dnx-search__form {
    max-width: 860px;
}

.dnx-facets {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

a.dnx-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 13px;
    border-radius: 999px;
    border: 1px solid var(--pnx-line);
    background: var(--pnx-card);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--pnx-ink);
    text-decoration: none;
}

a.dnx-pill:hover {
    border-color: var(--pnx-accent);
    color: var(--pnx-accent-ink);
}

a.dnx-pill.is-on {
    background: var(--pnx-accent);
    border-color: var(--pnx-accent);
    color: var(--pnx-card);
}

.dnx-pill__n {
    opacity: 0.6;
}

.dnx-search__count {
    margin: 18px 0 0;
    font-size: 14.5px;
    color: var(--pnx-ink-2);
}

.dnx-search__count strong {
    color: var(--pnx-ink);
}

.dnx-hits {
    margin-top: 14px;
    overflow: hidden;
}

a.dnx-hit {
    display: block;
    padding: 18px 22px;
    border-top: 1px solid var(--pnx-hairline);
    text-decoration: none;
    color: inherit;
}

a.dnx-hit:first-child {
    border-top: 0;
}

a.dnx-hit:hover,
a.dnx-hit:focus-visible {
    background: var(--pnx-accent-wash);
}

.dnx-hit__crumb {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    font-size: 12.5px;
    color: var(--pnx-ink-3);
    font-weight: 600;
}

.dnx-hit__title {
    display: block;
    margin-top: 5px;
    font-size: 18px;
    font-weight: 700;
    color: var(--pnx-ink);
}

.dnx-hit__ex {
    display: block;
    margin-top: 6px;
    font-size: 14.5px;
    line-height: 1.6;
    color: var(--pnx-ink-2);
}

.dnx-mk {
    background: var(--pnx-amber-bg);
    color: var(--pnx-ink);
    font-weight: 650;
    border-radius: 3px;
    padding: 0 2px;
}

.dnx-dashed {
    margin-top: 26px;
    padding: 17px 22px;
    border: 1px dashed var(--pnx-line);
    border-radius: var(--pnx-radius);
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.dnx-dashed__copy {
    margin: 0;
    flex: 1;
    min-width: 340px;
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--pnx-ink-2);
}

/* =============================================================================
   10. The empty states
============================================================================= */

.dnx-empty {
    margin-top: 24px;
    padding: 48px 24px;
    text-align: center;
}

.dnx-empty__icon {
    color: var(--pnx-ink-3);
    margin-bottom: 12px;
}

.dnx-empty p {
    margin: 0;
    font-size: 16px;
    color: var(--pnx-ink-2);
}

/* =============================================================================
   11. Tablet and phone
============================================================================= */

@media (max-width: 991.98px) {
    /* The desktop sidebar and the on-this-page rail both go; the phone's own
       table of contents takes over, and "All guides" reaches the library. */
    .dnx-side,
    .dnx-toc {
        display: none;
    }

    .dnx-toc-ph {
        display: block;
    }

    .dnx-cols {
        display: block;
        padding-top: 18px;
    }

    /* Both rails are gone here, so the article would otherwise run the full width of
       a 980px tablet — a 950px line, which is a worse read than the one this review
       set out to fix. It keeps its measure and centres instead. */
    .dnx-main {
        margin-left: auto;
        margin-right: auto;
        padding-bottom: 40px;
    }

    .dnx-cats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dnx-head {
        padding: 36px 0 32px;
    }

    .dnx-head__title {
        font-size: 40px;
    }

    .dnx-head__lead {
        font-size: 17px;
    }

    .dnx-bar__search {
        max-width: none;
    }

    .dnx-art__title {
        font-size: 34px;
    }

    .dnx-cathead__title {
        font-size: 32px;
    }
}

@media (max-width: 767.98px) {
    .dnx-cats {
        grid-template-columns: minmax(0, 1fr);
    }

    .dnx-next__pair {
        grid-template-columns: minmax(0, 1fr);
    }

    .dnx-next__card--next {
        text-align: left;
    }

    .dnx-next__card--next .dnx-next__kind {
        justify-content: flex-start;
    }

    .dnx-head__title {
        font-size: 31px;
    }

    .dnx-head {
        padding: 28px 0 26px;
    }

    .dnx-art__title {
        font-size: 31px;
        letter-spacing: -0.025em;
    }

    .dnx-art__lead {
        font-size: 16px;
    }

    .dnx-cathead {
        gap: 12px;
    }

    .dnx-cathead__title {
        font-size: 28px;
    }

    .dnx-cathead__end {
        align-items: flex-start;
    }

    .dnx-search__title {
        font-size: 27px;
    }

    .dnx-body h2 {
        font-size: 23px;
        margin-top: 34px;
    }

    .dnx-body p,
    .dnx-body li {
        font-size: 16.5px;
    }

    /* A screenshot reaches the gutter on a phone — the measure is only 358px, and
       a framed image inside it was unreadable (review F15). */
    .dnx-fig {
        margin-left: calc(var(--pnx-gutter) * -1);
        margin-right: calc(var(--pnx-gutter) * -1);
    }

    .dnx-fig__frame {
        border-left: 0;
        border-right: 0;
        border-radius: 0;
    }

    .dnx-fig__bar {
        padding-left: var(--pnx-gutter);
        padding-right: var(--pnx-gutter);
    }

    .dnx-fig__dots {
        display: none;
    }

    .dnx-note__copy,
    .dnx-dashed__copy {
        min-width: 0;
    }

    .dnx-find--lg .dnx-find__box,
    .dnx-find--lg .pnx-btn {
        height: 48px;
    }

    .dnx-hit,
    .dnx-row {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* =============================================================================
   12. The admin article editor (board F)

   Source and the reader's page side by side. It used to be one raw 18-row
   monospace textarea with the preview BELOW it, which pushed Save off-screen —
   so a 5,772-character article showed about a tenth of itself and the preview
   was somewhere else entirely (review F24).

   This lives in docs-nx.css rather than a second file because the preview pane
   IS the reader's body: it uses .dnx-body above, and the two must never drift.
============================================================================= */

.docs-editor-split {
    min-height: 620px;
}

.docs-editor-source {
    background: var(--bg-secondary, #e8e3dc);
    display: flex;
    flex-direction: column;
}

.docs-editor-source textarea {
    flex: 1;
    min-height: 520px;
    background: transparent;
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
}

.docs-editor-source textarea:focus {
    background: var(--bg-elevated, #faf8f5);
    box-shadow: none;
}

.docs-editor-preview {
    border-left: 1px solid var(--border-light, #d4cec6);
    overflow-x: auto;
}

/* The preview is a reader's page at a reader's scale, inside a half-width pane,
   so the body steps down one notch rather than being shown at 17px in 480px. */
.docs-editor-preview .dnx-body h2 {
    margin-top: 26px;
    font-size: 20px;
}

.docs-editor-preview .dnx-body h3 {
    margin-top: 20px;
    font-size: 16px;
}

.docs-editor-preview .dnx-body p,
.docs-editor-preview .dnx-body li {
    font-size: 14.5px;
    line-height: 1.6;
}

.docs-editor-preview .dnx-body img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--border-light, #d4cec6);
    border-radius: 10px;
    margin-top: 14px;
}

.docs-editor-preview .dnx-body blockquote p {
    font-size: 14px;
}

@media (max-width: 991.98px) {
    .docs-editor-preview {
        border-left: 0;
        border-top: 1px solid var(--border-light, #d4cec6);
    }

    .docs-editor-split {
        min-height: 0;
    }

    .docs-editor-source textarea {
        min-height: 320px;
    }
}
