/* Orbit – one visual board for many work topics.
   Every surface/text/border color is a CSS variable; [data-theme="dark"] redefines them. */

:root {
  --bg-app: #f3f5fa;
  --topbar: #ffffff;
  --panel: #ffffff;
  --panel-2: #f6f7fb;
  --board: #eceff6;
  --dot: #c3cad8;
  --card: #ffffff;
  --card-border: #dde2eb;
  --border: #e1e5ed;
  --border-strong: #c9d0dd;
  --text: #1b2232;
  --text-2: #465065;
  --muted: #778196;
  --faint: #a2aabb;
  --accent: #4f5bd5;
  --accent-weak: #eceeff;
  --accent-text: #3a45b8;
  --link: #2f5fd0;
  --btn: #ffffff;
  --hover: rgba(25, 35, 70, .06);
  --chip: #eef1f5;
  --rel: #6b7690;
  --input: #ffffff;
  --shadow-card: 0 1px 2px rgba(16, 24, 40, .06), 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-pop: 0 12px 32px rgba(16, 24, 40, .20);
  --danger: #d92d20;
  --sel: #4f5bd5;

  --u-overdue-bg: #fde3e1; --u-overdue: #b42318;
  --u-soon2-bg: #ffe9d3; --u-soon2: #b54708;
  --u-soon-bg: #fff3c4; --u-soon: #8a6200;
  --u-later-bg: #eef1f5; --u-later: #56607a;
  --u-done-bg: #dcf4e4; --u-done: #157347;

  --st-todo-bg: #eef1f5; --st-todo: #56607a;
  --st-active-bg: #dde8ff; --st-active: #1f4fd1;
  --st-waiting-bg: #ffe9d3; --st-waiting: #b54708;
  --st-blocked-bg: #f1e6ff; --st-blocked: #7e2bd0;
  --st-done-bg: #dcf4e4; --st-done: #157347;

  --oc-red: #ef4444; --oc-orange: #f97316; --oc-yellow: #eab308; --oc-green: #22c55e;
  --oc-blue: #3b82f6; --oc-purple: #a855f7; --oc-gray: #94a3b8;
  --pill-red-bg: #fde3e1; --pill-red: #b42318;
  --pill-orange-bg: #ffe9d3; --pill-orange: #b54708;
  --pill-yellow-bg: #fff3c4; --pill-yellow: #8a6200;
  --pill-green-bg: #dcf4e4; --pill-green: #157347;
  --pill-blue-bg: #dde8ff; --pill-blue: #1f4fd1;
  --pill-purple-bg: #f1e6ff; --pill-purple: #7e2bd0;
  --pill-gray-bg: #eef1f5; --pill-gray: #56607a;

  --frame-alpha: .07;
  --tag-l: 92%; --tag-s: 75%; --tag-tl: 32%;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-app: #121827;
  --topbar: #151c2d;
  --panel: #172034;
  --panel-2: #1b2539;
  --board: #0c111d;
  --dot: rgba(150, 170, 220, .16);
  --card: #26314b;
  --card-border: #36435f;
  --border: #2c3852;
  --border-strong: #3b4967;
  --text: #e8ecf4;
  --text-2: #c2cada;
  --muted: #8f9bb3;
  --faint: #67738d;
  --accent: #6874f5;
  --accent-weak: rgba(104, 116, 245, .18);
  --accent-text: #aab2ff;
  --link: #8fb4ff;
  --btn: #1e283e;
  --hover: rgba(255, 255, 255, .07);
  --chip: rgba(148, 163, 184, .16);
  --rel: #d5dceb;
  --input: #111a2c;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 3px 10px rgba(0, 0, 0, .25);
  --shadow-pop: 0 14px 36px rgba(0, 0, 0, .55);
  --danger: #ff6b6b;
  --sel: #8a94ff;

  --u-overdue-bg: rgba(239, 68, 68, .24); --u-overdue: #ff9b9b;
  --u-soon2-bg: rgba(249, 115, 22, .24); --u-soon2: #ffb784;
  --u-soon-bg: rgba(234, 179, 8, .22); --u-soon: #f4d66a;
  --u-later-bg: rgba(148, 163, 184, .16); --u-later: #aeb8ca;
  --u-done-bg: rgba(34, 197, 94, .20); --u-done: #7fe3a2;

  --st-todo-bg: rgba(148, 163, 184, .16); --st-todo: #aeb8ca;
  --st-active-bg: rgba(59, 130, 246, .24); --st-active: #94bbff;
  --st-waiting-bg: rgba(249, 115, 22, .22); --st-waiting: #ffb784;
  --st-blocked-bg: rgba(168, 85, 247, .24); --st-blocked: #d5a8ff;
  --st-done-bg: rgba(34, 197, 94, .20); --st-done: #7fe3a2;

  --pill-red-bg: rgba(239, 68, 68, .2); --pill-red: #ff9b9b;
  --pill-orange-bg: rgba(249, 115, 22, .2); --pill-orange: #ffb784;
  --pill-yellow-bg: rgba(234, 179, 8, .2); --pill-yellow: #f4d66a;
  --pill-green-bg: rgba(34, 197, 94, .2); --pill-green: #7fe3a2;
  --pill-blue-bg: rgba(59, 130, 246, .22); --pill-blue: #94bbff;
  --pill-purple-bg: rgba(168, 85, 247, .22); --pill-purple: #d5a8ff;
  --pill-gray-bg: rgba(148, 163, 184, .16); --pill-gray: #aeb8ca;

  --frame-alpha: .14;
  --tag-l: 28%; --tag-s: 45%; --tag-tl: 82%;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex; flex-direction: column; overflow: hidden;
  font: 13px/1.4 "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg-app); color: var(--text);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: var(--link); }
kbd {
  display: inline-block; font: 600 10.5px/1.5 "Segoe UI", sans-serif; padding: 0 5px; border-radius: 4px;
  border: 1px solid var(--border-strong); background: var(--panel-2); color: var(--muted);
}
code { font-family: Consolas, "Cascadia Mono", monospace; font-size: 12px; background: var(--chip); padding: 0 4px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; }
[hidden] { display: none !important; }

/* ---------------- top bar ---------------- */
#topbar {
  flex: none; height: 50px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: var(--topbar); border-bottom: 1px solid var(--border); position: relative; z-index: 30;
  white-space: nowrap; overflow: hidden;
}
.brand { display: flex; align-items: center; gap: 7px; font-weight: 800; font-size: 15px; margin: 0 6px 0 2px; letter-spacing: -.01em; }
.brand img { display: block; }
.tb-btn {
  height: 31px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--border);
  background: var(--btn); font-weight: 600; display: inline-flex; align-items: center; gap: 5px; flex: none;
}
.tb-btn:hover:not(:disabled) { background: var(--hover); border-color: var(--border-strong); }
.tb-btn.icon { width: 31px; padding: 0; justify-content: center; font-size: 15px; }
.tb-btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.tb-btn.primary:hover { background: var(--accent); filter: brightness(1.08); }
.tb-btn.active { background: var(--accent-weak); border-color: var(--accent); color: var(--accent-text); }
#btn-project { max-width: 240px; }
#project-name { overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.split { display: flex; flex: none; }
.split .tb-btn:first-child { border-radius: 7px 0 0 7px; }
.split .narrow { border-radius: 0 7px 7px 0; padding: 0 7px; border-left-color: rgba(255, 255, 255, .35); }
.group { display: flex; flex: none; }
.group .tb-btn { border-radius: 0; margin-left: -1px; }
.group .tb-btn:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
.group .tb-btn:last-child { border-radius: 0 7px 7px 0; }
.tb-btn.zl { min-width: 52px; justify-content: center; font-variant-numeric: tabular-nums; }
.tb-check { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--text-2); cursor: pointer; padding: 0 3px; user-select: none; flex: none; }
.tb-check input { margin: 0; accent-color: var(--accent); }
.spacer { flex: 1; min-width: 8px; }
.goto { color: var(--muted); }
.goto kbd { margin-left: 4px; }
.save-status {
  border: 0; background: none; color: var(--muted); font-size: 12px; padding: 4px 6px; border-radius: 6px;
  max-width: 330px; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto;
}
.save-status:hover { background: var(--hover); }
.save-status.warn { color: var(--u-overdue); background: var(--u-overdue-bg); font-weight: 600; }

