:root {
  --column-w: 272px;
  --on-accent: var(--dreams-ink);
  /* the board: a light sheet of columns over the board colour, white tiles on it */
  --column-bg: color-mix(in srgb, var(--bg) 95%, transparent);
  --tile-bg: var(--card);
  --tile-shadow: 0 1px 1px color-mix(in srgb, var(--ink) 16%, transparent), 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent);
  --board-shade: color-mix(in srgb, var(--bg) 8%, transparent);
  --on-tone: var(--dreams-ink);
  --label-strength: 84%;
  --sb-thumb: color-mix(in srgb, var(--ink) 22%, transparent);
  --sb-thumb-hover: color-mix(in srgb, var(--ink) 38%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --column-bg: color-mix(in srgb, var(--bg) 90%, transparent);
    --tile-bg: var(--card-2);
    --tile-shadow: 0 1px 1px color-mix(in srgb, var(--bg) 60%, transparent);
    --board-shade: color-mix(in srgb, var(--bg) 42%, transparent);
    --on-tone: var(--dreams-obsidian);
    --label-strength: 100%;
  }
}
:root[data-theme="dark"] {
  --column-bg: color-mix(in srgb, var(--bg) 90%, transparent);
  --tile-bg: var(--card-2);
  --tile-shadow: 0 1px 1px color-mix(in srgb, var(--bg) 60%, transparent);
  --board-shade: color-mix(in srgb, var(--bg) 42%, transparent);
  --on-tone: var(--dreams-obsidian);
  --label-strength: 100%;
}

/* No browser chrome anywhere: thin scrollbars in our tokens, in both themes */
* { scrollbar-width: thin; scrollbar-color: var(--sb-thumb) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { border: 2px solid transparent; border-radius: var(--r-pill); background: var(--sb-thumb) padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-hover) padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--page-glow);
  color: var(--ink);
  font-family: var(--ff);
  font-size: var(--fs-base);
  line-height: 1.45;
}
a { color: var(--violet-2); text-decoration: none; }
a:hover { color: var(--violet); }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
[hidden] { display: none !important; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon {
  width: 1em; height: 1em; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}

/* Buttons and fields */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 34px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--card); color: var(--ink-2);
  font-size: var(--fs-md); font-weight: 700; white-space: nowrap;
  transition: background-color var(--d1) var(--ease), border-color var(--d1) var(--ease);
}
.btn:hover { background: var(--hover-tint); color: var(--ink); }
.btn .icon { font-size: 15px; }
.btn.primary { border-color: transparent; background: var(--violet); color: var(--on-accent); }
.btn.primary:hover { background: var(--violet-2); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover-tint); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-bg); }
.btn.danger-fill { border-color: transparent; background: var(--bad); color: var(--on-accent); }
.btn.danger-fill:hover { background: var(--bad); color: var(--on-accent); filter: brightness(1.08); }
.btn.wide { width: 100%; justify-content: flex-start; }
.btn.center { justify-content: center; }
.btn[disabled] { opacity: 0.5; cursor: default; }
.icon-btn {
  width: 34px; height: 34px; display: inline-grid; place-items: center; flex: 0 0 auto;
  border: 1px solid transparent; border-radius: var(--r-1);
  background: transparent; color: var(--ico);
}
.icon-btn:hover { background: var(--hover-tint); color: var(--ink); }
.icon-btn .icon { font-size: 17px; }
.field, .area {
  width: 100%; min-height: 36px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--input-bg); color: var(--ink);
  font-size: var(--fs-md);
}
.area { min-height: 80px; resize: vertical; line-height: 1.5; }
.field:focus, .area:focus { outline: none; border-color: var(--chip-on-ring); box-shadow: var(--ring); }
.field::placeholder, .area::placeholder { color: var(--ink-4); }
.eyebrow {
  margin: 0 0 6px; color: var(--ink-4);
  font-size: var(--fs-cap); font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
}
.muted { color: var(--ink-3); }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }
.notice { padding: 10px 12px; border-radius: var(--r-1); font-size: var(--fs-md); }
.notice.bad { color: var(--bad); background: var(--bad-bg); }
.notice.warn { color: var(--warn); background: var(--warn-bg); }

/* Every visible checkbox and radio is drawn by us, with or without the .check class */
.check, input[type="checkbox"]:not(.sr-only), input[type="radio"]:not(.sr-only) {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex: 0 0 auto; margin: 0;
  display: inline-grid; place-items: center;
  border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--input-bg);
  cursor: pointer; vertical-align: middle;
}
input[type="radio"]:not(.sr-only) { border-radius: var(--r-pill); }
.check::after, input[type="checkbox"]:not(.sr-only)::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px;
  border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent);
  transform: rotate(-45deg); opacity: 0;
}
input[type="radio"]:not(.sr-only)::after {
  content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--on-accent); opacity: 0;
}
.check:checked, input[type="checkbox"]:not(.sr-only):checked { border-color: var(--ok); background: var(--ok); }
input[type="radio"]:not(.sr-only):checked { border-color: var(--violet); background: var(--violet); }
.check:checked::after, input[type="checkbox"]:not(.sr-only):checked::after,
input[type="radio"]:not(.sr-only):checked::after { opacity: 1; }
.check:focus-visible, input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.check:disabled, input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: 0.55; cursor: default; }

.mode-switch { display: flex; align-items: center; gap: 8px; margin: 6px 0 10px; }

.choice { display: flex; flex-wrap: wrap; gap: 6px; }
.choice label {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: var(--r-pill); cursor: pointer;
  font-size: var(--fs-md); font-weight: 700; color: var(--ink-2);
}
.choice input, .choice input:disabled { position: absolute; opacity: 0; pointer-events: none; }
.choice input:checked + span { color: var(--badge-ink); }
.choice label:has(input:checked) { border-color: var(--chip-on-ring); background: var(--chip-on-bg); }
.choice label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.preset-preview { margin: 8px 0 0; font-size: var(--fs-sm); color: var(--ink-3); line-height: 1.4; }

/* Tones: labels, covers, avatars, board marks */
.tone-green { --tone: var(--s-green); --tone-g: var(--t-green); }
.tone-yellow { --tone: var(--s-yellow); --tone-g: var(--t-yellow); }
.tone-orange { --tone: var(--s-orange); --tone-g: var(--t-orange); }
.tone-red { --tone: var(--s-red); --tone-g: var(--t-red); }
.tone-purple { --tone: var(--s-purple); --tone-g: var(--t-purple); }
.tone-blue { --tone: var(--s-blue); --tone-g: var(--t-blue); }
.tone-sky { --tone: var(--s-sky); --tone-g: var(--t-sky); }
.tone-lime { --tone: var(--s-lime); --tone-g: var(--t-lime); }
.tone-pink { --tone: var(--s-pink); --tone-g: var(--t-pink); }
.tone-black { --tone: var(--s-obsidian); --tone-g: var(--t-obsidian); }
/* The light and dark shades of the label tones: mixed from the same tokens, with words that stay readable */
:is(.tone-green-light, .tone-yellow-light, .tone-orange-light, .tone-red-light, .tone-purple-light,
  .tone-blue-light, .tone-sky-light, .tone-lime-light, .tone-pink-light, .tone-black-light) {
  --tone: color-mix(in oklab, var(--base-tone) 50%, var(--dreams-ink));
  --tone-g: linear-gradient(135deg, color-mix(in oklab, var(--base-tone) 32%, var(--dreams-ink)), color-mix(in oklab, var(--base-tone) 62%, var(--dreams-ink)));
  --on-tone: var(--dreams-obsidian);
  --label-strength: 100%;
}
:is(.tone-green-dark, .tone-yellow-dark, .tone-orange-dark, .tone-red-dark, .tone-purple-dark,
  .tone-blue-dark, .tone-sky-dark, .tone-lime-dark, .tone-pink-dark, .tone-black-dark) {
  --tone: color-mix(in oklab, var(--base-tone) 46%, var(--dreams-obsidian));
  --tone-g: linear-gradient(135deg, color-mix(in oklab, var(--base-tone) 60%, var(--dreams-obsidian)), color-mix(in oklab, var(--base-tone) 34%, var(--dreams-obsidian)));
  --on-tone: var(--dreams-ink);
  --label-strength: 100%;
}
.tone-green-light, .tone-green-dark { --base-tone: var(--s-green); }
.tone-yellow-light, .tone-yellow-dark { --base-tone: var(--s-yellow); }
.tone-orange-light, .tone-orange-dark { --base-tone: var(--s-orange); }
.tone-red-light, .tone-red-dark { --base-tone: var(--s-red); }
.tone-purple-light, .tone-purple-dark { --base-tone: var(--s-purple); }
.tone-blue-light, .tone-blue-dark { --base-tone: var(--s-blue); }
.tone-sky-light, .tone-sky-dark { --base-tone: var(--s-sky); }
.tone-lime-light, .tone-lime-dark { --base-tone: var(--s-lime); }
.tone-pink-light, .tone-pink-dark { --base-tone: var(--s-pink); }
.tone-black-light, .tone-black-dark { --base-tone: var(--s-obsidian); }
.tone-none { --tone: var(--ink-4); --tone-g: var(--none-bg); }
.tone-violet { --tone: var(--s-violet); --tone-g: var(--t-violet); }
.tone-amber { --tone: var(--s-amber); --tone-g: var(--t-amber); }
.tone-teal { --tone: var(--s-teal); --tone-g: var(--t-teal); }
.tone-rose { --tone: var(--s-rose); --tone-g: var(--t-rose); }
.tone-indigo { --tone: var(--s-indigo); --tone-g: var(--t-indigo); }
.tone-slate { --tone: var(--s-slate); --tone-g: var(--t-slate); }
.tone-brand { --tone: var(--s-violet); --tone-g: var(--g-brand); }

.avatar {
  width: 28px; height: 28px; display: inline-grid; place-items: center; flex: 0 0 auto;
  border-radius: var(--r-pill); background: var(--tone-g, var(--t-violet));
  color: var(--on-accent); font-size: 10px; font-weight: 800; letter-spacing: 0.02em;
}
.avatar.sm { width: 24px; height: 24px; font-size: 9px; }
.avatar.lg { width: 32px; height: 32px; font-size: 11px; }
/* A person's face as in Dreams ID (app/faces.py): the profile's colour from the palette in tokens.css
   and an emoji picture centred by its own edges – an emoji font sits the drawing below the middle.
   Every face carries the initials too; <html data-faces="initials"> (the viewer's choice) shows
   them instead of the picture, the colour stays. The bot keeps its robot either way. */
