/* QZ Clarity. Single source for navigation, tools, reading and Studio.
   Quiet, Apple-inspired hierarchy; QZ brand and real controls stay intact.
   Load after legacy page CSS. Do not reduce consent, attribution or warnings. */
html:root {
  --qz-canvas:#f7f8fa; --qz-surface:#fff; --qz-surface-muted:#f0f2f5;
  --qz-surface-strong:#e5e5ea; --qz-ink:#282a2d;
  --qz-ink-secondary:#5b616b; --qz-ink-tertiary:#5b616b;
  --qz-accent:#2563eb; --qz-accent-hover:#1d4ed8;
  --qz-accent-soft:#edf2ff; --qz-on-accent:#fff;
  --qz-line:#e4e7ec; --qz-line-strong:#bfc0c7;
  --qz-focus:#2563eb;
  --qz-font-sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  --qz-font-size-12:.875rem; --qz-font-size-14:.875rem;
  --qz-font-size-16:1rem; --qz-leading-body:1.65;
  --qz-radius-control:.625rem; --qz-radius-surface:.75rem;
  --qz-header-height:4rem; --qz-shadow-float:0 8px 24px #1d1d1f0a;
  --qz-shadow-menu:0 16px 48px #1d1d1f18;
  --qc-body:.875rem; --qc-ui:.875rem; --qc-caption:.875rem;
  --qc-page:clamp(1.5rem,2.2vw,2rem); --qc-section:1.25rem;
  --qc-card:.9375rem; --qc-gap:1.5rem;
  --mono:"SF Mono",ui-monospace,"JetBrains Mono",Menlo,Consolas,monospace;
  /* Map older page variables to the same palette, not a second theme. */
  --bg:var(--qz-canvas); --bg-soft:var(--qz-canvas); --bg-secondary:var(--qz-surface-muted);
  --surface:var(--qz-surface); --surface-soft:var(--qz-surface-muted); --card:var(--qz-surface);
  --ink:var(--qz-ink); --text:var(--qz-ink); --ink-2:var(--qz-ink-secondary);
  --ink-3:var(--qz-ink-tertiary); --text-secondary:var(--qz-ink-secondary); --text-muted:var(--qz-ink-secondary);
  --blue:var(--qz-accent); --blue-strong:var(--qz-accent-hover); --blue-soft:var(--qz-accent-soft);
  --accent:var(--qz-accent); --accent-soft:var(--qz-accent-soft);
  --line:var(--qz-line); --hair:var(--qz-line); --border:var(--qz-line); --border-light:var(--qz-line);
  --paper:var(--qz-surface); --muted:var(--qz-ink-secondary); --soft:var(--qz-ink-secondary);
  --directory-muted:var(--qz-ink-secondary); --directory-line:var(--qz-line);
  --directory-surface:var(--qz-surface); --directory-soft:var(--qz-canvas);
}
html.dark,html[data-theme="dark"] {
  --qz-canvas:#161618; --qz-surface:#222225; --qz-surface-muted:#2b2b30;
  --qz-surface-strong:#34343a; --qz-ink:#f5f5f7;
  --qz-ink-secondary:#b6b6bf; --qz-ink-tertiary:#b6b6bf;
  --qz-line:#3b3b41; --qz-line-strong:#66666f;
  --qz-accent:#8fb2ff; --qz-accent-hover:#b3caff; --qz-accent-soft:#29334d;
  --qz-on-accent:#161618; --qz-focus:#8fb2ff;
}
body,body.qz-shell,body.discovery-page,body.studio {
  background:var(--qz-canvas); color:var(--qz-ink); font-family:var(--qz-font-sans);
  font-size:var(--qc-body); line-height:var(--qz-leading-body); -webkit-font-smoothing:auto;
}
button,input,textarea,select { font-family:var(--qz-font-sans); }
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),textarea { font-size:var(--qc-body); }
:focus-visible { outline:2px solid var(--qz-focus); outline-offset:3px; }
/* The navigation is one line; visible active state is retained. */
.qz-header { background:color-mix(in srgb,var(--qz-surface) 92%,transparent); border-color:var(--qz-line); backdrop-filter:blur(16px); }
.qz-header .qz-header-brand-copy strong { font-size:1.125rem; letter-spacing:-.025em; }
.qz-header-brand { min-width:0; }
.qz-header .qz-header-current,.qz-header .qz-module-link,.qz-header .qz-favorites-link { font-size:var(--qc-ui); }
.qz-header [aria-current="page"] { color:var(--qz-ink); }
.qz-module-link::after { display:none; }
.qz-header .qz-module-link[aria-current="page"] { background:var(--qz-surface-muted); border-radius:var(--qz-radius-control); }
.qz-header button,.qz-header .qz-favorites-link { min-height:44px; }
.qz-header kbd,.big-search .kbd,.hero-search kbd { display:none; }
/* Search, then browse. No hero art or marketing chrome. */
.directory-first .home-browse-layout { margin-block:32px 64px; gap:32px; grid-template-columns:208px minmax(0,1fr); }
.directory-first .home-start { padding:12px 0 24px; }
.directory-first .hero { max-width:none; align-items:center; text-align:center; padding:0 0 20px; }
.directory-first .home-start .hero h1 { font-size:var(--qc-page); font-weight:600; line-height:1.3; letter-spacing:-.035em; }
.directory-first .catalogue-overview { justify-content:center; margin:16px 0 20px; gap:24px; font-size:var(--qc-ui); }
.directory-first .catalogue-overview strong { font-size:inherit; font-weight:600; }
.directory-first .big-search { width:min(100%,760px); height:60px; background:var(--qz-surface); border-color:var(--qz-line); border-radius:var(--qz-radius-surface); box-shadow:none; }
.directory-first .home-search-submit { background:var(--qz-accent); color:var(--qz-on-accent)!important; border-radius:var(--qz-radius-control); font-size:var(--qc-ui); font-weight:500; }
.directory-first .scene-shortcuts { max-width:760px; margin:12px auto 0; gap:8px; }
.directory-first .scene-shortcuts a { background:transparent; border:0; min-height:44px; font-weight:500; color:var(--qz-ink-secondary); }
.directory-first .scene-shortcuts a:hover { background:var(--qz-surface-muted); color:var(--qz-ink); }
.directory-first .scene-shortcuts a span { display:none; }
.directory-first .directory-toolbar { padding-block:20px 12px; }
.directory-first .directory-heading h2 { font-size:var(--qc-section); font-weight:600; }
.directory-first .directory-fav,.directory-first .seg-btn { font-weight:500; }
.directory-first #homeTopPagination { display:none; } /* One pager, below results. */
.directory-first #homeLocal { border-color:var(--qz-line); padding-block:16px; }
.directory-first #homeLocalTitle { font-size:var(--qc-ui); font-weight:600; }
.directory-first #homeLocalGrid a h3 { font-weight:500; font-size:var(--qc-ui); }
/* Categories remain complete. A selected row, not 19 little cards. */
.directory-first #directories,body[data-category-id] #directories { background:transparent; border:0; border-radius:0; padding:0 12px 0 0; border-right:1px solid var(--qz-line); }
#directories .portal-head h2 { font-size:var(--qc-ui); font-weight:600; }
#directories .portal-head p { font-size:var(--qc-caption); }
#directories .portal-card { min-height:44px; border:0; border-radius:10px; padding:8px 10px; gap:10px; }
#directories .portal-card strong { font-size:var(--qc-ui); font-weight:400; }
#directories .portal-card small { font-size:var(--qc-caption); }
#directories .portal-card small b { font-weight:500; font-variant-numeric:tabular-nums; }
#directories .portal-card[aria-current],#directories .portal-card.is-selected,.home-all-categories.is-selected { background:var(--qz-surface); color:var(--qz-ink); border-left:2px solid var(--qz-accent); }
/* Name + purpose + action. No repeated category label inside a category. */
.discovery-tool,.discovery-guide { border-color:var(--qz-line); border-radius:var(--qz-radius-surface); box-shadow:none; }
.discovery-tool { padding:20px; gap:12px; }
.discovery-page .discovery-tool h3,body[data-category-id] .discovery-tool h3 { font-size:var(--qc-card); line-height:1.4; font-weight:600; }
.discovery-page .discovery-tool p,body[data-category-id] .discovery-tool p,.discovery-guide p { font-size:var(--qc-ui); line-height:1.65; }
.discovery-tool .discovery-label,.discovery-guide small { font-size:var(--qc-caption); color:var(--qz-ink-secondary); }
body[data-category-id] .discovery-tool:not(:has(a[rel~="sponsored"]))>.discovery-label { display:none; }
.discovery-tool .discovery-card-actions { margin-top:auto; gap:16px; }
.discovery-tool .discovery-card-actions a,.discovery-tool .discovery-card-actions button { min-height:44px; font-size:var(--qc-ui); }
.discovery-tool .discovery-open { background:transparent!important; padding:0 4px; font-weight:500; }
.discovery-tool .discovery-fav { min-width:44px; min-height:44px; }
.discovery-tool:hover,.discovery-guide:hover { transform:none; border-color:var(--qz-line-strong); box-shadow:none; }
.category-hero { padding-block:8px 24px; }
.hero-copy h1,.directory-intro h1 { font-size:var(--qc-page)!important; font-weight:650; line-height:1.3; }
.hero-copy p { font-size:var(--qc-ui); max-width:68ch; line-height:1.65; }
.hero-facts { gap:20px; margin-top:16px; }
.scenario-chip { border-radius:var(--qz-radius-control); font-size:var(--qc-caption); font-weight:500; }
.result-line { font-size:var(--qc-caption); }
.category-scenario-panel summary { min-height:44px; font-size:var(--qc-ui); }
.category-scenario-panel summary small { display:none; } /* Count already in hero. */
#categoryScenarioPanel>summary>span { display:none; }
/* Online tools: icon and title on the same row; quiet, generous work area. */
.toolbox-hero { padding-block:32px 24px; }
.toolbox-hero .hero-title { font-size:var(--qc-page); font-weight:650; }
.toolbox-hero .hero-sub { font-size:var(--qc-ui); margin-top:12px; }
.toolbox-hero .hero-search { height:56px; border-radius:var(--qz-radius-surface); box-shadow:none; }
.toolbox-hero .toolbox-privacy { font-size:var(--qc-caption); max-width:640px; margin:12px auto 0; }
.toolbox-categories { padding:8px; background:transparent; border:0; border-right:1px solid var(--qz-line); border-radius:0; }
.toolbox-categories .cat-tabs button { font-size:var(--qc-ui); }
.toolbox-categories .cat-tabs .tab-count { background:transparent; font-size:var(--qc-caption); }
.toolbox-categories .cat-tabs button.on { background:var(--qz-surface); color:var(--qz-ink); border-left:2px solid var(--qz-accent); }
.toolbox-results-head h2 { font-size:var(--qc-section); }
.toolbox-results .mini-open { display:grid; grid-template-columns:40px minmax(0,1fr); grid-template-rows:auto 1fr; align-content:start; text-align:left; gap:16px 12px; padding:22px; min-height:164px; }
.toolbox-results .mini-icon { grid-column:1; grid-row:1; background:var(--qz-surface-muted); color:var(--qz-ink); }
.toolbox-results .mini-name { grid-column:2; grid-row:1; align-self:center; padding-right:24px; font-size:var(--qc-card); font-weight:600; }
.toolbox-results .mini-desc { grid-column:1/-1; grid-row:2; font-size:var(--qc-ui); line-height:1.65; }
.toolbox-results .mini-open::after { display:none; } /* Whole card is the button. */
.toolbox-results .mini-card { border-color:var(--qz-line); border-radius:var(--qz-radius-surface); }
.toolbox-results .mini-star { min-width:44px; min-height:44px; top:4px; right:4px; }
.toolbox-results .mini-card:hover { border-color:var(--qz-line-strong); }
.toolbox-results .mini-card:hover .mini-name { color:var(--qz-accent); }
.workspace-shell .tool-card { padding:32px; border-radius:var(--qz-radius-surface); box-shadow:none; }
.workspace-shell .tool-name { font-size:var(--qc-page); font-weight:650; }
.workspace-shell .tool-desc { font-size:var(--qc-body); line-height:1.65; }
.workspace-shell .btn,.tool-modal-panel .btn { font-weight:500; font-size:var(--qc-ui); box-shadow:none; }
.tool-modal-panel { border-radius:20px; box-shadow:var(--qz-shadow-menu); }
.tool-modal-panel .tool-input,.workspace-shell .tool-input { background:var(--qz-surface); }
/* Reading and community use the same type ladder, not more nested panels. */
.community-header h1,.composer-head h1,.beginner-hero h1,.reading-hero h1,.guide-hero h1,.discovery-scene-page h1 { font-size:var(--qc-page); line-height:1.3; font-weight:650; }
.community-eyebrow,.community-kicker,.directory-intro .eyebrow,.group-kicker { display:none; }
.community-sidebar,.community-aside .qz-surface { box-shadow:none; border-color:var(--qz-line); border-radius:var(--qz-radius-surface); }
.community-shell .qz-btn,.community-shell button { font-size:var(--qc-ui); font-weight:500; }
.post-title { font-size:var(--qc-card); }
.directory-item { border-color:var(--qz-line); }
.directory-item strong { font-size:var(--qc-card)!important; font-weight:600; }
.directory-item span,.directory-item small { font-size:var(--qc-ui)!important; }
.beginner-reading .reading-hero,.beginner-hero { background:transparent; border:0; box-shadow:none; padding-inline:0; }
.beginner-reading-nav,.beginner-subnav,.qz-learning-nav { display:flex; flex-wrap:wrap; gap:8px; padding-block:12px; margin-bottom:24px; }
.beginner-reading-nav a,.beginner-subnav a,.qz-learning-nav a { display:inline-flex; align-items:center; min-height:44px; padding:8px 16px; border-radius:var(--qz-radius-control); font-size:var(--qc-ui); }
.beginner-reading-nav a:hover,.beginner-subnav a:hover,.qz-learning-nav a:hover { background:var(--qz-surface); }
.qz-learning-nav a[aria-current="page"] { background:var(--qz-surface); font-weight:600; }
.beginner-reading p,.beginner-reading li,.discovery-scene-page section>p { font-size:var(--qc-body); line-height:1.8; }
.beginner-reading h2,.discovery-scene-page h2 { font-size:var(--qc-section); }
.beginner-reading .reading-search-hint { display:none; }
.beginner-local-search input:placeholder-shown~[data-beginner-search-status] { display:none; } /* Live results stay visible after typing. */
.discovery-scene-page .discovery-materials { background:transparent; border:0; padding:0; border-radius:0; }
body.whitepaper-original { font-family:var(--qz-font-sans); }
.whitepaper-original .hero-title,.whitepaper-original .section.hero h1 { font-size:var(--qc-page); }
.whitepaper-original .section { background:var(--qz-surface); border-color:var(--qz-line); box-shadow:none; }
.whitepaper-original .section p,.whitepaper-original .section li { font-size:var(--qc-body); line-height:1.8; }
.whitepaper-original .author-box,.whitepaper-original .author-card { background:var(--qz-surface-muted); color:var(--qz-ink); box-shadow:none; }
.whitepaper-original .author-box p,.whitepaper-original .author-card p { color:var(--qz-ink-secondary); }
.whitepaper-original .signature-card { background:var(--qz-surface-muted); color:var(--qz-ink); border:1px solid var(--qz-line); box-shadow:none; }
.whitepaper-original .signature-card p { color:var(--qz-ink-secondary); }
footer,.site-footer,.footer { font-family:var(--qz-font-sans); font-size:var(--qc-caption); line-height:1.7; }
/* Studio keeps its actual service states, controls and original assets. */
.studio { font-size:var(--qc-body); }
.studio .topbar { background:var(--qz-surface); }
.studio .hero-title { font-size:var(--qc-page); line-height:1.3; letter-spacing:-.035em; font-weight:650; }
.studio .hero-title span { color:var(--qz-ink); }
.studio h1 { font-size:var(--qc-page); font-weight:650; }
.studio h2 { font-size:var(--qc-section); font-weight:600; }
.studio h3 { font-size:var(--qc-card); font-weight:600; }
.studio .eyebrow { display:none; }
.studio .studio-hero { padding-block:32px 24px; }
.studio .top-actions button,.studio .top-actions a { min-height:44px; font-size:var(--qc-caption); }
.studio button,.studio .button,.studio input,.studio textarea,.studio select { font-size:var(--qc-ui); border-radius:var(--qz-radius-control); }
.studio input,.studio textarea { font-size:var(--qc-body); }
.studio .icon-button { min-width:44px; min-height:44px; }
.studio .primary { color:var(--qz-on-accent); font-weight:500; box-shadow:none; }
.studio .panel,.studio .composer,.studio .featured-card,.studio .visual-card,.studio .library-card,.studio .task-card { border-color:var(--qz-line); border-radius:var(--qz-radius-surface); box-shadow:none; }
.studio .capability-label,.studio .field-note,.studio .save-state,.studio .preview-toolbar,.studio .notice,.studio .featured-card p { font-size:var(--qc-caption); line-height:1.65; }
.studio .composer-tab-hint { display:none; }
.studio .home-hero { padding:40px 32px 32px; }
.studio .home-hero h1 { font-size:var(--qc-page); font-weight:600; letter-spacing:-.035em; line-height:1.3; }
.studio .home-hero h1 span { color:var(--qz-ink); }
.studio .composer-tabs p { display:none; } /* Repeats the upload and brief controls. */
.studio .composer-tabs button { min-height:44px; font-size:var(--qc-ui); padding:8px 18px; }
.studio .output-line>span,.studio .output-line small,.studio .output-choice,.studio .output-choice span,.studio .more-output { font-size:var(--qc-caption); }
.studio .compact .output-choice span,.studio .more-output { min-height:44px; padding:8px 12px; }
.studio .composer-status,.studio .preview-badge,.studio .section-title p,.studio .section-title>a,.studio .quick-tools small { font-size:var(--qc-caption); }
.studio .section-title h2 { font-size:var(--qc-section); }
.studio .quick-tools button,.studio .quick-tool-grid a { font-size:var(--qc-ui); }
.studio .library-card p,.studio .visual-card p,.studio .repair-card p,.studio .workflow-form label,.studio .workflow-form small { font-size:var(--qc-caption); line-height:1.7; }
.studio .composer-body { background:var(--qz-canvas); }
.studio .sidebar { box-shadow:none; border-color:var(--qz-line); }
.studio .sidebar nav a,.studio .subnav nav a { font-size:var(--qc-ui); font-weight:500; }
.studio small { font-size:var(--qc-caption); }
.studio p { font-size:var(--qc-body); line-height:1.7; }
.studio .composer-status,.studio .scope-note p,.studio .preview-badge,.studio .section-title p { font-size:var(--qc-caption); }
.studio .hero-composer .composer-status { font-size:var(--qc-caption); }
.studio .field-note,.studio .reference-note,.studio .workflow-form .field-note,.studio .workflow-form .char-count,.studio .composer-status { font-size:var(--qc-caption)!important; }
.studio .repair-items>a,.studio .repair-items>button { min-height:48px; font-size:var(--qc-ui); }
.studio .repair-items span { font-size:var(--qc-caption); }
.studio .video-shortcuts a,.studio .video-shortcuts a span { font-size:var(--qc-caption); min-height:44px; }
.studio .reference-card h3 { font-size:var(--qc-card); }
.studio .reference-card small { font-size:var(--qc-caption); }
.studio .reference-card>div>span { font-size:var(--qc-ui); min-height:44px; padding:8px 12px; border-radius:var(--qz-radius-control); }
.studio .composer-entry .tiny-button { font-size:var(--qc-caption); min-height:44px; padding:8px 12px; }
.studio .composer-footer>button { font-size:var(--qc-ui); min-height:44px; }
.studio .upload-box p,.studio .filter-tabs button { font-size:var(--qc-caption); }
.studio .filter-tabs button { min-height:44px; }
.studio .topbar #menu-toggle { min-width:44px; min-height:44px; }
.studio .top-actions #logout { font-size:var(--qc-caption); min-height:44px; }
.studio .generation-eyebrow,.studio .user-subnav p { display:none; }
.studio .generation-page .page-heading h1,.studio .generation-heading h1 { font-size:var(--qc-page); }
.studio .generation-page .page-heading p { font-size:var(--qc-body); }
.studio .generation-page .inline-note,.studio .generation-page .check-row,.studio .generation-page .check-row span { font-size:var(--qc-caption); line-height:1.7; }
.studio .inline-note { font-size:var(--qc-caption)!important; }
.studio .generation-page .generation-step { font-size:var(--qc-caption); }
.studio #account-action-page .empty-state h1 { font-size:var(--qc-section); }
.studio .repair-chip,.studio .repair-chip span,.studio .video-tool span { font-size:var(--qc-caption); }
.studio .sidebar .nav-label { display:none; }
.studio .user-subnav nav { flex-wrap:wrap; overflow:visible; gap:6px; }
.studio .user-subnav nav a { min-height:44px; }
@media(max-width:1000px) {
  .toolbox-categories { border:1px solid var(--qz-line); border-radius:var(--qz-radius-control); background:var(--qz-surface); }
}
@media(max-width:800px) {
  .directory-first .home-browse-layout { margin-top:24px; gap:16px; }
  .directory-first .home-start { padding:0 0 8px; }
  .directory-first .hero { text-align:center; padding:0 0 12px; }
  .directory-first .home-start .hero h1 { font-size:2rem; line-height:1.35; }
  .directory-first .catalogue-overview { margin:12px 0 16px; gap:16px; }
  .directory-first .catalogue-overview a[href='/tools/'] { background:transparent; padding:0; }
  .directory-first .scene-shortcuts { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px; }
  .directory-first #directories,body[data-category-id] #directories { border:1px solid var(--qz-line); border-radius:var(--qz-radius-control); background:var(--qz-surface); padding:6px 8px; }
  .directory-first .directory-toolbar { padding-block:12px; }
  .directory-first .directory-actions .seg { margin-top:8px; }
  .discovery-tool { padding:20px; }
  .category-hero { padding-block:0 16px; }
  .category-workspace .hero-copy h1 { font-size:2rem!important; }
  .toolbox-hero { padding:24px 16px; }
  .toolbox-results .mini-open { padding:20px; min-height:140px; }
  .workspace-shell .tool-card { padding:24px 20px; }
  .studio .studio-hero { padding-block:24px 20px; }
  .studio .home-hero { padding:28px 16px; }
  .studio main { padding-inline:16px; }
  .studio .user-subnav { padding:8px 16px; }
  .studio .topbar .preview-badge { display:none; } /* Full state remains beside submit. */
}
@media(max-width:540px) {
  .directory-first .big-search { height:56px; }
  .directory-first .home-search-submit { min-height:44px; padding-inline:16px; }
  .directory-first .home-start .hero h1 { font-size:1.875rem; }
  .directory-first .catalogue-overview { font-size:var(--qc-ui); }
  .directory-first .directory-heading h2 { font-size:1.375rem; }
  .tool-modal-panel { border-radius:0; }
  .studio .hero-title,.studio .home-hero h1 { font-size:1.875rem; }
}
/* Production's local Studio workbenches use a separate public-* shell. */
body.studio.public-studio h1 { font-size:var(--qc-page); line-height:1.3; font-weight:650; }
body.studio.public-studio :is(p,label,small,.field,.field>span,.board-note,.board-artifact-note,.public-handoff-direct) { font-size:var(--qc-caption)!important; line-height:1.7; }
body.studio.public-studio :is(button,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),textarea) { font-size:var(--qc-ui)!important; }
body.studio.public-studio select { font-size:var(--qc-caption)!important; }
body.studio.public-studio :is(button,select,input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"])) { min-height:44px; }
body.studio.public-studio :is(.public-help-button,.public-back,.public-nav a,.public-handoff-direct) { font-size:var(--qc-caption); min-height:44px; }
/* The existing concept gallery remains explicitly a preview, not a live API. */
body:has(.hero-gallery) :is(.edition,.section-index) { display:none; }
body:has(.hero-gallery) h1 { font-size:var(--qc-page); line-height:1.3; letter-spacing:-.035em; }
body:has(.hero-gallery) :is(p,small,.header-status,.frame-stamp,.gallery-topline,.example-meta,.image-label,.results-count) { font-size:var(--qc-caption)!important; line-height:1.7; }
body:has(.hero-gallery) :is(button,.filter-button,.button-primary,.button-subtle,.back-link) { font-size:var(--qc-ui); min-height:44px; }
body:has(.hero-gallery) :is(.gallery-controls small,.filter-button span) { font-size:var(--qc-caption); }
body:has(.hero-gallery) .example-open strong { font-size:var(--qc-card); }
@media(max-width:800px) {
  body.studio.public-studio h1,body:has(.hero-gallery) h1 { font-size:2rem; }
}
@media(max-width:540px) {
  body.studio.public-studio .field:has(select) { grid-column:1/-1; }
}
@media(prefers-reduced-motion:reduce) {
  html { scroll-behavior:auto; }
  *,*::before,*::after { animation:none!important; transition:none!important; }
}

/* System typography: readable normal weight, compact labels, full control targets. */
.qz-header .qz-header-brand-copy strong { letter-spacing:0; }
.qz-header .qz-module-link { font-weight:500; }
.discovery-scene-page { font-family:var(--qz-font-sans); }
.directory-first .home-browse-layout { margin-top:20px; }
.directory-first .home-start { padding-bottom:12px; }
.directory-first .hero { padding-bottom:12px; }
.directory-first .home-start .hero h1 { letter-spacing:0; line-height:1.35; }
.directory-first .catalogue-overview { margin:12px 0 16px; }
.directory-first .big-search { height:56px; }
.directory-first .directory-toolbar { padding-block:14px 10px; }
.directory-first #homeLocal { padding-block:10px; }
.discovery-tool { padding:16px; gap:10px; }
.discovery-page .discovery-tool p,body[data-category-id] .discovery-tool p,.discovery-guide p { line-height:1.6; }
.directory-first .discovery-tool>p,body[data-category-id] .discovery-tool>p { min-height:0; }
.hero-copy h1,.directory-intro h1,.toolbox-hero .hero-title,
.workspace-shell .tool-name,.community-header h1,.composer-head h1,
.beginner-hero h1,.reading-hero h1,.guide-hero h1,.discovery-scene-page h1,
.whitepaper-original .hero-title,.whitepaper-original .section.hero h1,
.studio .hero-title,.studio h1,.studio .home-hero h1,
body.studio.public-studio h1,body:has(.hero-gallery) h1 {
  font-weight:600; letter-spacing:0;
}
.category-hero { padding-block:0 16px; }
.hero-copy p { line-height:1.6; }
.toolbox-hero { padding-block:24px 16px; }
.toolbox-results .mini-open { padding:16px; gap:12px; min-height:144px; }
.toolbox-results .mini-desc { line-height:1.6; }
.studio .studio-hero { padding-block:24px 16px; }
.studio .home-hero { padding:28px 24px; }
@media(max-width:800px) {
  .directory-first .home-browse-layout { margin-top:20px; }
  .directory-first .home-start .hero h1,.category-workspace .hero-copy h1,
  body.studio.public-studio h1,body:has(.hero-gallery) h1 { font-size:var(--qc-page)!important; }
  .directory-first .home-start { padding-bottom:8px; }
  .directory-first .directory-toolbar { padding-block:10px; }
  .discovery-tool { padding:16px; }
  .toolbox-hero { padding:20px 16px 16px; }
  .toolbox-results .mini-open { min-height:128px; }
  .studio .home-hero { padding:24px 16px; }
}
@media(max-width:540px) {
  .directory-first .home-browse-layout { margin-top:16px; }
  .directory-first .catalogue-overview { gap:12px; }
  .directory-first .directory-heading h2 { font-size:1.25rem; }
  .studio .hero-title,.studio .home-hero h1 { font-size:var(--qc-page); }
}

/* User preference: compact navigation and cards, native screen rendering. */
body,body.qz-shell,body.discovery-page,body.studio {
  -webkit-font-smoothing:auto; -moz-osx-font-smoothing:auto; text-rendering:auto;
}
.qz-header .qz-header-brand-copy strong { font-size:1.125rem; font-weight:600; }
.qz-header .qz-module-link { font-size:.875rem; font-weight:500; letter-spacing:0; }
.directory-first .discovery-tool p,body[data-category-id] .discovery-tool p {
  font-size:.875rem; line-height:1.65;
}
body.studio.public-studio :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),textarea) {
  font-size:1rem!important;
}

