/* Section archive controls only. Keep the search form and cards theme-owned. */
.nkc-topics {
    position:relative; clear:both; min-width:0; max-width:100%; margin:20px 0;
    container-type:inline-size; line-height:1.5; text-align:start;
}
.nkc-topics, .nkc-topics * { box-sizing:border-box }
.nkc-topics [hidden] { display:none!important }
.nkc-topics .nkc-topics__arrow { display:none }
.nkc-topics .nkc-topics__primary { display:flex; align-items:flex-start; gap:6px; min-width:0 }
.nkc-topics--more .nkc-topics__primary { padding-inline-end:6.5em }
.nkc-topics.nkc-topics [data-nkc-topic], .nkc-topics.nkc-topics summary {
    display:inline-flex; align-items:center; justify-content:center; min-height:44px;
    min-width:0; max-width:100%; padding:6px 12px; margin:0; border:1px solid #d6dee7;
    border-radius:9px; background:var(--nkc-control-bg); color:var(--nkc-control-ink); box-shadow:none; text-decoration:none;
    font:inherit; font-size:14px; font-weight:600; line-height:1.45; text-align:center; overflow-wrap:anywhere;
}
.nkc-topics, .nkc-selection {
    --nkc-control-bg:#fff; --nkc-control-ink:#172536; --nkc-control-active:#b51c3f; --nkc-control-line:#c4cbd2;
}
/* Use a theme accent when available, with a capped lightness for white labels. */
@supports (color:oklch(from red l c h)) {
    .nkc-topics, .nkc-selection {
        --nkc-control-active:oklch(from var(--brand-color,var(--wp--preset--color--primary,#b51c3f)) min(l,.49) c h);
    }
}
.nkc-topics.nkc-topics :is([data-nkc-topic],summary):hover { border-color:var(--nkc-control-active); text-decoration:underline }
.nkc-topics.nkc-topics :is(a[aria-current="page"],button[aria-pressed="true"]) { background:var(--nkc-control-active); color:#fff; border-color:var(--nkc-control-active); font-weight:700 }
.nkc-topics :is([data-nkc-topic],summary,input):focus-visible, .nkc-selection .nkc-selection__clear:focus-visible {
    outline:2px solid var(--nkc-control-ink); outline-offset:2px;
}
.nkc-topics details { margin:0; padding:0; border:0; background:none }
.nkc-topics summary {
    position:absolute; inset-block-start:0; inset-inline-end:0; gap:8px; max-width:6.2em;
    list-style:none; cursor:pointer; background:#f8fafc; font-weight:600;
}
.nkc-topics summary::-webkit-details-marker { display:none }
.nkc-topics summary::after { content:''; width:7px; height:7px; flex:none; border:solid currentColor; border-width:0 1.5px 1.5px 0; transform:rotate(45deg) }
.nkc-topics details[open] summary::after { transform:rotate(225deg) }
.nkc-topics .nkc-topics__panel { display:none; margin-block-start:10px; padding:12px; border:1px solid var(--nkc-control-line); border-radius:8px; background:var(--nkc-control-bg); color:var(--nkc-control-ink) }
.nkc-topics .nkc-topics__rail-all, .nkc-topics .nkc-topics__mobile-icon,
.nkc-topics:not(.nkc-topics--more) .nkc-topics__details { display:none }
.nkc-topics--more .nkc-topics__details[open] + .nkc-topics__panel { display:block }
.nkc-topics:has(> .nkc-topics__details[open]) > .nkc-topics__panel { display:block }
.nkc-topics .nkc-topics__find { display:block; font:inherit; font-weight:600; margin:0 0 12px }
.nkc-topics .nkc-topics__find input { display:block; width:100%; max-width:32em; min-height:44px; margin:4px 0 0; padding:6px 10px; font:inherit; font-size:16px; border:1px solid #a6b5c2; border-radius:6px; background:#fff; color:#0f172a }
.nkc-topics .nkc-topics__options { display:flex; flex-wrap:wrap; gap:6px; max-height:18em; overflow:auto; padding:3px }
.nkc-topics .nkc-topics__empty { margin:4px 0 }
.nkc-standalone-main > .nkc-topics { margin-block:0 }
.nkc-standalone-main > [data-nkc-results] { display:grid; min-width:0; gap:inherit }
[data-nkc-results][aria-busy="true"] { cursor:progress }
.nkc-topics .nkc-filter-status { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap }
.nkc-selection {
    display:flex; align-items:center; flex-wrap:wrap; gap:4px 20px;
    padding:4px 12px; margin:0 0 12px; min-width:0; text-align:start; line-height:1.5;
    background:var(--nkc-control-bg); color:var(--nkc-control-ink); border-inline-start:3px solid var(--nkc-control-active);
}
.nkc-selection__info { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 12px; min-width:0; overflow-wrap:anywhere }
.nkc-selection__count { font-size:.88em; font-variant-numeric:tabular-nums }
.nkc-selection a.nkc-selection__clear { display:inline-flex; align-items:center; min-height:44px; color:inherit; font-size:14px; font-weight:600; text-decoration:underline; text-underline-offset:3px }
.nkc-topics.nkc-topics [data-nkc-pending] { outline:2px dashed var(--nkc-control-ink); outline-offset:-4px; cursor:progress }
.nkc-topics .nkc-topics__failure { margin-block:8px 0; color:var(--nkc-control-ink); background:var(--nkc-control-bg) }
.nkc-topics__failure button { min-height:44px; padding-inline:10px; margin-inline-start:8px; font:inherit; color:inherit; background:transparent; cursor:pointer; text-decoration:underline; border:0 }
:is(.dark-skin,.tie-dark-mode,[data-theme="dark"]) :is(.nkc-topics,.nkc-selection) { --nkc-control-bg:#222d39; --nkc-control-ink:#e7edf4; --nkc-control-line:#697887 }
@container(max-width:580px) {
    .nkc-topics .nkc-topics__primary { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)) }
    .nkc-topics--more .nkc-topics__primary { display:flex; flex-wrap:wrap; padding-inline-end:5.8em }
    .nkc-topics--more .nkc-topics__primary [data-nkc-secondary] { display:none }
}
@media(max-width:640px) {
    .nkc-topics.nkc-topics--catalog {
        display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; column-gap:2px;
        border-block:1px solid var(--nkc-control-line); padding:2px; background:var(--nkc-control-bg);
    }
    .nkc-topics.nkc-topics--catalog .nkc-topics__primary, .nkc-topics .nkc-topics__desktop-label,
    .nkc-topics summary::after { display:none }
    .nkc-topics.nkc-topics--catalog .nkc-topics__details { display:block; grid-column:1; grid-row:1; align-self:start }
    .nkc-topics .nkc-topics__details summary {
        position:static; display:grid; place-items:center; width:44px; height:44px; padding:0;
        border:0; border-radius:6px; background:none; color:var(--nkc-control-ink);
    }
    .nkc-topics .nkc-topics__mobile-icon { display:block; width:20px; height:20px }
    .nkc-topics .nkc-topics__details[open] summary { outline:1px solid var(--nkc-control-line); outline-offset:-2px }
    .nkc-topics .nkc-topics__details[open] + .nkc-topics__panel {
        display:block; grid-column:1 / -1; border:0; margin:0; padding:6px 4px 10px;
    }
    .nkc-topics__details:not([open]) + .nkc-topics__panel {
        display:grid; grid-column:2; grid-row:1; grid-template-columns:auto minmax(0,1fr) auto; align-items:center;
        min-width:0; margin:0; padding:0; background:none; border:none;
    }
    .nkc-topics .nkc-topics__failure { grid-column:1 / -1 }
    .nkc-topics__details:not([open]) + .nkc-topics__panel .nkc-topics__options {
        grid-column:2; grid-row:1; min-width:0; flex-wrap:nowrap; align-items:center; gap:2px;
        overflow-x:auto; overflow-y:hidden; max-height:none; padding:0; overscroll-behavior-x:contain; scrollbar-width:none;
    }
    .nkc-topics__details:not([open]) + .nkc-topics__panel .nkc-topics__options::-webkit-scrollbar { display:none }
    .nkc-topics__details:not([open]) + .nkc-topics__panel .nkc-topics__arrow {
        display:inline-grid; place-items:center; grid-row:1; width:44px; height:44px; padding:0; margin:0;
        border:0; border-radius:6px; background:none; color:var(--nkc-control-ink); box-shadow:none; cursor:pointer;
    }
    .nkc-topics__arrow[data-nkc-scroll="left"] { grid-column:1 }
    .nkc-topics__arrow[data-nkc-scroll="right"] { grid-column:3 }
    .nkc-topics__arrow[data-nkc-scroll="left"]:dir(rtl) { grid-column:3 }
    .nkc-topics__arrow[data-nkc-scroll="right"]:dir(rtl) { grid-column:1 }
    .nkc-topics__arrow::after { content:''; display:block; width:9px; height:9px; border:solid currentColor; border-width:2px 2px 0 0; transform:rotate(45deg) }
    .nkc-topics__arrow[data-nkc-scroll="left"]::after { transform:rotate(-135deg) }
    .nkc-topics .nkc-topics__arrow:disabled { opacity:.36; cursor:default }
    .nkc-topics :is(.nkc-topics__arrow,summary,[data-nkc-topic]):focus-visible { outline:2px solid currentColor; outline-offset:-3px }
    .nkc-topics__details:not([open]) + .nkc-topics__panel :is(.nkc-topics__find,.nkc-topics__empty) { display:none }
    .nkc-topics__details:not([open]) + .nkc-topics__panel .nkc-topics__rail-all { display:inline-flex }
    .nkc-topics__details:not([open]) + .nkc-topics__panel .nkc-topics__options > * { flex:none; max-width:none }
    .nkc-topics.nkc-topics .nkc-topics__details:not([open]) + .nkc-topics__panel [data-nkc-topic] {
        position:relative; min-height:44px; max-width:none; padding:5px 10px; border:0; border-radius:0;
        white-space:nowrap; background:transparent; color:var(--nkc-control-ink); line-height:1.5;
    }
    .nkc-topics__details:not([open]) + .nkc-topics__panel :is([aria-pressed="true"],[aria-current="page"])::after {
        content:''; position:absolute; inset-inline:9px; bottom:3px; height:3px; border-radius:2px;
        background:var(--nkc-control-active);
    }
    .nkc-topics.nkc-topics[data-nkc-rail-fits] .nkc-topics__details:not([open]) { display:none }
    .nkc-topics[data-nkc-rail-fits] .nkc-topics__details:not([open]) + .nkc-topics__panel,
    .nkc-topics[data-nkc-rail-fits] .nkc-topics__details:not([open]) + .nkc-topics__panel .nkc-topics__options { grid-column:1 / -1 }
}
.nkc-topics button[data-nkc-topic], .nkc-pagination button[data-nkc-page] { cursor:pointer }
.nkc-pagination button[data-nkc-page] { font:inherit; color:inherit; background:transparent; border:1px solid #c6d0da; border-radius:6px; min-height:44px; min-width:44px; padding:4px 12px }
