/* Potok / Night glass. An independent, presentation-only copy of the accepted
   light variant. Geometry, animation and data contracts remain unchanged. */
html[data-color-theme="dark"] {
  color-scheme: dark;
  background: #202225;
}

body[data-color-theme="dark"] {
  --night-page: #202225;
  --night-surface: #25272b;
  --night-card: #292c31;
  --night-hover: #30343a;
  --night-text: #f0f1f2;
  --night-secondary: #b8bcc3;
  --night-muted: #a4aab3;
  --night-line: #42474f;
  --night-control: #858f9c;
  --night-focus: #819ba8;
  --night-lime: #c8ff5a;
  --night-blue: #63d8ff;
  --night-danger: #ff7d89;
  --night-success: #79d5a4;
  --night-warning: #e8c078;
  --ink: var(--night-text);
  --paper: var(--night-card);
  --cream: var(--night-page);
  --muted: var(--night-muted);
  --line: var(--night-line);
  --line-strong: var(--night-control);
  --blue: var(--night-blue);
  --amber: var(--night-warning);
  --violet: #bbadff;
  --coral: var(--night-danger);
  --emerald: var(--night-success);
  --lime: var(--night-lime);
  --shadow-soft: 0 16px 40px rgb(0 0 0 / 20%);
  --shadow-card: none;
  --potok-picker-accent: var(--night-blue);
  color: var(--night-text);
  background: var(--night-page);
  accent-color: var(--night-lime);
  scrollbar-color: #526575 transparent;
}

body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] {
  --solo-islands-page: var(--night-page);
  --solo-islands-surface: var(--night-card);
  --solo-islands-ink: var(--night-text);
  --solo-islands-muted: var(--night-muted);
  --solo-islands-line: var(--night-line);
  --solo-islands-line-strong: var(--night-control);
  --solo-glass-heading: rgba(41, 44, 49, .82);
  background: var(--night-page);
  color: var(--night-text);
}

body[data-color-theme="dark"] .potok-page-loader {
  background: var(--night-page);
  color: var(--night-secondary);
}

body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .pointer-grid-layer {
  background:
    linear-gradient(90deg, rgb(220 225 232 / 2%) 1px, transparent 1px) 0 0 / 72px 72px,
    linear-gradient(rgb(220 225 232 / 2%) 1px, transparent 1px) 0 0 / 72px 72px,
    var(--night-page);
}

body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .topbar {
  background: rgb(32 34 37 / 96%);
  border-color: rgb(184 188 195 / 9%);
  box-shadow: none;
}

body[data-color-theme="dark"] :is(.brand, .brand-name, .project-name, .project-title-wrap, .today-heading h1) {
  color: var(--night-text) !important;
}
/* Outline the animated square, not its invisible fallback image or wordmark. */
body[data-color-theme="dark"] .brand > :is(.potok-motion-logo, .brand-mark) {
  outline: 1px solid #66707c;
  outline-offset: 0;
}