/* ---------------- layout ---------------- */
#main { flex: 1; display: flex; min-height: 0; }
#sidebar { width: 282px; flex: none; display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--border); min-height: 0; }
body.sb-closed #sidebar { display: none; }
#board-wrap { flex: 1; position: relative; min-width: 0; overflow: hidden; }
#inspector {
  width: 330px; flex: none; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--border);
  padding: 10px 14px 24px;
}

/* ---------------- board ---------------- */
#board {
  position: absolute; inset: 0; overflow: hidden; outline: none; touch-action: none;
  background-color: var(--board);
  background-image: radial-gradient(circle, var(--dot) 1.15px, transparent 1.5px);
}
body.panning, body.panning * { cursor: grabbing !important; }
body.is-dragging #board { cursor: grabbing; }
body.picking #board, body.picking .node { cursor: crosshair !important; }
#board.file-over { box-shadow: inset 0 0 0 3px var(--accent); }
#world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#frames-layer, #cards-layer, #labels-layer { position: absolute; left: 0; top: 0; }
#labels-layer { pointer-events: none; z-index: 3; }
#cards-layer { z-index: 2; }
#edges-layer { position: absolute; overflow: visible; pointer-events: none; z-index: 1; }
#empty-hint {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; color: var(--muted);
  max-width: 420px; pointer-events: none; font-size: 14px; line-height: 1.6;
}
.eh-title { font-size: 20px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
#rubber { position: absolute; border: 1px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); pointer-events: none; z-index: 10; }

/* connections */
.link-line { fill: none; stroke-width: 2.2; opacity: .9; }
.rel-line { fill: none; stroke: var(--rel); stroke-width: 1.8; stroke-dasharray: 7 5; opacity: .9; }
.rel-line.quiet { opacity: .28; }
.rel-line.lit { opacity: 1; stroke-width: 2.2; }
.rel-line.sel { stroke: var(--accent); stroke-width: 2.6; opacity: 1; }
.rel-line.temp { stroke: var(--accent); }
.rel-hit { fill: none; stroke: transparent; stroke-width: 14; pointer-events: stroke; cursor: pointer; }
.arr { fill: var(--rel); }
.arr-sel { fill: var(--accent); }
.faded { opacity: .12 !important; }
.rel-label {
  position: absolute; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; white-space: nowrap;
  background: var(--card); border: 1px solid var(--border-strong); border-radius: 999px; padding: 2px 10px;
  font-size: 12px; font-weight: 600; color: var(--text-2); box-shadow: var(--shadow-card);
}
.rel-label.sel { border-color: var(--accent); color: var(--accent-text); }

/* ---------------- frames ---------------- */
.frame-box {
  --fc: #60a5fa;
  position: absolute; border: 2px dashed var(--fc); border-radius: 16px;
  background: color-mix(in srgb, var(--fc) calc(var(--frame-alpha) * 100%), transparent);
}
.frame-box.fc-blue { --fc: #60a5fa; }
.frame-box.fc-green { --fc: #34d399; }
.frame-box.fc-yellow { --fc: #eab308; }
.frame-box.fc-pink { --fc: #f472b6; }
.frame-box.fc-purple { --fc: #a78bfa; }
.frame-box.fc-gray { --fc: #94a3b8; }
.frame-box.sel { border-style: solid; box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc) 35%, transparent); }
.frame-box.frame-drop { --fc: #22c55e; border-style: solid; box-shadow: 0 0 0 4px rgba(34, 197, 94, .35); background: rgba(34, 197, 94, .14); }
.frame-box.dim { opacity: .35; }
.frame-title {
  position: absolute; left: 14px; bottom: calc(100% - 42px); transform: scale(var(--ft, 1)); transform-origin: left bottom;
  padding: 3px 12px; border-radius: 9px; border: 2px solid var(--fc); cursor: grab; user-select: none; white-space: nowrap;
  background: color-mix(in srgb, var(--fc) 22%, var(--board)); color: var(--text); font-weight: 700; font-size: 14px;
  max-width: 600px; overflow: hidden; text-overflow: ellipsis;
}
.frame-resize {
  position: absolute; right: -2px; bottom: -2px; width: 18px; height: 18px; cursor: nwse-resize;
  border-right: 4px solid var(--fc); border-bottom: 4px solid var(--fc); border-radius: 0 0 14px 0; opacity: .7;
}
.frame-box.fixed .frame-resize { opacity: 1; }

/* ---------------- cards ---------------- */
.node {
  position: absolute; background: var(--card); border: 1px solid var(--card-border); border-radius: 10px;
  box-shadow: var(--shadow-card); color: var(--text); padding: 8px 11px 9px; user-select: none; cursor: grab;
  border-left: 4px solid var(--c, #94a3b8); width: max-content;
}
.node:hover { border-color: var(--border-strong); border-left-color: var(--c); }
.node.sel { outline: 2px solid var(--sel); outline-offset: 2px; }
.node.dragging { cursor: grabbing; box-shadow: var(--shadow-pop); z-index: 5; }
.node.dim { opacity: .25; }
.node.hit { box-shadow: 0 0 0 3px #facc15, var(--shadow-card); }
.node.drop-target { outline: 3px dashed var(--accent); outline-offset: 4px; background: color-mix(in srgb, var(--accent) 12%, var(--card)); }
.node.flash { animation: flash 1.2s ease-out; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: var(--shadow-card); } }
.node a { color: var(--link); text-decoration: none; }
.node a:hover { text-decoration: underline; }
.node input[type="checkbox"] { margin: 0; accent-color: var(--accent); width: 15px; height: 15px; flex: none; cursor: pointer; }

.rel-handle {
  position: absolute; right: -7px; top: 50%; margin-top: -6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--card); border: 2.5px solid var(--c, var(--accent)); opacity: 0; cursor: crosshair; transition: opacity .12s;
}
.node:hover .rel-handle, .node.sel .rel-handle { opacity: 1; }
.mini-btn {
  border: 1px solid var(--border); background: var(--btn); color: var(--muted); border-radius: 6px;
  height: 22px; min-width: 22px; padding: 0 5px; font-size: 12px; font-weight: 700; line-height: 1;
}
.mini-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--hover); }

.badge, .pill {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px;
  font-weight: 600; white-space: nowrap; background: var(--chip); color: var(--text-2); line-height: 1.5;
}
.u-overdue { background: var(--u-overdue-bg); color: var(--u-overdue); }
.u-soon2 { background: var(--u-soon2-bg); color: var(--u-soon2); }
.u-soon { background: var(--u-soon-bg); color: var(--u-soon); }
.u-later { background: var(--u-later-bg); color: var(--u-later); }
.u-done { background: var(--u-done-bg); color: var(--u-done); }
.u-text-overdue { color: var(--u-overdue); } .u-text-soon2 { color: var(--u-soon2); } .u-text-soon { color: var(--u-soon); }
.st-todo.pill, .st-text.st-todo { background: var(--st-todo-bg); color: var(--st-todo); }
.st-active.pill, .st-text.st-active { background: var(--st-active-bg); color: var(--st-active); }
.st-waiting.pill, .st-text.st-waiting { background: var(--st-waiting-bg); color: var(--st-waiting); }
.st-blocked.pill, .st-text.st-blocked { background: var(--st-blocked-bg); color: var(--st-blocked); }
.st-done.pill, .st-text.st-done { background: var(--st-done-bg); color: var(--st-done); }
.b-todo { background: var(--st-active-bg); color: var(--st-active); }
.b-hidden { background: transparent; border: 1px dashed var(--border-strong); color: var(--muted); }
.b-repeat { background: var(--accent-weak); color: var(--accent-text); }
.b-owner { background: transparent; color: var(--text-2); padding-left: 0; }
.prio-high.badge { background: var(--u-overdue-bg); color: var(--u-overdue); }
.prio-low.badge { background: var(--chip); color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag-chip {
  --h: 210; display: inline-flex; align-items: center; gap: 3px; border-radius: 999px; padding: 0 8px; font-size: 11.5px;
  font-weight: 600; line-height: 1.6; background: hsl(var(--h) var(--tag-s) var(--tag-l)); color: hsl(var(--h) 70% var(--tag-tl));
  border: 0; white-space: nowrap;
}

/* topic */
.t-topic { min-width: 180px; max-width: 310px; padding: 9px 12px 10px; border-left-width: 5px; }
.t-topic.root { min-width: 200px; }
.tc-head { display: flex; align-items: flex-start; gap: 5px; }
.tc-title { flex: 1; font-weight: 700; font-size: 15px; line-height: 1.3; word-break: break-word; padding-top: 1px; }
.t-topic.root .tc-title { font-size: 16.5px; }
.t-topic .add-btn {
  position: absolute; left: 50%; bottom: -11px; transform: translateX(-50%); width: 22px; height: 22px; padding: 0;
  border-radius: 50%; border: 1.5px solid var(--c); background: var(--card); color: var(--c);
  font-size: 16px; font-weight: 700; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-card); z-index: 1; transition: transform .12s, background .12s, color .12s;
}
.t-topic .add-btn:hover { background: var(--c); color: #fff; transform: translateX(-50%) scale(1.15); }
.tc-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tc-subs { display: flex; flex-direction: column; gap: 2px; margin: 8px -4px 2px; border-top: 1px solid var(--border); padding-top: 6px; }
.tc-sub {
  display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: none; text-align: left;
  padding: 3px 5px; border-radius: 6px; font-size: 12.5px; color: var(--text); min-width: 0;
}
.tc-sub:hover { background: var(--hover); }
.tc-sub.open { background: color-mix(in srgb, var(--sc) 16%, transparent); }
.sub-dot { width: 8px; height: 8px; border-radius: 2px; background: var(--sc); flex: none; }
.tc-sub.open .sub-dot { box-shadow: 0 0 0 2px color-mix(in srgb, var(--sc) 40%, transparent); }
.sub-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.tc-sub .st-text, .tc-sub .cnt { font-size: 11px; flex: none; }
.tc-sub .badge { font-size: 10.5px; padding: 0 5px; flex: none; }
.tc-desc { margin-top: 6px; color: var(--text-2); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; }
.t-topic.st-done .tc-title { color: var(--muted); }

/* to-do & deadline */
.t-todo, .t-deadline { width: 252px; }
.t-todo.prio-high { border-left-color: #ef4444; }
.t-todo.prio-normal { border-left-color: #3b82f6; }
.t-todo.prio-low { border-left-color: #94a3b8; }
.t-todo.overdue, .t-deadline.overdue { background: color-mix(in srgb, #ef4444 16%, var(--card)); border-color: color-mix(in srgb, #ef4444 45%, var(--card-border)); }
.t-deadline { border-left-color: #eab308; }
.node .row { display: flex; align-items: flex-start; gap: 8px; }
.node .row .chk { margin-top: 2px; }
.ttl { font-weight: 600; word-break: break-word; flex: 1; }
.node.done .ttl { text-decoration: line-through; color: var(--muted); }
.node.done { opacity: .8; }
.node .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; padding-left: 23px; }
.node .notes { margin-top: 5px; padding-left: 23px; color: var(--text-2); font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.t-deadline .meta { padding-left: 23px; }
.dl-icon { font-size: 13px; }

/* note: paper colors in both themes */
.t-note { width: 224px; color: #1f2937; border: 0; border-left: 0; padding: 10px 12px 12px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); border-radius: 4px 4px 12px 4px; }
.t-note.note-yellow { background: #fff2a8; } .t-note.note-blue { background: #d7e8ff; } .t-note.note-green { background: #d4f5dc; }
.t-note.note-pink { background: #fde0ef; } .t-note.note-purple { background: #e7e0ff; } .t-note.note-white { background: #ffffff; }
.t-note:hover { border: 0; }
.t-note a { color: #1d4ed8; }
.note-title { font-weight: 700; margin-bottom: 4px; }
.note-text { word-break: break-word; font-size: 12.5px; line-height: 1.4; }
.note-text.open { white-space: pre-wrap; max-height: 420px; overflow-y: auto; }
.note-more { border: 0; background: rgba(0, 0, 0, .07); color: #374151; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 1px 7px; margin-top: 5px; }
.note-more:hover { background: rgba(0, 0, 0, .14); }
.t-note .muted { color: #6b7280; }
.t-note .rel-handle { --c: #94a3b8; }

/* checklist */
.t-checklist { width: 246px; }
.cl-head, .ll-head, .tb-head { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.cl-head .ttl, .ll-head .ttl, .tb-head .ttl { flex: 1; font-weight: 700; }
.cnt { color: var(--muted); font-weight: 600; font-size: 12px; }
.progress { height: 5px; border-radius: 3px; background: var(--chip); margin: 6px 0 5px; overflow: hidden; }
.progress > div { height: 100%; background: #22c55e; border-radius: 3px; transition: width .2s; }
.cl-items { list-style: none; margin: 0; padding: 0; }
.cl-items li { display: flex; align-items: flex-start; gap: 7px; padding: 2px 0; font-size: 12.5px; }
.cl-items li input { margin-top: 2px !important; }
.cl-items li.done span { text-decoration: line-through; color: var(--muted); }
.cl-items li.more { color: var(--muted); padding-left: 22px; }

/* links */
.t-linklist { min-width: 230px; max-width: 390px; }
.t-link { min-width: 220px; max-width: 360px; }
.ll-head { margin-bottom: 4px; }
.ll-row { display: flex; align-items: center; gap: 7px; padding: 2px 0; white-space: nowrap; min-width: 0; }
.ll-row a, .ll-row .bad-link { overflow: hidden; text-overflow: ellipsis; font-weight: 600; min-width: 0; }
.host { color: var(--muted); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lbadge {
  flex: none; font-size: 9.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 1px 5px;
  border-radius: 4px; color: #fff; min-width: 70px; text-align: center; background: #64748b; line-height: 1.5;
}
.lk-jira { background: #2563eb; } .lk-confluence { background: #16a34a; } .lk-microsoft { background: #7c3aed; }
.lk-git { background: #475569; } .lk-web { background: #64748b; } .lk-mail { background: #0891b2; } .lk-file { background: #b45309; }

/* picture */
.t-image { padding: 6px; }
.img-wrap { border-radius: 6px; overflow: hidden; background: var(--chip); }
.img-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; pointer-events: none; }
.img-missing { display: flex; align-items: center; justify-content: center; border-radius: 6px; border: 2px dashed var(--border-strong); color: var(--muted); font-weight: 600; min-height: 60px; }
.caption { margin: 5px 4px 1px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }

/* table card */
.t-table { width: 344px; }
.status-bar { display: flex; gap: 2px; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0 6px; }
.status-bar span { min-width: 3px; }
.oc-red { --oc: var(--oc-red); } .oc-orange { --oc: var(--oc-orange); } .oc-yellow { --oc: var(--oc-yellow); } .oc-green { --oc: var(--oc-green); }
.oc-blue { --oc: var(--oc-blue); } .oc-purple { --oc: var(--oc-purple); } .oc-gray { --oc: var(--oc-gray); }
.status-bar span, .dot { background: var(--oc, var(--oc-gray)); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tb-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.tb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.tb-row { display: flex; align-items: center; gap: 7px; font-size: 12.5px; padding: 2px 0; }
.tb-row span:not(.tb-todo) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tb-todo { color: var(--accent-text); font-size: 12px; }
.tb-more { color: var(--muted); font-style: italic; font-size: 12px; padding: 2px 0 0 16px; }
.btn.block { width: 100%; justify-content: center; margin-top: 8px; }

/* ---------------- sidebar ---------------- */
.sb-search { padding: 10px 10px 6px; position: relative; }
.sb-search input {
  width: 100%; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--input); padding: 0 10px; outline: none;
}
.sb-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
#search-count { position: absolute; right: 36px; top: 17px; font-size: 11px; color: var(--muted); pointer-events: none; }
.tagbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 10px 8px; }
.tag-chip.filter { cursor: pointer; opacity: .85; }
.tag-chip.filter small { opacity: .7; }
.tag-chip.filter.on { opacity: 1; box-shadow: 0 0 0 2px hsl(var(--h) 70% 55%); }
.link-btn { border: 0; background: none; color: var(--link); padding: 0 4px; font-size: 12px; }
.sb-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0 6px; }
.sb-tabs button {
  flex: 1; border: 0; background: none; padding: 8px 4px 9px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: inline-flex; justify-content: center; align-items: center; gap: 5px;
}
.sb-tabs button.active { color: var(--accent-text); border-bottom-color: var(--accent); }
.tab-badge:empty { display: none; }
.tab-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--chip); color: var(--text-2); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.tab-badge.alert { background: #ef4444; color: #fff; }
.sb-body { flex: 1; overflow-y: auto; padding: 6px 6px 20px; }
.sb-empty { color: var(--muted); text-align: center; padding: 30px 12px; line-height: 1.7; }
.sb-group { margin-bottom: 6px; margin-left: calc(var(--d) * 10px); }
.sb-frame {
  width: 100%; display: flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 6px 4px;
  text-transform: uppercase; font-size: 11px; font-weight: 800; letter-spacing: .05em; color: var(--muted); text-align: left; border-radius: 6px;
}
.sb-frame[data-frame]:hover { background: var(--hover); color: var(--text); }
.sb-frame .fr-ico { font-size: 12px; }
.sb-frame.fc-blue .fr-ico { color: #60a5fa; } .sb-frame.fc-green .fr-ico { color: #34d399; } .sb-frame.fc-yellow .fr-ico { color: #eab308; }
.sb-frame.fc-pink .fr-ico { color: #f472b6; } .sb-frame.fc-purple .fr-ico { color: #a78bfa; } .sb-frame.fc-gray .fr-ico { color: #94a3b8; }
.fr-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fr-count { font-weight: 600; }
.sb-topic {
  width: 100%; display: flex; align-items: flex-start; gap: 8px; border: 0; background: none; text-align: left;
  padding: 5px 8px 5px calc(10px + var(--d) * 16px); border-radius: 7px;
}
.sb-topic:hover { background: var(--hover); }
.sb-topic.sel { background: var(--accent-weak); }
.sb-topic .dot { background: var(--c); margin-top: 5px; border-radius: 3px; }
.sb-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.sb-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px; font-size: 11.5px; color: var(--muted); }
.st-text { background: none !important; padding: 0; font-weight: 600; }
.sb-due .badge { font-size: 11px; margin-top: 2px; }
.sb-todo { display: flex; align-items: flex-start; gap: 7px; padding: 5px 8px; border-radius: 7px; border-left: 3px solid transparent; }
.sb-todo:hover { background: var(--hover); }
.sb-todo.prio-high { border-left-color: #ef4444; }
.sb-todo.overdue { background: color-mix(in srgb, #ef4444 9%, transparent); }
.sb-todo input { margin-top: 3px; accent-color: var(--accent); }
.sb-todo.done .sb-title { text-decoration: line-through; color: var(--muted); }
.sb-todo-main { flex: 1; min-width: 0; border: 0; background: none; text-align: left; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-topicname { display: inline-flex; align-items: center; gap: 4px; }
.sb-topicname::before { content: ''; width: 7px; height: 7px; border-radius: 2px; background: var(--c); }
.sb-ico { width: 13px; text-align: center; color: var(--muted); margin-top: 2px; }
.sb-section { padding: 10px 8px 3px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sb-section.alert { color: var(--u-overdue); }
.sb-section span { font-weight: 600; }
.sb-done-toggle { border: 0; background: none; color: var(--muted); font-weight: 700; padding: 10px 8px 4px; }

/* ---------------- inspector ---------------- */
.insp-head { display: flex; align-items: center; gap: 8px; margin: 2px 0 10px; }
.insp-type { flex: 1; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.fl { margin-bottom: 11px; }
.fl > label, .field-label { display: block; font-size: 11.5px; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.field-label { margin-top: 10px; }
.input {
  width: 100%; border: 1px solid var(--border); background: var(--input); border-radius: 7px; padding: 6px 9px; outline: none; min-height: 32px;
}
textarea.input { resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.input.num { width: 70px; }
select.input { padding: 5px 6px; }
.row-inline { display: flex; align-items: center; gap: 6px; }
.row-inline .input { flex: 1; min-width: 0; }
.row-inline .input.num { flex: none; }
.row-inline input[type="range"] { flex: 1; accent-color: var(--accent); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.check-line { display: flex; align-items: center; gap: 8px; margin: 4px 0 12px; font-weight: 600; cursor: pointer; }
.check-line input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
.hint { color: var(--muted); font-size: 12px; margin: -4px 0 12px; }
.hint.warn, .warn { color: var(--u-overdue); }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel) inset; }
.sw-blue { background: #3b82f6; } .sw-teal { background: #14b8a6; } .sw-green { background: #22c55e; } .sw-yellow { background: #eab308; }
.sw-orange { background: #f97316; } .sw-red { background: #ef4444; } .sw-pink { background: #ec4899; } .sw-purple { background: #a855f7; }
.sw-indigo { background: #6366f1; } .sw-gray { background: #64748b; } .sw-white { background: #ffffff; }
.sw-set-note-color .sw-yellow { background: #fff2a8; } .sw-set-note-color .sw-blue { background: #d7e8ff; } .sw-set-note-color .sw-green { background: #d4f5dc; }
.sw-set-note-color .sw-pink { background: #fde0ef; } .sw-set-note-color .sw-purple { background: #e7e0ff; }
.sw-set-frame-color .sw-blue { background: #60a5fa; } .sw-set-frame-color .sw-green { background: #34d399; } .sw-set-frame-color .sw-pink { background: #f472b6; }
.sw-set-frame-color .sw-purple { background: #a78bfa; } .sw-set-frame-color .sw-gray { background: #94a3b8; }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.btn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.btn-grid.two-col { grid-template-columns: 1fr 1fr; }
.insp-foot { display: flex; gap: 6px; border-top: 1px solid var(--border); padding-top: 12px; margin-top: 6px; }
.list-edit { display: flex; flex-direction: column; gap: 5px; margin-bottom: 6px; }
.le-row { display: flex; align-items: center; gap: 5px; }
.le-row .input { flex: 1; min-width: 0; min-height: 29px; padding: 4px 8px; }
.le-row input[type="checkbox"] { accent-color: var(--accent); }
.le-row.sub { padding-left: 76px; }
.le-link { padding: 5px; border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 4px; }
.le-plus { width: 15px; text-align: center; color: var(--muted); font-weight: 700; }
.links .lbadge { min-width: 70px; }

/* ---------------- buttons, tag editor ---------------- */
.btn {
  height: 32px; padding: 0 13px; border-radius: 7px; border: 1px solid var(--border-strong); background: var(--btn); font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--text); white-space: nowrap;
}
.btn:hover:not(:disabled) { background: var(--hover); }
.btn.small { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); background: var(--accent); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.icon-btn {
  border: 0; background: none; color: var(--muted); width: 26px; height: 26px; border-radius: 6px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; text-decoration: none; flex: none;
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.icon-btn.big { font-size: 22px; width: 34px; height: 34px; }
.tag-editor {
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center; border: 1px solid var(--border); background: var(--input);
  border-radius: 7px; padding: 4px 6px; min-height: 32px;
}
.tag-editor:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.tag-input { border: 0; outline: none; background: none; flex: 1; min-width: 80px; padding: 2px; }
.chip-x { border: 0; background: none; padding: 0 0 0 2px; color: inherit; opacity: .6; font-size: 13px; line-height: 1; }
.chip-x:hover { opacity: 1; }

/* ---------------- dialogs, menus, toasts ---------------- */
.modal-back { position: fixed; inset: 0; background: rgba(8, 12, 25, .48); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.modal {
  width: 470px; max-width: 94vw; max-height: 88vh; display: flex; flex-direction: column; background: var(--panel); color: var(--text);
  border-radius: 14px; box-shadow: var(--shadow-pop); border: 1px solid var(--border);
}
.modal.wide { width: 760px; }
.modal-head { display: flex; align-items: center; padding: 14px 16px 6px 20px; }
.modal-head h2 { flex: 1; margin: 0; font-size: 16px; }
.modal-body { padding: 6px 20px 12px; overflow-y: auto; }
.modal-body p { margin: 6px 0 10px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.menu-layer { position: fixed; inset: 0; z-index: 1100; }
.menu {
  position: fixed; min-width: 210px; max-width: 380px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow-pop); padding: 5px; max-height: 80vh; overflow-y: auto;
}
.menu-item {
  width: 100%; display: flex; align-items: center; gap: 8px; border: 0; background: none; text-align: left; padding: 6px 9px;
  border-radius: 6px; white-space: nowrap;
}
.menu-item:hover:not(:disabled) { background: var(--accent-weak); color: var(--accent-text); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.mi-icon { width: 18px; text-align: center; color: var(--muted); flex: none; }
.mi-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.mi-arrow { color: var(--muted); }
.menu-item kbd { margin-left: 10px; }
.menu-sep { height: 1px; background: var(--border); margin: 4px 6px; }
.menu-header { padding: 6px 9px 3px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
#toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 1300; pointer-events: none; }
.toast {
  pointer-events: auto; background: #1f2740; color: #f1f4fa; padding: 9px 16px; border-radius: 9px; box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; max-width: 640px; display: flex; align-items: center; gap: 12px;
}
[data-theme="dark"] .toast { background: #e9edf6; color: #141a2b; }
.toast.show { opacity: 1; transform: none; }
.toast-error { background: #b42318 !important; color: #fff !important; }
.toast button { border: 0; background: rgba(255, 255, 255, .16); color: inherit; font-weight: 700; padding: 3px 10px; border-radius: 6px; }
[data-theme="dark"] .toast button { background: rgba(0, 0, 0, .1); }
.help-table { width: 100%; border-collapse: collapse; }
.help-table td { padding: 5px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.help-table td:first-child { font-weight: 700; white-space: nowrap; width: 170px; }
.help-sec td { padding-top: 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 800; border-bottom: 0; }
.snap-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.snap-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; padding: 6px; }
.snap-table td { padding: 5px 6px; border-top: 1px solid var(--border); }
.snap-btns { white-space: nowrap; text-align: right; }
.snap-btns .btn { margin-left: 3px; }
.tpl-list { display: flex; flex-direction: column; gap: 4px; }
.tpl-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; }
.tpl-name { flex: 1; font-weight: 600; }

/* palette */
.palette-back { position: fixed; inset: 0; background: rgba(8, 12, 25, .35); z-index: 1050; display: flex; justify-content: center; align-items: flex-start; padding-top: 11vh; }
.palette { width: 640px; max-width: 94vw; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow-pop); border: 1px solid var(--border); overflow: hidden; }
.pal-input { width: 100%; border: 0; outline: none; background: none; font-size: 16px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.pal-list { max-height: 52vh; overflow-y: auto; padding: 5px; }
.pal-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.pal-item.on { background: var(--accent-weak); }
.pal-icon { width: 20px; text-align: center; color: var(--muted); }
.pal-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.pal-hint { color: var(--muted); font-size: 12px; white-space: nowrap; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.pal-empty { padding: 18px; color: var(--muted); text-align: center; }
.pal-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.pal-foot kbd { margin-right: 3px; }

/* lightbox */
.lightbox { position: fixed; inset: 0; background: rgba(5, 8, 16, .86); z-index: 1200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: zoom-out; }
.lightbox img { max-width: 94vw; max-height: 86vh; object-fit: contain; border-radius: 6px; background: #fff; }
.lb-caption { color: #e5e7eb; font-weight: 600; }
.lb-close { position: absolute; top: 14px; right: 18px; color: #fff; font-size: 20px; }

/* ---------------- overlays: calendar & table view ---------------- */
.overlay-view { position: absolute; inset: 0; background: var(--bg-app); z-index: 20; display: flex; flex-direction: column; padding: 12px 16px 8px; overflow: hidden; }
.cal-head, .tv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex: none; }
.cal-head h2 { margin: 0 4px; font-size: 19px; min-width: 190px; text-align: center; }
.cal-grid {
  flex: 1; display: grid; grid-template-columns: 34px repeat(7, minmax(0, 1fr)); grid-template-rows: 24px repeat(6, minmax(0, 1fr));
  gap: 4px; min-height: 0;
}
.cal-dow { text-align: center; font-size: 11.5px; font-weight: 800; color: var(--muted); text-transform: uppercase; align-self: end; }
.cal-wk { font-size: 11px; color: var(--faint); font-weight: 700; padding-top: 6px; text-align: center; }
.cal-wk.head { align-self: end; padding: 0; }
.cal-day { background: var(--card); border: 1px solid var(--border); border-radius: 9px; padding: 4px 5px 5px; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.cal-day.weekend { background: color-mix(in srgb, var(--card) 70%, var(--bg-app)); }
.cal-day.other { opacity: .5; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day.drop-day { outline: 2px dashed var(--accent); outline-offset: -2px; background: var(--accent-weak); }
.cal-num { font-size: 12px; font-weight: 700; color: var(--text-2); align-self: flex-start; padding: 0 5px; border-radius: 999px; margin-bottom: 3px; }
.cal-day.today .cal-num { background: var(--accent); color: #fff; }
.cal-items { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; min-height: 0; }
.cal-item {
  display: flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 6px; border-radius: 5px; cursor: pointer; flex: none;
  background: color-mix(in srgb, var(--c) 18%, var(--card)); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden;
}
.cal-item span { overflow: hidden; text-overflow: ellipsis; }
.cal-item input { margin: 0; flex: none; accent-color: var(--accent); }
.cal-item:hover { filter: brightness(1.06); box-shadow: 0 0 0 1px var(--c); }
.cal-item.ghost { background: transparent; border: 1px dashed var(--c); opacity: .75; cursor: default; }
.cal-item.done span { text-decoration: line-through; opacity: .6; }
.cal-item.u-overdue { color: var(--u-overdue); font-weight: 600; background: color-mix(in srgb, var(--c) 14%, var(--card)); }
.cal-item.u-soon2, .cal-item.u-soon, .cal-item.u-later, .cal-item.u-done { color: var(--text); background: color-mix(in srgb, var(--c) 18%, var(--card)); }
.cal-item.dragging { opacity: .4; }
.tv-tip { flex: none; color: var(--muted); font-size: 11.5px; padding: 8px 2px 2px; }

body.overlay-open #inspector { display: none; }
.tv-title { width: 300px; max-width: 32vw; font-size: 17px; font-weight: 700; border-color: transparent; background: transparent; }
.tv-title:hover { border-color: var(--border); }
.tv-meta { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tv-filter { width: 220px; }
.tv-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -2px 0 10px; flex: none; }
.chip { border: 1px solid var(--oc); background: transparent; color: var(--text-2); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.chip.on { background: var(--oc); color: #fff; }
.tv-scroll { flex: 1; overflow: auto; min-height: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.tv-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.tv-table th {
  position: sticky; top: 0; z-index: 2; background: var(--panel-2); border-bottom: 1px solid var(--border-strong);
  border-right: 1px solid var(--border); text-align: left; padding: 0; font-weight: 700; color: var(--text-2);
}
.th-in { display: flex; align-items: center; gap: 3px; padding: 6px 6px 6px 8px; position: relative; }
.th-name { flex: 1; border: 0; background: none; text-align: left; font-weight: 700; padding: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; }
.th-name:hover { color: var(--accent-text); }
.sort { color: var(--accent-text); font-size: 10px; }
.th-type { color: var(--faint); font-size: 11px; }
.th-menu { border: 0; background: none; color: var(--muted); border-radius: 4px; padding: 0 4px; }
.th-menu:hover { background: var(--hover); color: var(--text); }
.tv-table th { position: sticky; }
.col-resize { position: absolute; right: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 3; }
.col-resize:hover { background: var(--accent); opacity: .5; }
.tv-table td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: top; padding: 0; }
.tv-table tr:hover td { background: color-mix(in srgb, var(--accent) 4%, transparent); }
.tv-table tr.done td { opacity: .5; }
.tv-rowh { width: 44px; text-align: center; padding: 4px 2px !important; white-space: nowrap; }
.row-menu, .todo-mark { border: 0; background: none; color: var(--muted); border-radius: 4px; padding: 0 4px; font-size: 14px; }
.row-menu:hover, .todo-mark:hover { background: var(--hover); color: var(--text); }
.todo-mark { color: var(--accent-text); }
.cell { min-height: 32px; padding: 6px 9px; white-space: pre-wrap; word-break: break-word; outline: none; cursor: text; }
.cell:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--input); }
.cell.person:not(:empty)::before { content: '👤 '; }
.cell.person:focus::before { content: ''; }
.link-cell { display: flex; align-items: flex-start; }
.link-cell .cell { flex: 1; color: var(--link); font-weight: 600; }
.link-cell .cell:focus { color: var(--text); font-weight: 400; }
.open-link { padding: 6px 7px; text-decoration: none; font-weight: 700; }
.status-pill {
  margin: 5px 7px; border: 1px solid var(--pill-c, var(--border-strong)); background: var(--pill-bg, var(--chip)); color: var(--pill-c, var(--muted));
  text-transform: uppercase; font-size: 10.5px; letter-spacing: .02em; padding: 1px 7px; cursor: pointer;
}
.status-pill.empty { border-style: dashed; text-transform: none; }
.status-pill.oc-red, .pill.oc-red { --pill-bg: var(--pill-red-bg); --pill-c: var(--pill-red); }
.status-pill.oc-orange, .pill.oc-orange { --pill-bg: var(--pill-orange-bg); --pill-c: var(--pill-orange); }
.status-pill.oc-yellow, .pill.oc-yellow { --pill-bg: var(--pill-yellow-bg); --pill-c: var(--pill-yellow); }
.status-pill.oc-green, .pill.oc-green { --pill-bg: var(--pill-green-bg); --pill-c: var(--pill-green); }
.status-pill.oc-blue, .pill.oc-blue { --pill-bg: var(--pill-blue-bg); --pill-c: var(--pill-blue); }
.status-pill.oc-purple, .pill.oc-purple { --pill-bg: var(--pill-purple-bg); --pill-c: var(--pill-purple); }
.status-pill.oc-gray, .pill.oc-gray { --pill-bg: var(--pill-gray-bg); --pill-c: var(--pill-gray); }
.pill[class*="oc-"] { background: var(--pill-bg); color: var(--pill-c); }
.cell-date { border: 0; background: transparent; padding: 6px 7px; outline: none; width: 100%; border-radius: 0; }
.cell-date:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.cell-date.u-overdue, .cell-date.u-soon2, .cell-date.u-soon, .cell-date.u-done { font-weight: 600; }
.tv-empty { padding: 30px !important; text-align: center; color: var(--muted); }
.tv-add { margin: 8px; }

.fatal { position: fixed; left: 20px; right: 20px; top: 70px; padding: 16px; background: #b42318; color: #fff; border-radius: 10px; z-index: 2000; font-weight: 600; }
body.browser-mode .save-status:not(.warn) { color: var(--muted); }