.avatar.face {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--face, var(--face-grey)); color: var(--ink);
}
.face-red { --face: var(--face-red); }
.face-orange { --face: var(--face-orange); }
.face-amber { --face: var(--face-amber); }
.face-yellow { --face: var(--face-yellow); }
.face-lime { --face: var(--face-lime); }
.face-green { --face: var(--face-green); }
.face-teal { --face: var(--face-teal); }
.face-cyan { --face: var(--face-cyan); }
.face-sky { --face: var(--face-sky); }
.face-blue { --face: var(--face-blue); }
.face-indigo { --face: var(--face-indigo); }
.face-violet { --face: var(--face-violet); }
.face-purple { --face: var(--face-purple); }
.face-pink { --face: var(--face-pink); }
.face-rose { --face: var(--face-rose); }
.face-grey { --face: var(--face-grey); }
.avatar .glyph { display: block; width: 62%; height: 62%; pointer-events: none; user-select: none; }
.avatar .glyph + .ini { display: none; }
.avatar.face { position: relative; overflow: hidden; }
.avatar .photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
:root[data-faces="initials"] .avatar:not(.face-bot) .glyph { display: none; }
:root[data-faces="initials"] .avatar:not(.face-bot) .glyph + .ini { display: inline; }
.avatars { display: inline-flex; align-items: center; }
.avatars .avatar { box-shadow: 0 0 0 2px var(--card); }
.avatars .avatar + .avatar { margin-left: -6px; }
.avatar-more {
  height: 24px; min-width: 24px; padding: 0 6px; display: inline-grid; place-items: center;
  margin-left: 4px; border-radius: var(--r-pill); background: var(--none-bg);
  color: var(--ink-3); font-size: var(--fs-xs); font-weight: 800;
}

/* Labels: one slim plate everywhere – solid tone with the word on it; a nameless label is a bare
   colour bar. The light theme deepens the tone a little so white words stay readable on lime and
   yellow; the dark theme keeps its light tones under dark words. */
.label-chip, .label-plate {
  --label-bg: color-mix(in srgb, var(--tone) var(--label-strength), var(--dreams-obsidian));
  display: inline-block; max-width: 100%; min-width: 0; vertical-align: middle;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: 4px; background: var(--label-bg); color: var(--on-tone);
  font-size: var(--fs-sm); font-weight: 700;
}
.label-chip { height: 20px; padding: 0 8px; line-height: 20px; }
.label-chip.nameless { width: 40px; padding: 0; }
.label-chip.tone-none, .label-plate.tone-none {
  --label-bg: var(--none-bg); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
}