body[data-color-theme="dark"] :is(.search, .label-library-button, .workspace-view-switch, .solo-project-view-switch, .avatar, .account-button) {
  color: var(--night-secondary) !important;
  background: var(--night-surface) !important;
  border-color: var(--night-line) !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] :is(.search input, .search-icon, .workspace-view-button, .solo-project-view-switch > button, .toolbar-count) {
  color: var(--night-secondary) !important;
  background: transparent !important;
  border-color: var(--night-line) !important;
}
body[data-color-theme="dark"] :is(.workspace-view-button, .solo-project-view-switch > button)[aria-pressed="true"] {
  color: var(--night-lime) !important;
  background: rgb(200 255 90 / 7%) !important;
}
body[data-color-theme="dark"] .workspace-view-switch::after,
body[data-color-theme="dark"] .solo-project-view-switch > button::after {
  background: var(--night-lime) !important;
}
body[data-color-theme="dark"] :is(.toolbar-count, .label-library-button[aria-expanded="true"]) { color: var(--night-blue) !important; }
body[data-color-theme="dark"] input::placeholder,
body[data-color-theme="dark"] textarea::placeholder { color: var(--night-muted) !important; opacity: 1; }
body[data-color-theme="dark"] ::selection { color: var(--night-text); background: #375263; }

body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView :is(.project, .project-head, .columns, .column, .solo-workflow-scroll) {
  background-color: transparent !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .solo-board-frame-slot {
  --solo-frame-color: #42474f !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .column-head {
  color: var(--night-text);
  background: var(--solo-glass-heading) !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .column-head :is(.column-title, .column-count) {
  color: var(--night-text) !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .column-head::after {
  background: linear-gradient(to bottom, rgb(0 0 0 / 16%), rgb(0 0 0 / 5%) 45%, transparent);
}
body[data-color-theme="dark"] :is(.solo-project-group-head, .solo-project-group.is-collapsed .solo-project-group-head) {
  color: var(--night-secondary) !important;
  background: var(--night-surface) !important;
  border-color: transparent !important;
}
body[data-color-theme="dark"] .solo-project-group-copy strong { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] .solo-project-group-copy :is(small, i) { color: var(--night-muted) !important; }
body[data-color-theme="dark"] :is(.solo-project-chevron, .solo-project-settings, .solo-project-grip, .project-tools button) {
  color: var(--night-muted) !important;
  background: transparent !important;
  border-color: var(--night-line) !important;
}

body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .card,
/* Filter exits are body-level clones, outside #projectsView. Keep the same
   material from their very first animation frame instead of falling to white. */
body[data-color-theme="dark"] .card.korzinka-filter-ghost,
body[data-color-theme="dark"] .today-card {
  color: var(--night-text) !important;
  background: var(--night-card) !important;
  border-color: var(--night-line) !important;
  box-shadow: var(--shadow-card) !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .card:hover,
body[data-color-theme="dark"] .today-card:hover {
  background: var(--night-hover) !important;
  border-color: #50565f !important;
}
/* The same reparenting also drops canonical project-only typography/padding.
   Mirror those pinned dimensions on exit clones so the text cannot jump. */
body[data-color-theme="dark"] .card.korzinka-filter-ghost {
  padding: 10px 11px 11px;
  transition: none;
}
body[data-color-theme="dark"] .korzinka-filter-ghost h3 {
  font-weight: 670;
  letter-spacing: -0.008em;
}
body[data-color-theme="dark"] .korzinka-filter-ghost .card-label {
  height: 10px;
  padding: 3px 3px 0;
  border: 0;
  border-radius: 0 !important;
  background: transparent;
  font-size: 5.5px;
  font-weight: 800;
  line-height: 6px;
  text-transform: uppercase;
}
body[data-color-theme="dark"][data-project-view="blocks"] .korzinka-filter-ghost .card-label {
  box-sizing: border-box;
  height: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 3px 0;
  border: 1px solid transparent;
  font-size: 5px;
  line-height: 8px;
}
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost .card-project-tag {
  height: 11px;
  padding: 2px 4px 0;
  border: 1px solid transparent;
  border-radius: 0 !important;
  font-size: 5.5px;
  font-weight: 800;
  line-height: 6px;
  text-transform: uppercase;
  contain: paint;
}
/* Aggregate cards use the pinned potok-ui-v2 three-row layout, unlike Blocks. */
body[data-color-theme="dark"][data-project-view="columns"] .card.korzinka-filter-ghost {
  min-height: 70px;
  grid-template-areas: "labels" "title" "footer";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 10px 16px 14px;
  align-content: start;
  row-gap: 6px;
  padding: 8px 10px;
}
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost > .card-labels {
  min-width: 0;
  grid-area: labels;
}
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost .card-labels:has(.card-project-tag) {
  min-height: 11px;
  height: 11px;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 4px;
  margin: 0;
  padding-right: 18px;
  line-height: 11px;
}
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost .card-label {
  box-sizing: border-box;
  display: inline-flex;
  align-items: flex-start;
  letter-spacing: 0;
}
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost h3 {
  min-height: 16px;
  height: 16px;
  grid-area: title;
  margin: 0;
  padding-right: 18px;
  line-height: 16px;
}
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost > .card-subtitle { display: none; }
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost .card-footer {
  min-height: 14px;
  height: 14px;
  grid-area: footer;
  margin: 0;
  line-height: 14px;
}
body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost :is(.card-footer-meta, .card-footer-actions, .due) {
  min-height: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  line-height: 14px;
}
@media (min-width: 651px) {
  body[data-color-theme="dark"][data-project-view="columns"] .korzinka-filter-ghost :is(.card-labels:has(.card-project-tag), h3) { translate: 0 1px; }
}
body[data-color-theme="dark"] :is(.card h3, .card-title, .today-card-title, .today-card h3) { color: var(--night-text) !important; }
body[data-color-theme="dark"] :is(.card-date, .card-meta, .card-footer, .card-subtitle, .today-card-subtitle, .today-card-meta) { color: var(--night-secondary) !important; }
/* Keep user label hues meaningful; mix their rendered foreground toward white,
   not their stored value. Saturated canonical blue/red are too dark at night. */
body[data-color-theme="dark"] :is(.card-label, .drawer-label-option, .card-popover-option, .filter-label-option) {
  color: color-mix(in srgb, var(--label-color, #63d8ff) 34%, #f0f1f2) !important;
  border-color: color-mix(in srgb, var(--label-color, #63d8ff) 35%, #354451) !important;
}
body[data-color-theme="dark"] :is(.card-project-tag, .today-project-tag) {
  color: var(--night-secondary) !important;
  background: transparent !important;
  box-shadow: inset 0 0 0 1px var(--night-line) !important;
}
body[data-color-theme="dark"] :is(.card-date.is-overdue, .card-date.is-late, .card.is-overdue .card-date) { color: var(--night-danger) !important; }
body[data-color-theme="dark"] :is(.card-date.is-completed, .card-date.is-done, .column[data-status="done"] .card-date) { color: var(--night-success) !important; }
body[data-color-theme="dark"] :is(.card-focus-button, .card-focus-controls button) {
  color: var(--night-secondary) !important;
  background: var(--night-surface) !important;
  border-color: var(--night-control) !important;
}
body[data-color-theme="dark"] :is(.add-card, .add-project-wide, .solo-add-project, .today-add-inline) {
  color: var(--night-secondary) !important;
  background: rgb(24 33 41 / 48%) !important;
  border-color: #4c6172 !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] :is(.add-card, .add-project-wide, .solo-add-project, .today-add-inline):hover {
  color: var(--night-lime) !important;
  background: rgb(200 255 90 / 5%) !important;
  border-color: #829865 !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .card-placeholder {
  background: rgb(99 216 255 / 10%);
  border-color: rgb(99 216 255 / 60%);
}

/* Floating controls and dialog surfaces. Only color/material declarations:
   no broad display/position/overflow rules that could resurrect hidden UI. */
body[data-color-theme="dark"] :is(dialog, .label-filter-popover, .account-popover, .task-context-menu, .card-label-popover, .drawer-card-menu-popover, .drawer-label-list, .potok-picker-popover, .today-panel, .card-focus-panel, .card-focus-notes-link, .rich-editor-link-popover) {
  color: var(--night-text) !important;
  background: var(--night-card) !important;
  border-color: var(--night-line) !important;
  box-shadow: 0 20px 60px rgb(0 0 0 / 40%) !important;
}
body[data-color-theme="dark"] dialog::backdrop,
body[data-color-theme="dark"] :is(.card-modal-backdrop, .document-editor-frame-layer, .today-panel-catcher) {
  background-color: rgb(4 9 14 / 62%) !important;
}
body[data-color-theme="dark"] :is(.icon-button, .secondary-button, .dialog-close, .modal-close, .drawer-close, .filter-manage-button, .filter-actions button, .card-popover-manage, .today-secondary-button, .today-panel-close, .today-picker-search, .potok-picker-trigger, .drawer-select-shell, .drawer-label-option, .filter-label-option, .card-popover-option) {
  color: var(--night-secondary) !important;
  background: var(--night-surface) !important;
  border-color: var(--night-control) !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] :is(.icon-button, .secondary-button, .account-popover a, .account-popover button, .card-popover-option, .filter-label-option, .today-secondary-button):hover {
  color: var(--night-text) !important;
  background: var(--night-hover) !important;
}
body[data-color-theme="dark"] :is(.primary-button, .today-primary-button) {
  color: #17200d !important;
  background: var(--night-lime) !important;
  border-color: var(--night-lime) !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] :is(.danger-button, .menu-danger, .drawer-card-menu-delete, .label-row-delete, .file-remove) {
  color: var(--night-danger) !important;
  background: rgb(255 125 137 / 8%) !important;
}
body[data-color-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), textarea, select) {
  color: var(--night-text) !important;
  background-color: var(--night-surface);
  border-color: var(--night-control);
  caret-color: var(--night-lime);
}
body[data-color-theme="dark"] :is(.search input, .project-name, .drawer-title-input, .drawer-subtitle-input, .today-picker-search input) { background: transparent !important; }
body[data-color-theme="dark"] :is(button, input, textarea, select, a, [tabindex], [contenteditable="true"]):focus-visible {
  outline: 1px solid var(--night-focus) !important;
  outline-offset: 2px;
}
body[data-color-theme="dark"] :is(.filter-popover-head span, .account-summary small, .dialog-description, .field-label, .drawer-meta-caption, .drawer-meta-field > span, .drawer-breadcrumb, .drawer-section-title, .form-hint) { color: var(--night-secondary) !important; }

body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .drawer.task-card-workspace {
  color: var(--night-text);
  background: var(--night-card) !important;
  border-color: var(--night-line) !important;
}
body[data-color-theme="dark"] .drawer.task-card-workspace::before,
body[data-color-theme="dark"] :is(.drawer-head, .drawer-settings-panel, .drawer-description-panel, .drawer-side-group, .drawer-settings-content, .drawer-workspace-body, .drawer-documents-group, .drawer-documents-body, .drawer-document-row, .drawer-document-open, .drawer-live-material, .drawer-document-add, .card-focus-description, .card-focus-notes, .card-focus-panel-title, .rich-editor-shell, .rich-editor, .rich-editor-toolbar, .drawer-mobile-tabs) {
  color: var(--night-text) !important;
  background: var(--night-surface) !important;
  border-color: var(--night-line) !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] :is(.drawer-title-input, .drawer-subtitle-input, .drawer-description-input, .drawer-document-name, .card-focus-panel-title strong, .card-focus-description-text, #cardFocusNotesInput) { color: var(--night-text) !important; }
body[data-color-theme="dark"] :is(.drawer-document-leading, .drawer-document-download, .drawer-live-material, .drawer-document-add, .drawer-document-meta, .rich-editor-toolbar button) { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] :is(.drawer-time-toggle, .urgent-toggle) > i { background: #354451 !important; border-color: #64788a !important; }
body[data-color-theme="dark"] .drawer-time-toggle input:checked + i { background: var(--night-lime) !important; }
body[data-color-theme="dark"] .urgent-toggle input:checked + i { background: var(--night-danger) !important; }
body[data-color-theme="dark"] .drawer-today-recurrence { color: var(--night-secondary) !important; background: var(--night-surface) !important; border-color: var(--night-control) !important; }
body[data-color-theme="dark"] .drawer-today-recurrence.is-active { color: var(--night-lime) !important; background: #263322 !important; border-color: #829865 !important; }
body[data-color-theme="dark"] .drawer-today-recurrence small { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] .card-drawer-glow::before { background: conic-gradient(from 0deg, #526575, #334e62, #526575) !important; }
body[data-color-theme="dark"] .card-drawer-glow::after { background: var(--night-danger) !important; }

body[data-color-theme="dark"] :is(.today-overview, .today-column, .today-column > header, .today-panel > header, .today-empty, .today-empty-state, .today-picker-group, .today-picker-card, .today-picker-project, .today-history-day, .today-settings-section) {
  color: var(--night-text) !important;
  background-color: var(--night-surface) !important;
  border-color: var(--night-line) !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] :is(.today-overview, .today-empty, .today-empty-state) { background: transparent !important; }
body[data-color-theme="dark"] :is(.today-column h2, .today-column > header > span, .today-picker-group-title, .today-picker-card-title, .today-panel h2, .today-settings-section h3) { color: var(--night-text) !important; }
body[data-color-theme="dark"] :is(.today-heading p, .today-empty p, .today-empty-state p, .today-column > header small, .today-picker-project-name, .today-picker-card-project, .today-settings-section p) { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] .today-column-focus > header { color: var(--night-lime) !important; }
body[data-color-theme="dark"] .today-progress { background: var(--night-line) !important; }
body[data-color-theme="dark"] #todayProgressValue { background: var(--night-lime) !important; }

body[data-color-theme="dark"] :is(.mobile-stage-heading, .mobile-project-count, .mobile-project-row, .mobile-project-title, .mobile-card-sheet, .mobile-projects-content, .mobile-projects-title, .mobile-task-card, .mobile-project-card, .mobile-sheet) {
  color: var(--night-text) !important;
  background-color: var(--night-surface) !important;
  border-color: var(--night-line) !important;
}
body[data-color-theme="dark"] .mobile-stage-headings { background: transparent !important; }
body[data-color-theme="dark"] .mobile-stage-heading { background: var(--solo-glass-heading) !important; }
body[data-color-theme="dark"] :is(.mobile-projects-content, .mobile-projects-title) { background: transparent !important; }

/* Quiet materials: strokes distinguish interactive controls; board frames are
   decorative. Keep all established transition geometry in the base layer. */
body[data-color-theme="dark"] .project-name:not(:focus) { border-color: transparent !important; }
body[data-color-theme="dark"] .project-tools button { border-color: transparent !important; }
body[data-color-theme="dark"] .project-tools button:hover { color: var(--night-secondary) !important; background: var(--night-hover) !important; }
body[data-color-theme="dark"] .solo-board-scrollbar::before { background: #2a2d32; box-shadow: none; }
body[data-color-theme="dark"] .solo-board-scrollbar > span > i { background: #555c66; box-shadow: none; }
body[data-color-theme="dark"] .solo-board-scrollbar:hover > span > i { background: #737c88; box-shadow: none; }
body[data-color-theme="dark"] .toast,
body[data-color-theme="dark"] .tour-card { color: var(--night-text); background: var(--night-card); border-color: var(--night-line); }
body[data-color-theme="dark"] .toast.is-error { color: var(--night-danger); background: #342125; }
body[data-color-theme="dark"] .due { color: var(--night-secondary) !important; background: transparent !important; }
body[data-color-theme="dark"] .due.is-overdue { color: var(--night-danger) !important; }
body[data-color-theme="dark"] .due.is-done { color: var(--night-success) !important; }
body[data-color-theme="dark"] .card-focus-button { background: transparent !important; box-shadow: none !important; }
body[data-color-theme="dark"] .card-focus-button::before { border-color: var(--night-muted) !important; background: transparent !important; box-shadow: none !important; }
body[data-color-theme="dark"] .card-focus-button[aria-pressed="true"]::before { background: var(--night-lime) !important; border-color: var(--night-lime) !important; }
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .card:is(.is-selected, .is-task-selected) { border-color: var(--night-blue) !important; outline: 1px solid var(--night-blue); outline-offset: 2px; }
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .card-drawer-glow { box-shadow: none !important; }
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .card-drawer-glow::before,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .card-drawer-glow::after { opacity: 0 !important; }

/* Card editor: actual canonical selectors, including the higher-specificity
   soft-islands rules. Preserve authored rich text and all hidden-panel states. */
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-description-panel .rich-editor-shell,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-meta-field :is(input, select),
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-time-row,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .potok-picker-trigger,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-today-recurrence {
  background: var(--night-surface) !important; color: var(--night-text) !important;
  border-color: var(--night-line) !important; box-shadow: none !important;
}
body[data-color-theme="dark"] .editor-toolbar { background: var(--night-card) !important; border-color: var(--night-line) !important; }
body[data-color-theme="dark"] :is(.editor-toolbar button, .potok-picker-trigger > i, .drawer-card-menu-toggle, .drawer-section-title, .drawer-description-panel .description-editor, .drawer-label-chip) { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] .description-editor { color: var(--night-text) !important; }
body[data-color-theme="dark"] .description-editor:empty::before { color: var(--night-muted) !important; }
body[data-color-theme="dark"] .editor-toolbar-separator { background: var(--night-line) !important; }
body[data-color-theme="dark"] .drawer-label-chip { background: var(--night-hover) !important; }
body[data-color-theme="dark"] :is(.drawer-label-option, .card-popover-option, .filter-label-option) {
  color: color-mix(in srgb, var(--label-color, #63d8ff) 34%, #f0f1f2) !important;
  background: transparent !important;
}
body[data-color-theme="dark"] :is(.task-context-menu button, .drawer-card-menu-popover button, .account-popover button, .account-popover a, .potok-calendar-day, .potok-time-options button, .potok-picker-clear, .potok-picker-heading button) {
  color: var(--night-secondary) !important; background: transparent !important; border-color: transparent !important;
}
body[data-color-theme="dark"] :is(.task-context-menu button, .drawer-card-menu-popover button, .account-popover button, .account-popover a, .potok-calendar-day, .potok-time-options button, .potok-picker-heading button):hover {
  color: var(--night-text) !important; background: var(--night-hover) !important;
}
body[data-color-theme="dark"] :is(.potok-calendar-day, .potok-time-options button).is-selected {
  color: #17200d !important; background: var(--night-lime) !important;
}
body[data-color-theme="dark"] .potok-calendar-day.is-today::after { background: var(--night-blue); }
body[data-color-theme="dark"] .potok-calendar-day.is-selected::after { background: #17200d; }
body[data-color-theme="dark"] .potok-calendar-day.is-outside { color: var(--night-muted) !important; }
body[data-color-theme="dark"] :is(.potok-picker-heading, .potok-picker-footer, .potok-time-title) { border-color: var(--night-line); }
body[data-color-theme="dark"] :is(.potok-time-column > span, .potok-calendar-weekdays span) { color: var(--night-muted); }

/* Today and mobile use their own task components, not board card aliases. */
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] :is(.today-task, .today-focus-task.card, .today-later-task, .today-done-task, .mobile-stage-task) {
  color: var(--night-text) !important; background: var(--night-card) !important;
  border-color: var(--night-line) !important; box-shadow: none !important;
}
body[data-color-theme="dark"] :is(.today-title-line time, .today-task h3, .today-task-title, .today-task-project, .today-task span, .today-task small) { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] .today-task h3 { color: var(--night-text) !important; }
body[data-color-theme="dark"] :is(.today-task-actions button, .today-timer-control, .today-timer-control i, .today-progress-controls button) { color: var(--night-secondary) !important; background: var(--night-surface) !important; border-color: var(--night-line) !important; box-shadow: none !important; }
body[data-color-theme="dark"] .today-task-actions .today-focus-action { color: var(--night-lime) !important; background: var(--night-hover) !important; }
body[data-color-theme="dark"] .today-progress.is-overloaded > #todayProgressValue { background: var(--night-danger) !important; }
body[data-color-theme="dark"] .focus-backdrop::before { background: rgb(12 13 15 / 78%) !important; }
body[data-color-theme="dark"] :is(.mobile-stage-sheet, .mobile-stage-sheet > header, .mobile-project-row, .mobile-stage-count, .mobile-project-add) { background: var(--night-surface) !important; color: var(--night-text) !important; border-color: var(--night-line) !important; }
body[data-color-theme="dark"] :is(.today-picker-group button, .today-duration-options button, .today-settings-note, .today-settings-form input, .today-settings-form select) { color: var(--night-secondary) !important; background: var(--night-surface) !important; border-color: var(--night-line) !important; }
body[data-color-theme="dark"] .today-picker-group button:hover { color: var(--night-text) !important; background: var(--night-hover) !important; }
body[data-color-theme="dark"] .today-duration-options button.is-active { color: var(--night-lime) !important; background: var(--night-hover) !important; }
body[data-color-theme="dark"] :is(.add-card, .add-project-wide, .solo-add-project, .today-add-inline) { background: transparent !important; border-color: var(--night-line) !important; }
body[data-color-theme="dark"] .potok-page-loader-wordmark { color: var(--night-text); }
body[data-color-theme="dark"] :is(.drawer-content-heading, .drawer-workspace-body h2) { color: var(--night-secondary) !important; }
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-time-row .potok-picker-trigger { background: transparent !important; }
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-time-row::after,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-time-row:hover::after { background: transparent !important; border-color: var(--night-line) !important; box-shadow: none !important; }
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace :is(.drawer-date-field .potok-picker-trigger, .drawer-today-recurrence, .drawer-live-material, .drawer-document-add):hover { border-color: var(--night-control) !important; box-shadow: none !important; }
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #mobileProjectsMode { background: var(--night-page) !important; color: var(--night-text) !important; }
body[data-color-theme="dark"] :is(.mobile-stage-task-open, .mobile-stage-task-open strong, .mobile-projects-title h1, .mobile-project-row h2, .mobile-stage-sheet h2) { color: var(--night-text) !important; }
body[data-color-theme="dark"] :is(.mobile-stage-task-open span, .mobile-projects-title p, .mobile-stage-sheet p) { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] .mobile-stage-task-timer { background: var(--night-surface) !important; color: var(--night-secondary) !important; border-color: var(--night-line) !important; }
body[data-color-theme="dark"] .mobile-stage-task-timer[aria-pressed="true"] { color: var(--night-lime) !important; background: var(--night-hover) !important; }
body[data-color-theme="dark"] .mobile-stage-task-timer:disabled { opacity: .45; }
body[data-color-theme="dark"] .mobile-stage-sheet .mobile-stage-task .mobile-stage-task-open { color: var(--night-text) !important; }
body[data-color-theme="dark"] .mobile-stage-heading span { color: var(--night-secondary) !important; }
body[data-color-theme="dark"] .mobile-project-row > h2 { border-color: var(--night-line) !important; }
body[data-color-theme="dark"] :is(.filter-label-option, .filter-manage-button) { border-color: var(--night-line) !important; }
body[data-color-theme="dark"] .account-summary { border-color: var(--night-line) !important; }
body[data-color-theme="dark"] .account-summary strong { color: var(--night-text) !important; }
body[data-color-theme="dark"] .account-avatar { background: var(--night-hover) !important; color: var(--night-text) !important; }
body[data-color-theme="dark"] :is(.drawer-card-menu-delete, .task-context-menu .is-danger) { color: var(--night-danger) !important; }

/* Keep urgency identical to the accepted light scheme, including Today and
   detached filter clones. This follows every ordinary card material rule. */
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .card.is-urgent,
body[data-color-theme="dark"] .card.korzinka-filter-ghost.is-urgent,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] :is(.today-card, .today-task).is-urgent {
  border: 2px solid #ff3030 !important;
  box-shadow: 0 0 0 3px rgb(255 48 48 / 12%), 0 8px 22px rgb(164 28 28 / 15%) !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #projectsView .card.is-urgent:hover,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] :is(.today-card, .today-task).is-urgent:hover {
  border-color: #ff2020 !important;
  box-shadow: 0 0 0 4px rgb(255 48 48 / 15%), 0 11px 28px rgb(164 28 28 / 20%) !important;
}

/* A field has one focus owner: its own border, or its search/editor shell.
   Never combine the canonical border/shadow with an extra focus outline. */
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]), textarea, select, [contenteditable="true"]):focus,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-meta-field :is(input, select):focus {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--night-focus) !important;
  outline: none !important;
  box-shadow: none !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] :is(.search, .today-picker-search):focus-within,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .emoji-picker-head label:focus-within {
  border-color: var(--night-focus) !important;
  outline: none !important;
  box-shadow: none !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] :is(.search input, .today-picker-search input, .emoji-picker-head input),
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] :is(.search input, .today-picker-search input, .emoji-picker-head input, .description-editor, #cardFocusNotesInput):focus {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .task-card-workspace .drawer-description-panel .rich-editor-shell:focus-within,
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] .card-focus-notes:focus-within {
  border-color: var(--night-focus) !important;
  box-shadow: none !important;
}

/* Concentration notes share one dark surface from header to editable body. */
body[data-color-theme="dark"] #cardFocusNotesInput {
  color: var(--night-text) !important;
  background: var(--night-surface) !important;
}
body[data-color-theme="dark"] #cardFocusNotesInput:empty::before { color: var(--night-muted); }
body[data-color-theme="dark"] :is(.card-focus-description-text, #cardFocusNotesInput) a { color: var(--night-blue); }
body[data-color-theme="dark"] .card-focus-scrollbar > span { background: var(--night-control); }
body[data-color-theme="dark"] .card-focus-panel-title::after { background: var(--night-line); }
body[data-color-theme="dark"] :is(.card-focus-notes-link, .editor-link-popover) button {
  color: var(--night-secondary) !important;
  background: var(--night-surface) !important;
  border-color: var(--night-line) !important;
}
body[data-color-theme="dark"] :is(.card-focus-notes-link, .editor-link-popover) button:hover {
  color: var(--night-text) !important;
  background: var(--night-hover) !important;
}
body[data-color-theme="dark"] :is(.editor-link-popover, .emoji-picker, .emoji-picker-head label) {
  background: var(--night-card) !important;
  border-color: var(--night-line) !important;
}

/* Today sits on the page grid, without a solid sheet behind all three lanes. */
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #todayView :is(.today-overview, .today-columns, .today-column, .today-list, .today-empty, .today-empty-state),
body.solo-islands-canonical[data-scope="potok"][data-color-theme="dark"] #todayView .today-column > header {
  background: transparent !important;
  box-shadow: none !important;
}

body[data-color-theme="dark"] .task-card-workspace :is(.drawer-close, .drawer-card-menu-toggle) {
  color: var(--night-secondary) !important;
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] .task-card-workspace :is(.drawer-close, .drawer-card-menu-toggle):is(:hover, :focus-visible, [aria-expanded="true"]) {
  color: var(--night-text) !important;
  background: var(--night-hover) !important;
  border-color: var(--night-control) !important;
  outline: none !important;
}

/* Formatting is indicated by a colored stroke and glyph, never a white tile. */
body[data-color-theme="dark"] .editor-toolbar button {
  color: var(--night-secondary) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  box-shadow: none !important;
}
body[data-color-theme="dark"] .editor-toolbar button:hover {
  color: var(--night-text) !important;
  border-color: var(--night-control) !important;
}
body[data-color-theme="dark"] .editor-toolbar button:focus-visible {
  outline: none !important;
  border-color: var(--night-focus) !important;
}
body[data-color-theme="dark"] .editor-toolbar button:is(.is-active, [aria-pressed="true"]) {
  color: var(--night-blue) !important;
  border-color: var(--night-blue) !important;
}
