/* Site chrome only. Photographs, video, native previews and iframe documents keep their colours. */
:root{--cat-paper:#fff;--cat-ink:#000;color-scheme:light;--theme-canvas:#eef1f6;--theme-surface:#fafbfe;--theme-raised:#fff;--theme-soft:#e9edf4;--theme-ink:#172235;--theme-muted:#66717f;--theme-line:#d8dee8;--theme-accent:#165dff;--theme-on-accent:#fafbfe}
:root[data-theme=dark]{--cat-paper:#000;--cat-ink:#fff;color-scheme:dark;--theme-canvas:#14171c;--theme-surface:#20242c;--theme-raised:#282e38;--theme-soft:#333d50;--theme-ink:#edf1f7;--theme-muted:#aab4c4;--theme-line:#444d5d;--theme-accent:#91b2ff;--desk:var(--theme-canvas);--paper:var(--theme-canvas);--cream:var(--theme-canvas);--card:var(--theme-surface);--ink:var(--theme-ink);--muted:var(--theme-muted);--rule:var(--theme-line);--board-ink:var(--theme-ink);--board-mist:var(--theme-soft);--board-blue:#234caa;--board-red:#963639;--board-violet:#61439a;--board-amber:#e0a94e;--brand-ink:var(--theme-ink);--brand-paper:var(--theme-canvas);--brand-card:var(--theme-surface);--brand-muted:var(--theme-muted);--brand-line:var(--theme-line);--vicoo-ink:var(--theme-ink);--vicoo-yellow:#6e5428;--vicoo-green:#245343;--vicoo-blue:#304e6a;--vicoo-lilac:#49405d}
/* Same compact disclosure; a 24px labelled control sits beside its existing caption. */
.settings-row{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;gap:8px;min-height:26px}.settings-fonts{display:grid;gap:6px}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:5px;min-height:28px;padding:4px 8px;border:0;border-radius:8px;font:500 12px/1.3 var(--ui,system-ui);color:var(--theme-ink);background:var(--theme-soft);cursor:pointer;white-space:nowrap}
.theme-toggle svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-sun{display:none}:root[data-theme=dark] .theme-toggle .theme-moon{display:none}:root[data-theme=dark] .theme-toggle .theme-sun{display:block}
.theme-toggle:hover{background:color-mix(in srgb,var(--theme-ink) 12%,var(--theme-soft))}.theme-toggle:focus-visible{outline:2px solid var(--theme-accent);outline-offset:2px}
.utility-nav .nav-details .theme-toggle{min-height:24px;padding:3px 6px;border-radius:7px;font-size:11px;line-height:18px;color:var(--theme-ink);background:var(--theme-soft)}
.utility-nav .nav-details .theme-toggle[aria-pressed=true]{background:var(--theme-soft);color:var(--theme-ink)}
.collage-board[data-nav-expanded=true] .utility-nav[data-settings-direction=horizontal]>.nav-details{max-height:72px;flex:0 0 184px}
.collage-board[data-nav-expanded=true] .utility-nav[data-settings-direction=down]>.nav-details{max-height:72px;flex:0 0 72px}
.utility-nav[data-settings-direction=horizontal] .nav-details-inner{padding:8px 12px 8px 4px}
.bubble-card.utility-nav[data-settings-direction=down] .nav-details-inner{padding:4px 12px 10px}
/* Neutral tiles become ink-dark paper, not an inverted image filter. */
:root[data-theme=dark] body{background-color:var(--theme-canvas);color:var(--theme-ink)}
:root[data-theme=dark] .desk-card[data-board-tone=white]{--card-fill:var(--theme-surface);--card-ink:var(--theme-ink)}
:root[data-theme=dark] .desk-card[data-board-tone=amber]{--card-ink:#241b0c}
:root[data-theme=dark] .bubble-card.utility-nav{background:var(--theme-surface);color:var(--theme-ink)}
:root[data-theme=dark] .nav-card>.social-strip,:root[data-theme=dark] .nav-card>.nav-details{background:transparent;color:inherit}
:root[data-theme=dark] .settings-caption{color:var(--theme-muted)}
:root[data-theme=dark] .font-choices{background:var(--theme-soft)}
:root[data-theme=dark] .font-choices>button{background:transparent!important;color:var(--theme-muted)!important}
:root[data-theme=dark] .font-choices>button[aria-pressed=true]{background:var(--theme-raised)!important;color:var(--theme-ink)!important;box-shadow:none}
:root[data-theme=dark] .desk-search input{background:var(--theme-surface);color:var(--theme-ink)}
:root[data-theme=dark] .desk-filters button{color:inherit}:root[data-theme=dark] .desk-filters button[aria-pressed=true]{background:var(--theme-raised);color:var(--theme-ink)}
/* Reading and settings surfaces. Original media never inherit a filter. */
:root[data-theme=dark] :is(.reader-window,.reader-window>.reader-surface,.desk-preferences,.visual-reader){background:var(--theme-surface);color:var(--theme-ink)}
:root[data-theme=dark] .reader-window:not(.is-project):not(.is-visual) .reader-toolbar{background:var(--theme-raised);color:var(--theme-muted)}
:root[data-theme=dark] :is(.reader-share,.reader-feedback,.reader-end,.desk-preferences small,.visual-prompt dt){color:var(--theme-muted)}
:root[data-theme=dark] .reader-scrim{background:#080b1077}
:root[data-theme=dark] .desk-preferences::backdrop{background:#080b1088}
:root[data-theme=dark] :is(.reader-post:not(.project-story):not(.visual-collection),.post-head){color:var(--theme-ink)}
:root[data-theme=dark] :is(.post-topic,.post-head__summary,.post-meta,.content-block__head,.content-block__caption,.block-source-kind,.block-code summary,.block-transcript summary){color:var(--theme-muted)}
:root[data-theme=dark] .prose :not(pre)>code{background:var(--theme-raised);color:var(--theme-ink)}
:root[data-theme=dark] .reader-post .prose th{background:var(--theme-raised);color:var(--theme-ink)}
:root[data-theme=dark] .reader-post .prose tr:nth-child(even){background:var(--theme-raised)}
:root[data-theme=dark] .reader-post.project-story{--story-ink:var(--theme-ink);--story-soft:var(--theme-muted);--story-accent:var(--theme-soft);--story-paper:var(--theme-surface);background:var(--theme-surface);color:var(--theme-ink)}
:root[data-theme=dark] .project-story .story-actions a{background:var(--theme-ink);color:var(--theme-surface)}
:root[data-theme=dark] .content-block,:root[data-theme=dark] .reader-post .prose .content-block{--cb-ink:var(--theme-ink);--cb-muted:var(--theme-muted);--cb-line:var(--theme-line);--cb-soft:var(--theme-raised);--cb-surface:var(--theme-surface)}
:root[data-theme=dark] .reader-post .block-actions button{background:var(--theme-raised);color:var(--theme-ink)}
:root[data-theme=dark] .shiki,:root[data-theme=dark] .shiki span{color:var(--shiki-dark)!important;background-color:var(--shiki-dark-bg)!important}
:root[data-theme=dark] :is(.work-dialog,.work-dialog__bar,.work-viewer-tabs,.work-viewer-footer,.work-viewer-source){background:var(--theme-surface);color:var(--theme-ink)}
:root[data-theme=dark] :is(.work-viewer-title,.work-viewer-tools button,.work-copy-code,.work-viewer-counter){color:var(--theme-muted)}
:root[data-theme=dark] .work-viewer-tabs button[aria-pressed=true]{background:var(--theme-raised);color:var(--theme-ink)}
/* Archive/about/sample routes use the same persisted preference. */
:root[data-theme=dark] :is(.living-home,.living-archive){--desk-paper:var(--theme-surface);--desk-ink:var(--theme-ink);--desk-blue:#304e6a;--desk-yellow:#6e5428}
:root[data-theme=dark] :is(.site-head,.sample-drawer,.archive-box,.notes-dialog){background:var(--theme-surface);color:var(--theme-ink)}
:root[data-theme=dark] .head-nav a[aria-current]{background:var(--theme-raised);color:var(--theme-ink)}
:root[data-theme=dark] .site-foot{background:var(--theme-canvas);color:var(--theme-ink)}
:root[data-theme=dark] ::selection{background:#52739c;color:#fff}
/* These badges sit on unmodified media, so their original light surface needs dark ink. */
:root[data-theme=dark] .media-facts{color:#172235}
:root[data-theme=dark] :is(.visual-copy-control>button,.visual-copy-control [role=status]:not(:empty),.visual-direction){background:var(--theme-raised);color:var(--theme-ink)}
/* Article typography has legacy fixed paper colours; theme the owned prose explicitly. */
:root[data-theme=dark] .reader-post:not(.project-story):not(.visual-collection){background:var(--theme-surface)}
:root[data-theme=dark] .reader-post .prose,:root[data-theme=dark] .reader-post .prose :is(h2,h3,h4,strong){color:var(--theme-ink)}
:root[data-theme=dark] .reader-post .prose a{color:var(--theme-accent);text-decoration-color:var(--theme-line)}
:root[data-theme=dark] .reader-post .prose blockquote{color:var(--theme-muted)}
:root[data-theme=dark] .reader-post .prose .callout{background:var(--theme-raised);color:var(--theme-ink)}
:root[data-theme=dark] .reader-post .code-block{background:var(--theme-raised)}
:root[data-theme=dark] :is(.reader-share,.reader-feedback,.reader-post [data-copy-code]){background:var(--theme-raised);color:var(--theme-ink)}
:root[data-theme=dark] .article--guide .prose>h2::before{background:var(--theme-soft);color:var(--theme-ink)}

/* Settings: two aligned rows, shared UI typography, one quiet selected surface. */
.bubble-card.utility-nav .nav-details [data-nav-pane]{gap:4px}
.utility-nav .settings-row{width:164px}
.utility-nav .settings-caption{font:500 11px/1.3 var(--ui);letter-spacing:0;color:var(--theme-muted)}
.utility-nav .settings-row .theme-toggle{height:26px;min-height:26px;width:100%;padding:3px 8px;border-radius:8px;justify-content:center}
.bubble-card.utility-nav .settings-row .font-choices{width:100%;height:26px;min-height:26px;gap:2px;padding:2px;box-sizing:border-box;border-radius:8px;background:var(--theme-soft)}
.bubble-card.utility-nav .settings-row .font-choices>button{height:22px;min-height:22px;max-height:22px;padding:1px 4px!important;border-radius:5px!important;background:transparent!important;color:var(--theme-muted)!important;font:500 11px/20px var(--ui)!important;box-shadow:none!important}
.settings-row .font-choices>button[aria-pressed=true]{background:var(--theme-raised)!important;color:var(--theme-ink)!important}
.font-option-label{font:inherit;white-space:nowrap}
.bubble-card.utility-nav .social-strip>[data-settings-trigger].is-active{background:var(--theme-soft);color:var(--theme-ink)}
.utility-nav[data-settings-direction=horizontal] .nav-details-inner{padding:8px 16px 8px 4px}
.bubble-card.utility-nav[data-settings-direction=down] .nav-details-inner{padding:4px 12px 12px}

/* Short navigation stays short when it opens; nested radii follow their inset. */
.bubble-band>.bubble-card.utility-nav{border-radius:18px}
.collage-board[data-nav-expanded=true] .bubble-card.utility-nav[data-settings-direction=down]{border-radius:18px}
.bubble-card.utility-nav .social-strip>:is(a,button){border-radius:12px}

:root[data-theme=dark] .desk-card[data-content-kind=article] .media-facts{color:inherit}

/* Owned project chrome follows the theme; product screenshots remain original. */
:root[data-theme=dark] .reader-post.project-story .story-hero{background:var(--story-paper);color:var(--story-ink)}
:root[data-theme=dark] .reader-window.is-project .reader-toolbar{background:transparent}
:root[data-theme=dark] .reader-window.is-project .reader-share{background:var(--theme-raised);color:var(--theme-ink)}
:root[data-theme=dark] #reader-title{color:var(--theme-muted)}

.bubble-card.utility-nav .social-strip>[data-settings-trigger]:is(.is-active,:hover,:focus-visible) .mi{color:var(--theme-ink)}
.bubble-card.utility-nav .social-strip>[data-settings-trigger]:is(.is-active,:hover,:focus-visible){background:var(--theme-soft);color:var(--theme-ink)}

:root:not([data-theme=dark]) .bubble-card.utility-nav{background:#e4e9f1;color:var(--theme-ink)}

/* Owned reading chrome stays legible in daylight too. */
:root:not([data-theme=dark]) :is(.reader-post .post-head__summary,.reader-post .post-meta,.reader-post .post-topic,#reader-title,.reader-share){color:var(--theme-muted)}