/* Priority: a card's own tone, kept apart from the cover tone on the same element */
.prio-green { --prio: var(--s-green); }
.prio-yellow { --prio: var(--s-yellow); }
.prio-orange { --prio: var(--s-orange); }
.prio-red { --prio: var(--s-red); }
.prio-purple { --prio: var(--s-purple); }
.prio-blue { --prio: var(--s-blue); }
.prio-sky { --prio: var(--s-sky); }
.prio-lime { --prio: var(--s-lime); }
.prio-pink { --prio: var(--s-pink); }
.prio-black { --prio: var(--s-obsidian); }
.prio-dot { width: 8px; height: 8px; flex: 0 0 auto; border-radius: var(--r-pill); background: var(--prio, var(--ink-4)); }
.prio-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px;
  border: 1.5px solid var(--prio, var(--line)); border-radius: var(--r-1);
  background: color-mix(in srgb, var(--prio, transparent) 10%, transparent); color: var(--ink);
  font-size: var(--fs-md); font-weight: 700;
}
button.prio-chip:hover:not([disabled]) { background: color-mix(in srgb, var(--prio, transparent) 18%, transparent); }
.prio-pick { flex: 0 0 auto; color: var(--prio); }
.prio-pick .icon { stroke-width: 2.5; }
.prio-pick.auto { opacity: 0.6; }
.prio-frozen { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.list-row > .prio-chip + .prio-pick { margin-left: -4px; }

/* Who is behind an avatar: a button that opens a small card of the person */
.avatar-btn { padding: 0; border: 0; cursor: pointer; font-family: inherit; }
.avatar-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.person-pop { width: 280px; }
.person-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.person-head .avatar { width: 40px; height: 40px; font-size: 13px; }
.person-head b { display: block; font-size: var(--fs-base); line-height: 1.3; overflow-wrap: anywhere; }
.person-head small { display: block; color: var(--ink-3); overflow-wrap: anywhere; }
.person-pop .pop-item { min-height: 32px; }
.person-pop .pop-item .icon { color: var(--ico); }
.person-note { margin: 6px 0 0; color: var(--ink-3); font-size: var(--fs-sm); }

/* Shell */
.sidebar-rule { height: 1px; margin: 10px 4px; background: var(--line); flex: 0 0 auto; }
.sidebar-title {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 6px; color: var(--ink-2);
  font-size: var(--fs-sm, 12px); font-weight: 800;
}
.space {
  min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 8px;
  color: var(--ink-2); font-size: var(--fs-md); font-weight: 700;
}
.space-mark { width: 18px; height: 18px; flex: 0 0 auto; border-radius: 5px; background: var(--tone-g); }
.space-boards { display: grid; gap: 2px; margin: 0 0 6px 18px; }
.space-boards[hidden] { display: none; }
.space-toggle {
  flex: 1; min-width: 0; min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0;
  border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.space-chevron { flex: none; margin-right: -4px; font-size: 14px; color: var(--ink-4); transition: transform var(--d1) var(--ease); }
.space-toggle[aria-expanded="false"] .space-chevron { transform: rotate(-90deg); }
.space-boards a { gap: 8px; }
.board-mark { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--tone-g); }
.board-name { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.space-boards a {
  min-height: 32px; display: flex; align-items: center; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--r-1);
  color: var(--ink-2); font-size: var(--fs-md);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.space-boards a:hover { background: var(--hover-tint); color: var(--ink); }
.space-boards a.active {
  color: var(--badge-ink); background: var(--badge-bg); border-color: var(--chip-on-ring);
  font-weight: 700;
}
.space-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.side-row { display: flex; align-items: center; gap: 2px; min-width: 0; }
.side-row > a { flex: 1; min-width: 0; }
.side-more { width: 28px; height: 28px; color: var(--ink-3); opacity: 0; }
.side-more .icon { font-size: 16px; }
:is(.space, .side-row):is(:hover, :focus-within) .side-more, .side-more[aria-expanded="true"] { opacity: 1; }
@media (hover: none) { .side-more { opacity: 1; } }
.fav-block:not([hidden]) { display: contents; }
.main { min-width: 0; display: flex; flex-direction: column; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); background: var(--none-bg); color: var(--ink-3);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.chip .icon { font-size: 13px; }
.chip.accent { background: var(--badge-bg); color: var(--badge-ink); }
.page { width: 100%; max-width: 1200px; margin: 0 auto; padding: 28px 24px 48px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: var(--fs-3xl); letter-spacing: -0.03em; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.page-head .spacer { flex: 1; }

/* Home: boards by workspace */
.ws { margin-bottom: 28px; }
.ws-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.ws-head h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: var(--fs-lg); font-weight: 800; }
.ws-head .space-mark { width: 22px; height: 22px; border-radius: 6px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.tile {
  position: relative; min-height: 112px; display: flex; flex-direction: column; gap: 4px;
  padding: 16px 14px 14px; border: 1px solid var(--line); border-radius: var(--r-3);
  background: var(--card); color: var(--ink);
  box-shadow: 0 1px 0 var(--line);
  transition: transform var(--d1) var(--ease), box-shadow var(--d1) var(--ease);
  overflow: hidden;
}
.tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--tone-g); }
.tile:hover { color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.tile b { font-size: var(--fs-base); font-weight: 800; }
.tile small { color: var(--ink-4); font-size: var(--fs-sm); }
.tile-new {
  align-items: center; justify-content: center; border-style: dashed;
  background: transparent; box-shadow: none; color: var(--ink-4); font-weight: 700;
}
.tile-new::before { display: none; }
.tile-new .icon { font-size: 18px; }
.empty {
  display: grid; justify-items: center; gap: 10px; padding: 48px 24px; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--r-4); background: var(--card);
}
.empty h2 { margin: 6px 0 0; font-size: var(--fs-xl); }
.empty p { max-width: 460px; margin: 0; color: var(--ink-3); }
.empty.empty-simple { border: 0; background: transparent; }
.empty-mark {
  width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px;
  background: var(--g-brand); color: var(--on-accent);
}
.empty-mark .icon { font-size: 26px; stroke-width: 2.1; }

/* Board: the board colour fills the screen, columns are sheets over it, each with its own scroll */
.board-page { height: 100dvh; overflow: hidden; }
.board-page .main {
  height: 100dvh;
  background: linear-gradient(var(--board-shade), var(--board-shade)), var(--tone-g, var(--t-violet));
}
/* Two zones: the shell bar is global (path, search, bell, account), the board bar under it manages
   the board – a translucent strip over the board colour, so it reads as a part of the board */
.board-path .path-link { color: var(--ink-2); font-weight: 700; text-decoration: none; }
.board-path .path-link:hover { color: var(--ink); }
.board-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  position: relative; z-index: 5; min-height: 52px; padding: 8px 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
/* the blur lives on a layer of its own: on the bar itself it traps the project links popover under the cards */
.board-bar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(8px);
}
.board-bar-main, .board-bar-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.board-bar-main { flex: 1 1 auto; }
.board-bar-side { flex: none; }
.board-bar h1 {
  flex: 0 0 auto; min-width: 0; max-width: 36ch; margin: 0 2px 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--fs-lg);
}
/* One row on a desktop (board.js fitBar): words fold into icons step by step, then the name shortens */
.board-bar { flex-wrap: nowrap; }
.board-bar.fit-wrap { flex-wrap: wrap; }
.board-bar.fit-1 :is(#board-watch, #board-visibility) .bar-text { display: none; }
.board-bar.fit-2 :is(#board-settings, #view-switch, #filter-button, #board-rules) .bar-text,
.board-bar.fit-2 .mode-pill-text { display: none; }
.board-bar.fit-3 #board-share .bar-text, .board-bar.fit-3 .bar-rule { display: none; }
.board-bar.fit-3 .board-search { flex-basis: 160px; min-width: 110px; }
.board-bar.fit-4 h1 { flex: 0 1 auto; min-width: 8ch; max-width: 24ch; }
.board-bar.fit-4 .board-search { min-width: 90px; }
.board-bar .icon-btn .icon, .bar-btn .icon { font-size: 16px; }
.bar-rule { width: 1px; height: 20px; margin: 0 4px; background: var(--line); }
.bar-btn { flex: none; gap: 6px; padding: 0 10px; color: var(--ink-2); font-weight: 700; text-decoration: none; }
.bar-btn.on { border-color: var(--chip-on-ring); background: var(--chip-on-bg); color: var(--ink); }
.bar-btn .filter-count { margin-left: 2px; }
.view-switch { gap: 6px; }
.board-search { position: relative; display: inline-flex; align-items: center; flex: 0 1 220px; min-width: 140px; margin-left: 4px; }
.board-search .icon { position: absolute; left: 10px; font-size: 14px; color: var(--ink-3); pointer-events: none; }
.board-search .field { width: 100%; min-height: 34px; padding-left: 32px; }
.view-switch .icon + .icon { font-size: 13px; }
.face-stack {
  display: inline-flex; align-items: center; min-height: 34px; padding: 0 4px; border: 0; border-radius: var(--r-pill);
  background: transparent;
}
.face-stack:hover { background: var(--hover-tint); }
.face-stack .avatar { box-shadow: 0 0 0 2px var(--card); }
.face-stack .avatar + .avatar { margin-left: -2px; }
.filter-count {
  min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center;
  border-radius: var(--r-pill); background: var(--violet); color: var(--on-accent);
  font-size: var(--fs-xs); font-weight: 800;
}
.icon-btn.has-count { position: relative; }
.icon-btn .filter-count { position: absolute; top: 0; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: var(--fs-cap); }
.icon-btn.star.on { color: var(--s-amber); }
.icon-btn.star.on .icon { fill: currentColor; }
.board-canvas {
  flex: 1; min-height: 0; display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 12px 8px; overflow-x: auto; overflow-y: hidden;
  overscroll-behavior-x: contain;
  scrollbar-color: color-mix(in srgb, var(--dreams-ink) 55%, transparent) color-mix(in srgb, var(--dreams-obsidian) 18%, transparent);
}
.board-canvas::-webkit-scrollbar { height: 12px; }
.board-canvas::-webkit-scrollbar-track { margin: 0 12px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--dreams-obsidian) 18%, transparent); }
.board-canvas::-webkit-scrollbar-thumb { border-width: 3px; background: color-mix(in srgb, var(--dreams-ink) 55%, transparent) padding-box; }
.board-canvas::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--dreams-ink) 75%, transparent) padding-box; }
.board-canvas.filtered { box-shadow: inset 0 3px 0 var(--chip-on-ring); }
.column {
  width: var(--column-w); flex: 0 0 var(--column-w); max-height: 100%;
  display: flex; flex-direction: column;
  border-radius: var(--r-3); background: var(--column-bg); color: var(--ink);
  box-shadow: 0 1px 1px color-mix(in srgb, var(--dreams-obsidian) 14%, transparent);
}
.column.lifted { box-shadow: 0 0 0 2px var(--violet), var(--shadow); }
/* A column folded for everyone: a narrow strip with the count and the name read bottom to top */
.column.folded { width: 44px; flex: 0 0 44px; }
.fold-strip {
  display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 0; padding: 12px 0 14px;
  border-radius: var(--r-3); color: var(--ink); cursor: pointer;
}
.fold-strip:hover { background: var(--hover-tint); }
.fold-strip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.fold-strip > .icon { flex: 0 0 auto; color: var(--ink-3); }
.fold-strip .count { color: var(--ink-3); font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.fold-name {
  min-height: 0; margin: 0; writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: var(--fs-base); font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card.lifted { box-shadow: 0 0 0 2px var(--violet), var(--shadow), var(--glow); }
.column-head {
  min-height: 44px; display: flex; align-items: center; gap: 6px; padding: 6px 6px 2px 14px;
  cursor: grab; border-radius: var(--r-3) var(--r-3) 0 0;
}
.column-head h2 {
  flex: 1; margin: 0; min-width: 0; font-size: var(--fs-base); font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.column-head .count { color: var(--ink-3); font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.column-head .icon-btn { width: 32px; height: 32px; color: var(--ink-3); }
.column-head .rename { flex: 1; min-height: 30px; padding: 3px 8px; font-weight: 700; }
.column-cards {
  flex: 1 1 auto; min-height: 8px; display: flex; flex-direction: column; gap: 8px;
  margin: 0 4px; padding: 4px 4px 2px; overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain;
}
.column-foot { display: flex; align-items: center; gap: 2px; padding: 6px 8px 8px; }
.column-foot .add-card { flex: 1; }
.column-foot > .icon-btn { width: 32px; height: 32px; color: var(--ink-3); }
.column-foot > .icon-btn:hover { color: var(--ink); }
.column-foot:has(.composer) { display: block; }
.add-card {
  width: 100%; min-height: 32px; display: flex; align-items: center; gap: 8px; padding: 0 8px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink-3);
  font-size: var(--fs-base); font-weight: 600;
}
.add-card:hover { background: var(--hover-tint); color: var(--ink); }
.cards-more { flex: 0 0 auto; display: flex; }
.cards-more-btn {
  flex: 1; min-height: 32px; display: flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed var(--line); border-radius: var(--r-1); background: transparent; color: var(--ink-3);
  font-size: var(--fs-sm); font-weight: 600;
}
.cards-more-btn:hover { background: var(--hover-tint); color: var(--ink); }
.composer { display: grid; gap: 8px; }
.composer .area { min-height: 64px; border: 0; background: var(--tile-bg); box-shadow: var(--tile-shadow); }
.add-column {
  width: var(--column-w); flex: 0 0 var(--column-w);
  border-radius: var(--r-3); padding: 6px;
  background: color-mix(in srgb, var(--dreams-ink) 24%, transparent); color: var(--dreams-ink);
}
.add-column > .add-card { color: inherit; }
.add-column > .add-card:hover { background: color-mix(in srgb, var(--dreams-ink) 18%, transparent); color: inherit; }
.add-column:has(form) { background: var(--column-bg); color: var(--ink); }

/* Carrying (drag.js): the item leaves the flow, a slot of its size shows where it lands */
.card.drag-source, .column.drag-source { display: none; }
.card-slot {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 10px;
  border: 2px dashed color-mix(in srgb, var(--violet) 55%, transparent); border-radius: var(--r-1);
  background: color-mix(in srgb, var(--violet) 10%, transparent);
  color: var(--bad); font-size: var(--fs-sm); font-weight: 700; line-height: 1.3; text-align: center;
}
.card-slot.forbidden { border-color: var(--bad); background: var(--bad-bg); }
.card-slot .icon { flex: none; font-size: 16px; }
.column-slot {
  flex: 0 0 var(--column-w); max-height: 100%; border-radius: var(--r-3);
  border: 2px dashed color-mix(in srgb, var(--dreams-ink) 60%, transparent);
  background: color-mix(in srgb, var(--dreams-ink) 16%, transparent);
}
.column-slot.narrow { flex-basis: 44px; }
.column.drop-target { box-shadow: 0 0 0 2px color-mix(in srgb, var(--violet) 40%, transparent); }
.column.drop-target.blocked, .column.folded.drop-target { box-shadow: 0 0 0 2px color-mix(in srgb, var(--bad) 45%, transparent); }
body > .drag-ghost {
  position: fixed; left: 0; top: 0; z-index: var(--z-sheet); margin: 0;
  pointer-events: none; opacity: 0.96; box-shadow: var(--shadow); will-change: transform;
}
body > .column.drag-ghost { overflow: hidden; }
body > .drag-ghost.refused, body > .card.prio.prio-line.drag-ghost.refused { outline: 2px solid var(--bad); outline-offset: -2px; }
body > .drag-ghost[data-refusal]::after {
  content: attr(data-refusal); position: absolute; left: 0; top: calc(100% + 6px); max-width: 100%;
  padding: 4px 8px; border-radius: var(--r-1); background: var(--bad); color: var(--on-accent);
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.3;
}
.board-canvas.dragging-now { scroll-snap-type: none; }
html.is-dragging, html.is-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
.board-canvas .card { -webkit-user-select: none; user-select: none; }

/* A card on the board: Trello density – labels with words, title, a row of badges, faces right */
.card {
  position: relative; display: grid; gap: 4px; padding: 8px 12px 6px;
  border: 0; border-radius: var(--r-1);
  background: var(--tile-bg); color: var(--ink);
  --glow: 0 0 0 0 transparent;
  box-shadow: var(--tile-shadow), var(--glow);
  cursor: pointer; text-align: left;
}
.card:hover { box-shadow: var(--tile-shadow), inset 0 0 0 1px var(--line-strong), var(--glow); }
.card:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.card.pending { opacity: 0.7; }
.card.locked .card-title::after { content: none; }
.card-cover { height: 32px; margin: -8px -12px 2px; border-radius: var(--r-1) var(--r-1) 0 0; background: var(--tone-g); }
.card.full-cover { background: var(--tone-g); color: var(--on-accent); }
.card.full-cover .card-cover { display: none; }
.card.full-cover .badge { color: var(--on-accent); }
.card.full-cover .card-title { font-weight: 800; }
.card > * { min-width: 0; }
.card-labels { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 2px; }
.card-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-bottom: 2px; }
.front-chip {
  --label-bg: color-mix(in srgb, var(--tone) var(--label-strength), var(--dreams-obsidian));
  display: inline-flex; align-items: center; gap: 3px; flex: 0 1 auto; max-width: 100%; min-width: 0;
  height: 16px; padding: 0 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border-radius: 4px; background: var(--label-bg); color: var(--on-tone);
  font-size: var(--fs-xs); font-weight: 700; line-height: 16px;
}
.front-chip .icon { font-size: 12px; }
.front-chip.tone-none { --label-bg: var(--none-bg); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
.label-plate {
  min-width: 40px; height: 16px; padding: 0 6px; line-height: 16px; font-size: var(--fs-xs);
  cursor: pointer;
}
.label-plate.plain { --label-bg: transparent; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); }
/* a bar in «Карточки» and the list is the plate without its word, as before the label modes */
.card:not(.compact) .card-labels .label-bar, .lv-labels .label-bar {
  width: 40px; height: 8px; border-radius: 4px;
  background: color-mix(in srgb, var(--tone) var(--label-strength), var(--dreams-obsidian));
}
.card:not(.compact) .card-labels .label-bar.tone-none, .lv-labels .label-bar.tone-none {
  background: var(--none-bg); box-shadow: inset 0 0 0 1px var(--line);
}
.card.prio.prio-line { outline: 2px solid color-mix(in srgb, var(--prio) 85%, transparent); outline-offset: -2px; }
.card.prio.prio-line:hover { outline-color: var(--prio); }
.card.prio.prio-glow { --glow: inset 0 0 18px -2px color-mix(in srgb, var(--prio) 55%, transparent); }
.card.prio:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.card-title {
  display: flex; align-items: flex-start; margin: 0;
  font-size: var(--fs-base); font-weight: 500; line-height: 20px; overflow-wrap: anywhere;
}
.card-title .text { min-width: 0; }
.card-check {
  width: 0; height: 20px; flex: 0 0 auto; display: inline-grid; place-items: center; padding: 0; margin: 0;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3);
  overflow: hidden; opacity: 0;
  transition: width var(--d1) var(--ease), opacity var(--d1) var(--ease), margin var(--d1) var(--ease);
}
.card-check .icon { font-size: 16px; }
.card-check:hover { color: var(--ok); }
/* not while carrying: the copy passes over cards, and a check that opens can wrap a title and move
   every card below away from where the drag measured it */
html:not(.is-dragging) .card:hover .card-check, .card:focus-within .card-check, .card-check.done { width: 16px; margin-right: 6px; opacity: 1; }
.card-check.done { color: var(--ok); }
.card-check.done .icon { fill: var(--ok); stroke: var(--tile-bg); }
.card.is-done .card-title .text { color: var(--ink-2); }
.card-meta { display: flex; align-items: center; gap: 2px 8px; flex-wrap: wrap; min-height: 0; margin-top: 2px; }
.card-meta:empty { display: none; }
.badge {
  min-height: 20px; display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3);
  font-size: var(--fs-sm); font-weight: 500;
}
.badge .icon { font-size: 14px; }
.badge.ref { padding: 1px 6px; border-radius: 4px; background: var(--none-bg); font-size: var(--fs-xs); }
.badge.lock { color: var(--warn); }
.badge.pill, .due { padding: 0 4px; border-radius: 4px; }
.due.overdue { background: var(--bad); color: var(--on-tone); }
.due.soon { background: var(--warn-bg); color: var(--warn); }
.due.done, .badge.pill.done { background: var(--ok); color: var(--on-tone); }
.card-people { margin-left: auto; }
.card .avatars .avatar { box-shadow: 0 0 0 2px var(--tile-bg); }
.card .avatars .avatar + .avatar { margin-left: -4px; }
.board-empty {
  margin: auto; max-width: 420px; padding: 32px; text-align: center; color: var(--ink-3);
  border-radius: var(--r-3); background: var(--column-bg);
}
.show-phone { display: none !important; }

