/* The appearance switch resolves both Night and a dark system preference to this theme. */
.night-cursor { display: none; }
:root[data-theme=dark] .night-cursor:not([hidden]) {
  display:block;position:fixed;top:0;left:0;width:24px;height:24px;z-index:1000;
  pointer-events:none;border-radius:50%;
  background:radial-gradient(circle,#b7dbee24 0%,#adceeb16 32%,transparent 72%);
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #141f2e;
  --panel: #192638;
  --panel-raised: #233349;
  --rail: #152235;
  --selected: #2d4566;
  --line: #37495f;
  --line-strong: #7086a3;
  --ink: #f1f5fa;
  --muted: #beccdd;
  --accent: var(--desk-accent-night);
  --accent-ink: var(--desk-shadow-navy);
  --focus: var(--desk-focus-night);
  --urgent-ink: #ffa3ab;
  --progress: #abcfee;
  --sand: #f1c284;
  --done: #a7d7b6;
  --warning-panel: #34312c;
  --warning-line: var(--sand);
  --avatar: #304768;
  --partner-avatar: #54402b;
  --partner-ink: #f4dbb6;
  --neutral-avatar: #334153;
  --header-finish: var(--desk-header-night);
  --header-edge: linear-gradient(100deg, transparent 32%, #356bc198 56%, #a8c9f299 76%, transparent);
  --paper: var(--panel);
  --paper-ink: var(--ink);
  --placeholder: var(--muted);
  --thread: var(--panel);
  --thread-head: var(--panel-raised);
  --disabled: var(--panel-raised);
  --panel-hover: color-mix(in srgb, var(--panel) 76%, var(--ink));
  --accent-hover: color-mix(in srgb, var(--accent) 82%, white);
  --control-hover-fill: var(--panel-hover);
  --focus-halo: transparent;
  --focus-glow: transparent;
  --shadow: transparent;
}

:root[data-theme=dark] :is(#workspace-content, .team-grid, .team-my-work) {
  --bg: #1e1f20;
  --panel: #262729;
  --panel-raised: #303133;
  --line: #414244;
  --line-strong: #777a7e;
  --muted: #c5c7ca;
  --paper: var(--panel);
  --thread: var(--panel);
  --thread-head: var(--panel-raised);
  background-color: var(--bg);
}

:root[data-theme=dark] :is(#ticket-detail, .team-my-work-detail) {
  --bg: #292826;
  --panel: #333230;
  --panel-raised: #383735;
  --ink: #f4f1ed;
  --muted: #c4c1bc;
  --line: #4d4b48;
  --line-strong: #8d8983;
  --paper: var(--panel);
  --paper-ink: var(--ink);
  --thread: var(--panel);
  --thread-head: var(--panel-raised);
  --panel-hover: #41403e;
  background-color: var(--bg);
  color: var(--ink);
  border-color: #514f4c;
}

:root[data-theme=dark] :is(.top,.team-header) {
  --reflected-sky: #c4d3e6;
  --reflected-blue: #6181b4;
  border-color: var(--desk-shadow-navy);
}
:root[data-theme=dark] .side {
  --nav-paper: #2d4669;
  --nav-selected-ink: #f1f5fa;
  --rail-glint: #1669ef;
  background-color: #16263d;
  border-inline-end: 1px solid var(--desk-shadow-navy);
}
:root[data-theme=dark] .side .nav-btn:is([aria-current=page], [aria-current=location]) {
  background: var(--nav-paper);
  color: var(--nav-selected-ink);
  border-color: transparent;
  box-shadow: inset 3px 0 var(--desk-sky-reflection);
}
:root[data-theme=dark] .side .nav-btn:is([aria-current=page], [aria-current=location]) .nav-icon { color: inherit; }
:root[data-theme=dark] :is(.queue-scopes, .ticket-layouts) .tag-btn[aria-pressed=true] {
  background: var(--panel-raised);
  color: var(--ink);
  box-shadow: inset 0 -2px var(--muted);
}

:root[data-theme=dark] :is(.btn, .surface, .board-card),
:root[data-theme=dark] #channel-layout .chat-shell,
:root[data-theme=dark] #ticket-detail :is(.relation, .ticket-discussion, .history) { box-shadow: none; }
:root[data-theme=dark] :is(.btn, .board-card, .nav-btn):hover { transform: none; }
:root[data-theme=dark] :is(.btn, .nav-btn)::after { background-image: none; }
:root[data-theme=dark] .desk-caret-beam { box-shadow: 0 0 2px currentColor; color: var(--ink); }
:root[data-theme=dark] .desk-pointer-glow.visible::after { opacity: .25; }
:root[data-theme=dark] :where(:focus-visible) { outline: 2px solid var(--focus); }
:root[data-theme=dark] :is(.surface, .composer),
:root[data-theme=dark] #channel-layout .chat-shell { border-radius: 5px; }

:root[data-theme=dark] .board-lane,
:root[data-theme=dark] .board-lane > .board-lane-heading { border-radius: 3px; }
:root[data-theme=dark] .board-lane .board-card {
  margin: 0;
  padding: .52rem .58rem;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
:root[data-theme=dark] .board-lane .board-card[aria-pressed=true] {
  background: var(--selected);
  box-shadow: inset 3px 0 var(--progress);
}
@media (hover: hover) and (pointer: fine) {
  :root[data-theme=dark] .board-lane .board-card:not([aria-pressed=true]):hover { background: var(--panel-hover); }
}
:root[data-theme=dark] :is(.board-topic, .ticket-identity small, .message time, .file-item small) {
  font-family: ui-monospace, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
:root[data-theme=dark] #ticket-detail .review-card { border-left: 3px solid var(--sand); border-radius: 3px; }
:root[data-theme=dark] #channel-layout .message:not(.message-continuation) {
  border-top: 1px solid var(--line);
  border-radius: 0;
}
