/* The directory script appends its button after this group. */
section.toolbar .nb-toolbar-right {
    display:flex; align-items:center; gap:6px; margin-left:auto; flex:none;
}
section.toolbar .nb-toolbar-tools,
section.toolbar .nb-site-search { display:flex; align-items:center; gap:6px; }
section.toolbar .nb-site-search,
section.toolbar .nb-mode-toggle {
    box-sizing:border-box; height:32px; margin:0; border:1px solid var(--nb-line-strong);
    border-radius:6px; background:var(--nb-paper); color:var(--nb-blue);
}
section.toolbar .nb-site-search { width:clamp(96px, 16vw, 180px); gap:0; }
.nb-site-search input[type=search] {
    flex:1; width:0; min-width:0; border:0; padding:0 0 0 8px;
    background:transparent; color:var(--nb-ink); font:inherit; font-size:12px;
}
.nb-site-search input::placeholder { color:var(--nb-muted); }
.nb-site-search:focus-within { border-color:var(--nb-blue); }
.nb-site-search button,
section.toolbar .nb-mode-toggle { display:grid; place-items:center; padding:0; cursor:pointer; }
.nb-site-search button { flex:0 0 26px; align-self:stretch; border:0; border-radius:5px; background:transparent; color:inherit; }
section.toolbar .nb-mode-toggle { width:32px; }
.nb-site-search button:hover,
section.toolbar .nb-mode-toggle:hover { background:var(--nb-blue-soft); }
section.toolbar .nb-toolbar-tools svg { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.nb-mode-toggle[hidden], .nb-mode-sun, [data-nb-dark] .nb-mode-moon { display:none!important; }
[data-nb-dark] .nb-mode-sun { display:block!important; }
section.toolbar:has(.nb-toolbar-tools) .category { min-width:0; flex-shrink:1; overflow-x:auto; }
@media(max-width:600px) {
    section.toolbar .nb-toolbar-right, section.toolbar .nb-toolbar-tools { gap:4px; }
    section.toolbar .nb-site-search { width:78px; height:28px; }
    section.toolbar .nb-mode-toggle { width:28px; height:28px; }
    .nb-site-search button { flex-basis:22px; }
}

/* Dimmed neutral surfaces and brighter blue links. */
html.nb-visual-sample[data-nb-dark] {
    color-scheme:dark;
    --nb-canvas:#11161d;
    --nb-sidebar:#171e27;
    --nb-paper:#1d2530;
    --nb-raised:#242f3d;
    --nb-ink:#e0e7f0;
    --nb-secondary:#c0ccda;
    --nb-muted:#a2b2c5;
    --nb-line:#344152;
    --nb-line-strong:#485a70;
    --nb-blue:#8bb8ff;
    --nb-blue-hover:#b4d0ff;
    --nb-blue-soft:#263951;
    --nb-action:#2455a1;
    --nb-shadow-shell:10px 0 30px -14px #080c13b0;
    --page-bg:var(--nb-canvas);
    --bg-card:var(--nb-paper);
    --accent-gradient:linear-gradient(var(--nb-blue),var(--nb-blue));
}
html[data-nb-dark] body { color:var(--nb-ink); }
html.nb-visual-sample[data-nb-dark] :is(section.toolbar,section.content,.nb-error-card,.nb-nav-more-panel) {
    background-color:var(--nb-paper)!important;
    color:var(--nb-ink);
    border-color:var(--nb-line)!important;
}
html.nb-visual-sample[data-nb-dark] body > header .box nav ul li > a:hover,
html.nb-visual-sample[data-nb-dark] .artlist.content ul.items > li.post-entry.toplist:hover {
    background:var(--nb-blue-soft)!important;
}
html.nb-visual-sample[data-nb-dark] body > header .box nav li:is(.active,.navbar-active,.current-menu-item) > a,
html.nb-visual-sample[data-nb-dark] body > header .box nav a[aria-current=page] {
    background:var(--nb-action)!important;
}
html[data-nb-dark] section.toolbar :is(a.homelink,.category > .btn,.btnList .btn,.nb-toolbar-button,.article-toc-toggle) {
    background:var(--nb-paper)!important; color:var(--nb-blue)!important; border-color:var(--nb-line-strong)!important;
}
html[data-nb-dark] section.toolbar :is(.category > .btn,.btnList .btn,.nb-toolbar-button,.article-toc-toggle):hover,
html[data-nb-dark] section.toolbar .article-toc-toggle[aria-expanded=true] { background:var(--nb-blue-soft)!important; }
html[data-nb-dark] section.toolbar :is(.switch,.nb-toolbar-name,.showcase-toolbar-label),
html[data-nb-dark] .artshow .box .words :is(h2,h3,h4,a),
html[data-nb-dark] .artshow .box :is(.tags a,.comment-actions a,.msgname a),
html[data-nb-dark] .nb-error-code { color:var(--nb-blue)!important; }
html[data-nb-dark] .artshow .box .words a:hover { color:var(--nb-blue-hover)!important; }
html[data-nb-dark] .artshow .box :is(.post-page-title h1,.words,.msgarticle,.posttop,.posti),
html[data-nb-dark] .artlist.content .article-feed-heading h1 { color:var(--nb-ink)!important; }
html[data-nb-dark] body > footer :is(a,span,p),
html[data-nb-dark] .artshow .box :is(.rel,.rel .meta-item,.rel a,.msgtime,.comment-meta) { color:var(--nb-muted)!important; }
html[data-nb-dark] .artshow .box .words blockquote:not(.callout),
html[data-nb-dark] .artshow .box .words blockquote:not(.callout) blockquote:not(.callout) {
    background:var(--nb-raised)!important; color:var(--nb-secondary)!important; border-left-color:var(--nb-blue)!important;
}
html[data-nb-dark] .artshow .box .words table :is(th,td) {
    background:var(--nb-paper)!important; color:var(--nb-ink)!important;
}
html[data-nb-dark] .artshow .box .words table thead > tr:last-child > :is(th,td),
html[data-nb-dark] .artshow .box .words table:not(:has(thead)) > tbody:first-of-type > tr:first-child > th {
    border-bottom-color:var(--nb-secondary)!important;
}
html[data-nb-dark] .artshow .box .words table :is(tbody,tfoot) > tr + tr > :is(th,td) {
    border-top-color:var(--nb-line-strong)!important;
}
html[data-nb-dark] .artshow .words :is(pre,code):not(:where(.code-wrapper,.code-wrapper *)) {
    background:var(--nb-raised); color:var(--nb-ink); border-color:var(--nb-line);
}
html[data-nb-dark] .artshow .box #divCommentPost,
html[data-nb-dark] #divCommentPost :is(.comment-composer,form p input.text,form .comment-composer #txaArticle),
html[data-nb-dark] .artshow .box :is(.rel,.tags a,.comment-author-badge,.commentpagebar .page:not(.now-page)) {
    background:var(--nb-raised)!important; border-color:var(--nb-line)!important; color:var(--nb-ink)!important;
}
html[data-nb-dark] #divCommentPost :is(input,textarea)::placeholder { color:var(--nb-muted); }
html[data-nb-dark] :is(.showcase-heading,.showcase-card,.showcase-panel,.project-card,.resource-card,.reading-card,.topic-card,.task-record,.moment-card,.series-node) {
    background-color:var(--nb-raised); border-color:var(--nb-line); color:var(--nb-ink);
}
html[data-nb-dark] .showcase-heading :is(h1,p) { color:var(--nb-ink); }

html[data-nb-dark] .nb-nav-more-panel li > a { color:var(--nb-secondary); }
html[data-nb-dark] .nb-nav-more-panel li > a:is(:hover,[aria-current=page]) { color:var(--nb-blue); background:var(--nb-blue-soft); }
html[data-nb-dark] .nuliblog-showcase {
    --showcase-line:var(--nb-line);
    --showcase-tint:var(--nb-raised);
    --showcase-accent:var(--nb-action);
}
html.nb-visual-sample[data-nb-dark] .nuliblog-showcase :is(.showcase-link-card,.showcase-project-card,.showcase-profile,.showcase-site-info,.showcase-search input,.showcase-button.secondary,.showcase-filter-tabs button[aria-pressed=true],.showcase-layout-switch button[aria-pressed=true]) {
    background-color:var(--nb-raised); color:var(--nb-ink); border-color:var(--nb-line);
}
html[data-nb-dark] .nuliblog-showcase :is(.showcase-link-card,.showcase-project-card,.showcase-profile,.task-record) :is(h2,h3,p) { color:var(--nb-secondary); }
html[data-nb-dark] .nuliblog-showcase :is(.showcase-link-card,.showcase-project-card,.task-record) :is(h2,h3) { color:var(--nb-blue); }

section.toolbar.nb-list-toolbar { flex-wrap:nowrap!important; }
section.toolbar.nb-list-toolbar .category {
    display:flex; flex:1 1 0; flex-wrap:nowrap!important; min-width:0;
    white-space:nowrap; overflow-x:auto; scrollbar-width:none;
}
section.toolbar.nb-list-toolbar .category > .btn {
    flex:0 0 auto; float:none; margin:0!important;
}
section.toolbar.nb-list-toolbar .category > .btn[hidden] { display:none!important; }
section.toolbar.nb-list-toolbar .category .nb-tags-more {
    background:var(--nb-blue-soft)!important; color:var(--nb-blue)!important;
}
section.toolbar.nb-list-toolbar .category .nb-tags-more:focus-visible { outline-offset:-3px; }

html.nb-visual-sample[data-nb-dark] section.content,
html.nb-visual-sample[data-nb-dark] section.content > .box,
html.nb-visual-sample[data-nb-dark] .artlist.content ul.items,
html.nb-visual-sample[data-nb-dark] .artlist.content ul.items > li.post-entry:not(.toplist) {
    background:var(--nb-paper)!important;
}
html.nb-visual-sample[data-nb-dark] .artlist.content ul.items > li.post-entry:not(.toplist):hover {
    background:var(--nb-raised)!important;
}
html.nb-visual-sample[data-nb-dark] .artshow .box .post-page-title .rel { background:transparent!important; }
html.nb-visual-sample[data-nb-dark] body > header .box nav .nav-icon,
html[data-nb-dark] .topic-copy h2 { color:var(--nb-blue); }
html[data-nb-dark] .topic-copy p,
html[data-nb-dark] .topic-card-meta,
html[data-nb-dark] .topic-toolbar > .showcase-search-count,
html[data-nb-dark] .topic-view-tools button { color:var(--nb-secondary); }
html[data-nb-dark] :is(.topic-view-tools,.showcase-tag-cloud,.topic-cover) {
    background:var(--nb-raised); border-color:var(--nb-line);
}
html[data-nb-dark] :is(.topic-featured,.topic-view-tools button[aria-pressed=true],.topic-toolbar .showcase-filter button) {
    background:var(--nb-blue-soft); color:var(--nb-blue); box-shadow:none;
}
html[data-nb-dark] .topic-toolbar .showcase-filter button[aria-pressed=true] {
    background:var(--nb-action); color:white;
}

/* Shared surfaces and controls used by the collection and reading templates. */
html[data-nb-dark] .paging#Paging { background:var(--nb-paper); }
html[data-nb-dark] .paging .qzPagination span.page {
    background:var(--nb-raised)!important;
    border-color:var(--nb-line-strong)!important;
    color:var(--nb-secondary)!important;
}
html[data-nb-dark] .paging .qzPagination a:hover span.page {
    background:var(--nb-blue-soft)!important;
    border-color:var(--nb-blue)!important;
    color:var(--nb-blue)!important;
}
html[data-nb-dark] .paging .qzPagination span.now-page {
    background:var(--nb-action)!important;
    border-color:var(--nb-action)!important;
    color:white!important;
}

html.nb-visual-sample[data-nb-dark] :is(.article-neighbors,.series-neighbors) {
    border-color:var(--nb-line-strong);
}
html.nb-visual-sample[data-nb-dark] .article-neighbor,
html.nb-visual-sample[data-nb-dark] .series-tree,
html.nb-visual-sample[data-nb-dark] .nuliblog-showcase :is(.showcase-empty,.series-empty,.gallery-item,.showcase-photo-card,.showcase-resource-card,.showcase-category-card,.showcase-reading-card,.showcase-now-card,.showcase-change,.product-card) {
    background:var(--nb-raised);
    border-color:var(--nb-line);
}
html.nb-visual-sample[data-nb-dark] :is(.series-catalogue-title h2,.series-membership-head a) {
    color:var(--nb-blue);
}
html.nb-visual-sample[data-nb-dark] :is(.series-tree-actions button,.series-excerpt-toggle,.series-tree-toggle,.article-neighbor):hover {
    background:var(--nb-blue-soft);
    color:var(--nb-blue);
}

html.nb-visual-sample[data-nb-dark] .nuliblog-showcase .showcase-tag,
html.nb-visual-sample[data-nb-dark] .nuliblog-showcase :is(.showcase-filter-tabs button,.gallery-filter button),
html.nb-visual-sample[data-nb-dark] :is(.gallery-layout-switch,.showcase-layout-switch) {
    background:var(--nb-raised);
    border-color:var(--nb-line);
}
html.nb-visual-sample[data-nb-dark] .nuliblog-showcase .showcase-tag.weight-3 {
    background:var(--nb-blue-soft);
}
html.nb-visual-sample[data-nb-dark] .nuliblog-showcase :is(.showcase-tag:hover,.showcase-filter-tabs button:hover,.gallery-filter button:hover) {
    background:var(--nb-blue-soft);
    color:var(--nb-blue);
    border-color:var(--nb-line-strong);
}
html.nb-visual-sample[data-nb-dark] .nuliblog-showcase .showcase-filter-tabs button[aria-pressed=true] {
    background:var(--nb-action);
    color:white;
}
html.nb-visual-sample[data-nb-dark] :is(.gallery-layout-switch,.showcase-layout-switch) button[aria-pressed=true] {
    background:var(--nb-blue-soft);
    color:var(--nb-blue);
}
html.nb-visual-sample[data-nb-dark] .nuliblog-showcase .showcase-status {
    background:var(--nb-blue-soft);
    border-color:var(--nb-line);
    color:var(--nb-blue);
}
html.nb-visual-sample[data-nb-dark] .showcase-project-actions a:not(:first-child) {
    color:var(--nb-blue);
}