/* Popovers and dialogs */
.pop {
  position: fixed; z-index: var(--z-pop); width: 304px; max-width: calc(100vw - 32px);
  max-height: min(70dvh, 560px); overflow-y: auto;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r-3);
  background: var(--card); box-shadow: var(--shadow);
  transform-origin: top left; animation: pop-in var(--d1) var(--ease);
}
.pop.closing { pointer-events: none; animation: pop-out calc(var(--d1) * .8) var(--ease) forwards; }
@keyframes pop-in { from { opacity: 0; transform: scale(.95); } }
@keyframes pop-out { to { opacity: 0; transform: scale(.95); } }
.dialog { width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.dialog.narrow { width: min(420px, calc(100vw - 32px)); }
.dialog::backdrop { background: var(--scrim); }
.dialog-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px 20px 20px; margin: 0; }
.dialog-form > * { min-width: 0; }
.dialog-head { display: flex; align-items: center; gap: 10px; }
.dialog-head h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-xl); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dialog-text { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.pop-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.pop-head b { flex: 1; text-align: center; font-size: var(--fs-md); }
.pop-head .icon-btn { width: 28px; height: 28px; }
.pop-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; margin: 6px 0; }
.pop-item {
  min-height: 36px; display: flex; align-items: center; gap: 10px; padding: 4px 8px;
  border: 0; border-radius: var(--r-1); background: transparent; text-align: left;
  font-size: var(--fs-md); color: var(--ink-2);
}
.pop-item:hover { background: var(--hover-tint); color: var(--ink); }
a.pop-item { text-decoration: none; }
.pop-item.static { cursor: default; }
.pop-item.static:hover { background: transparent; color: var(--ink-2); }
.pop-item[disabled] { opacity: 0.5; cursor: default; }
.pop-item.closed { color: var(--ink-3); cursor: not-allowed; }
.pop-item.closed:hover { background: transparent; color: var(--ink-3); }
.pop-item.closed > .icon { opacity: 0.6; }
.pop-item .lock-mark { display: inline-flex; color: var(--ink-3); }
.pop-item.danger { color: var(--bad); }
.pop-rule { height: 1px; margin: 6px 0; background: var(--line); }
.pop-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item .mark { color: var(--violet); }
.pop-item .label-chip { flex: 1; }
.pop-item .two-lines { display: grid; gap: 1px; white-space: normal; }
.pop-item .two-lines small { font-size: var(--fs-xs); }
.pop-item .two-lines b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item .two-lines small { white-space: normal; overflow-wrap: anywhere; }
.look-chips[hidden] { display: none; }
.sort-note { margin: 0 0 4px; font-size: var(--fs-sm); line-height: 1.4; }
.pop-section { margin: 12px 0 4px; color: var(--ink-4); font-size: var(--fs-cap); font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.side-swatches { padding: 6px 8px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.swatch {
  height: 32px; border: 2px solid transparent; border-radius: var(--r-1); background: var(--tone-g);
}
.swatch[aria-pressed="true"] { border-color: var(--ink); }
.dialog {
  width: min(520px, calc(100vw - 32px)); padding: 0;
  border: 1px solid var(--line); border-radius: var(--r-4);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
.dialog::backdrop { background: var(--scrim); }
.dialog form { display: grid; gap: 14px; padding: 22px; }
.dialog h2 { margin: 0; font-size: var(--fs-xl); }
.dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog label.field-label { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-3); }

.toast {
  position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: var(--z-sheet); transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 32px)); padding: 10px 16px;
  border-radius: var(--r-2); background: var(--ink); color: var(--card);
  font-size: var(--fs-md); font-weight: 700; box-shadow: var(--shadow);
}
.toast-action {
  margin-left: 12px; padding: 3px 10px; border: 0; border-radius: var(--r-1);
  background: color-mix(in srgb, var(--card) 18%, transparent); color: inherit; font: inherit;
}
.toast-action:hover { background: color-mix(in srgb, var(--card) 28%, transparent); }

