/* Appearance controls stay available on signed-in and public screens. */
:root{color-scheme:light}
.theme-toggle{flex-shrink:0}
.theme-help{margin-top:14px;margin-bottom:0!important}
.auth-side{position:relative}
.auth-theme{position:absolute;top:20px;right:22px;display:flex;align-items:center;gap:8px}
.auth-theme small{font-size:.75rem}
.bf-theme-bar{max-width:660px;margin:0 auto 12px;display:flex;justify-content:flex-end;align-items:center;gap:8px}
.bf-theme-bar small{font-size:.75rem}

:root[data-theme="dark"]{
  color-scheme:dark;
  --ink:#e8eaf4;--muted:#a4adc4;--line:#343d53;--bg:#111522;
  --surface:#1b2133;--surface-raised:#222a3e;--surface-soft:#171d2d;--hover:#293149;
  --purple:#b2a3ff;--purple-light:#302b4e;--nav:#171b2e;--green:#65ceb0;
  --primary-fill:#6956d8;--shadow:0 12px 44px #0005;
  --status-neutral-bg:#30384b;--status-neutral-text:#c2cadc;
  --status-waiting-bg:#453723;--status-waiting-text:#f0c779;
  --status-bad-bg:#472837;--status-bad-text:#ffa3b8;
  --status-review-bg:#372b53;--status-review-text:#d0b3ff;
  --status-good-bg:#1c3c33;--status-good-text:#7fdfbd;
}
:root[data-theme="dark"] :is(.topbar,.panel,.stat,.board-card,.table-scroll,.kanban-card,.skeleton,dialog,.auth-page){background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] button{background:var(--surface-raised)}
:root[data-theme="dark"] button:hover{background:var(--hover)}
:root[data-theme="dark"] :is(.ghost,.text-button,.side-button,.tab,.task-name,.task-title,.day-number){background:transparent}
:root[data-theme="dark"] :is(.ghost,.text-button,.side-button,.tab,.task-name,.task-title,.day-number):hover{background:var(--hover)}
:root[data-theme="dark"] :is(button.primary,.day.today .day-number){background:var(--primary-fill);border-color:var(--primary-fill);color:#fff}
:root[data-theme="dark"] button.primary:hover{background:#7864e6}
:root[data-theme="dark"] :is(input,select,textarea){background:var(--surface-soft);border-color:#48546d;color:var(--ink)}
:root[data-theme="dark"] :is(input,textarea)::placeholder{color:#8e9bb6;opacity:1}
:root[data-theme="dark"] :is(input,select,textarea):focus{border-color:var(--purple);outline:2px solid #b2a3ff45}
:root[data-theme="dark"] :focus-visible{outline-color:var(--purple)}
:root[data-theme="dark"] :is(.drawer .modal-head,.drawer .form-actions){background:var(--surface)}
:root[data-theme="dark"] dialog::backdrop{background:#080b16ac}
:root[data-theme="dark"] :is(.board-card:hover,.kanban-card:hover){background:var(--surface-raised);border-color:#7368a8}
:root[data-theme="dark"] .board-table :is(th,td){border-color:var(--line)}
:root[data-theme="dark"] .table-scroll{border-left-color:var(--group-color,var(--purple))}
:root[data-theme="dark"] :is(.board-table th,.wf-table th,.pm-table th,.day-label,.day.other,.pm-timeline-header,.pm-timeline-axis){background:var(--surface-soft);color:var(--muted)}
:root[data-theme="dark"] :is(.board-table tr:hover td,.add-row:focus-within){background:#242b42}
:root[data-theme="dark"] :is(.title-cell .task-title,.comment p,.activity-row p){color:var(--ink)}
:root[data-theme="dark"] .title-cell .task-title.done{color:var(--muted)}
:root[data-theme="dark"] .owner-select{background:#30304b;color:#d3cbee}
:root[data-theme="dark"] .cell-date{background:transparent;color:var(--ink)}
:root[data-theme="dark"] .group-title :is(h2,span){color:color-mix(in srgb,var(--group-color),white 38%)!important}
:root[data-theme="dark"] :is(.progress,.kanban-lane){background:#242c40}
:root[data-theme="dark"] .kanban-lane.drag-over{background:#342e50}
:root[data-theme="dark"] :is(.tag,.topbar .badge){background:#2d344b;color:#c3cae0}
:root[data-theme="dark"] :is(.avatar,.team-row .role-badge){background:#383158;color:#d1c5ff;border-color:var(--surface)}
:root[data-theme="dark"] :is(.task-list-row,.checklist-row,.activity-row){border-color:var(--line)}
:root[data-theme="dark"] :is(.status-0,.badge.priority-Low,.wf-badge.neutral){background:var(--status-neutral-bg);color:var(--status-neutral-text)}
:root[data-theme="dark"] :is(.status-1,.badge.priority-High,.wf-badge.waiting){background:var(--status-waiting-bg);color:var(--status-waiting-text)}
:root[data-theme="dark"] :is(.status-2,.badge.priority-Critical,.wf-badge.bad){background:var(--status-bad-bg);color:var(--status-bad-text)}
:root[data-theme="dark"] .status-3{background:var(--status-review-bg);color:var(--status-review-text)}
:root[data-theme="dark"] :is(.status-4,.wf-badge.good,.wf-step.then,.bf-success){background:var(--status-good-bg);color:var(--status-good-text)}
:root[data-theme="dark"] .badge.priority-Medium{background:#253853;color:#a5c4ff}
:root[data-theme="dark"] :is(.overdue,.danger){color:#ff9db3!important}
:root[data-theme="dark"] .danger-zone{border-color:#754153}
:root[data-theme="dark"] .form-error{background:#442736;border-color:#7c455a;color:#ffb4c6}
:root[data-theme="dark"] .notice{background:#302b48;color:#d0c1ec}
:root[data-theme="dark"] .toast{background:#343d59;border:1px solid #5a6686;color:#f4f5fc}
:root[data-theme="dark"] .toast.error{background:#733149;border-color:#a4536e}
:root[data-theme="dark"] :is(.wf-symbol,.wf-step){background:var(--purple-light);color:var(--purple)}
:root[data-theme="dark"] :is(.wf-action-editor,.pm-planning-fields,.bf-question-editor){background:#22263c;border-color:#43435f}
:root[data-theme="dark"] .bf-question-editor.selected{background:#2b2944;border-color:#72629d}
:root[data-theme="dark"] .wf-code{background:var(--surface-soft);color:var(--ink)}
:root[data-theme="dark"] .pm-timeline-label{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .pm-timeline-label:hover{background:var(--hover)}
:root[data-theme="dark"] .pm-timeline-header{background:var(--surface-soft)}
:root[data-theme="dark"] .pm-timeline-label small{color:#f2a4bc}
:root[data-theme="dark"] .pm-timeline-track{background:repeating-linear-gradient(90deg,transparent,transparent calc(100% / 12 - 1px),var(--line) calc(100% / 12 - 1px),var(--line) calc(100% / 12))}
:root[data-theme="dark"] .pm-timeline-bar.milestone{background:var(--status-review-bg);color:var(--status-review-text)}
:root[data-theme="dark"] .bf-public{background:radial-gradient(ellipse at top,#2d2549,transparent 70%),var(--bg)}
:root[data-theme="dark"] .side-button.active{background:#373152;color:#fff}
:root[data-theme="dark"] .auth-art{background:var(--nav)}
:root[data-theme="dark"] .auth-logo-mobile{color:var(--ink)}
:root[data-theme="dark"] ::selection{background:#625097;color:#fff}
@media(max-width:760px){
  .topbar>.row{gap:8px}.topbar>.row:first-child{min-width:0}
  .topbar>.row:last-child{flex-shrink:0}
  .topbar .breadcrumb{min-width:0}.topbar .breadcrumb strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .topbar .breadcrumb>span{display:none}
  .auth-side{padding-top:70px}
  .auth-theme{top:18px;right:20px}
}
