/* Zamza PV palette. Every rule is limited to dark mode. */
html[data-theme="dark"] {
  --bg:#0c0b10; --surface:#211e30; --surface-2:#302b43;
  --text:#e9e7f1; --text-2:#c6c1d6; --text-3:#a39bb9;
  --border:#b0a2d126; --border-strong:#b0a2d140;
  --pink:#b3a0eb; --blue:#a697db; --eden-blue:#a697db; --lilith-pink:#b3a0eb;
  --color-background-primary:#17141f; --color-background-secondary:#211e30; --color-background-tertiary:#302b43;
  --color-text-primary:#e9e7f1; --color-text-secondary:#c6c1d6; --color-text-tertiary:#a39bb9;
  --color-border-tertiary:#b0a2d126; --color-border-secondary:#b0a2d140;
  background:#0c0b10!important;
}
html[data-theme="dark"] body { color:var(--text); background:transparent!important; }
html[data-theme="dark"]:has(body > .archive-frame) {
  background:#161616!important;
}
html[data-theme="dark"] body > .archive-frame { background:transparent!important; }
html[data-theme="dark"] body :is(.main-wrap,.playlist-window,.desktop-document,.dday-window,.banner-window,.pc-page-window),
html[data-theme="dark"] body > .arch-messenger-root > .msg-panel {
  background:linear-gradient(135deg,rgba(69,61,91,.76),rgba(24,22,34,.86))!important;
  border-color:#b6a7d832 #b6a7d81c #b6a7d812!important;
  box-shadow:inset 0 1px 0 #d4c8ef0d,0 12px 34px #0005!important;
  backdrop-filter:blur(20px) saturate(115%)!important;
  -webkit-backdrop-filter:blur(20px) saturate(115%)!important;
  color:var(--text)!important;
}
html[data-theme="dark"].archive-content-document,
html[data-theme="dark"].archive-content-document body,
html[data-theme="dark"] body :is(.archive-content-slot,.archive-content-frame,.agent-workspace,.agent-window,.wiki-wrap,.home-content,.gallery-wrap,.log-wrap,.detail-wrap,.detail-scroll,.pc-page-workspace) { background:transparent!important; }
html[data-theme="dark"].archive-content-document body .pc-page-window { background:transparent!important; box-shadow:none!important; }
html[data-theme="dark"] body .sidebar-stack { background:#100e1b55!important; border-right-color:#afa0cf20!important; }
html[data-theme="dark"] body :is(.main-windowbar,.main-toolbar,.main-address,.player-windowbar,.desktop-document__bar,.dday-window__bar,.banner-window__bar,.msg-windowbar,.pc-page-windowbar,.pc-page-toolbar,.pc-page-address) { background:transparent!important; color:#cbc5da!important; border-color:#afa0cf20!important; }
html[data-theme="dark"] body :is(.main-toolbar-nav,.archive-window-control,.main-window-button,.desktop-document__button,.msg-window-button,.theme-toggle) { color:#c6bfd9!important; }
html[data-theme="dark"] body .explorer-sidebar :is(.explorer-root,.explorer-branch-title,.explorer-tree a,.explorer-drive) { color:#c6c1d6!important; }
html[data-theme="dark"] body .explorer-sidebar :is(.explorer-label,.explorer-chevron) { color:#a39bb9!important; }
html[data-theme="dark"] body .explorer-sidebar a.active,
html[data-theme="dark"] body .explorer-sidebar .explorer-tree a.active { color:#c1a8ff!important; }
html[data-theme="dark"] body .explorer-sidebar svg { fill:currentColor; }
html[data-theme="dark"] body :is(.desktop-document__body,.banner-window__body,.wiki-panel,.popup-inner,.log-item,.gallery-item,.msg-body,.msg-header) { background:rgba(43,38,59,.76)!important; border-color:#b0a2d126!important; box-shadow:none!important; color:var(--text)!important; }
html[data-theme="dark"] body .wiki-wrap { --profile-accent:#b6a0ee; --profile-muted:#a39bb9; }
html[data-theme="dark"] body .wiki-wrap .wiki-panel { backdrop-filter:blur(20px)!important; -webkit-backdrop-filter:blur(20px)!important; }
html[data-theme="dark"] body :is(.wiki-title,.info-value,.section-title,.log-item-title,.detail-title,.popup-title,.video-title,.yt-video-title,.board-title) { color:#e9e7f1!important; }
html[data-theme="dark"] body :is(.desc-block,.log-block,.detail-body,.detail-quote,.detail-quote p,.log-item-preview,.popup-lyrics,.desktop-document__copy,.banner-window__copy,.video-desc,.video-meta,.msg-name,.msg-text) { color:#c6c1d6!important; }
html[data-theme="dark"] body :is(.info-label,.profile-eyebrow,.detail-meta,.log-item-date,.agent-back,.back-btn,.desktop-document__heading,.media-caption,.queue-heading) { color:#a39bb9!important; }
html[data-theme="dark"] body .wiki-wrap :is(.ability-block,.tmi-block,.member-card,.note-list,.profile-tags span) { background:#8672b01a!important; border-color:#b0a2d126!important; color:#c6c1d6!important; }
html[data-theme="dark"] body .profile-tabs button { color:#a39bb9; }
html[data-theme="dark"] body .profile-tabs button[aria-pressed="true"] { color:#c1a8ff; border-bottom-color:#9e7ddb; }
html[data-theme="dark"] body .playlist-window .media-copy .track-title,
html[data-theme="dark"] body .playlist-window .media-transport .control { color:#e9e7f1!important; }
html[data-theme="dark"] body .playlist-window .media-timeline .time,
html[data-theme="dark"] body .playlist-window #player-queue .queue-duration { color:#b8afcc!important; }
html[data-theme="dark"] body .playlist-window #player-queue .queue-name { color:#ddd7ea!important; }
html[data-theme="dark"] body .playlist-window #player-queue .queue-item.active { background:#9877d42b!important; }
html[data-theme="dark"] body .playlist-window .media-transport #queue-toggle { color:#c6b5e7!important; }
html[data-theme="dark"] body .playlist-window .media-transport #queue-toggle[aria-expanded="true"] { background:#9877d42b!important; }
html[data-theme="dark"] body .media-timeline .progress { background:#b0a2d12b!important; }
html[data-theme="dark"] body .media-timeline .progress-fill { background:#aa88e8!important; }
html[data-theme="dark"] body :is(.log-item:hover,.gallery-item:hover) { background:#51426580!important; }
html[data-theme="dark"] body .theme-toggle { background:#292235!important; }
@media (prefers-reduced-transparency:reduce) {
  html[data-theme="dark"] body :is(.main-wrap,.playlist-window,.desktop-document,.dday-window,.banner-window,.wiki-panel,.msg-panel) { background:#292435!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; }
}
html[data-theme="dark"] body .playlist-window:has(#queue-toggle[aria-expanded="true"]) {
  background:linear-gradient(135deg,rgba(62,54,83,.90),rgba(24,22,34,.94))!important;
}
html[data-theme="dark"] body .playlist-window #player-queue .queue-item:not(.active):hover { background:#9877d41f!important; color:#e9e7f1!important; }
html[data-theme="dark"] body .playlist-window #player-queue .queue-heading { color:#a39bb9!important; }

/* Blur only the desktop photograph, never the windows or text. */
html[data-theme="dark"]:has(body > .archive-frame) > body { isolation:isolate; }
html[data-theme="dark"] body > .dark-desktop-background {
  content:'';
  position:fixed;
  inset:-18px;
  z-index:0;
  pointer-events:none;
  background:url('../img/desktop-dark.jpg') center/cover no-repeat;
  filter:blur(2px);
}
/* Log emphasis has its own colors; it cannot inherit the light reading palette. */
html[data-theme="dark"] body .detail-body { color:#d2ccdf!important; }
html[data-theme="dark"] body .detail-body :is(strong,b,.log-dialogue) { color:#f0eaf9!important; }
html[data-theme="dark"] body .detail-body :is(em,i,.log-thought) { color:#cbbce8!important; }
html[data-theme="dark"] body .detail-body .log-dialogue-block {
  background:#a88bd61f!important; border-left-color:#ab8cdb!important;
}
html[data-theme="dark"] body .detail-body :is(code,pre,.log-code) {
  color:#dfd1f4!important; background:#171320!important; border-color:#9980be55!important;
}
html[data-theme="dark"] body .detail-body :is(blockquote,mark) {
  color:#eee5fa!important; background:#6b518c38!important; border-color:#ab8cdb!important;
}
html[data-theme="dark"] body .detail-body a { color:#c7a6ff!important; }
html[data-theme="dark"] body .detail-body :is(summary,.log-thought:hover) { color:#f0eaf9!important; }
html[data-theme="dark"] body :is(.detail-meta,.log-item-date,.log-divider-label,.video-meta,.video-thumb-desc,.yt-channel-meta,.story-msg-time) { color:#b5acc9!important; }
html[data-theme="dark"] body :is(.label-eden,.line-eden,.story-msg-row.eden .story-msg-name) { color:#c7c0ed!important; }
html[data-theme="dark"] body :is(.label-lilith,.line-lilith,.story-msg-row.lilith .story-msg-name) { color:#dec5ea!important; }
html[data-theme="dark"] body .story-msg-row .story-msg-bubble { color:#eee8f7!important; background:#62517533!important; border-color:#b0a2d140!important; }
html[data-theme="dark"] body .video-block { background:#201b2c99!important; border-color:#b0a2d126!important; }
html[data-theme="dark"] body .detail-wrap:has(.detail-body-glass) { background:#211c2c80!important; }
html[data-theme="dark"] body :is(.log-scroll,.detail-scroll)::-webkit-scrollbar-thumb { background:#a798c466!important; }
@media(prefers-reduced-transparency:reduce) {
  html[data-theme="dark"] body .detail-wrap,
  html[data-theme="dark"] body .detail-wrap:has(.detail-body-glass) { background:#292435!important; }
}
/* Embedded documents must reveal the desktop photograph behind the shell. */
html[data-theme="dark"]:not(:has(body > .archive-frame)),
html[data-theme="dark"]:not(:has(body > .archive-frame)) > body {
  background:transparent!important;
}

.dark-desktop-background { display:none; }
html[data-theme="dark"] body > .dark-desktop-background { display:block; }
html[data-theme="dark"] { color-scheme:dark; }
/* Agent dossiers: keep every tab readable against portraits and dark glass. */
html[data-theme="dark"] body .wiki-wrap { color:#eee9f7; --profile-muted:#c1b7d3; }
html[data-theme="dark"] body .wiki-wrap .wiki-panel { background:rgba(35,29,48,.90)!important; }
html[data-theme="dark"] body .wiki-wrap :is(.desc-block,.log-block,.note-list li,.tmi-value,.member-desc,.ability-block) { color:#ddd6ea!important; }
html[data-theme="dark"] body .wiki-wrap :is(.ability-block strong,.member-name,.info-value,strong,b) { color:#f4effb!important; }
html[data-theme="dark"] body .wiki-wrap :is(.info-label,.tmi-label,.team-label,.profile-eyebrow,.agent-back,.char-codename) { color:#c1b7d3!important; }
html[data-theme="dark"] body .wiki-wrap .profile-tabs button { color:#c7bdd8!important; }
html[data-theme="dark"] body .wiki-wrap .profile-tabs button[aria-pressed="true"] { color:#dcc6ff!important; border-bottom-color:#b995ee; }
html[data-theme="dark"] body .wiki-wrap :is(.profile-tags span,.attr-tag,.member-attr) { color:#e1d4f6!important; background:#55436d!important; border-color:#bfa6de40!important; }
html[data-theme="dark"] body .wiki-wrap .wiki-title::after { color:#c1b7d3!important; }
html[data-theme="dark"] body .wiki-wrap .team-nav button { color:#e1d4f6!important; border-color:#bfa6de55; }
/* Character selection screen: names remain visible behind the portraits. */
html[data-theme="dark"] body .entry {
  background:radial-gradient(ellipse at 25% 35%,#51436530,transparent 65%),radial-gradient(ellipse at 75% 65%,#73608d20,transparent 65%);
}
html[data-theme="dark"] body .entry-names { color:rgba(218,207,238,.68); }
html[data-theme="dark"] body .entry .character:focus-visible { outline-color:#c6a5f0; }

/* SNS status and conversation retain their colors in dark mode. */
html[data-theme="dark"] body .msg-online-dot { background:#6ddd9a!important; box-shadow:0 0 7px #6ddd9a66!important; }
html[data-theme="dark"] body .msg-header-sub { color:#9be5b7!important; }
html[data-theme="dark"] body .msg-header-title { color:#eee8f7!important; }
html[data-theme="dark"] body > .arch-messenger-root .msg-footer { background:rgba(43,38,59,.76)!important; border-color:#b0a2d126!important; }
html[data-theme="dark"] body > .arch-messenger-root .msg-row.eden .msg-bubble { background:#40374f!important; color:#eee8f7!important; }
html[data-theme="dark"] body > .arch-messenger-root .msg-row.lilith .msg-bubble { background:#65517d!important; color:#faf5ff!important; }
html[data-theme="dark"] body :is(.msg-time,.msg-divider span,.msg-footer-icon) { color:#bcb1ce!important; }
html[data-theme="dark"] body .msg-input { background:#251f32!important; border-color:#b0a2d140!important; color:#c9bfd9!important; }
html[data-theme="dark"] body .msg-send { background:#9374b8!important; color:#fff!important; }
html[data-theme="dark"] body .msg-send:hover { background:#a58ac6!important; }
html[data-theme="dark"] body .msg-body::-webkit-scrollbar-track { background:transparent; }
html[data-theme="dark"] body .msg-body::-webkit-scrollbar-thumb { background:#776789; border-radius:8px; }