/* Calendar */
.cal { display: grid; gap: 6px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head b { font-size: var(--fs-md); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-grid span { text-align: center; color: var(--ink-4); font-size: var(--fs-xs); font-weight: 800; padding: 4px 0; }
.cal-day {
  height: 34px; border: 0; border-radius: var(--r-1); background: transparent;
  font-size: var(--fs-md); color: var(--ink-2);
}
.cal-day:hover { background: var(--hover-tint); }
.cal-day.other { color: var(--ink-4); }
.cal-day.today { font-weight: 800; color: var(--violet-2); }
.cal-day.in-range { background: var(--chip-on-bg); border-radius: 0; }
.cal-day.picked { background: var(--violet); color: var(--on-accent); }
.date-row { display: grid; grid-template-columns: 22px 1fr 84px; align-items: center; gap: 8px; }

/* Card detail: a bar on top, details on the left, comments and events on the right */
.card-dialog {
  width: min(1080px, calc(100vw - 32px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0;
  border: 0; border-radius: var(--r-4); background: var(--card); color: var(--ink);
  box-shadow: var(--shadow); overflow: hidden; animation: card-in var(--d2) var(--ease);
}
.card-dialog::backdrop { background: var(--scrim); animation: fade-in var(--d2) var(--ease); }
.card-dialog.closing { pointer-events: none; animation: card-out var(--d1) var(--ease) forwards; }
.card-dialog.closing::backdrop { animation: fade-out var(--d1) var(--ease) forwards; }
@keyframes card-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pop, .card-dialog { animation-name: fade-in; } .pop.closing, .card-dialog.closing { animation-name: fade-out; } }
.card-dialog-body { max-height: calc(100dvh - 48px); overflow: hidden; }
.card-loading { min-height: 60vh; padding: 48px; color: var(--ink-3); }
.skeleton-line { display: block; height: 18px; width: 75%; margin-bottom: 24px; border-radius: var(--r-1); background: var(--hover-tint); animation: skeleton-pulse var(--d3) var(--ease) infinite alternate; }
.skeleton-title { width: 55%; height: 32px; }
.skeleton-actions { width: 35%; height: 32px; }
.board-skeleton { display: flex; gap: 12px; }
.board-skeleton-column { flex: 0 0 var(--column-w); padding: 12px; border-radius: var(--r-3); background: var(--column-bg); }
.board-skeleton-column b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 12px; }
.board-skeleton-column span { display: block; height: 76px; margin-bottom: 8px; border-radius: var(--r-2); background: var(--card); animation: skeleton-pulse var(--d3) var(--ease) infinite alternate; }
.list-skeleton { display: grid; width: 100%; }
.list-skeleton .board-skeleton-column { width: 100%; }
.list-skeleton .board-skeleton-column span { height: 36px; }
.calendar-skeleton { min-height: 70px; background: var(--hover-tint); animation: skeleton-pulse var(--d3) var(--ease) infinite alternate; }
@keyframes skeleton-pulse { from { opacity: .45; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .skeleton-line, .board-skeleton-column span, .calendar-skeleton { animation: none; } }
.detail { position: relative; display: flex; flex-direction: column; min-width: 0; }
.detail.in-dialog { height: calc(100dvh - 48px); max-height: 920px; }
.detail-page {
  max-width: 1120px; margin: 24px auto; border: 1px solid var(--line);
  border-radius: var(--r-4); background: var(--card); box-shadow: var(--shadow); overflow: clip;
}
.detail-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-height: 56px; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line);
}
.detail-bar .spacer { flex: 1; }
.detail-bar .btn { min-height: 30px; padding: 0 10px; }
.detail-bar .btn.where { gap: 6px; background: var(--none-bg); border-color: transparent; color: var(--ink); }
.detail-bar .btn.where:hover { background: var(--hover-tint); }
.detail-bar .btn .icon { font-size: 14px; }
.detail-bar .chip.ref { font-family: var(--ff-mono); font-size: var(--fs-xs); }
.detail-board { color: var(--ink-4); font-size: var(--fs-sm); }
.detail-bar .icon-btn[aria-pressed="true"] { color: var(--badge-ink); }
.detail-cover { flex: 0 0 auto; height: 88px; background: var(--tone-g); }
.detail-panes { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); }
.detail-main { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 22px; padding: 20px 24px 28px; }
.in-dialog .detail-main, .in-dialog .detail-talk { overflow-y: auto; overscroll-behavior: contain; }
.detail-talk {
  min-width: 0; display: flex; flex-direction: column; gap: 12px; padding: 0 20px 24px;
  border-left: 1px solid var(--line); background: var(--card-2);
}
.detail-head { display: flex; align-items: flex-start; gap: 10px; }
.done-toggle {
  width: 24px; height: 24px; margin-top: 8px; flex: 0 0 auto; display: inline-grid; place-items: center; padding: 0;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--ink-3);
}
.done-toggle .icon { font-size: 20px; }
.done-toggle:hover { color: var(--ok); }
.done-toggle.on { color: var(--ok); }
.done-toggle.on .icon { fill: var(--ok); stroke: var(--card); }
.title-input {
  flex: 1; width: 100%; margin: 0; padding: 2px 6px; margin-left: -6px;
  border: 1px solid transparent; border-radius: var(--r-1); background: transparent;
  font-size: var(--fs-2xl); font-weight: 800; line-height: 1.3; letter-spacing: -0.02em;
  resize: none; overflow: hidden;
}
.title-input:hover:not([readonly]) { background: var(--hover-tint); }
.title-input:focus { outline: none; border-color: var(--chip-on-ring); background: var(--input-bg); }
.title-input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 34px; }
.detail-actions .btn { min-height: 32px; padding: 0 12px; }
.small-note { margin: 0; padding-left: 34px; font-size: var(--fs-sm); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 16px 24px; padding-left: 34px; }
.detail-meta .row { gap: 6px; }
.detail-meta .eyebrow { margin-bottom: 6px; font-size: var(--fs-xs); letter-spacing: 0.02em; text-transform: none; color: var(--ink-3); font-weight: 700; }
.round-add {
  width: 28px; height: 28px; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--r-pill);
  background: var(--none-bg); color: var(--ink-2);
}
.round-add:hover { background: var(--hover-tint); color: var(--ink); }
.detail-meta .row { min-height: 28px; }
.detail-meta .label-chip { height: 24px; padding: 0 10px; line-height: 24px; }
.detail-meta .label-chip.nameless { width: 44px; padding: 0; }
.due-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 0 10px;
  border: 0; border-radius: var(--r-1); background: var(--none-bg); color: var(--ink);
  font-size: var(--fs-md); font-weight: 700;
}
.due-chip .icon { font-size: 14px; color: var(--ink-3); }
.due-word { display: none; padding: 0 5px; border-radius: 4px; font-size: var(--fs-xs); font-weight: 800; }
.due-chip.overdue .due-word, .due-chip.soon .due-word, .due-chip.done .due-word { display: inline-block; }
.due-chip.overdue .due-word { background: var(--bad); color: var(--on-tone); }
.due-chip.overdue .due-word::after { content: "просрочен"; }
.due-chip.soon .due-word { background: var(--warn-bg); color: var(--warn); }
.due-chip.soon .due-word::after { content: "скоро"; }
.due-chip.done .due-word { background: var(--ok); color: var(--on-tone); }
.due-chip.done .due-word::after { content: "выполнено"; }
.section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.section-head { display: flex; align-items: center; gap: 12px; min-height: 32px; }
.section-head h3 { margin: 0; font-size: var(--fs-base); font-weight: 800; }
.section-head .icon { font-size: 20px; color: var(--ico); flex: 0 0 22px; }
.section-head .spacer { flex: 1; }
.section-head .btn { min-height: 30px; padding: 0 12px; }
.checklist .section-head { min-width: 0; gap: 6px; }
.checklist .section-head h3 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checklist .section-head .btn { flex: none; }
@media (max-width: 640px) {
  .checklist .section-head [data-action="hide-checked"] { min-height: 44px; }
  .checklist .section-head [data-action="delete-checklist"] { min-width: 44px; min-height: 44px; padding: 0; justify-content: center; }
  .checklist .section-head [data-action="delete-checklist"] span { display: none; }
}
.section-body { margin-left: 34px; }
.prose { color: var(--ink-2); font-size: var(--fs-base); line-height: 1.6; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ink); line-height: 1.3; margin: 16px 0 8px; }
.prose h1 { font-size: var(--fs-xl); } .prose h2 { font-size: var(--fs-lg); } .prose h3 { font-size: var(--fs-base); }
.prose p { margin: 0 0 10px; }
.prose ul, .prose ol { margin: 0 0 10px; padding-left: 22px; }
.prose li > p { margin: 0; }
.prose blockquote { margin: 0 0 10px; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); color: var(--ink-3); }
.prose code { padding: 1px 5px; border-radius: 5px; background: var(--none-bg); font-family: var(--ff-mono); font-size: 0.92em; }
.prose pre { margin: 0 0 10px; padding: 12px; border-radius: var(--r-1); background: var(--none-bg); overflow-x: auto; }
.prose pre code { padding: 0; background: none; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.prose .doc-image { margin: 0 0 10px; }
.prose .doc-image img { display: block; max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r-1); }
.ed-text .doc-image.uploading img { opacity: 0.55; }
.ed-text .doc-image.ProseMirror-selectednode img { outline: 2px solid var(--violet); outline-offset: 2px; }
.prose-empty {
  width: 100%; min-height: 56px; padding: 10px 12px; border: 0; border-radius: var(--r-1);
  background: var(--none-bg); color: var(--ink-3); text-align: left; font-size: var(--fs-md);
}
.prose-empty:hover { background: var(--hover-tint); }
.progress { display: flex; align-items: center; gap: 10px; }
.progress small { width: 32px; color: var(--ink-3); font-size: var(--fs-xs); font-weight: 700; font-variant-numeric: tabular-nums; }
.checklist .progress { margin-left: 0; }
.progress-bar { flex: 1; height: 8px; border-radius: var(--r-pill); background: var(--none-bg); overflow: hidden; }
.progress-bar span { display: block; height: 100%; border-radius: inherit; background: var(--violet); transition: width var(--d2) var(--ease); }
.progress-bar.full span { background: var(--ok); }
.check-items { display: grid; gap: 2px; margin-left: 0; }
.check-item { display: flex; align-items: flex-start; gap: 16px; min-height: 36px; padding: 6px 6px 6px 3px; border-radius: var(--r-1); }
.check-item:hover { background: var(--hover-tint); }
.check-item .check { margin-top: 1px; }
.check-item .text { flex: 1; min-width: 0; font-size: var(--fs-base); overflow-wrap: anywhere; cursor: text; }
.check-item.done .text { color: var(--ink-3); text-decoration: line-through; }
.check-item .item-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.check-item .item-main .text, .check-item .item-main > .field { flex: 1 1 120px; }
.check-item .item-actions { flex: none; display: flex; align-items: center; gap: 2px; }
.check-item .icon-btn { width: 26px; height: 26px; opacity: 0; }
.check-item:hover .icon-btn, .check-item:focus-within .icon-btn { opacity: 1; }
@media (hover: none) { .check-item .icon-btn { opacity: 1; } }
.check-item .chip { min-height: 22px; padding: 0 8px; font-size: var(--fs-xs); }
.check-item .chip.item-due.overdue { background: var(--bad); color: var(--on-tone); }
.check-item .chip.item-due.soon { background: var(--warn-bg); color: var(--warn); }
.check-item .chip.item-due.done { background: var(--none-bg); color: var(--ink-3); }
.check-item .subtask-chip { max-width: 100%; color: var(--badge-ink); background: var(--badge-bg); }
.check-item .subtask-chip:hover { filter: brightness(1.05); }
.check-item .subtask-chip.done { background: var(--ok); color: var(--on-tone); }
.check-item .subtask-chip > span { overflow: hidden; text-overflow: ellipsis; max-width: 16ch; }
.check-item .subtask-ref { font-family: var(--ff-mono); font-weight: 700; }
.check-item .subtask-hidden { color: var(--ink-3); font-weight: 500; }
.check-item.flash { animation: item-flash 2.4s ease-out; }
@keyframes item-flash { 0%, 55% { background: var(--badge-bg); box-shadow: 0 0 0 2px var(--badge-ink); } }
@media (prefers-reduced-motion: reduce) { .check-item.flash { animation: none; background: var(--badge-bg); } }
.checklist.hide-done .check-item.done { display: none; }
.checklist [data-add-row] { display: flex; flex-wrap: wrap; gap: 8px; }
.checklist [data-add-subtask] { margin-top: 2px; }
.subtask-find { position: relative; display: grid; gap: 4px; }
.subtask-find .mention-pick { margin-top: 0; }
.subtask-find .pop-item { align-items: baseline; gap: 8px; }
.subtask-find .pop-item .rel-ref { font-family: var(--ff-mono); font-weight: 700; color: var(--ink-3); flex: none; }
.subtask-find .pop-item small { color: var(--ink-3); margin-left: auto; flex: none; }
.detail-bar .chip.part-of { color: var(--violet-2); text-decoration: none; }
.detail-bar .chip.part-of:hover { color: var(--violet); background: var(--hover-tint); }
.checklist [data-add-item] { margin-top: 2px; }
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.file {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--card);
}
.file-mark {
  width: 34px; height: 34px; flex: 0 0 auto; display: grid; place-items: center;
  border-radius: var(--r-1); background: var(--badge-bg); color: var(--badge-ink);
}
.file-copy { min-width: 0; flex: 1; display: grid; }
.file-copy > a, .file-copy > b {
  display: -webkit-box; overflow: hidden; color: var(--ink); font-size: var(--fs-md); font-weight: 800;
  overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 5; line-clamp: 5;
}
.file-copy small { color: var(--ink-4); font-size: var(--fs-xs); }
.file-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.file-tag, .file-act { display: inline-flex; align-items: center; color: var(--ink-3); font-size: 14px; }
.file-act { padding: 4px; margin: -4px 0; border-radius: var(--r-1); }
.file-act:hover { background: var(--hover-tint); color: var(--ink); }
.file-copy .file-lost { color: var(--bad); }
.file-meta > span { white-space: nowrap; }
.file-meta > span:not(:last-child)::after { content: " ·"; }
.file-comment { color: var(--ink-3); text-decoration: underline; }
.file-comment:hover { color: var(--ink); }
.comment-files, .compose-files { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.comment-file, .compose-file {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 8px;
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--card); font-size: var(--fs-xs);
}
.comment-file a, .comment-file b, .compose-file span { min-width: 0; max-width: 260px; overflow: hidden; color: var(--ink); text-overflow: ellipsis; white-space: nowrap; }
.comment-file small, .compose-file small { flex: none; color: var(--ink-4); white-space: nowrap; }
.comment-shot { width: 96px; overflow: hidden; border-radius: var(--r-1); box-shadow: 0 0 0 1px var(--line); }
.comment-shot .shot-open { aspect-ratio: 4 / 3; }
.compose-file .icon-btn { width: 22px; height: 22px; }
.files.deleted .file { background: transparent; }
.files.deleted .file-copy > b, .files.deleted .file-copy > a { color: var(--ink-3); }
.detail-talk > * { flex: none; }
.talk-head {
  position: sticky; top: 0; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  margin: 0 -20px; padding: 16px 20px 10px; background: var(--card-2);
}
.talk-head .section-head { align-self: stretch; }
.talk-head .section-head .icon-btn { width: 32px; height: 32px; }
.talk-head .icon { font-size: 18px; }
.detail-talk .comment.new { display: block; }
.talk { display: grid; gap: 14px; margin: 4px 0 0; padding: 0; list-style: none; }
.talk.hide-events .event { display: none; }
.talk.hide-comments > .comment { display: none; }
.talk-modes { display: inline-flex; gap: 2px; padding: 2px; border-radius: var(--r-2); background: var(--none-bg); }
.talk-modes button {
  min-height: 26px; padding: 0 10px; border: 0; border-radius: var(--r-1); background: transparent;
  color: var(--ink-3); font: inherit; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; white-space: nowrap;
}
.talk-modes button:hover { color: var(--ink); }
.talk-modes button[aria-checked="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px var(--line); }
.talk-empty { font-size: var(--fs-md); }
.talk-more { justify-self: center; margin: 10px auto 0; display: block; }
.conflict-note .link-btn { margin-left: 6px; padding: 4px 2px; color: inherit; }
@media (max-width: 600px) { .conflict-note .link-btn { padding: 10px 6px; font-size: var(--fs-md); } }
.comment, .event { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
.talk .avatar { width: 32px; height: 32px; font-size: 11px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.comment-head b { font-size: var(--fs-md); }
.comment-head small, .event-copy small { color: var(--ink-4); font-size: var(--fs-xs); }
.comment-body {
  margin-top: 4px; padding: 8px 12px; border-radius: var(--r-1);
  background: var(--card); box-shadow: 0 0 0 1px var(--line); font-size: var(--fs-md);
}
.event-copy { padding-top: 6px; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.45; overflow-wrap: anywhere; }
.event-copy b { color: var(--ink); }
.event-copy small { display: block; margin-top: 2px; }
.comment-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.comment-foot .reactions { margin: 0; }
.comment-actions { display: flex; gap: 10px; margin-top: 4px; }
.link-btn { padding: 0; border: 0; background: none; color: var(--ink-3); font-size: var(--fs-sm); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--ink); }
.side-title { margin: 8px 4px 4px; color: var(--ink-4); font-size: var(--fs-cap); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.side-rule { height: 1px; margin: 10px 0; background: var(--line); }
.archived-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-1); background: var(--warn-bg); color: var(--warn); font-weight: 700; }

/* Settings and archive */
.panel { margin-bottom: 18px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-4); background: var(--card); }
.panel h2 { margin: 0 0 14px; font-size: var(--fs-lg); }
.list-row { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 0; border-bottom: 1px solid var(--line); }
/* a choice field with many options: the name keeps its width, the options give way in two lines */
.field-row > .grow { flex: 0 0 240px; min-width: 0; }
.field-row > .chip, .field-row > .field-oncard, .field-row > .choice, .field-row > .btn, .field-row > .icon-btn { flex: none; }
.field-oncard { white-space: nowrap; }
.field-options {
  flex: 1 1 0; min-width: 0; overflow: hidden;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.purge-note {
  display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 12px; padding: 10px 12px;
  border-radius: var(--r-2); background: var(--card-2); color: var(--ink-3); font-size: var(--fs-sm);
}
.purge-note .icon { flex: 0 0 auto; margin-top: 2px; }
.list-row:last-child { border-bottom: 0; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .field { max-width: 360px; }
.never {
  display: inline-block; padding: 0 6px; border-radius: var(--r-pill); background: var(--none-bg);
  color: var(--ink-3); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
}
.kind-pill { color: var(--ink-2); }
.external-pill { padding: 0 6px; flex: none; }
.member-row { flex-wrap: wrap; }
.member-row .grow { min-width: 160px; }

/* Rights of a person: the preset's name on the row, the checklist in a popover (rights.js) */
.rights-button { gap: 6px; }
.rights-button .icon:last-child { color: var(--ink-4); }
.rights-plain {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  color: var(--ink-2); font: inherit; font-size: var(--fs-sm); cursor: pointer; white-space: nowrap;
}
.rights-plain .icon { color: var(--ink-4); }
.rights-plain:hover span { text-decoration: underline dotted; text-underline-offset: 3px; }
.rights-plain:focus-visible { outline: 2px solid var(--violet); outline-offset: 2px; border-radius: var(--r-1); }
.rights-note { margin: 0 0 4px; font-size: var(--fs-sm); line-height: 1.4; }
.rights-list { display: grid; gap: 2px; }
.rights-item {
  display: flex; align-items: flex-start; gap: 10px; padding: 6px 8px; border-radius: var(--r-1);
  cursor: pointer;
}
.rights-item:hover { background: var(--hover-tint); }
.rights-item:has(input:disabled) { cursor: default; }
.rights-item:has(input:disabled):hover { background: transparent; }
.rights-item .check { margin-top: 1px; }
.rights-item.inherited { opacity: 0.6; }
.inherit-note { display: flex; align-items: center; gap: 6px; margin: -6px 0 8px; font-size: var(--fs-sm); }
.inherit-note .icon { flex: 0 0 auto; }
.inherit-pill { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; color: var(--ink-2); font-size: var(--fs-sm); }
.rights-text { display: grid; gap: 1px; min-width: 0; }
.rights-text b { font-size: var(--fs-md); font-weight: 600; color: var(--ink); }
.rights-text small { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.35; }
.rights-foot {
  position: sticky; bottom: -12px; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin: 8px -12px -12px; padding: 10px 12px; border-top: 1px solid var(--line);
  background: var(--card);
}
.rights-preset { font-weight: 700; color: var(--ink); }

/* Wide screens: the board does not stretch, extra space stays empty */
@media (min-width: 1920px) {
  .page { max-width: 1440px; }
}

@media (max-width: 720px) {
  :root { --column-w: calc(100vw - 48px); }
  .sh-top .hide-phone, .board-bar .hide-phone { display: none; }
  /* the phone keeps the board bar in one row of icons: the words stay in titles and labels */
  .board-bar { flex-wrap: nowrap; gap: 6px; min-height: 48px; padding: 6px 10px; overflow-x: auto; scrollbar-width: none; }
  .board-bar .bar-text, .bar-rule { display: none; }
  .board-bar-main { flex: 0 0 auto; }
  .board-bar h1 { max-width: 34vw; font-size: var(--fs-base); }
  .board-bar .external-pill { order: -1; }
  .bar-btn { padding: 0 8px; }
  .board-canvas { padding: 12px 16px 16px; gap: 12px; scroll-snap-type: x mandatory; scroll-padding: 0 16px; }
  .column, .add-column { scroll-snap-align: start; }
  .page { padding: 20px 16px 40px; }
  .page-head h1 { font-size: var(--fs-2xl); }
  .icon-btn, .btn { min-height: 44px; }
  .icon-btn { width: 44px; height: 44px; }
  .card-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .card-dialog-body { max-height: 100dvh; }
  .detail.in-dialog { height: 100dvh; max-height: none; }
  .detail-bar { padding: 6px 8px 6px 16px; gap: 6px; }
  .detail-bar .btn { min-height: 36px; }
  .detail-main { padding: 18px 16px 20px; gap: 18px; }
  .detail-talk { padding: 0 16px 16px; }
  .talk-head { margin: 0 -16px; padding: 12px 16px 8px; }
  .detail-actions, .detail-meta, .small-note { padding-left: 0; }
  .section-body { margin-left: 0; }
  .detail-page { margin: 0; border-radius: 0; border: 0; }
  .title-input { font-size: var(--fs-xl); }
  .list-row { flex-wrap: wrap; }
  .field-row > .grow { flex: 1 1 160px; }
  .field-options { flex-basis: 100%; order: 1; }
  .show-phone { display: inline-grid !important; }
}
@media (max-width: 900px) {
  .detail-panes { display: block; }
  .in-dialog .detail-panes { overflow-y: auto; overscroll-behavior: contain; }
  .in-dialog .detail-main, .in-dialog .detail-talk { overflow: visible; }
  .detail-talk { border-left: 0; border-top: 1px solid var(--line); }
  .talk-head { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; }

.progress-bar .w-0 { width: 0%; }
.progress-bar .w-5 { width: 5%; }
.progress-bar .w-10 { width: 10%; }
.progress-bar .w-15 { width: 15%; }
.progress-bar .w-20 { width: 20%; }
.progress-bar .w-25 { width: 25%; }
.progress-bar .w-30 { width: 30%; }
.progress-bar .w-35 { width: 35%; }
.progress-bar .w-40 { width: 40%; }
.progress-bar .w-45 { width: 45%; }
.progress-bar .w-50 { width: 50%; }
.progress-bar .w-55 { width: 55%; }
.progress-bar .w-60 { width: 60%; }
.progress-bar .w-65 { width: 65%; }
.progress-bar .w-70 { width: 70%; }
.progress-bar .w-75 { width: 75%; }
.progress-bar .w-80 { width: 80%; }
.progress-bar .w-85 { width: 85%; }
.progress-bar .w-90 { width: 90%; }
.progress-bar .w-95 { width: 95%; }
.progress-bar .w-100 { width: 100%; }
.field-label { display: grid; gap: 6px; font-size: var(--fs-sm); font-weight: 700; color: var(--ink-3); }
label.swatch { cursor: pointer; }
label.swatch:has(input:checked) { border-color: var(--ink); }
label.swatch:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.pop-item[aria-pressed="true"] { background: var(--chip-on-bg); }
.btn[aria-pressed="true"] { border-color: var(--chip-on-ring); background: var(--chip-on-bg); color: var(--badge-ink); }
.row .grow { flex: 1; min-width: 0; }
.list-row > .label-chip, .list-row > .prio-chip { flex: 0 0 auto; width: 148px; max-width: 36%; }
.list-row > .label-chip.nameless { padding: 0; }
.list-row > .prio-chip > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-item .label-chip.nameless { width: auto; }

/* Card editor: Tiptap 3, the same menus as the wiki editor, tokens only */
.editor-host { min-width: 0; }
.ed {
  position: relative; border: 1px solid var(--line); border-radius: var(--r-1);
  background: var(--input-bg); color: var(--ink);
}
.ed.focused { border-color: var(--chip-on-ring); box-shadow: var(--ring); }
.ed-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px;
  border-bottom: 1px solid var(--line);
}
.ed-tool {
  width: 32px; height: 32px; display: inline-grid; place-items: center;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--ico);
}
.ed-tool:hover { background: var(--hover-tint); color: var(--ink); }
.ed-tool[aria-pressed="true"] { background: var(--chip-on-bg); color: var(--badge-ink); }
.ed-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.ed .i, .ed-menu .i {
  width: 1em; height: 1em; flex: 0 0 auto; font-size: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round;
}
.ed-text {
  min-height: 120px; max-height: 60vh; overflow-y: auto; padding: 10px 12px; outline: none;
  position: relative; white-space: pre-wrap; white-space: break-spaces; word-wrap: break-word;
  font-variant-ligatures: none;
}
[data-comment-editor] .ed-text, [data-edit-editor] .ed-text { min-height: 72px; }
/* a long description grows with the card: one scroll – the card's, the tools stay on top of it */
[data-description-editor] .ed-text { max-height: none; overflow-y: visible; }
[data-description-editor] .ed-bar {
  position: sticky; top: 0; z-index: 2; background: var(--input-bg); border-radius: var(--r-1) var(--r-1) 0 0;
}
/* on the card's own page the page scrolls under the sticky topbar of the shell */
/* the card page clips its corners with overflow: clip, so these stick under the sticky topbar of the shell */
.detail:not(.in-dialog) [data-description-editor] .ed-bar, .detail:not(.in-dialog) .talk-head { top: var(--sh-top-h); }
.ed-text pre { white-space: pre-wrap; }
.ed-text p.is-editor-empty:first-child::before {
  content: attr(data-placeholder); float: left; height: 0; pointer-events: none; color: var(--ink-4);
}
.ed-text .ProseMirror-selectednode { outline: 2px solid var(--chip-on-ring); }
.ed-text .ProseMirror-gapcursor { display: none; pointer-events: none; position: absolute; }
.ed-text.ProseMirror-hideselection *::selection { background: transparent; }
.ed-text a { color: var(--violet-2); text-decoration: underline; }
.ed-text ul[data-type="taskList"] { list-style: none; padding-left: 0; }
.ed-text ul[data-type="taskList"] li { display: flex; align-items: flex-start; gap: 8px; }
.ed-text ul[data-type="taskList"] li > label { flex: 0 0 auto; margin-top: 3px; }
.ed-text ul[data-type="taskList"] li > div { flex: 1; min-width: 0; }
.ed-text ul[data-type="taskList"] input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; margin: 0;
  display: inline-grid; place-items: center; cursor: pointer;
  border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--input-bg);
}
.ed-text ul[data-type="taskList"] input[type="checkbox"]::after {
  content: ""; width: 9px; height: 5px; margin-top: -2px; opacity: 0; transform: rotate(-45deg);
  border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent);
}
.ed-text ul[data-type="taskList"] input[type="checkbox"]:checked { border-color: var(--ok); background: var(--ok); }
.ed-text ul[data-type="taskList"] input[type="checkbox"]:checked::after { opacity: 1; }
.ed-menu, .ed-link {
  position: fixed; left: 0; top: 0; z-index: var(--z-sheet); display: none;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--card);
  box-shadow: var(--shadow); color: var(--ink);
}
.ed-menu.on { display: grid; gap: 1px; width: 260px; max-height: min(420px, 70vh); overflow-y: auto; padding: 6px; }
.ed-link.on { display: flex; align-items: center; gap: 6px; width: min(380px, calc(100vw - 32px)); padding: 8px; }
.ed-menu .mi-t {
  padding: 8px 8px 4px; color: var(--ink-4);
  font-size: var(--fs-cap); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.ed-menu .mi {
  min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 0 8px;
  border: 0; border-radius: var(--r-1); background: transparent; color: var(--ink-2);
  font-size: var(--fs-md); text-align: left;
}
.ed-menu .mi .i { color: var(--ico-soft); }
.ed-menu .mi.on { background: var(--hover-tint); color: var(--ink); }
.ed-menu .mi-l { flex: 1; min-width: 0; }
.ed-menu .k { color: var(--ink-4); font-family: var(--ff-mono); font-size: var(--fs-xs); }
.ed-menu .menu-empty { padding: 10px; color: var(--ink-3); font-size: var(--fs-md); }
.comment-start {
  width: 100%; min-height: 40px; padding: 0 12px; text-align: left;
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--input-bg);
  color: var(--ink-4); font-size: var(--fs-md); cursor: text;
}
.comment-start:hover { border-color: var(--line-strong); }

