:root { --lb-border: #ddd9d2; }
:root[data-lb-theme=dark] {
  color-scheme: dark;
  --color-paper:#212121;
  --color-paper-rgb:33, 33, 33;
  --color-surface:#212121;
  --color-surface-secondary:#2f2f2f;
  --color-surface-raised:#303030;
  --color-text-primary:#f4f4f4;
  --color-text-secondary:#d0d0d0;
  --color-text-tertiary:#bfbfbf;
  --color-brand:#bdccff;
  --color-interactive:#bdccff;
  --ink:#f4f4f4;
  --lb-border:#515151;
}
[data-lb-theme=dark] :is(.sp-group,.sp-head,.xp-head,.sp-item,.iconbtn--menu .menu-button-face) {
  background-color: var(--color-surface-raised);
  color: var(--color-text-primary);
}
[data-lb-theme=dark] :is(.hero__greet,.hero__reply,.chip,.askbar__input,.topbar__title) { color: var(--color-text-primary); }
[data-lb-theme=dark] .askbar__input::placeholder { color: var(--color-text-secondary); }
[data-lb-theme=dark] :is(.dock,.hero__replies)[data-liquid-glass=fallback] :is(.chip,.askbar,.hero__reply) { background: #303030; }
/* Preserve the existing illustrated paper surfaces and their text contrast. */
[data-lb-theme=dark] :is(.treehole,.diary,.release) {
  color-scheme: light;
  --color-surface:#fcfcfb; --color-surface-secondary:#f2efe9; --color-surface-raised:#fff;
  --color-text-primary:#0b0b0a; --color-text-secondary:#55534e; --color-text-tertiary:#6a675f;
  --color-brand:#1b4fbf; --color-interactive:#207bff;
  --ink:#0b0b0a; --ink-soft:#55534e;
}
[data-lb-theme=dark] :is(.sp,.xp,.gl) {
  --sp-line: var(--lb-border);
}
[data-lb-theme=dark] .dock[data-liquid-glass="webgl"].is-glass-ready .askbar__input::placeholder { color: var(--color-text-secondary); }
[data-lb-theme=dark] .iconbtn--menu .menu-button-lines::before,
[data-lb-theme=dark] .iconbtn--menu .menu-button-lines::after { background: var(--color-text-primary); }

.canary-dark-dialog {
  width:min(23rem,calc(100% - 2rem)); box-sizing:border-box; border:1px solid rgba(120,120,120,.28);
  border-radius:1rem; padding:1.25rem; background:#fcfcfc; color:#191a1d; font:16px/1.5 system-ui,sans-serif;
}
:root[data-lb-theme=dark] .canary-dark-dialog {background:#242528;color:#f4f4f5}
.canary-dark-dialog::backdrop {background:rgba(15,16,20,.42)}
.canary-dark-dialog h2 {margin:0;font-size:1.15em}
.canary-dark-dialog p {margin:.55rem 0}
.canary-dark-dialog [role=status]:empty {display:none}
.canary-dark-actions {display:flex;justify-content:flex-end;gap:.55rem;margin-top:1rem}
.canary-dark-actions button {min-height:44px;border-radius:999px;padding:0 1rem;font:inherit;cursor:pointer}
.canary-dark-actions [data-canary-choice=ignore] {color:inherit;background:transparent;border:1px solid rgba(120,120,120,.38)}
.canary-dark-actions [data-canary-choice=accept] {color:white;background:#285eb4;border:1px solid #285eb4}
