:root { color-scheme: dark; }
.zoombar { left: 16px; right: auto; bottom: max(16px, env(safe-area-inset-bottom)); }
.zoombar #themeToggle { margin-right: 5px; border-right: 1px solid #62656b; border-radius: 7px 0 0 7px; width: 38px; }
#themeToggle:focus-visible { outline: 2px solid #86b740; outline-offset: 2px; }
:root[data-theme="light"] { color-scheme: light; --bg: #f4f5f1; --canvas: #f4f5f1; --line: rgba(65,77,53,.4); }
[data-theme="light"] body { color: #252b22; }
[data-theme="light"] .canvas { background-image: radial-gradient(circle at 1px 1px, rgba(53,66,42,.13) 1px, transparent 0); }
[data-theme="light"] .canvas::before { opacity: .25; }
[data-theme="light"] :is(.toolbar,.popover,.quick-input,.context-menu,.spawn-menu,.chat-panel,.zoombar,.corner button) { background: #fffffff5; color: #252b22; border-color: #d3d8cc; box-shadow: 0 8px 28px #26311b14; }
[data-theme="light"] :is(.toolbar input,.toolbar select,.popover input,.quick-input input,.chat-form textarea) { background: #f6f7f3; color: #252b22; border-color: #cbd2c3; }
[data-theme="light"] :is(input,textarea)::placeholder { color: #71796a; }
[data-theme="light"] :is(.board-open,.boards-close,.chat-close,.chat-head strong,.context-menu button,.spawn-menu button,.zoombar button,.quick-actions button,.popover.help h3,.popover.help h4) { color: #252b22; }
[data-theme="light"] :is(.service-brand,.brand-title) { color: #20281c; text-shadow: none; }
[data-theme="light"] :is(.brand-mark,.brand-handle,.text-node,.popover.boards .new) { color: #4b761c; }
[data-theme="light"] .service-brand small { color: #4b761c; }
[data-theme="light"] .service-brand strong { color: #20281c; }
[data-theme="light"] .service-brand span { color: #4b761c; }
[data-theme="light"] .text-node { text-shadow: none; }
[data-theme="light"] .empty-hint { color: #71796a; }
[data-theme="light"] :is(.board-row.active,.board-open:hover,.boards-close:hover,.chat-close:hover,.zoombar button:hover,.corner button:hover,.context-menu button:hover,.context-menu button:focus-visible) { background: #eaf2db; color: #355516; }
[data-theme="light"] :is(.help-section,.chat-message.assistant,.image-node) { background: #fff; color: #30382a; border-color: #d3d8cc; }
[data-theme="light"] :is(.help-section,.chat-head,.chat-form) { border-color: #d3d8cc; }
[data-theme="light"] :is(.chat-welcome,.chat-message.pending,.popover.help p,.popover.help li,.popover p,.quick-input p) { color: #616b58; }
[data-theme="light"] .popover.help kbd { background: #edf0e7; color: #344028; border-color: #bfc8b4; }
[data-theme="light"] .popover.help strong { color: #252b22; }
[data-theme="light"] :is(.idea-node,.idea-node.main,.image-node,.center-node) { box-shadow: 0 6px 18px #26311b1c; }
[data-theme="light"] .idea-node { background: #fff; }
[data-theme="light"] .image-node .image-caption { color: #344028; }
[data-theme="light"] .context-menu .divider { background: #d3d8cc; }
[data-theme="light"] .quick-actions .confirm,[data-theme="light"] .spawn-menu .ai { background: var(--lime); color: #101a08; }
@media (max-width: 640px) { .zoombar { left: 12px; } }
/* Keep touch editing at the right edge, away from theme/zoom controls. */
@media (any-pointer: coarse) {
  .touch-actions { left: auto; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (any-pointer: coarse) and (max-width: 640px) {
  .touch-actions { right: max(12px, env(safe-area-inset-right)); }
}