.qz-command-field input { font-size:1rem; }

/* Official and promotional entry points are peers; disclosure remains explicit. */
.discovery-tool .discovery-card-actions:has(>.discovery-promotion) {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr));
  align-items:stretch; column-gap:12px; row-gap:8px;
}
.discovery-tool .discovery-card-actions:has(>.discovery-promotion)>:is(.discovery-open,.discovery-promotion) {
  display:flex; flex-direction:row; align-items:center; justify-content:center;
  min-width:0; min-height:44px; padding:6px 4px;
  font-size:var(--qz-font-size-14); font-weight:500; line-height:1.5;
  white-space:normal; overflow-wrap:anywhere; text-align:center;
}
.discovery-tool .discovery-card-actions:has(>.discovery-promotion)>:not(.discovery-open):not(.discovery-promotion) {
  grid-column:1/-1; justify-self:start;
}
.discovery-tool .discovery-card-actions:has(>.discovery-promotion)>:is(.discovery-open,.discovery-promotion):hover {
  text-decoration:underline; text-underline-offset:4px;
}

/* AI discovery: compact native text and clean light surfaces, based on user-selected reference. */
body,body.qz-shell,body.discovery-page { font-weight:400; letter-spacing:normal; }
.discovery-tool { border-radius:12px; }
.discovery-tool h3,.discovery-page .discovery-tool h3 { font-size:.9375rem; font-weight:600; line-height:1.5; letter-spacing:normal; }
.qz-discovery-links { display:flex; flex-wrap:wrap; gap:4px 16px; align-items:center; padding:6px 0; margin:0; }
.qz-discovery-links a { display:inline-flex; align-items:center; min-height:40px; color:var(--qz-ink-secondary); font-size:.875rem; font-weight:500; text-decoration:none; }
.qz-discovery-links a:hover,.qz-discovery-links a[aria-current="page"] { color:var(--qz-accent); text-decoration:underline; text-underline-offset:6px; }
.qz-category-discovery { display:flex; flex-wrap:wrap; gap:8px 20px; margin-block:12px 0; }
.qz-category-discovery a { display:inline-flex; align-items:center; min-height:44px; font-size:.875rem; color:var(--qz-accent); }
@media(max-width:800px) { .qz-discovery-links a { min-height:44px; } }

