/* The selected theme stylesheet is injected before this shared layer by
   theme-init.js. Keeping this file import-free avoids loading five themes. */

/* Dark themes use their own SVG diagram palette. The shared pastel boxes were
   designed for light paper and can otherwise produce invisible labels. */
:root.theme-developer .osc-diagram :is(.box, .boxb) { fill:#162b3b !important; stroke:#71859d !important; }
:root.theme-developer .osc-diagram .boxy { fill:#3a321f !important; stroke:#a58b55 !important; }
:root.theme-developer .osc-diagram .boxg { fill:#173526 !important; stroke:#659b76 !important; }
:root.theme-developer .osc-diagram .boxr { fill:#3b2227 !important; stroke:#a76e76 !important; }
:root.theme-developer .osc-diagram :is(.lbl, .ttl) { fill:#e6edf7 !important; }
:root.theme-developer .osc-diagram .lblf { fill:#aab8ca !important; }

:root.theme-hacker .osc-diagram :is(.box, .boxb) { fill:#14271f !important; stroke:#66937a !important; }
:root.theme-hacker .osc-diagram .boxy { fill:#332d18 !important; stroke:#9d8948 !important; }
:root.theme-hacker .osc-diagram .boxg { fill:#18331f !important; stroke:#60966e !important; }
:root.theme-hacker .osc-diagram .boxr { fill:#38211f !important; stroke:#a16e67 !important; }
:root.theme-hacker .osc-diagram :is(.lbl, .ttl) { fill:#e8f2eb !important; }
:root.theme-hacker .osc-diagram .lblf { fill:#afc2b5 !important; }

:root.theme-god .osc-diagram :is(.box, .boxb) { fill:#211b48 !important; stroke:#9c8aca !important; }
:root.theme-god .osc-diagram .boxy { fill:#44391f !important; stroke:#b9a15e !important; }
:root.theme-god .osc-diagram .boxg { fill:#20382e !important; stroke:#739c88 !important; }
:root.theme-god .osc-diagram .boxr { fill:#43242f !important; stroke:#ae7785 !important; }
:root.theme-god .osc-diagram :is(.lbl, .ttl) { fill:#f7f1df !important; }
:root.theme-god .osc-diagram .lblf { fill:#c4b9d2 !important; }

/* Modernist keeps technical diagrams aligned with the cream/cobalt/orange
   portfolio palette while preserving high-contrast labels. */
:root.theme-modernist .osc-diagram :is(.box, .boxb) { fill:#edf0fb !important; stroke:#7189dc !important; }
:root.theme-modernist .osc-diagram .boxy { fill:#f7e5de !important; stroke:#c75c3c !important; }
:root.theme-modernist .osc-diagram .boxg { fill:#e6eadf !important; stroke:#74816d !important; }
:root.theme-modernist .osc-diagram .boxr { fill:#f3dfdc !important; stroke:#a85b49 !important; }
:root.theme-modernist .osc-diagram :is(.lbl, .ttl) { fill:#171a1d !important; }
:root.theme-modernist .osc-diagram .lblf { fill:#50565a !important; }

:root.theme-apple-glass .osc-diagram :is(.box, .boxb) { fill:#e8f2ff !important; stroke:#6c9ddd !important; }
:root.theme-apple-glass .osc-diagram .boxy { fill:#f4eaff !important; stroke:#9b79c8 !important; }
:root.theme-apple-glass .osc-diagram .boxg { fill:#e4f5f0 !important; stroke:#5e9f8e !important; }
:root.theme-apple-glass .osc-diagram .boxr { fill:#f7e7eb !important; stroke:#b16e80 !important; }
:root.theme-apple-glass .osc-diagram :is(.lbl, .ttl) { fill:#142033 !important; }
:root.theme-apple-glass .osc-diagram .lblf { fill:#536176 !important; }

/* Scroll-performance guard. Long readers use stable, opaque/compositor-light
   surfaces; temporary controls retain their visual hierarchy without blurring
   the moving page behind them. */
html.view-modern body { background-attachment:scroll !important; }
html.view-modern body::before,
:root.theme-anime.view-modern body::after { display:none !important; }

html.view-modern:not(.theme-apple-glass) article .post-body,
html.view-modern:not(.theme-apple-glass) article :is(.osc-diagram,.ain-architecture),
html.view-modern:not(.theme-apple-glass) :is(.sidebar,.toc-panel,.vocab-panel,.reading-xp,.paged-controls,.focus-hud,.book-toolbar,.settings-panel,.settings-panel-head) {
  -webkit-backdrop-filter:none !important;
  backdrop-filter:none !important;
}

:root.theme-developer.view-modern article .post-body { background:#111a27 !important; }
:root.theme-hacker.view-modern article .post-body { background:#0c130e !important; }
:root.theme-god.view-modern article .post-body { background:linear-gradient(165deg,#191536,#0c0a1f) !important; }
:root.theme-anime.view-modern article .post-body { background:#fffdfc !important; }
:root.theme-minimalist.view-modern article .post-body { background:#fffdf8 !important; }
:root.theme-modernist.view-modern article .post-body { background:#faf9f5 !important; }
:root.theme-apple-glass.view-modern article .post-body { background:#fbfdff !important; }

:root.theme-developer.view-modern :is(.sidebar,.toc-panel,.vocab-panel,.reading-xp) { background:#0b111b !important; }
:root.theme-hacker.view-modern :is(.sidebar,.toc-panel,.vocab-panel,.reading-xp) { background:#080e0a !important; }
:root.theme-god.view-modern :is(.sidebar,.toc-panel,.vocab-panel,.reading-xp) { background:#090719 !important; }
:root.theme-anime.view-modern :is(.sidebar,.toc-panel,.vocab-panel,.reading-xp) { background:#fff9f7 !important; }
:root.theme-minimalist.view-modern :is(.sidebar,.toc-panel,.vocab-panel,.reading-xp) { background:#f7f5f0 !important; }
:root.theme-modernist.view-modern :is(.sidebar,.toc-panel,.vocab-panel,.reading-xp) { background:#f2f0e8 !important; }
html.view-modern article :is(.osc-diagram,.ain-architecture) { background-color:var(--paper-2) !important; }
/* Avoid retaining full-document compositor layers after entrance effects. */
:root.theme-developer.view-modern body > .layout > .page,
:root.theme-minimalist.view-modern body > .layout > .page { animation:none !important; }
:root.theme-god.view-modern .page > article { animation:none !important; }
:root.theme-anime.view-modern .sidebar .dot,
:root.theme-god.view-modern .settings-btn { animation:none !important; }
