/* Host-owned chrome. Topic canvases and scientific colors remain upstream-owned. */
:root { --gallery-font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
:root[data-gallery-catalog][data-theme="light"] {
  --page: #fff; --surface: #fff; --ink: #18181b; --secondary: #5f6368;
  --quiet: #71717a; --border: #e4e4e7; --accent: #3f3f46; --tint: #f4f4f5;
}
:root[data-gallery-catalog][data-theme="dark"] {
  --page: #0f0f10; --surface: #171719; --ink: #f4f4f5; --secondary: #a1a1aa;
  --quiet: #a1a1aa; --border: #303033; --accent: #d4d4d8; --tint: #242427;
}
[data-gallery-catalog] body, .encyclopedia-nav { font-family: var(--gallery-font); }
[data-gallery-catalog] .catalog-shell { width: min(1120px, calc(100% - 32px)); max-width: none; padding: 0; }
[data-gallery-catalog] .catalog-header { min-height: 86px; height: auto; gap: 20px; }
.gallery-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font: 650 16px/1.4 var(--gallery-font); letter-spacing: -.02em; }
.gallery-brand img { width: 24px; height: 24px; object-fit: contain; }
.gallery-brand small { display: block; margin-top: 3px; font-size: 11px; font-weight: 400; letter-spacing: .02em; color: var(--secondary); }
[data-gallery-catalog] .topic-card { border-radius: 8px; }
[data-gallery-catalog] .topic-card h3 { font-size: 22px; line-height: 1.45; font-weight: 620; }
[data-gallery-catalog] .topic-card-body { padding: 22px; }
[data-gallery-catalog] .catalog-search, [data-gallery-catalog] .category-list button, [data-gallery-catalog] .reading-note { border-radius: 6px; }
.gallery-topic-home { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; font-weight: 600; }
.gallery-topic-home img { width: 22px; height: 22px; }
.gallery-editor { color: var(--secondary); }
@media (max-width: 700px) {
  .gallery-topic-home span { display: none; }
  .encyclopedia-nav { gap: 10px; }
}
@media (max-width: 650px) {
  [data-gallery-catalog] .catalog-header { padding: 18px 0; }
  [data-gallery-catalog] #catalog-appearance { gap: 8px; }
  .gallery-brand { font-size: 15px; }
}
