/* Midnight at Hogwarts. Data retain their semantic colours. */
body.modern-ui[data-visual-theme="hogwarts"] {
  --bg: #101821; --panel: #1b2631; --ink: #f2e8d4; --muted: #b9b4a8;
  --line: #44505a; --teal: #e2bf70; --blue: #92b7de; --coral: #ed9a87;
  --compare: #e7a392; --compare-border: #986b63; --compare-bg: #382b30;
  --gold: #e2bf70; --accent-soft: #39372e; --accent-ink: #211c12;
  --surface-soft: #24313d; --control-bg: #202d39;
  --shadow: 0 4px 20px #0003; --ui-shadow-soft: 0 3px 16px #0003;
  --ui-shadow-float: 0 18px 45px #0006;
  color-scheme: dark;
  background: linear-gradient(180deg, #08121c40, #08121c88), url("/hogwarts-castle.png?v=20261102-2") center center / cover fixed, var(--bg);
}
body.modern-ui[data-visual-theme="hogwarts"] .hogwarts-motion-option { display: flex; }
body.modern-ui .hogwarts-motion-option { display: none; }
body.modern-ui[data-visual-theme="hogwarts"] :is(.topbar, .filters, .panel, .kpis article, .comparison-filter-panel, .map-dialog, .map-data-panel, .map-analysis-overlay, .map-project-passport, .map-tops-dock, .pdf-export-dialog, .theme-mini-menu, .search-select-menu, .toast) {
  color: var(--ink); background: var(--panel); border-color: var(--line); box-shadow: var(--ui-shadow-soft);
}
body.modern-ui[data-visual-theme="hogwarts"] .topbar {
  border-top: 2px solid var(--gold);
  background: linear-gradient(110deg, #1b2631ed, #1b2631b8);
}
body.modern-ui[data-visual-theme="hogwarts"] :is(.filters, .panel, .kpis article, .comparison-filter-panel) { background: #1b2631e0; }
body.modern-ui[data-visual-theme="hogwarts"] .topbar::after { display: none; }
body.modern-ui[data-visual-theme="hogwarts"] .eyebrow { color: var(--gold); background: var(--accent-soft); border-color: var(--line); }
body.modern-ui[data-visual-theme="hogwarts"] .kpis article::before { display: none; }
body.modern-ui[data-visual-theme="hogwarts"] .kpis article::after { background: var(--gold); opacity: .15; }
body.modern-ui[data-visual-theme="hogwarts"] :is(.dynamics-chart-card, .corpus-detail-legend, .range-navigator, .stage-step, .object-status-filter, .absorption-rank-details > span, .search-select-multi-controls, .map-layer-hint, .map-layer-legend, .map-custom-location-tools, .map-radius-tools, .map-analysis-tops, .map-period-slider, .map-analysis-grid > span, .map-passport-kpis > div, .pdf-export-format label, .pdf-export-options label, .pdf-export-preview, .corpus-detail-chip, .map-project-item, .map-period-strip, table, .table-wrap, .theme-design-option, .theme-mini-menu button) {
  color: var(--ink); background: var(--surface-soft); border-color: var(--line);
}
body.modern-ui[data-visual-theme="hogwarts"] :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select, textarea, .search-select-check) {
  color: var(--ink); background: var(--control-bg); border-color: var(--line);
}
body.modern-ui[data-visual-theme="hogwarts"] input::placeholder { color: var(--muted); }
body.modern-ui[data-visual-theme="hogwarts"] :is(.search-select-option:hover, .search-select-option.active, .search-select-option.selected, tbody tr:hover, .stage-step.active) { color: var(--ink); background: var(--accent-soft); }
body.modern-ui[data-visual-theme="hogwarts"] :is(.map-open-button, .database-sync-button, .structure-segment.active, .segmented button.active, .theme-design-option.active, .map-dialog-head .map-layer-toggle button.active, .map-tops-limit button.active, .map-analysis-unit-toggle button.active) { color: var(--accent-ink); background: var(--gold); border-color: var(--gold); }
body.modern-ui[data-visual-theme="hogwarts"] :is(.chart, .combo-chart, .price-brush-chart, .chart-scroll svg) { background: var(--panel); }
body.modern-ui[data-visual-theme="hogwarts"] :is(.combo-chart text, .price-brush-chart text, .chart-label, .axis-label) { fill: var(--ink); }
body.modern-ui[data-visual-theme="hogwarts"] .comparison-series-label { stroke: var(--panel); }
body.modern-ui[data-visual-theme="hogwarts"] .overview-year-label { fill: var(--muted); stroke: var(--panel); }
body.modern-ui[data-visual-theme="hogwarts"] .chart-point { stroke: var(--panel); }
body.modern-ui[data-visual-theme="hogwarts"] .range-year-scale > span { background: var(--surface-soft); border-color: var(--line); }
body.modern-ui[data-visual-theme="hogwarts"] .comparison-side-card.primary { background: #35362e; }
body.modern-ui[data-visual-theme="hogwarts"] :is(.comparison-side-card.compare, .map-compare-switch) { color: var(--compare); background: var(--compare-bg); border-color: var(--compare-border); }
body.modern-ui[data-visual-theme="hogwarts"] .compare-item-card { background: var(--surface-soft); }
body.modern-ui[data-visual-theme="hogwarts"] .red-zones-panel { --risk: #fa938b; --risk-strong: #ffb4ad; --risk-line: #90534f; }
body.modern-ui[data-visual-theme="hogwarts"] .red-zone-alert { background: #993c36; color: #fff; }
body.modern-ui[data-visual-theme="hogwarts"] :is(.red-zone-grouping-buttons button.active, .red-zone-corpus-name span) { color: #301613; }
body.modern-ui[data-visual-theme="hogwarts"] .assistant-widget:not(.collapsed) { background: var(--panel); color: var(--ink); }
body.modern-ui[data-visual-theme="hogwarts"] :is(.assistant-head, .assistant-message.bot) { background: var(--surface-soft); color: var(--ink); }
body.modern-ui[data-visual-theme="hogwarts"] .assistant-message.user { color: var(--accent-ink); }
body.modern-ui[data-visual-theme="hogwarts"] :is(th, .map-analysis-tops li, .stage-label) { color: var(--muted); }
body.modern-ui[data-visual-theme="hogwarts"] :is(.map-analysis-grid b, .map-analysis-tops li b, .map-radius-head, .absorption-rank-details b) { color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  body[data-visual-theme="hogwarts"], body[data-visual-theme="hogwarts"] :is(button, a, select, summary, label, input[type="checkbox"], input[type="range"], [role="button"]) {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Cpath d='M5 5L28 28' stroke='%230b121c' stroke-width='5'/%3E%3Cpath d='M5 5L28 28' stroke='%23a87843' stroke-width='3'/%3E%3Cpath d='M21 21L28 28' stroke='%23503324' stroke-width='4'/%3E%3Cpath d='M5 0L6.4 3.6L10 5L6.4 6.4L5 10L3.6 6.4L0 5L3.6 3.6Z' fill='%23fff1b5' stroke='%23c59c45' stroke-width='.6'/%3E%3C/svg%3E") 5 5, auto;
  }
}
.hogwarts-owl { position: fixed; left: 0; bottom: 40px; width: 138px; height: 110px; z-index: 65; pointer-events: none; user-select: none; contain: layout style; filter: drop-shadow(0 5px 8px #0005); }
.hogwarts-owl[hidden] { display: none; }
.hogwarts-owl svg { width: 100%; height: 100%; overflow: visible; }
.hogwarts-owl-wing { transform-box: view-box; animation: hogwarts-wing 1.15s ease-in-out infinite alternate; }
.hogwarts-owl-wing.left { transform-origin: 80px 57px; }
.hogwarts-owl-wing.right { transform-origin: 100px 57px; animation-name: hogwarts-wing-right; }
.hogwarts-owl-eyes { transform-origin: 90px 50px; animation: hogwarts-blink 6s infinite; }
@keyframes hogwarts-wing { from { transform: rotate(-16deg) scaleY(.8); } to { transform: rotate(22deg) scaleY(1.07); } }
@keyframes hogwarts-wing-right { from { transform: rotate(16deg) scaleY(.8); } to { transform: rotate(-22deg) scaleY(1.07); } }
@keyframes hogwarts-blink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.08); } }
@media (max-width: 720px) { .hogwarts-owl { width: 102px; height: 82px; bottom: 72px; } }
@media (prefers-reduced-motion: reduce) { .hogwarts-owl { display: none; } .hogwarts-owl * { animation: none; } }
@media print {
  .hogwarts-owl { display: none !important; }
  body.modern-ui[data-visual-theme="hogwarts"] { --bg: #fff; --panel: #fff; --ink: #172026; --muted: #52616c; --line: #ccd2d8; --teal: #79591c; --gold: #79591c; --accent-soft: #f4efe1; --surface-soft: #f7f6f2; --control-bg: #fff; color-scheme: light; background: #fff; }
}