/* Check items written inside a description or a comment */
.prose ul.tasks { list-style: none; padding-left: 0; }
.prose li.task { display: flex; align-items: flex-start; gap: 8px; }
.prose li.task > div { flex: 1; min-width: 0; }
.task-tick { display: inline-grid; margin-top: 3px; color: var(--ink-4); }
.task-tick .icon { font-size: 16px; }
.prose li.task.done .task-tick { color: var(--ok); }
.prose li.task.done > div { color: var(--ink-3); }

/* Cover image: a field of the card, served by the same rights-checking handler as any file */
.card-cover.image {
  height: auto; overflow: hidden; background: var(--none-bg);
  display: flex; justify-content: center;
}
.card-cover.image img { display: block; width: 100%; max-height: 160px; object-fit: cover; }
.card.full-image .card-cover.image img { max-height: 280px; }
.card.full-image .card-title { font-weight: 800; }
.detail-cover.image { height: auto; display: flex; justify-content: center; background: var(--none-bg); }
.detail-cover.image img { display: block; max-width: 100%; max-height: 240px; object-fit: contain; }
.cover-picks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.cover-pick {
  aspect-ratio: 4 / 3; padding: 0; overflow: hidden; cursor: pointer;
  border: 2px solid transparent; border-radius: var(--r-1); background: var(--none-bg);
}
.cover-pick img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-pick[aria-pressed="true"] { border-color: var(--violet); }
.icon-btn[aria-pressed="true"] { background: var(--chip-on-bg); color: var(--badge-ink); }
.files { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

/* Finger drag: a long press lifts, no callout menu while holding */
.card, .column-head, .fold-strip { -webkit-touch-callout: none; }
.fold-strip { -webkit-user-select: none; user-select: none; }
@media (pointer: coarse) {
  .column-head { -webkit-user-select: none; user-select: none; }
}

/* Our drop-down list (select.js): never the browser's <select> */
.dselect { position: relative; display: inline-block; min-width: 0; width: 100%; }
.dselect-button {
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
}
.dselect-button:disabled { cursor: default; opacity: 0.6; }
.dselect-button .dselect-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dselect-button .dselect-text.placeholder { color: var(--ink-4); }
.dselect-button .icon { font-size: 14px; color: var(--ink-3); transition: transform var(--d1) var(--ease); }
.dselect.open .dselect-button { border-color: var(--chip-on-ring); box-shadow: var(--ring); }
.dselect.open .dselect-button .icon { transform: rotate(180deg); }
.dselect-pop {
  position: fixed; z-index: var(--z-sheet); max-width: min(420px, calc(100vw - 16px));
  display: grid; gap: 6px; padding: 6px;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--card); box-shadow: var(--shadow);
}
.dselect-list { position: relative; max-height: min(320px, 50dvh); overflow-y: auto; margin: 0; padding: 0; list-style: none; outline: none; }
.dselect-list [role="option"] {
  min-height: 34px; display: flex; align-items: center; gap: 10px; padding: 4px 10px;
  border-radius: var(--r-1); color: var(--ink-2); font-size: var(--fs-md); cursor: pointer;
}
.dselect-list [role="option"] .grow { flex: 1; min-width: 0; }
.dselect-list [role="option"] small { color: var(--ink-4); font-size: var(--fs-xs); }
.dselect-list [role="option"].active { background: var(--hover-tint); color: var(--ink); }
.dselect-list [role="option"][aria-disabled="true"] { color: var(--ink-4); cursor: default; }
.dselect-list [role="option"][aria-selected="true"] { color: var(--badge-ink); font-weight: 700; }
.dselect-list [role="option"][aria-selected="true"]::after {
  content: ""; width: 9px; height: 5px; margin: -3px 2px 0 0; flex: 0 0 auto;
  border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg);
}
.dselect-list:focus-visible { box-shadow: none; }
.dselect-list:focus-visible [role="option"].active, .dselect-search:focus ~ .dselect-list [role="option"].active { box-shadow: inset 0 0 0 1px var(--chip-on-ring); }
@media (max-width: 720px) {
  .dselect-list [role="option"] { min-height: 44px; }
}