/* Studio inherits the site's single palette/type system; artwork pixels stay owned by editors. */
body.studio.public-studio {
  color-scheme:inherit;
  --public-header-height:var(--qz-header-height);
  --public-sidebar-width:208px;
  --qz-canvas:inherit; --qz-surface:inherit; --qz-surface-muted:inherit;
  --qz-surface-strong:inherit; --qz-ink:inherit;
  --qz-ink-secondary:inherit; --qz-ink-tertiary:inherit;
  --qz-line:inherit; --qz-line-strong:inherit;
  --qz-accent:inherit; --qz-accent-hover:inherit; --qz-accent-soft:inherit;
  --qz-on-accent:inherit; --qz-focus:inherit;
  --st-ink:var(--qz-ink); --st-muted:var(--qz-ink-secondary);
  --st-line:var(--qz-line); --st-accent:var(--qz-accent);
  font-weight:400; letter-spacing:normal;
}
body.studio.public-studio [hidden] { display:none!important; }
body.studio.public-studio :is(.public-main,.public-layout) { min-width:0; }
body.studio.public-studio .public-main { padding:0 0 32px; }
body.studio.public-studio .public-sidebar {
  padding:24px 16px; overflow-y:auto; scrollbar-width:thin;
  scrollbar-color:var(--qz-line-strong) transparent;
}
body.studio.public-studio .public-nav { gap:4px; }
body.studio.public-studio .public-nav a {
  border-radius:var(--qz-radius-control); min-height:44px;
  font-size:var(--qc-ui); font-weight:500; padding:10px 12px;
}
body.studio.public-studio .public-nav a[aria-current="page"] {
  background:var(--qz-accent-soft); color:var(--qz-accent); font-weight:600;
}
body.studio.public-studio .public-local-note { gap:10px; padding:20px 4px 0; }
body.studio.public-studio .public-local-note :is(strong,p) { font-size:.875rem; line-height:1.65; }
body.studio.public-studio :is(.content-page,.batch-page,.pp-page,.board-editor) {
  width:100%; max-width:1440px; margin-inline:auto; padding:28px 32px;
}
body.studio.public-studio :is(.page-heading,.pp-header,.board-heading) { margin:0 0 24px; }
body.studio.public-studio :is(.page-heading,.pp-header,.board-heading) h1 {
  font-size:clamp(1.5rem,2.2vw,1.75rem); font-weight:600; letter-spacing:normal; line-height:1.35;
}
body.studio.public-studio :is(h2,.board-sidebar-section h2,.batch-controls h2,.batch-results h2) {
  font-size:1rem; font-weight:600; line-height:1.5;
}
body.studio.public-studio :is(.page-heading,.pp-header,.board-heading) p {
  max-width:70ch; margin-top:8px; color:var(--qz-ink-secondary); line-height:1.65;
}
body.studio.public-studio button {
  min-height:44px; border-radius:var(--qz-radius-control);
  border-color:var(--qz-line); background:var(--qz-surface); color:var(--qz-ink);
  font-weight:500; padding:10px 14px; line-height:1.5;
  box-shadow:none; white-space:normal;
}
body.studio.public-studio button:hover:not(:disabled) {
  border-color:var(--qz-line-strong); background:var(--qz-surface-muted);
}
body.studio.public-studio button:active:not(:disabled) { background:var(--qz-surface-strong); }
body.studio.public-studio button.primary {
  background:var(--qz-accent); border-color:var(--qz-accent); color:var(--qz-on-accent);
}
body.studio.public-studio button.primary:hover:not(:disabled) {
  background:var(--qz-accent-hover); border-color:var(--qz-accent-hover);
}
body.studio.public-studio button.primary:active:not(:disabled) { filter:brightness(.94); }
body.studio.public-studio button:disabled { opacity:.48; cursor:not-allowed; }
body.studio.public-studio :is(button[aria-pressed="true"],.board-layer-row[data-selected="true"]) {
  color:var(--qz-accent); background:var(--qz-accent-soft); border-color:var(--qz-accent);
}
body.studio.public-studio :is(button,input,select,textarea,summary,a):focus-visible {
  outline:2px solid var(--qz-focus); outline-offset:3px;
}
body.studio.public-studio :is(input,select,textarea) {
  background:var(--qz-surface); color:var(--qz-ink); border-color:var(--qz-line-strong);
  border-radius:var(--qz-radius-control); font-family:var(--qz-font-sans);
  caret-color:var(--qz-accent); accent-color:var(--qz-accent); min-width:0;
}
body.studio.public-studio :is(input,textarea)::placeholder { color:var(--qz-ink-secondary); opacity:1; }
body.studio.public-studio :is(input,select,textarea):disabled {
  background:var(--qz-surface-muted); color:var(--qz-ink-secondary); cursor:not-allowed;
}
body.studio.public-studio :is(input[type="range"],input[type="checkbox"],input[type="radio"]) {
  padding:0; box-shadow:none;
}
body.studio.public-studio input[type="range"] { min-height:44px; }
body.studio.public-studio input[type="color"] { min-height:44px; padding:5px; cursor:pointer; }
body.studio.public-studio :is(.pp-field,.board-field,.field)>span {
  font-size:var(--qc-ui); font-weight:500; color:var(--qz-ink);
}
body.studio.public-studio :is(.pp-field small,.pp-field output,.field-note,.board-note,.pp-note,.pp-status,.board-save-state) {
  color:var(--qz-ink-secondary); font-size:var(--qc-caption); line-height:1.65;
}
body.studio.public-studio :is(.panel,.pp-settings,.pp-source,.board-inspector,.public-starting) {
  background:var(--qz-surface); border:1px solid var(--qz-line);
  border-radius:var(--qz-radius-surface); box-shadow:none;
}
body.studio.public-studio :is(.pixel-layout,.batch-layout,.lv-layout) {
  grid-template-columns:280px minmax(0,1fr); gap:24px;
}
body.studio.public-studio :is(.pixel-layout,.batch-layout,.lv-layout)>.panel { padding:20px; }
body.studio.public-studio :is(.canvas-stage,.pp-stage,.board-stage,.lv-stage) {
  background:var(--qz-surface-muted); border:1px solid var(--qz-line);
  border-radius:var(--qz-radius-control);
}
body.studio.public-studio :is(.pixel-result,.batch-controls,.pp-preview) { top:calc(var(--public-header-height) + 24px); }
body.studio.public-studio :is(#px-empty,.lv-empty,.batch-empty) { background:var(--qz-surface-muted); }
body.studio.public-studio :is(.upload-label,.batch-upload) {
  background:var(--qz-surface); border-color:var(--qz-line-strong);
  border-radius:var(--qz-radius-control); min-height:112px;
}
body.studio.public-studio :is(.upload-label,.batch-upload):hover {
  border-color:var(--qz-accent); background:var(--qz-accent-soft);
}
body.studio.public-studio input::file-selector-button {
  font:inherit; min-height:44px; padding:8px 12px; border:1px solid var(--qz-line);
  border-radius:var(--qz-radius-control); background:var(--qz-surface); color:var(--qz-ink);
  cursor:pointer; margin-right:12px;
}
body.studio.public-studio input::file-selector-button:hover { background:var(--qz-surface-muted); }
body.studio.public-studio .pixel-tabs { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:20px; padding-bottom:16px; }
body.studio.public-studio .pixel-tabs button { border:1px solid transparent; background:transparent; }
body.studio.public-studio .pixel-tabs button[aria-pressed="true"] {
  background:var(--qz-accent-soft); border-color:transparent; color:var(--qz-accent);
}
body.studio.public-studio .public-feedback {
  margin:20px 32px 0; background:var(--qz-accent-soft); color:var(--qz-ink);
  border-color:var(--qz-line); border-radius:var(--qz-radius-control); font-size:var(--qc-ui);
}
body.studio.public-studio .public-feedback button { min-height:44px; width:44px; padding:12px; border:0; background:transparent; }
body.studio.public-studio :is(.public-feedback[data-error="true"],.pp-error,.board-warning,.board-status[data-error="true"],#lv-status[data-error="true"]) {
  color:var(--qz-danger); border-color:var(--qz-danger);
}
body.studio.public-studio .public-feedback[data-error="true"] { background:var(--qz-surface); }
body.studio.public-studio :is(.public-dialog,.board-dialog) {
  color:var(--qz-ink); background:var(--qz-surface); border:0; border-radius:var(--qz-radius-surface);
  box-shadow:var(--qz-shadow-menu); max-height:calc(100dvh - 32px);
  width:min(100% - 32px,580px); padding:24px; scrollbar-width:thin;
  scrollbar-color:var(--qz-line-strong) transparent;
}
body.studio.public-studio .board-dialog:not(.board-confirm) { width:min(980px,calc(100% - 32px)); }
body.studio.public-studio :is(.public-dialog,.board-dialog)::backdrop { background:var(--qz-overlay); }
body.studio.public-studio :is(.public-dialog-head,.board-dialog-head) h2 { font-size:1.25rem; }
body.studio.public-studio :is(.public-dialog-head,.board-dialog-head)>button { min-height:44px; width:44px; padding:10px; }
body.studio.public-studio .board-layer-row { grid-template-columns:minmax(0,1fr) 44px 44px; background:var(--qz-surface-muted); }
body.studio.public-studio .board-layer-row[data-selected="true"] { background:var(--qz-accent-soft); }
body.studio.public-studio .board-layer-row button { background:transparent; min-height:44px; padding:8px; }
body.studio.public-studio .board-layer-row .board-layer-select { justify-content:flex-start; }
body.studio.public-studio .board-layer-row .board-icon-button[aria-pressed="true"] { background:var(--qz-accent-soft); }
body.studio.public-studio .board-layers { scrollbar-color:var(--qz-line-strong) transparent; }
body.studio.public-studio .board-local-file-panel { background:var(--qz-surface); border-color:var(--qz-line); }
body.studio.public-studio .public-handoff { padding-top:12px; margin-top:16px; }
body.studio.public-studio .qz-header button { padding:0; background:transparent; border:0; min-height:44px; }
body.studio.public-studio .qz-header button:hover { background:var(--qz-surface-muted); }
.qz-studio-help span { display:none; }
.qz-studio-help svg { width:20px; height:20px; }
body.studio.public-studio .skip:focus { position:fixed; z-index:calc(var(--qz-layer-dialog) + 2); color:var(--qz-ink); background:var(--qz-surface); outline:2px solid var(--qz-focus); }
.studio-preview-status { max-width:var(--qz-container); margin:24px auto 0; padding-inline:var(--qz-gutter); font-size:.875rem; color:var(--qz-ink-secondary); }
html.dark body.studio.public-studio :is(.public-nav,.board-editor,.public-dialog,.pixel-page,.batch-page,.pp-page,.local-video-page,.public-feedback) img[src*="/icons/"] { filter:brightness(0) invert(1); opacity:.8; }
html.dark body.studio.public-studio button.primary img[src*="/icons/"] { filter:brightness(0); opacity:1; }
@media(min-width:901px) {
  body.studio.public-studio .board-editor { min-height:620px; }
}
@media(max-width:1200px) and (min-width:901px) {
  body.studio.public-studio { --public-sidebar-width:192px; }
  body.studio.public-studio :is(.content-page,.batch-page,.pp-page,.board-editor) { padding:24px; }
  body.studio.public-studio :is(.pixel-layout,.batch-layout,.lv-layout) { grid-template-columns:250px minmax(0,1fr); gap:20px; }
}
@media(max-width:1000px) {
  body.studio.public-studio .lv-layout { grid-template-columns:minmax(0,1fr); }
  body.studio.public-studio .lv-preview { order:-1; }
}
@media(max-width:900px) {
  body.studio.public-studio .public-layout { display:block; }
  body.studio.public-studio .public-sidebar { height:auto; padding:8px 16px; overflow-y:visible; }
  body.studio.public-studio .public-nav { display:flex; overflow-x:auto; gap:4px; }
  body.studio.public-studio .public-nav a { flex-shrink:0; padding:10px 12px; }
  body.studio.public-studio .public-local-note { display:none; }
  body.studio.public-studio :is(.content-page,.batch-page,.pp-page,.board-editor) { padding:24px 20px; }
  body.studio.public-studio .public-feedback { margin:16px 20px 0; }
  body.studio.public-studio :is(.pixel-result,.batch-controls,.pp-preview) { position:static; }
}
@media(max-width:760px) {
  body.studio.public-studio :is(.pixel-layout,.batch-layout,.lv-layout,.pp-workspace) { grid-template-columns:minmax(0,1fr); gap:20px; }
  body.studio.public-studio .pixel-result { order:-1; }
  body.studio.public-studio :is(.content-page,.batch-page,.pp-page,.board-editor) { padding:20px 16px; }
  body.studio.public-studio .public-feedback { margin:16px 16px 0; }
  body.studio.public-studio .pixel-tabs { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:thin; margin-right:0; padding-right:0; }
  body.studio.public-studio .pixel-tabs button { flex:none; white-space:nowrap; }
  body.studio.public-studio :is(.pixel-layout,.batch-layout,.lv-layout)>.panel { padding:16px; }
  body.studio.public-studio .board-layer-row { grid-template-columns:minmax(0,1fr) 44px 44px; }
  body.studio.public-studio .board-additions button { font-size:.875rem; }
  body.studio.public-studio .public-dialog-actions button { min-width:0; }
}
@media(max-width:520px) {
  body.studio.public-studio .public-nav a { flex:0 0 auto; flex-direction:row; min-width:0; font-size:.875rem; }
  body.studio.public-studio .public-nav a .ui-icon { width:18px; height:18px; }
  body.studio.public-studio .pixel-export { grid-template-columns:minmax(0,1fr); }
  body.studio.public-studio .board-topbar>button { flex:1 1 calc(50% - 8px); }
  body.studio.public-studio .board-toolbar { flex-wrap:wrap; }
  body.studio.public-studio .board-undo-actions { flex-direction:row; width:100%; }
}

/* Repeated UI patterns share semantics across navigation, tools and Studio.
   Editor canvases, artwork swatches, code and document content retain their own values. */
html:root {
  --accent-hover:var(--qz-accent-hover); --blue-dark:var(--qz-accent-hover);
  --text-tertiary:var(--qz-ink-tertiary); --line-strong:var(--qz-line-strong);
  --danger:var(--qz-danger); --success:var(--qz-success);
  --qc-input:1rem; --qc-reading:1rem;
  --qc-control-height:44px; --qc-control-padding:10px 14px;
  --qc-weight-ui:500; --qc-weight-heading:600; --qc-disabled:.48;
}
/* Standard native rendering keeps small Chinese text legible on Windows. */
body,body.qz-shell,body.discovery-page,body.studio,body.ac-page {
  font-family:var(--qz-font-sans); font-size:var(--qc-ui);
  font-weight:400; line-height:var(--qz-leading-body); letter-spacing:normal;
  -webkit-font-smoothing:auto; -moz-osx-font-smoothing:auto; text-rendering:auto;
}
:is(.ac-hero h1,.toolbox-hero .hero-title,.tool-modal-head h3,.workspace-shell .tool-name,
    .studio-preview-page .hero h1,.studio-preview-page .dialog-copy h2) {
  font-family:var(--qz-font-sans); font-size:var(--qc-page);
  font-weight:var(--qc-weight-heading); line-height:1.35; letter-spacing:0;
}
body.studio.public-studio :is(.page-heading,.pp-header,.board-heading) h1 {
  font-size:var(--qc-page); font-weight:var(--qc-weight-heading);
}
:is(.ac-card h2,.ac-news-copy h3,.discovery-tool h3,.toolbox-results .mini-name) {
  font-size:var(--qc-card); font-weight:var(--qc-weight-heading); line-height:1.5; letter-spacing:0;
}
.beginner-reading p,.beginner-reading li,.whitepaper-original .section p,.whitepaper-original .section li {
  font-size:var(--qc-reading); line-height:1.8;
}
/* These are equivalent action controls; menus, drawing tools and swatches keep their layout. */
:is(.qz-button,.ac-clear,.workspace-shell .btn,.tool-modal-body .btn,
    .studio-preview-page .button-primary,.studio-preview-page .button-subtle) {
  min-height:var(--qc-control-height); padding:var(--qc-control-padding);
  border:1px solid var(--qz-line); border-radius:var(--qz-radius-control);
  background:var(--qz-surface); color:var(--qz-ink);
  font-family:var(--qz-font-sans); font-size:var(--qc-ui);
  font-weight:var(--qc-weight-ui); line-height:1.5; text-decoration:none; box-shadow:none;
}
:is(.qz-button,.ac-clear,.workspace-shell .btn,.tool-modal-body .btn,
    .studio-preview-page .button-primary,.studio-preview-page .button-subtle):hover:not(:disabled):not([aria-disabled="true"]) {
  background:var(--qz-surface-muted); border-color:var(--qz-line-strong); color:var(--qz-ink);
}
:is(.qz-button,.ac-clear,.workspace-shell .btn,.tool-modal-body .btn,
    .studio-preview-page .button-primary,.studio-preview-page .button-subtle):active:not(:disabled):not([aria-disabled="true"]) {
  background:var(--qz-surface-strong); transform:none;
}
:is(.qz-button.is-primary,.workspace-shell .btn.primary,.tool-modal-body .btn.primary,
    .studio-preview-page .button-primary,.directory-first .home-search-submit) {
  background:var(--qz-accent); border-color:var(--qz-accent); color:var(--qz-on-accent);
}
:is(.qz-button.is-primary,.workspace-shell .btn.primary,.tool-modal-body .btn.primary,
    .studio-preview-page .button-primary,.directory-first .home-search-submit):hover:not(:disabled):not([aria-disabled="true"]) {
  background:var(--qz-accent-hover); border-color:var(--qz-accent-hover); color:var(--qz-on-accent); transform:none;
}
html:is(.dark,[data-theme="dark"]) :is(.qz-button.is-primary,.workspace-shell .btn.primary,.tool-modal-body .btn.primary) {
  color:var(--qz-on-accent);
}
:is(.workspace-shell,.tool-modal-body) .btn.ghost {
  color:var(--qz-ink-secondary); background:var(--qz-surface); border-color:var(--qz-line);
}
:is(.workspace-shell,.tool-modal-body) .btn.ghost:hover:not(:disabled) {
  color:var(--qz-accent); background:var(--qz-accent-soft); border-color:var(--qz-accent);
}
:is(.qz-button,.ac-clear,.workspace-shell .btn,.tool-modal-body .btn,
    .studio-preview-page button,.studio-preview-page .button-primary):is(:disabled,[aria-disabled="true"]) {
  opacity:var(--qc-disabled); cursor:not-allowed; transform:none;
}
:is(.qz-button,.ac-clear,.workspace-shell .btn,.tool-modal-body .btn,
    .studio-preview-page button,.studio-preview-page a):focus-visible {
  outline:2px solid var(--qz-focus); outline-offset:3px;
}
/* The same border, native input size, caret, placeholder and disabled state. */
:is(.qz-field,.ac-field input,.ac-field select,.workspace-shell .tool-input,.workspace-shell .tool-select,
    .tool-modal-body .tool-input,.tool-modal-body .tool-select) {
  color:var(--qz-ink); background:var(--qz-surface); border-color:var(--qz-line-strong);
  border-radius:var(--qz-radius-control); font-size:var(--qc-input); line-height:1.65;
  caret-color:var(--qz-accent); accent-color:var(--qz-accent); min-width:0;
}
:is(.qz-field,.ac-field input,.ac-field select,.workspace-shell .tool-select,.tool-modal-body .tool-select) {
  font-family:var(--qz-font-sans); min-height:var(--qc-control-height);
}
:is(.qz-field,.ac-field input,.workspace-shell .tool-input,.tool-modal-body .tool-input)::placeholder {
  color:var(--qz-ink-secondary); opacity:1;
}
:is(.qz-field,.ac-field input,.ac-field select,.workspace-shell .tool-input,.workspace-shell .tool-select,
    .tool-modal-body .tool-input,.tool-modal-body .tool-select):focus-visible {
  border-color:var(--qz-accent); outline:2px solid var(--qz-focus); outline-offset:0; box-shadow:none;
}
:is(.qz-field,.ac-field input,.ac-field select,.workspace-shell .tool-input,.workspace-shell .tool-select,
    .tool-modal-body .tool-input,.tool-modal-body .tool-select):disabled {
  background:var(--qz-surface-muted); color:var(--qz-ink-secondary); cursor:not-allowed;
}
:is(.tool-modal-body,.workspace-shell) .tool-output.error { color:var(--qz-danger); }
:is(.tool-modal-body,.workspace-shell) .tool-output {
  background:var(--qz-surface-muted); border-color:var(--qz-line); border-radius:var(--qz-radius-control);
}
/* Neutral surfaces, including gallery UI surrounding unchanged example images. */
:is(.discovery-tool,.ac-card,.toolbox-results .mini-card,.workspace-shell .tool-card) {
  background:var(--qz-surface); border-color:var(--qz-line); border-radius:var(--qz-radius-surface); box-shadow:none;
}
.tool-modal-panel { border-radius:var(--qz-radius-surface); }
.ac-logo { border-radius:var(--qz-radius-control); }
.ac-hero p,.ac-description { line-height:1.65; }
.ac-field select,.ac-clear,.ac-facet,.ac-tabs a { font-weight:var(--qc-weight-ui); }
.ac-clear,.ac-facet,.ac-field input,.ac-field select { border-radius:var(--qz-radius-control); }
.ac-facet[aria-pressed="true"] { background:var(--qz-accent-soft); color:var(--qz-accent); }
.studio-preview-page :is(.hero-gallery,.example-open,.example-dialog,.preview-scope,.site-footer) {
  background:var(--qz-surface); color:var(--qz-ink); border-color:var(--qz-line); box-shadow:none;
}
.studio-preview-page :is(.hero-gallery,.example-open,.example-dialog) { border-radius:var(--qz-radius-surface); }
.studio-preview-page :is(.hero-desc,.hero-footnote,.hero-gallery-bottom>p,.example-desc,
    .example-meta,.preview-scope>div>p,.scope-points span,.dialog-copy>p,.dialog-note,.site-footer) {
  color:var(--qz-ink-secondary); font-size:var(--qc-caption); line-height:1.65;
}
.studio-preview-page :is(.hero-gallery-bottom h2,.section-intro h2,.preview-scope h2) {
  color:var(--qz-ink); font-size:var(--qc-section); font-weight:var(--qc-weight-heading); line-height:1.5; letter-spacing:0;
}
.studio-preview-page :is(.gallery-controls button,.filter-button,.dialog-close) {
  color:var(--qz-ink-secondary); background:var(--qz-surface);
  border-color:var(--qz-line); border-radius:var(--qz-radius-control); font-weight:var(--qc-weight-ui);
}
.studio-preview-page :is(.gallery-controls button,.filter-button):hover { background:var(--qz-surface-muted); color:var(--qz-ink); }
.studio-preview-page :is(.gallery-controls button,.filter-button)[aria-pressed="true"] {
  background:var(--qz-accent-soft); border-color:var(--qz-accent); color:var(--qz-accent);
}
.studio-preview-page :is(.dialog-note,.dialog-image-wrap) { background:var(--qz-surface-muted); }
.studio-preview-page .dialog-close { min-height:44px; width:44px; box-shadow:none; }
.studio-preview-page .example-dialog { box-shadow:var(--qz-shadow-menu); }
.studio-preview-page .example-dialog::backdrop { background:var(--qz-overlay); }
.studio-preview-page .scope-points,.studio-preview-page .scope-points>div { border-color:var(--qz-line); }
.studio-preview-page .site-footer a { color:var(--qz-accent); font-weight:var(--qc-weight-ui); }
body.studio.public-studio input::file-selector-button { font-family:var(--qz-font-sans); font-weight:var(--qc-weight-ui); }
/* Selection and numeric UI remain consistent across both theme selectors. */
body ::selection { background:var(--qz-accent-soft); color:var(--qz-ink); }
body :is(input,textarea,[contenteditable="true"]) { caret-color:var(--qz-accent); }
:is(.ac-status,.result-line,.qz-category-count,.tab-count,.board-save-state) { font-variant-numeric:tabular-nums; }
html[data-theme="dark"] body.studio.public-studio :is(.public-nav,.board-editor,.public-dialog,.pixel-page,.batch-page,.pp-page,.local-video-page,.public-feedback) img[src*="/icons/"] { filter:brightness(0) invert(1); opacity:.8; }
html[data-theme="dark"] body.studio.public-studio button.primary img[src*="/icons/"] { filter:brightness(0); opacity:1; }
@media(max-width:800px) {
  html:root { --qc-page:1.5rem; }
  :is(.toolbox-hero .hero-title,.tool-modal-head h3,.workspace-shell .tool-name,.ac-hero h1) { font-size:var(--qc-page); }
}
@media(max-width:540px) { .tool-modal-panel { border-radius:0; } }

body.studio.public-studio select { font-size:var(--qc-input)!important; }