/* A file is picked with our button: the browser's file input stays hidden */
.file-pick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-pick input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.file-pick .file-name { min-width: 0; color: var(--ink-3); font-size: var(--fs-md); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-pick:focus-within .btn { outline: 2px solid var(--focus); outline-offset: 2px; }
.icon-btn.star[aria-pressed="true"] { background: transparent; }
.icon-btn.star[aria-pressed="true"]:hover { background: var(--hover-tint); }
.icon-btn.visibility { cursor: default; }
.icon-btn.visibility:hover { background: transparent; color: var(--ico); }
.talk-head h3 { white-space: nowrap; font-size: var(--fs-md); }
.talk-head .btn { min-height: 28px; padding: 0 10px; font-size: var(--fs-sm); }
@media (max-width: 640px) { .talk-head .section-head .icon-btn { width: 44px; height: 44px; } }

/* A mention looks the same in a comment, a description and the editor, for every reader */
.prose .mention, .ed-text .mention, .check-item .mention {
  display: inline-block; padding: 0 5px; border-radius: 5px; background: var(--badge-bg); color: var(--badge-ink);
  font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.ed-menu[aria-label="Упомянуть пользователя"].on { max-height: 306px; }
.mention-pick {
  margin-top: 4px; max-height: 260px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--card); box-shadow: var(--shadow);
}
.mention-pick .pop-item[aria-selected="true"] { background: var(--chip-on-bg); }
.check-item .item-main > .mention-pick { flex-basis: 100%; }
.ed-menu[aria-label="Упомянуть пользователя"] .mi-l { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-menu[aria-label="Упомянуть пользователя"] .mi { flex-wrap: wrap; row-gap: 0; padding-top: 4px; padding-bottom: 4px; }
.ed-menu[aria-label="Упомянуть пользователя"] .k { flex-basis: 100%; padding-left: 26px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-menu .mi[aria-disabled="true"] { color: var(--ink-4); cursor: default; }
.ed-menu .mi[aria-disabled="true"] .i { color: var(--ink-4); }
.ed-menu .mi[aria-disabled="true"].on { background: transparent; }
.ed-menu .mi[aria-disabled="true"] .k { font-family: inherit; }
.shot-comment {
  position: absolute; left: 4px; bottom: 4px; max-width: calc(100% - 8px); padding: 1px 7px; overflow: hidden;
  border-radius: var(--r-pill); background: var(--card); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line);
  font-size: var(--fs-xs); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; text-decoration: none;
}
.shot-comment:hover { color: var(--ink); }
.comment.flash .comment-body { animation: comment-flash 2.4s ease-out; }
@keyframes comment-flash { 0%, 55% { background: var(--badge-bg); box-shadow: 0 0 0 2px var(--badge-ink); } }
@media (prefers-reduced-motion: reduce) { .comment.flash .comment-body { animation: none; background: var(--badge-bg); } }

/* Home: a board tile is a thumbnail of the board – its colour, the name on it in white */
.tiles .tile:not(.tile-new) {
  min-height: 96px; border: 0; background: linear-gradient(var(--board-shade), var(--board-shade)), var(--tone-g);
  color: var(--dreams-ink); box-shadow: var(--tile-shadow);
}
.tiles .tile:not(.tile-new)::before { display: none; }
.tiles .tile:not(.tile-new):hover { color: var(--dreams-ink); filter: brightness(1.06); }
.tiles .tile:not(.tile-new) small { color: color-mix(in srgb, var(--dreams-ink) 82%, transparent); }
.tiles .tile:not(.tile-new) b { text-shadow: 0 1px 2px color-mix(in srgb, var(--dreams-obsidian) 35%, transparent); }
@media (max-width: 720px) {
  .detail-bar .hide-phone { display: none; }
  .check-item .icon-btn { width: 36px; height: 36px; min-height: 36px; opacity: 1; }
  .check-item { padding-top: 2px; padding-bottom: 2px; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
  .check-item .item-main { flex: 1 1 calc(100% - 48px); }
  .check-item .item-actions { flex-basis: 100%; justify-content: flex-end; }
}

/* Links between cards: grouped rows in the card, the picker of «Связи» */
.relations { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.rel-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.rel-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; }
.rel-count { color: var(--ink-3); letter-spacing: 0; text-transform: none; font-weight: 700; }
.rel-progress { flex: none; height: 6px; margin: 0 0 4px; }
.relation {
  display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 4px 2px 6px;
  border-radius: var(--r-1);
}
.relation:hover { background: var(--hover-tint); }
.relation .type-icon { width: 22px; height: 22px; font-size: 13px; }
.relation.done .type-icon { background: var(--ok); }
.relation .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-link {
  flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px;
  color: var(--ink); text-decoration: none; overflow: hidden;
}
.rel-link:hover .rel-title { text-decoration: underline; }
.rel-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; border-radius: 4px; }
.rel-ref, .relate-ref { flex: none; color: var(--ink-3); font-family: var(--ff-mono); font-size: var(--fs-xs); }
.rel-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relation.done .rel-title { color: var(--ink-3); text-decoration: line-through; }
.rel-board { flex: none; max-width: 30%; color: var(--ink-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rel-where { flex: none; max-width: 40%; min-height: 22px; padding: 0 8px; font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; }
.rel-where.done { background: var(--ok-bg); color: var(--ok); }
.relation .icon-btn { width: 28px; height: 28px; flex: none; }
.relation.undo { background: var(--none-bg); }
.relation.undo .btn { min-height: 28px; padding: 0 10px; }
.detail-back { color: var(--ink-2); }
.detail-back .icon { font-size: 16px; }

.pop.relate-pop { width: 440px; }
.relate { display: grid; gap: 8px; }
.relate-kinds { display: flex; gap: 6px; align-items: center; }
.relate-kinds .dselect { flex: 1; min-width: 0; }
.relate-kinds .dselect-button { min-height: 32px; }
.relate-quick { flex: none; min-height: 32px; padding: 0 10px; }
.relate-quick .icon { font-size: 14px; }
.relate-quick[aria-pressed="true"] { border-color: var(--chip-on-ring); background: var(--chip-on-bg); color: var(--badge-ink); }
.relate-list { max-height: min(340px, 46dvh); overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.relate-group {
  padding: 8px 8px 4px; color: var(--ink-4); font-size: var(--fs-cap); font-weight: 800;
  letter-spacing: 0.08em; text-transform: uppercase;
}
.relate-option {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 4px 8px;
  border-radius: var(--r-1); color: var(--ink-2); cursor: pointer;
}
.relate-option.active { background: var(--hover-tint); color: var(--ink); box-shadow: inset 0 0 0 1px var(--chip-on-ring); }
.relate-option .type-icon { width: 22px; height: 22px; font-size: 13px; }
.relate-option.done .type-icon { background: var(--ok); }
.relate-option.create .type-icon { background: var(--chip-on-bg); color: var(--badge-ink); }
.relate-option.create { color: var(--badge-ink); font-weight: 700; }
.relate-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.relate-line { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.relate-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relate-option.done .relate-title { color: var(--ink-3); text-decoration: line-through; }
.relate-text small { color: var(--ink-4); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relate-priority { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; }
.relate-where-box { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.relate-where { flex: 1 1 200px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; color: var(--ink-3); font-size: var(--fs-sm); }
.relate-where > span { flex: none; }
.relate-where .dselect { flex: 1 1 120px; min-width: 0; }
.relate-where .dselect-button { min-height: 30px; }
.relate-note { margin: 0; color: var(--ink-3); font-size: var(--fs-sm); }
.relate-note:empty { display: none; }
.relate-hint { margin: 0; color: var(--ink-4); font-size: var(--fs-xs); }
@media (max-width: 720px) {
  .relate-kinds { flex-wrap: wrap; }
  .relate-kinds .dselect { flex-basis: 100%; }
  .relation .icon-btn { width: 36px; height: 36px; }
  .rel-where { max-width: 34%; }
  .rel-board, .rel-add .btn-label, .relate-hint { display: none; }
  .detail-bar .detail-back { min-width: 0; padding: 0 4px; margin-left: -8px; }
  /* the way back takes the cover button's place; the cover stays in «Добавить» */
  .detail-bar:has(.detail-back) [data-action="cover"] { display: none; }
}
.git-copy { flex-wrap: nowrap; gap: 6px; }
.git-copy .field { flex: 1; min-width: 0; font-family: var(--ff-mono); font-size: var(--fs-sm); }
.git-steps { margin: 0; padding-left: 20px; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }
.git-hook-pop { width: min(520px, calc(100vw - 32px)); }
.git-repo a { color: inherit; }
.stack.tight { gap: 4px; }
[data-git] > fieldset { margin-top: 12px; }

/* Pictures of a card: a grid of previews, the full-screen viewer, a card that takes a dropped file */
.shots-section { margin-top: -4px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.shot {
  position: relative; min-width: 0; margin: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-2); background: var(--none-bg);
}
.shot-open { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; aspect-ratio: 4 / 3; }
.shot-open img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s ease; }
.shot-open:hover img, .shot-open:focus-visible img { transform: scale(1.04); }
.shot-delete {
  position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; opacity: 0;
  background: var(--card); color: var(--ink); border-color: var(--line);
}
.shot:hover .shot-delete, .shot:focus-within .shot-delete { opacity: 1; }
@media (hover: none) { .shot-delete { opacity: 1; } }
.prose .doc-image img { cursor: zoom-in; }
.detail.dropping { outline: 2px dashed var(--violet); outline-offset: -6px; }
.attach-drop {
  width: 100%; min-height: 84px; display: grid; justify-items: center; align-content: center; gap: 6px;
  padding: 12px; border: 2px dashed var(--line-strong); border-radius: var(--r-3); background: transparent;
  color: var(--ink-2); font: inherit; font-size: var(--fs-sm); text-align: center; cursor: pointer;
}
.attach-drop .icon { font-size: 20px; color: var(--ico); }
.attach-drop:hover, .attach-drop.over { border-color: var(--violet); background: var(--badge-bg); color: var(--ink); }

.viewer {
  width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  background: var(--bg); color: var(--ink);
}
.viewer:not([open]) { display: none; }
.viewer::backdrop { background: var(--scrim); }
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; }
.viewer-title { display: grid; flex: 1; min-width: 0; }
.viewer-title b { overflow: hidden; font-size: var(--fs-md); font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.viewer-title small { color: var(--ink-4); font-size: var(--fs-xs); }
.viewer-body { position: relative; display: flex; align-items: center; gap: 8px; min-height: 0; padding: 0 8px; }
.viewer-stage { position: relative; flex: 1; align-self: stretch; min-width: 0; overflow: hidden; touch-action: pan-y; }
.viewer-image {
  position: absolute; inset: 0; display: block; max-width: 100%; max-height: 100%; margin: auto;
  border-radius: var(--r-1); cursor: zoom-in; user-select: none;
}
.viewer-stage.zoomed { overflow: auto; touch-action: auto; }
.viewer-stage.zoomed .viewer-image { position: static; max-width: none; max-height: none; margin: 0; cursor: zoom-out; border-radius: 0; }
.viewer-nav {
  width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; font-size: 22px;
  border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink);
}
.viewer-nav:hover { background: var(--card-2); }
.viewer-strip { display: flex; justify-content: center; gap: 6px; padding: 10px 14px 14px; overflow-x: auto; }
.viewer-thumb {
  width: 64px; height: 44px; flex: 0 0 auto; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: var(--r-1); background: var(--none-bg); opacity: 0.6;
}
.viewer-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.viewer-thumb[aria-current="true"] { border-color: var(--violet); opacity: 1; }
.viewer-thumb:hover { opacity: 1; }
@media (max-width: 720px) {
  .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .viewer-nav { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); }
  .viewer-nav.prev { left: 8px; }
  .viewer-nav.next { right: 8px; }
  .viewer .hide-phone { display: none; }
}

.person-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.person-row:last-child { border-bottom: 0; }
.person-row > .icon { color: var(--ink-4); }
.person-copy { display: grid; min-width: 160px; flex: 1; }
.person-row.merged { color: var(--ok); font-weight: 700; }

/* Pictures of boards and workspaces: the picker in the settings, the crop dialog, the marks */
.icon-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.icon-pick-face { flex: none; width: 44px; height: 44px; border-radius: 10px; object-fit: cover; }
span.icon-pick-face { background: var(--tone-g); }
.icon-pick-problem, .crop-problem { flex-basis: 100%; margin: 0; color: var(--bad); font-size: var(--fs-sm); font-weight: 700; }
.icon-pick-problem[hidden], .crop-problem[hidden] { display: none; }
.crop-dialog {
  width: min(360px, calc(100vw - 32px)); padding: 22px;
  border: 1px solid var(--line); border-radius: var(--r-4);
  background: var(--card); color: var(--ink); box-shadow: var(--shadow);
}
.crop-dialog[open] { display: grid; gap: 14px; }
.crop-dialog::backdrop { background: var(--scrim); }
.crop-dialog h2 { margin: 0; font-size: var(--fs-xl); }
.crop-dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.crop-frame {
  position: relative; width: 256px; height: 256px; margin: 0 auto; overflow: hidden;
  background: var(--card-2); border-radius: 14px; cursor: grab; touch-action: none; user-select: none;
}
.crop-frame:active { cursor: grabbing; }
.crop-picture { position: absolute; max-width: none; pointer-events: none; }
.crop-mask {
  position: absolute; inset: 0; border-radius: 22%; pointer-events: none;
  box-shadow: 0 0 0 2px var(--card), 0 0 0 999px var(--scrim);
}
.crop-zoom { display: flex; align-items: center; gap: 10px; }
.crop-track { position: relative; flex: 1; min-width: 0; height: 24px; cursor: pointer; touch-action: none; }
.crop-rail, .crop-fill { position: absolute; top: 50%; left: 0; height: 4px; transform: translateY(-50%); border-radius: var(--r-pill); }
.crop-rail { right: 0; background: var(--line-strong); }
.crop-fill { background: var(--violet); }
.crop-thumb {
  position: absolute; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%);
  border: 2px solid var(--violet); border-radius: 50%; background: var(--card);
}
img.board-mark { width: 16px; height: 16px; border-radius: 4px; object-fit: cover; background: none; }
img.space-mark { width: 18px; height: 18px; border-radius: 5px; object-fit: cover; background: none; }
.ws-head img.space-mark { width: 22px; height: 22px; border-radius: 6px; }
.bar-mark { flex: none; width: 22px; height: 22px; border-radius: 6px; object-fit: cover; }
span.bar-mark { background: var(--tone-g); }
@media (max-width: 480px) { .bar-mark { display: none; } }

/* a link to a card in a text: the card itself, as in Trello (card.js showLinkedCards) */
.prose a.card-ref {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 1px 6px; vertical-align: baseline;
  border: 1px solid var(--line); border-radius: var(--r-1); background: var(--card-2); text-decoration: none;
}
.prose a.card-ref .icon { flex: none; font-size: 14px; color: var(--ink-3); }
.prose a.card-ref.done .icon { color: var(--ok); }
.card-ref-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-ref-column {
  flex: none; min-width: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 6px; border-radius: var(--r-1); background: var(--none-bg); color: var(--ink-2);
  font-size: var(--fs-cap); font-weight: 700;
}
.label-group { margin-top: 8px; }
.label-group-head { margin: 12px 0 2px; color: var(--ink-4); font-size: var(--fs-cap); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.list-row.label-group-head { margin: 0; text-transform: none; letter-spacing: 0; }
.label-group-pick { flex: 0 0 180px; max-width: 40%; }
.card-labels .label-gap { flex: 0 0 8px; height: 1px; }
.lv-labels .label-gap { display: inline-block; width: 8px; }
.label-group-title { margin: 8px 0 2px; }
.space-outside { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0; font-size: var(--fs-sm); }
