/* Трекер — визуальная система. Ориентир: Linear. Токены → база → оболочка → экраны. */
:root {
  color-scheme: light;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --bg: #F7F7F8;            /* фон приложения */
  --side: #F0F0F2;          /* сайдбар, чуть темнее */
  --surface: #FFFFFF;       /* карточки, панели */
  --surface-2: #F3F3F5;     /* ховер, вложенные поверхности */
  --surface-3: #E9E9EC;     /* активные */
  --line: #E4E4E8;
  --line-2: #D4D4DA;
  --tx: #1B1B1F;
  --tx-2: #55555E;
  --tx-3: #8A8A94;
  --acc: #5E6AD2;
  --acc-h: #4F5BC4;
  --acc-soft: #EEF0FB;
  --on-acc: #FFFFFF;
  --on-status: #FFFFFF;
  --ok: #2E9B5F;
  --warn: #C98A15;
  --danger: #D64545;
  --violet: #8C5CD6;
  --st-wish: #9A9AA4;
  --st-backlog: #6F7A8C;
  --st-planning: #7A6BD0;
  --st-clarify: #C97A15;
  --st-returned: #D64545;
  --st-progress: #D9A400;
  --st-review: #5E6AD2;
  --st-done: #2E9B5F;
  --st-rejected: #D64545;
  --shadow-1: 0 1px 2px rgba(20, 20, 30, .06);
  --shadow-2: 0 4px 16px -2px rgba(20, 20, 30, .12), 0 1px 3px rgba(20, 20, 30, .08);
  --shadow-3: 0 16px 48px -8px rgba(20, 20, 30, .25), 0 2px 6px rgba(20, 20, 30, .1);
  --r-1: 4px; --r-2: 6px; --r-3: 8px; --r-4: 10px;
  --side-w: 232px;
  --panel-w: 580px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
:root[data-theme="dark"], :root:not([data-theme="light"]):has(body) { }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17171A; --side: #131316; --surface: #1E1E22; --surface-2: #26262B; --surface-3: #2E2E34;
    --line: #2A2A30; --line-2: #3A3A42; --tx: #ECECEE; --tx-2: #A7A7B0; --tx-3: #6E6E78;
    --acc: #7B85E0; --acc-h: #8D96E8; --acc-soft: #262A48; --on-acc: #FFFFFF; --on-status: #17171A;
    --ok: #4CBF7E; --warn: #E0B23A; --danger: #E5655F; --violet: #A98BE8;
    --st-wish: #6E6E78; --st-backlog: #8A94A8; --st-planning: #9B8DE8; --st-clarify: #E0A24A; --st-returned: #E5655F; --st-progress: #E0B23A; --st-review: #7B85E0; --st-done: #4CBF7E; --st-rejected: #E5655F;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 16px -2px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4); --shadow-3: 0 16px 48px -8px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  --bg: #17171A; --side: #131316; --surface: #1E1E22; --surface-2: #26262B; --surface-3: #2E2E34;
  --line: #2A2A30; --line-2: #3A3A42; --tx: #ECECEE; --tx-2: #A7A7B0; --tx-3: #6E6E78;
  --acc: #7B85E0; --acc-h: #8D96E8; --acc-soft: #262A48; --on-acc: #FFFFFF; --on-status: #17171A;
  --ok: #4CBF7E; --warn: #E0B23A; --danger: #E5655F; --violet: #A98BE8;
  --st-wish: #6E6E78; --st-backlog: #8A94A8; --st-planning: #9B8DE8; --st-clarify: #E0A24A; --st-returned: #E5655F; --st-progress: #E0B23A; --st-review: #7B85E0; --st-done: #4CBF7E; --st-rejected: #E5655F;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 4px 16px -2px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4); --shadow-3: 0 16px 48px -8px rgba(0, 0, 0, .7), 0 2px 6px rgba(0, 0, 0, .4);
}

/* ---------- база ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; height: 100%; font: 13px/1.45 var(--font); color: var(--tx); background: var(--bg); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow: hidden; }
body.auth { overflow: auto; }
::selection { background: color-mix(in srgb, var(--acc) 28%, transparent); }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-track { background: transparent; }
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; border-radius: var(--r-1); }
svg { width: 16px; height: 16px; flex: none; }
kbd { font: 11px/1 var(--font); color: var(--tx-3); border: 1px solid var(--line); border-radius: 3px; padding: 2px 4px; background: var(--surface); }
.mono { font-family: var(--mono); font-size: .93em; letter-spacing: -.01em; }
.muted { color: var(--tx-3); }
.small { font-size: 12px; }
.danger { color: var(--danger); }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.sp { flex: 1; }
.flip svg { transform: scaleX(-1); }
.hint { font-size: 12px; color: var(--tx-3); line-height: 1.5; margin-top: 8px; }
[hidden] { display: none !important; }

/* ---------- контролы ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--surface); color: var(--tx); font-weight: 500; white-space: nowrap; transition: background .12s, border-color .12s, color .12s; box-shadow: var(--shadow-1); }
.btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn:active { background: var(--surface-3); }
.btn:disabled { opacity: .55; cursor: default; box-shadow: none; }
.btn.busy { position: relative; color: transparent; }
.btn.busy::after { content: ''; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid currentColor; border-color: var(--tx-3) transparent var(--tx-3) transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary.busy::after { border-color: var(--on-acc) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn-lg { height: 38px; font-size: 14px; justify-content: center; }
.btn-primary { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.btn-primary:hover { background: var(--acc-h); border-color: var(--acc-h); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(.94); background: var(--danger); }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-ghost.danger:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn.on { background: var(--acc-soft); border-color: color-mix(in srgb, var(--acc) 40%, var(--line-2)); color: var(--acc); }
.btn kbd { margin-left: 2px; }
.btn-primary kbd { color: var(--on-acc); border-color: rgba(255, 255, 255, .35); background: transparent; }
.ib { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--r-2); color: var(--tx-2); transition: background .12s, color .12s; flex: none; }
.ib:hover { background: var(--surface-2); color: var(--tx); }
.ib.xs { width: 22px; height: 22px; }
.ib.xs svg { width: 13px; height: 13px; }
.ib.danger:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.in { width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-2); background: var(--surface); color: var(--tx); transition: border-color .12s, box-shadow .12s; }
.in::placeholder { color: var(--tx-3); }
.in:hover { border-color: color-mix(in srgb, var(--tx-3) 60%, var(--line-2)); }
.in:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent); }
.in:disabled { background: var(--surface-2); color: var(--tx-2); }
.in-sm { height: 28px; font-size: 12.5px; }
textarea.in { height: auto; padding: 7px 10px; resize: vertical; line-height: 1.45; min-height: 32px; }
select.in { padding-right: 26px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8A94' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
input[type="date"].in { min-width: 140px; }
.in-wrap { position: relative; display: flex; align-items: center; }
.in-wrap .in { padding-right: 32px; }
.in-eye { position: absolute; right: 4px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; color: var(--tx-3); border-radius: var(--r-1); }
.in-eye:hover { color: var(--tx); }
.in-search i { position: absolute; left: 9px; display: inline-flex; color: var(--tx-3); pointer-events: none; }
.in-search i svg { width: 14px; height: 14px; }
.in-search .in { padding-left: 28px; padding-right: 10px; width: 220px; }
.fld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fld > span { font-size: 12px; font-weight: 500; color: var(--tx-2); }
.fld-row { display: flex; gap: 12px; }
.fld-row .fld { min-width: 0; }
.fld.grow { flex: 1; }
.fld.w-key { width: 96px; }
.fld-hr { border-top: 1px solid var(--line); margin: 4px 0 16px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 4px 12px; max-height: 180px; overflow: auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); }
.checks.tall { max-height: 260px; }
.chk { display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }
.chk input { accent-color: var(--acc); width: 15px; height: 15px; margin: 0; }
.chk-line { margin-top: 4px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; height: 28px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 30px; height: 18px; border-radius: 9px; background: var(--line-2); position: relative; transition: background .15s; }
.switch i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .15s var(--ease); }
.switch input:checked + i { background: var(--warn); }
.switch input:checked + i::after { transform: translateX(12px); }
.switch input:focus-visible + i { outline: 2px solid var(--acc); outline-offset: 2px; }
.swatches { display: flex; gap: 8px; }
.sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw i { display: block; width: 24px; height: 24px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: transform .12s; }
.sw input:checked + i { border-color: var(--tx); transform: scale(1.1); }
.sw input:focus-visible + i { outline: 2px solid var(--acc); outline-offset: 2px; }

/* чипы, бейджи, аватары */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 10px; font-size: 11.5px; font-weight: 500; color: var(--tx-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }
.chip.sm { height: 18px; padding: 0 6px; font-size: 11px; }
.chip svg { width: 12px; height: 12px; }
.chip.acc { color: var(--acc); background: var(--acc-soft); border-color: transparent; }
.chip.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); border-color: transparent; }
.chip.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: transparent; }
.chip.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: transparent; }
.chip.st-progress { color: color-mix(in srgb, var(--st-progress) 70%, var(--tx)); background: color-mix(in srgb, var(--st-progress) 16%, transparent); border-color: transparent; }
.chip.ty-bug { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: transparent; }
.chip.ty-feature { color: var(--acc); background: var(--acc-soft); border-color: transparent; }
.chip.ty-design { color: var(--violet); background: color-mix(in srgb, var(--violet) 12%, transparent); border-color: transparent; }
.chip.ty-content { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: transparent; }
.chip.ty-deploy { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); border-color: transparent; }
.tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font-size: 11px; font-weight: 500; color: hsl(var(--h) 45% 35%); background: hsl(var(--h) 60% 92%); }
:root[data-theme="dark"] .tag { color: hsl(var(--h) 60% 78%); background: hsl(var(--h) 30% 22%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tag { color: hsl(var(--h) 60% 78%); background: hsl(var(--h) 30% 22%); } }
.av { display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 50%; font-weight: 600; color: hsl(var(--h) 45% 30%); background: hsl(var(--h) 55% 86%); letter-spacing: 0; }
:root[data-theme="dark"] .av { color: hsl(var(--h) 60% 85%); background: hsl(var(--h) 35% 30%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av { color: hsl(var(--h) 60% 85%); background: hsl(var(--h) 35% 30%); } }
.av-xs { width: 18px; height: 18px; font-size: 8px; }
.av-sm { width: 24px; height: 24px; font-size: 10px; }
.av-md { width: 32px; height: 32px; font-size: 12px; }
.av-none { color: var(--tx-3); background: transparent; border: 1px dashed var(--line-2); }
.av-none svg { width: 60%; height: 60%; }
.pkey { display: inline-flex; align-items: center; height: 18px; padding: 0 5px; border-radius: 4px; font: 600 10.5px/1 var(--mono); letter-spacing: .02em; color: var(--tx-2); background: var(--surface-3); flex: none; }
.pkey.lg { height: 22px; padding: 0 7px; font-size: 12px; }
.ref { color: var(--tx-3); font-weight: 500; flex: none; }
.ref.lg { font-size: 13px; color: var(--tx-2); }
/* Прежний номер задачи (до переноса в другой проект) — тише текущего, но на виду */
.ref.prev { font-size: 11.5px; color: var(--tx-3); padding: 1px 5px; border-radius: var(--r-1); background: var(--surface-2); text-decoration: line-through; }
.sti { width: 15px; height: 15px; flex: none; }
.pri { width: 14px; height: 14px; flex: none; }
.pri rect { fill: var(--line-2); }
.pri rect.on { fill: var(--tx-2); }
/* Цветом выделены только срочный и высокий: если красить все четыре, цвет перестаёт
   что-либо значить и приоритет снова приходится вычитывать. */
.pri.urgent rect.on { fill: var(--danger); }
.pri.high rect.on { fill: var(--warn); }
.cnt { font-size: 11.5px; font-weight: 500; color: var(--tx-3); background: var(--surface-3); border-radius: 9px; padding: 1px 6px; margin-left: 6px; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--tx-2); white-space: nowrap; }
.due svg { width: 12px; height: 12px; }
.due.danger { color: var(--danger); font-weight: 500; }
.due.warn { color: var(--warn); font-weight: 500; }
.due.muted { color: var(--tx-3); }
.meta { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; color: var(--tx-3); }
.meta svg { width: 12px; height: 12px; }
.meta.ok { color: var(--ok); }
.meta.warn { color: var(--warn); }
.col-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--cc, var(--tx-3)); flex: none; margin: 0 3px; }

/* ---------- тосты ---------- */
#toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 900; pointer-events: none; }
#pushes { position: fixed; right: 16px; bottom: 16px; z-index: 900; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-height: calc(100dvh - 32px); }
.push-stack { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; min-height: 0; overflow-y: auto; overscroll-behavior: contain; pointer-events: none; }
.push-all { pointer-events: auto; flex: none; box-shadow: var(--shadow-2); }
.push { pointer-events: auto; flex: none; display: flex; align-items: flex-start; text-align: left; max-width: min(360px, calc(100vw - 32px)); border-radius: var(--r-3); background: var(--surface); color: var(--tx); border: 1px solid var(--line); border-left: 3px solid var(--acc); box-shadow: var(--shadow-2); opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s var(--ease); }
.push-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 4px 10px 12px; }
.push-x { margin: 6px 6px 0 0; }
.push-x:hover { background: var(--surface-3); }
.push-wish { border-left-color: var(--st-wish); }
.push-backlog { border-left-color: var(--st-backlog); }
.push-clarify { border-left-color: var(--st-clarify); }
.push-in_progress { border-left-color: var(--st-progress); }
.push-review { border-left-color: var(--st-review); }
.push-returned { border-left-color: var(--st-returned); }
.push-done { border-left-color: var(--st-done); }
.push-rejected { border-left-color: var(--st-rejected); }
.push.on { opacity: 1; transform: none; }
.push b { font-weight: 600; word-break: break-word; }
.push span { color: var(--tx-2); font-weight: 400; }
.push:hover { background: var(--surface-2); }
.toast { padding: 9px 14px; border-radius: var(--r-3); background: var(--tx); color: var(--bg); font-weight: 500; box-shadow: var(--shadow-2); opacity: 0; transform: translateY(8px); transition: opacity .18s, transform .18s var(--ease); max-width: min(520px, 90vw); }
.toast.on { opacity: 1; transform: none; }
.toast.err { background: var(--danger); color: #fff; }

/* ---------- слои ---------- */
.ov { position: fixed; inset: 0; z-index: 500; background: rgba(10, 10, 14, .38); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; opacity: 0; transition: opacity .14s; overflow: auto; }
.ov.on { opacity: 1; }
.ov.out { opacity: 0; }
.dlg { width: 100%; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-4); box-shadow: var(--shadow-3); transform: translateY(6px) scale(.985); transition: transform .16s var(--ease); }
.ov.on .dlg { transform: none; }
.dlg-sm { max-width: 420px; }
.dlg-md { max-width: 640px; }
.dlg-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 10px; }
.dlg-h h3 { font-size: 15px; font-weight: 600; flex: 1; }
.dlg-h-acts { display: flex; align-items: center; gap: 6px; }
.dlg-b { padding: 4px 16px 6px; }
.dlg-b p { color: var(--tx-2); line-height: 1.5; }
/* Вложения в модалке «Вернуть»: скрепка под полем, рамка при перетаскивании — как у комментария */
.ret-attach { display: flex; align-items: center; gap: 6px; margin: 4px 0 2px; }
#rf.dropping { box-shadow: 0 0 0 2px var(--acc); border-radius: var(--r-2); }
.dlg-f { display: flex; align-items: center; gap: 8px; padding: 10px 16px 14px; justify-content: flex-end; }
.dlg-f .sp { flex: 1; }
.menu-pop { position: fixed; z-index: 700; min-width: 180px; max-width: 320px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-3); box-shadow: var(--shadow-2); animation: pop .12s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-3px); } }
.menu-it { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border-radius: var(--r-1); text-align: left; color: var(--tx); font-weight: 450; }
.menu-it .mi-t { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-it .mi-t > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-it em { font-style: normal; color: var(--tx-3); margin-left: auto; }
.menu-it .mi-sub { margin-left: auto; padding-left: 8px; color: var(--tx-3); font-size: 11.5px; flex: none; }
.menu-it:hover, .menu-it:focus-visible { background: var(--surface-2); outline: 0; }
.menu-it > svg:first-child, .menu-it > .av { color: var(--tx-2); }
.menu-it .mi-check { color: var(--acc); margin-left: auto; flex: none; }
.menu-it.sel { color: var(--tx); }
.menu-it.danger { color: var(--danger); }
.menu-it.danger > svg:first-child { color: var(--danger); }
.menu-hr { border-top: 1px solid var(--line); margin: 4px 0; }
.menu-head { font-size: 11px; font-weight: 500; color: var(--tx-3); padding: 6px 8px 3px; text-transform: none; }
.menu-search { width: 100%; height: 30px; padding: 0 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; margin-bottom: 4px; outline: 0; }
.menu-list { max-height: 300px; overflow: auto; }
.menu-empty { padding: 10px 8px; color: var(--tx-3); }
.pick .menu-it { gap: 8px; }
.pick .menu-it .sti, .pick .menu-it .pri, .pick .menu-it .av, .pick .menu-it .col-dot { flex: none; }

/* ---------- вход ---------- */
body.auth { display: flex; align-items: center; justify-content: center; background: var(--side); }
.auth-wrap { width: 100%; max-width: 360px; padding: 24px; }
.auth-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-4); padding: 28px 28px 24px; box-shadow: var(--shadow-2); }
.auth-logo { margin-bottom: 14px; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 7px; background: var(--acc); color: #fff; font-weight: 700; font-size: 15px; }
.auth-card h1 { font-size: 18px; font-weight: 600; margin-bottom: 18px; letter-spacing: -.01em; }
.auth-err { color: var(--danger); font-size: 12.5px; margin: -6px 0 12px; }
.auth-card .btn-lg { margin-top: 4px; }

/* ---------- оболочка ---------- */
body.app #app { display: flex; height: 100%; }
.side { width: var(--side-w); flex: none; height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--side); border-right: 1px solid var(--line); }
.side-top { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 14px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--tx); font-weight: 600; font-size: 14px; }
.brand:hover { text-decoration: none; }
.brand .logo-mark { width: 22px; height: 22px; font-size: 12px; border-radius: 6px; }
.side-close { display: none; margin-left: auto; }
.side-search { padding: 2px 10px 8px; }
.search-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 30px; padding: 0 8px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); color: var(--tx-3); box-shadow: var(--shadow-1); }
.search-btn:hover { color: var(--tx-2); background: var(--surface-2); }
.search-btn span { flex: 1; text-align: left; }
.nav { display: flex; flex-direction: column; gap: 1px; padding: 4px 8px; }
.nav-it { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--r-2); color: var(--tx-2); font-weight: 500; }
.nav-it:hover { background: var(--surface-3); color: var(--tx); text-decoration: none; }
.nav-it.on { background: var(--surface); color: var(--tx); box-shadow: var(--shadow-1); }
.nav-it svg { color: var(--tx-3); }
.nav-it.on svg { color: var(--acc); }
.nav-it > span:not(.pkey):not(.nav-n) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-n { font-size: 11px; color: var(--tx-3); font-weight: 500; }
.nav-n.danger { color: var(--danger); }
.nav-empty { padding: 6px 8px; color: var(--tx-3); font-size: 12px; }
.side-sec { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 2px 16px; font-size: 11.5px; font-weight: 600; color: var(--tx-3); }
.side-sec .ib { width: 22px; height: 22px; }
.nav-proj { flex: 1; overflow: auto; min-height: 0; }
.side-foot { padding: 8px; border-top: 1px solid var(--line); }
.user-btn { display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 6px; border-radius: var(--r-2); color: var(--tx); }
.user-btn:hover { background: var(--surface-3); }
.user-n { flex: 1; text-align: left; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-btn > svg { color: var(--tx-3); }
.side-bg { display: none; }
.main { flex: 1; min-width: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--bg); flex: none; }
.top-menu { display: none; }
.crumbs { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; font-weight: 500; }
.crumbs a { color: var(--tx-3); }
.crumbs a:hover { color: var(--tx); text-decoration: none; }
.crumbs .cur { color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs .sep { display: inline-flex; color: var(--tx-3); }
.crumbs .sep svg { width: 13px; height: 13px; }
.top-acts { display: flex; align-items: center; gap: 8px; }
#bellBtn { position: relative; }
#bellBtn .dot { position: absolute; top: 5px; right: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--acc); border: 1.5px solid var(--bg); }
.view { flex: 1; min-height: 0; overflow: auto; position: relative; display: flex; flex-direction: column; }
.page { padding: 20px 24px 40px; width: 100%; }
/* Ограничение ширины осталось только у формы настроек: поля ввода во весь широкий
   монитор заполнять неудобно. Остальные страницы занимают всё доступное место. */
.page.narrow { max-width: 720px; }
/* Страница, на которой кроме заглушки ничего нет: растягиваем её на всю высоту,
   чтобы заглушка встала по центру свободной области, а не прижималась к верху. */
.page-hollow { max-width: none; min-height: 100%; display: flex; flex-direction: column; }
.page-hollow .empty { flex: 1; justify-content: center; padding-block: 24px; }
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 56px 20px; color: var(--tx-2); gap: 6px; }
.empty > svg { width: 28px; height: 28px; color: var(--tx-3); margin-bottom: 6px; }
.empty h3 { font-size: 15px; font-weight: 600; color: var(--tx); }
.empty p { max-width: 42ch; line-height: 1.5; }
.empty .btn { margin-top: 10px; }
.skeleton-rows { height: 200px; border-radius: var(--r-3); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 40%, var(--surface-2) 55%); background-size: 300% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -300% 0; } }
.bar { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- поиск и «что нового» ---------- */
.dlg-search { max-width: 620px; overflow: hidden; }
.search-in { display: flex; align-items: center; gap: 10px; padding: 0 14px; height: 48px; border-bottom: 1px solid var(--line); color: var(--tx-3); }
.search-in input { flex: 1; height: 100%; border: 0; background: transparent; font-size: 14px; outline: 0; color: var(--tx); }
.search-res { max-height: 60vh; overflow: auto; padding: 6px; }
.search-hint { padding: 16px 12px; color: var(--tx-3); }
.sg-h { padding: 8px 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--tx-3); }
.sr { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; padding: 7px 10px; border-radius: var(--r-2); color: var(--tx); }
.sr:hover, .sr:focus-visible { background: var(--surface-2); text-decoration: none; outline: 0; }
.sr b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr span { color: var(--tx-3); font-size: 12px; white-space: nowrap; }
.sr em { grid-column: 1 / -1; font-style: normal; color: var(--tx-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif { max-height: 60vh; overflow: auto; padding: 0 8px 8px; }
.nrow { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border-radius: var(--r-2); color: var(--tx); }
.nrow:hover { background: var(--surface-2); }
.nrow-go { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; color: inherit; }
.nrow-go:hover { text-decoration: none; }
.notif-bar { display: flex; gap: 6px; padding: 0 16px 10px; }
.nrow-read .nrow-t { font-weight: 400; color: var(--tx-3); }
.nrow-read .nrow-s, .nrow-read time { color: var(--tx-3); }
.nrow-one { flex: none; align-self: center; }
.nrow .sti { margin-top: 2px; }
.nrow-b { flex: 1; min-width: 0; }
.nrow-t { font-weight: 500; }
.nrow-s { color: var(--tx-2); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nrow time { color: var(--tx-3); font-size: 11.5px; white-space: nowrap; }

/* ---------- проекты ---------- */
.plist { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.plist-h, .prow { display: grid; grid-template-columns: 44px minmax(200px, 1fr) 120px 60px minmax(120px, auto) 90px; gap: 12px; align-items: center; padding: 0 14px; }
.plist-h { height: 34px; font-size: 11.5px; font-weight: 600; color: var(--tx-3); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.prow { min-height: 52px; padding-top: 8px; padding-bottom: 8px; color: var(--tx); border-bottom: 1px solid var(--line); }
.prow:last-child { border-bottom: 0; }
.prow:hover { background: var(--surface-2); text-decoration: none; }
.prow-main { display: flex; flex-direction: column; min-width: 0; }
.prow-main b { font-weight: 600; }
.prow-d { color: var(--tx-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prow-bar { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.prow-bar i { display: block; height: 100%; background: var(--ok); border-radius: 3px; }
.prow-n { font-weight: 600; text-align: right; }
.prow-meta { display: flex; gap: 4px; flex-wrap: wrap; }
.prow-act { color: var(--tx-3); font-size: 12px; text-align: right; white-space: nowrap; }
.arch { margin-top: 16px; }
.arch summary { cursor: pointer; color: var(--tx-3); font-weight: 500; padding: 6px 0; margin-bottom: 8px; }

/* ---------- список задач ---------- */
.tl-sec { margin-bottom: 22px; }
.tl-sec h2 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; height: 32px; padding: 0 8px; margin-bottom: 2px; }
.trow { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--r-2); color: var(--tx); border: 1px solid transparent; }
.trow:hover { background: var(--surface); border-color: var(--line); text-decoration: none; box-shadow: var(--shadow-1); }
.trow-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.trow-p { color: var(--tx-3); font-size: 12px; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }

/* ---------- пользователи ---------- */
.ulist { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.urow { display: grid; grid-template-columns: 32px minmax(180px, 1fr) auto 110px 120px auto; gap: 14px; align-items: center; width: 100%; padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; color: var(--tx); }
.urow:last-child { border-bottom: 0; }
.urow:hover { background: var(--surface-2); }
.urow.off { opacity: .6; }
.urow-main { display: flex; flex-direction: column; min-width: 0; }
.urow-main b { font-weight: 600; }
.urow-main span { color: var(--tx-3); font-size: 12px; }
.urow-n { color: var(--tx-2); font-size: 12px; }

/* ---------- шапка проекта и вкладки ---------- */
.phead { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); padding: 14px 24px 0; }
.phead-t { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.phead-t h1 { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.phead-members { display: inline-flex; margin-left: auto; }
.phead-members .av { margin-left: -6px; border: 2px solid var(--bg); }
.ptabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; padding: 0 8px; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; color: var(--tx-2); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; margin-bottom: -1px; border-radius: var(--r-1) var(--r-1) 0 0; }
.ptab:hover { color: var(--tx); background: var(--surface-2); text-decoration: none; }
.ptab.on { color: var(--tx); border-bottom-color: var(--acc); }
.ptab svg { color: var(--tx-3); width: 15px; height: 15px; }
.ptab.on svg { color: var(--acc); }
.ptab .n { font-style: normal; font-size: 11px; font-weight: 600; color: var(--tx-3); background: var(--surface-3); border-radius: 9px; padding: 1px 5px; }
.ptab .n.danger { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.pbody { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pbody > .page { padding-top: 18px; }

/* ---------- доска ---------- */
.board-bar { padding: 12px 24px 0; margin-bottom: 0; }
.seg { display: inline-flex; padding: 2px; border-radius: var(--r-2); background: var(--surface-3); gap: 2px; }
.seg-b { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 4px; font-weight: 500; color: var(--tx-2); font-size: 12.5px; }
.seg-b i { font-style: normal; color: var(--tx-3); font-size: 11px; }
.seg-b.on { background: var(--surface); color: var(--tx); box-shadow: var(--shadow-1); }
.dot-on { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--acc); }
/* Обёртка держит стрелки на месте, пока сама доска прокручивается под ними */
.board-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
.board { flex: 1; min-height: 0; display: flex; gap: 12px; padding: 12px 24px 16px; overflow-x: auto; overflow-y: hidden; align-items: flex-start; }
/* Стрелки по краям: полоса во всю высоту доски — за неё легко «поймать» курсором и
   перетаскиваемой карточкой. Сама полоса почти прозрачная, заметна только кнопка. */
.board-nav { position: absolute; top: 0; bottom: 16px; width: 44px; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.board-nav[hidden] { display: none; }
.board-nav.prev { left: 0; background: linear-gradient(to right, var(--bg) 20%, transparent); }
.board-nav.next { right: 0; background: linear-gradient(to left, var(--bg) 20%, transparent); }
.board-nav i { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); color: var(--tx-2); box-shadow: var(--shadow-2); transition: color .12s, border-color .12s, transform .15s var(--ease); }
.board-nav svg { width: 16px; height: 16px; }
.board-nav:hover i { color: var(--tx); border-color: var(--tx-3); transform: scale(1.08); }
/* На телефоне наведения нет, а ширина дорога: полосу сужаем, остаётся кнопка по нажатию */
@media (max-width: 720px) { .board-nav { width: 34px; } .board-nav i { width: 26px; height: 26px; } }
.col { width: 284px; flex: none; max-height: 100%; display: flex; flex-direction: column; border-radius: var(--r-3); background: var(--side); border: 1px solid transparent; transition: border-color .12s, background .12s; }
.col.drop { border-color: var(--acc); background: var(--acc-soft); }
.col.collapsed .col-b, .col.collapsed .col-h .ib, .col.collapsed .col-h .sp { display: none; }
.col.collapsed .col-fold { writing-mode: vertical-rl; transform: rotate(180deg); height: auto; padding: 8px 0; gap: 8px; }
.col.collapsed .col-fold .sti, .col.collapsed .col-fold .col-dot { transform: rotate(180deg); }
.col-h { display: flex; align-items: center; gap: 2px; height: 38px; padding: 0 6px 0 4px; flex: none; }
.col-fold:hover { background: var(--surface-3); }
.col-fold .col-dot { width: 10px; height: 10px; background: var(--cc); }
.col-h .ib { width: 26px; height: 26px; color: var(--tx-3); flex: none; }
.col-h .ib:hover { background: var(--surface-3); color: var(--tx); }
.col-b { flex: 1; min-height: 40px; overflow-y: auto; padding: 0 6px 6px; display: flex; flex-direction: column; gap: 6px; }
/* Куда встанет перетаскиваемая карточка: полоса акцентного цвета между карточками */
.drop-mark { height: 3px; margin: -1px 2px; border-radius: 2px; background: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent); pointer-events: none; flex: none; }
.col-empty { padding: 18px 12px; text-align: center; color: var(--tx-3); font-size: 12px; border: 1px dashed var(--line-2); border-radius: var(--r-2); }
.card { display: flex; flex-direction: column; gap: 6px; padding: 9px 10px 8px; border-radius: var(--r-2); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); cursor: pointer; transition: border-color .12s, box-shadow .12s, transform .12s; user-select: none; }
.card:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.card:focus-visible { outline: 2px solid var(--acc); outline-offset: 0; }
.card.drag { opacity: .5; transform: rotate(1deg); }
.card.blocked { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.card-top { display: flex; align-items: center; gap: 6px; }
.card-t { font-size: 13px; font-weight: 500; line-height: 1.4; color: var(--tx); word-break: break-word; }
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.card-f { display: flex; align-items: center; gap: 8px; min-height: 18px; }
/* Постановщик в правом нижнем углу: имя уступает место сроку и счётчикам, а не влезло —
   инициалы в кружке (класс short ставит fitCreators после отрисовки доски) */
.card-cr { display: inline-flex; align-items: center; flex: 0 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 11.5px; color: var(--tx-3); }
.card-cr .av { display: none; }
.card-cr.short { overflow: visible; }
.card-cr.short .cr-n { display: none; }
.card-cr.short .av { display: inline-flex; }

/* ---------- панель задачи ---------- */
#panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--panel-w), 100vw); z-index: 300; pointer-events: none; }
.panel { height: 100%; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); transform: translateX(24px); opacity: 0; transition: transform .2s var(--ease), opacity .16s; pointer-events: auto; }
#panel.on .panel { transform: none; opacity: 1; }
.panel-h { display: flex; align-items: center; gap: 4px; height: 48px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.panel-parent { display: inline-flex; align-items: center; gap: 6px; color: var(--tx-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-parent:hover { color: var(--tx); text-decoration: none; }
.panel-b { flex: 1; min-height: 0; overflow: auto; padding: 16px 20px 24px; }
.panel-b.dropping { box-shadow: inset 0 0 0 2px var(--acc); }
.panel-title { width: 100%; border: 0; background: transparent; resize: none; font-size: 18px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em; padding: 4px 6px; margin: -4px -6px 8px; border-radius: var(--r-1); outline: 0; overflow: hidden; }
.panel-title:hover { background: var(--surface-2); }
.panel-title:focus { background: var(--surface-2); box-shadow: 0 0 0 2px var(--acc); }
/* «Где задача»: проект › доска › колонка над названием. Каждая часть — кнопка: отсюда же
   меняют колонку, доску и проект. На узком экране строка переносится, а не распирает панель. */
.tpath { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-bottom: 8px; }
.tpath-i { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; min-width: 0; height: 24px; padding: 0 7px; border-radius: var(--r-1); font-size: 12px; font-weight: 500; color: var(--tx-2); cursor: pointer; }
.tpath-i:hover { background: var(--surface-2); color: var(--tx); }
.tpath-i span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpath-i svg { width: 14px; height: 14px; color: var(--tx-3); flex: none; }
.tpath-s { display: inline-flex; color: var(--tx-3); }
/* Кто завёл задачу и когда — в конце той же строки, у правого края панели */
.tmeta { display: flex; align-items: center; gap: 6px; min-width: 0; margin: -2px 0 8px; color: var(--tx-3); font-size: 11.5px; }
.tmeta-n { color: var(--tx-2); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tmeta time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tpath-s svg { width: 12px; height: 12px; }
/* Колонка — единственное цветное место в строке: по ней задачу и ищут глазами.
   Заливка приглушённая, цвет берётся у колонки (у своей — свой, у системной — статуса). */
.tpath-col { color: color-mix(in srgb, var(--cc) 72%, var(--tx)); background: color-mix(in srgb, var(--cc) 12%, transparent); }
.tpath-col:hover { background: color-mix(in srgb, var(--cc) 20%, transparent); color: color-mix(in srgb, var(--cc) 80%, var(--tx)); }
.tpath-col .sti { width: 13px; height: 13px; }
.tpath-col .col-dot { width: 8px; height: 8px; margin: 0; }
.tpath-col.st-wish { --cc: var(--st-wish); } .tpath-col.st-backlog { --cc: var(--st-backlog); }
.tpath-col.st-clarify { --cc: var(--st-clarify); } .tpath-col.st-in_progress { --cc: var(--st-progress); }
.tpath-col.st-review { --cc: var(--st-review); } .tpath-col.st-returned { --cc: var(--st-returned); }
.tpath-col.st-done { --cc: var(--st-done); } .tpath-col.st-rejected { --cc: var(--st-rejected); }

.props { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; margin: 4px 0 18px; }
.prop-wide { grid-column: 1 / -1; align-items: flex-start; }
.prop { display: flex; align-items: center; gap: 8px; min-height: 30px; }
.prop-l { width: 84px; flex: none; color: var(--tx-3); font-size: 12px; }
.prop-v { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px; margin-left: -6px; border-radius: var(--r-1); color: var(--tx); font-weight: 500; max-width: 100%; min-width: 0; position: relative; cursor: pointer; }
.prop-v:hover { background: var(--surface-2); }
.prop-v > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop-v.danger { color: var(--danger); }
.prop-v.warn { color: var(--warn); }
.prop-v input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.prop-v svg { color: var(--tx-3); }
.prop-in { height: 26px; padding: 0 6px; margin-left: -6px; border: 1px solid transparent; border-radius: var(--r-1); background: transparent; width: 100%; min-width: 0; font-weight: 500; }
.prop-in::placeholder { color: var(--tx-3); font-weight: 400; }
.prop-in:hover { background: var(--surface-2); }
.prop-in:focus { outline: 0; background: var(--surface-2); border-color: var(--acc); }
.prop .switch span { color: var(--tx-2); }
/* Метки: плашка с крестиком и поле «ещё метка». Крестик появляется у наведённой метки,
   чтобы ряд не рябил от значков. */
.tags-e { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 3px 0; min-width: 0; }
.tag-w { display: inline-flex; align-items: center; }
#subList.tags-e { gap: 6px; }
#subList .tag-w { gap: 6px; padding: 2px 4px 2px 2px; background: var(--surface-2); border-radius: var(--r-2); }
#subList .tag-x { opacity: 1; }
.tag-x { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 18px; margin-left: -2px; border-radius: 0 4px 4px 0; color: var(--tx-3); opacity: 0; cursor: pointer; }
.tag-w:hover .tag-x, .tag-x:focus-visible { opacity: 1; }
.tag-x:hover { color: var(--danger); }
.tag-x svg { width: 11px; height: 11px; }
.tag-in { height: 22px; min-width: 96px; flex: 1; padding: 0 6px; border: 1px solid transparent; border-radius: var(--r-1); background: transparent; font-size: 12px; }
.tag-in::placeholder { color: var(--tx-3); }
.tag-in:hover { background: var(--surface-2); }
.tag-in:focus { outline: 0; background: var(--surface-2); border-color: var(--acc); }
/* Диалог переноса в другой проект */
.mv-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.mv-row .fld { gap: 4px; }
.mv-warn { margin: 12px 0 0; padding: 10px 12px 10px 26px; border-radius: var(--r-1); background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--tx-2); font-size: 12.5px; line-height: 1.5; }
.mv-warn li + li { margin-top: 4px; }
.sec { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sec-h h3 { font-size: 13px; font-weight: 600; flex: 1; display: flex; align-items: center; }
.sec-acts { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.desc-in { min-height: 72px; }
.desc { font-size: 13.5px; line-height: 1.55; white-space: normal; word-break: break-word; padding: 2px 0; }
/* Разметка в текстах: описание, комментарии, обсуждения, «Знания», «Решения». Отступы
   сжаты под ленту — это рабочая переписка, а не статья. Первый и последний блок без
   внешних полей, чтобы короткий комментарий в одну строку выглядел как раньше. */
.md { min-width: 0; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 8px; }
.md h1, .md h2, .md h3, .md h4, .md h5, .md h6 { margin: 14px 0 6px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; color: var(--tx); }
.md h1 { font-size: 17px; } .md h2 { font-size: 15.5px; } .md h3 { font-size: 14.5px; }
.md h4, .md h5, .md h6 { font-size: 13.5px; }
.md ul, .md ol { padding-left: 22px; }
.md li + li { margin-top: 2px; }
.md li > ul, .md li > ol { margin: 2px 0 0; }
.md ol.paren > li::marker { content: counter(list-item) ") "; }
.md strong { font-weight: 600; }
.md blockquote { padding: 2px 0 2px 12px; border-left: 3px solid var(--line-2); color: var(--tx-2); }
.md code { font-family: var(--mono); font-size: .9em; padding: 1px 4px; border-radius: var(--r-1); background: var(--surface-2); }
/* Длинная строка кода прокручивается внутри блока, а не распирает ленту */
.md pre { max-width: 100%; overflow-x: auto; padding: 8px 10px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--line); }
.md pre code { padding: 0; background: none; font-size: 12.5px; line-height: 1.5; white-space: pre; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md a { overflow-wrap: anywhere; }
/* Снимок инструкции — часть текста, не карточка файла. В форме у него крестик. */
.md .instr-img { display: block; max-width: 100%; height: auto; margin: 8px 0; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); cursor: zoom-in; }
.instr-shot { position: relative; display: inline-block; max-width: 100%; margin: 8px 0; }
.instr-shot .instr-img { margin: 0; }
.instr-shot-x { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-2); background: var(--surface); color: var(--tx); border: 1px solid var(--line); box-shadow: var(--shadow-2); cursor: pointer; }
.instr-shot-x:hover { background: var(--surface-2); }
.instr-shot-x svg { width: 14px; height: 14px; }
.instr-form.dropping #inBody { box-shadow: 0 0 0 2px var(--acc); }
.md-help.is-busy { opacity: .55; pointer-events: none; }
/* Кнопка «Разметка» у полей ввода: тихая, как вспомогательная ссылка, — набору не мешает */
.md-help { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 7px; border-radius: var(--r-1); color: var(--tx-3); font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; cursor: pointer; }
.md-help:hover, .md-help[aria-expanded="true"] { color: var(--tx); background: var(--surface-2); }
.md-help svg { width: 15px; height: 15px; }
.md-help-row { display: flex; justify-content: flex-end; margin: -10px 0 10px; }
/* Узкий экран: у кнопки остаётся значок, подпись — в подсказке при наведении */
@media (max-width: 520px) { .md-help span { display: none; } .md-help { padding: 0 5px; } }
.nt-files .md-help { margin-left: auto; align-self: center; }
/* Памятка по разметке: слева — что написать, справа — что получится */
.md-pop { width: 320px; max-width: calc(100vw - 16px); padding: 10px 12px 12px; }
.md-pop-h { font-size: 12.5px; font-weight: 600; color: var(--tx); margin-bottom: 6px; }
.md-pop-t { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.md-pop-t td { padding: 4px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.md-pop-t tr:last-child td { border-bottom: 0; }
.md-pop-t td:first-child { width: 58%; padding-right: 10px; }
.md-pop-t td:last-child { color: var(--tx); }
.md-pop code { font-family: var(--mono); font-size: 11.5px; padding: 1px 4px; border-radius: var(--r-1); background: var(--surface-2); color: var(--tx); white-space: nowrap; }
.md-pv-h { font-size: 14px; }
.md-pv-q { padding-left: 7px; border-left: 3px solid var(--line-2); color: var(--tx-2); }
.md-pop-n { margin: 8px 0 0; padding-left: 16px; color: var(--tx-2); font-size: 12px; line-height: 1.45; }
.md-pop-n li + li { margin-top: 3px; }
.md-pop-n code { white-space: nowrap; }
.desc a { word-break: break-all; }
.subs { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.sub { display: flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 6px; border-radius: var(--r-1); }
.sub:hover { background: var(--surface-2); }
.sub.done .sub-t { color: var(--tx-3); text-decoration: line-through; }
.sub-t { flex: 1; text-align: left; padding: 4px 0; color: var(--tx); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-x { color: var(--tx-3); }
.chk-c { position: relative; display: inline-flex; width: 16px; height: 16px; flex: none; cursor: pointer; }
.chk-c input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chk-c i { width: 16px; height: 16px; border: 1.5px solid var(--line-2); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; color: transparent; background: var(--surface); transition: background .12s, border-color .12s; }
.chk-c i svg { width: 11px; height: 11px; stroke-width: 3; }
.chk-c input:checked + i { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk-c input:focus-visible + i { outline: 2px solid var(--acc); outline-offset: 1px; }
.sub-add { display: flex; align-items: center; gap: 4px; }
.sub-add .in { border-color: transparent; background: transparent; padding-left: 6px; }
.sub-add .in:hover { background: var(--surface-2); }
.sub-add .in:focus { background: var(--surface); border-color: var(--acc); }
.files { display: flex; flex-direction: column; gap: 4px; }
.file { display: flex; align-items: center; gap: 10px; padding: 4px 6px; border-radius: var(--r-2); }
.file:hover { background: var(--surface-2); }
.file-ic { width: 36px; height: 36px; flex: none; border-radius: var(--r-1); background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--tx-2); overflow: hidden; }
.file-ic img { width: 100%; height: 100%; object-fit: cover; }
.file-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.file-n { text-align: left; font-weight: 500; color: var(--tx); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-n:hover { color: var(--acc); }
.file-b .muted { font-size: 11.5px; }
.upl { margin-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.upl-row { position: relative; height: 22px; padding: 0 8px; font-size: 12px; line-height: 22px; color: var(--tx-2); background: var(--surface-2); border-radius: var(--r-1); overflow: hidden; }
.upl-row i { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--acc); }
.cmts { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.cmt { display: flex; gap: 10px; }
.cmt-b { flex: 1; min-width: 0; }
.cmt-h { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.cmt-h b { font-weight: 600; }
.cmt-h time { color: var(--tx-3); font-size: 11.5px; }
.cmt-h .muted { font-size: 11.5px; }
.cmt-h .ib { opacity: 0; }
.cmt:hover .cmt-h .ib, .cmt-h .ib:focus-visible { opacity: 1; }
.cmt-t { font-size: 13.5px; line-height: 1.5; word-break: break-word; }
.cmt-file { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 5px 9px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface-2); color: var(--tx); font-size: 12.5px; max-width: 100%; }
.cmt-file:hover { border-color: var(--line-2); text-decoration: none; }
.cmt-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt-file em { font-style: normal; color: var(--tx-3); }
.cmt-new { display: flex; gap: 10px; }
.cmt-new-b { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: var(--r-3); background: var(--surface); transition: border-color .12s, box-shadow .12s; }
.cmt-new-b:focus-within { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 18%, transparent); }
.cmt-new-b .in { border: 0; background: transparent; box-shadow: none; min-height: 36px; }
.cmt-new-b .in:focus { box-shadow: none; }
.cmt-new-f { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; row-gap: 4px; padding: 4px 6px 6px 6px; }
/* На узком экране строка инструментов переносится, а не уезжает за край: «Отправить»
   раньше пропадал из виду уже на 380 точках */
.cmt-new-f > .sp { flex: 1 0 0; }
.cmt-new-f #cmtSend { margin-left: auto; }
.cmt-att { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--tx-2); min-width: 0; overflow: hidden; }
/* Обращения и скрытые комментарии (TR-7). Скрытое — тёплым цветом «предупреждения»:
   это подсказка не для всех, и перепутать её с обычным ответом нельзя. */
.cmt-to { color: var(--tx-2); font-size: 12.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmt.to-me { position: relative; }
.cmt.to-me::before { content: ''; position: absolute; left: -10px; top: 2px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--acc); }
.cmt.is-hidden .cmt-b { background: color-mix(in srgb, var(--warn) 7%, transparent); border-radius: var(--r-2); padding: 2px 8px 6px; }
.chip.cmt-rep { flex: none; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--tx-3); text-transform: uppercase; }
.cmt.is-report .cmt-t { border-left: 2px solid var(--line-2); padding-left: 10px; margin-left: -12px; }
/* Подсветка после перехода к отчёту: короткая вспышка фона, без рамок и цвета —
   цвет в ленте занят обращениями и скрытыми комментариями. */
.cmt.flash { animation: cmt-flash 1.6s ease-out; }
@keyframes cmt-flash { from { background: var(--acc-soft); } to { background: transparent; } }
.cmt-hid { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); border-color: transparent; }
.chip.cmt-hid svg { width: 11px; height: 11px; }
.mention { color: var(--acc); background: var(--acc-soft); border-radius: var(--r-1); padding: 0 2px; font-weight: 500; }
.cmt.cmt-focus .cmt-b { animation: cmt-focus 2.4s var(--ease); }
@keyframes cmt-focus { 0%, 45% { box-shadow: 0 0 0 2px var(--acc); background: var(--acc-soft); } 100% { box-shadow: 0 0 0 2px transparent; } }
.cmt-tos { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px 8px 0; font-size: 12px; }
.cmt-t .cmt-tos { padding: 0 0 6px; }
.to-chip { display: inline-flex; align-items: center; gap: 2px; height: 22px; padding: 0 1px 0 8px; border-radius: 11px; background: var(--acc-soft); color: var(--acc); font-weight: 500; }
.to-chip .ib { color: inherit; }
.cmt-new-b.is-hidden { background: color-mix(in srgb, var(--warn) 8%, var(--surface)); border-color: color-mix(in srgb, var(--warn) 55%, var(--line-2)); }
.cmt-new-b.is-hidden:focus-within { border-color: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }
.cmt-hint { display: flex; align-items: center; gap: 6px; padding: 0 10px 2px; font-size: 12px; color: var(--warn); }
.cmt-hint svg { width: 13px; height: 13px; }
.cmt-hide { font-size: 12.5px; color: var(--tx-2); margin-right: 4px; }
.cmt-new-f .btn-ghost { color: var(--tx-2); padding: 0 8px; }
.at-pop { max-height: 280px; overflow: auto; }
.menu-it.on { background: var(--surface-2); }
.people-pick .menu-list { max-height: 300px; overflow: auto; }
.notif-h { display: flex; align-items: center; padding: 10px 8px 4px; font-size: 11.5px; font-weight: 600; color: var(--tx-3); }
.nrow-me .av { margin-top: 1px; }
.nrow-me .nrow-t svg { width: 13px; height: 13px; vertical-align: -2px; margin-right: 4px; color: var(--tx-3); }
.nrow-s b { font-weight: 500; color: var(--tx); }
.panel-f { margin-top: 20px; font-size: 11.5px; }

/* ---------- новая задача ---------- */
.dlg-nt { max-width: 640px; }
.nt { padding: 12px 16px 12px; }
.nt-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.nt-title { width: 100%; border: 0; background: transparent; resize: none; font-size: 17px; font-weight: 600; line-height: 1.35; outline: 0; padding: 4px 0; overflow: hidden; }
.nt-desc { width: 100%; border: 0; background: transparent; resize: none; font-size: 13.5px; line-height: 1.5; outline: 0; padding: 2px 0 8px; min-height: 64px; }
.nt-title::placeholder, .nt-desc::placeholder { color: var(--tx-3); }
.nt-props { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 10px; border-top: 1px solid var(--line); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: var(--r-2); border: 1px solid var(--line-2); background: var(--surface); color: var(--tx); font-size: 12.5px; font-weight: 500; position: relative; cursor: pointer; }
.pill:hover { background: var(--surface-2); }
.pill svg { color: var(--tx-3); }
.pill-date input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.pill-in { min-width: 180px; cursor: text; }
.pill-in:focus { outline: 0; border-color: var(--acc); }
.nt-f { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); }

/* ---------- просмотр файлов ---------- */
.vw { position: fixed; inset: 0; z-index: 800; background: rgba(8, 8, 12, .9); display: flex; flex-direction: column; }
.vw-bar { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 12px 0 16px; color: #fff; }
.vw-bar .ib { color: #fff; }
.vw-bar .ib:hover { background: rgba(255, 255, 255, .12); }
.vw-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 0 60px 24px; }
.vw-body img, .vw-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--r-2); }
.vw-body iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: var(--r-2); }
.vw-card { display: flex; flex-direction: column; align-items: center; gap: 10px; color: #fff; }
.vw-card svg { width: 32px; height: 32px; }
.vw-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; background: rgba(255, 255, 255, .1); }
.vw-nav:hover { background: rgba(255, 255, 255, .2); }
.vw-nav.prev { left: 12px; }
.vw-nav.next { right: 12px; }
.vw-nav.next svg { transform: scaleX(-1); }

/* ---------- календарь ---------- */
.cal-t { font-size: 14px; font-weight: 600; min-width: 130px; text-align: center; }
.legend { display: inline-flex; align-items: center; gap: 6px; color: var(--tx-3); font-size: 12px; }
.legend i { width: 9px; height: 9px; border-radius: 2px; margin-left: 8px; }
.legend i:first-child { margin-left: 0; }
.k-task { background: var(--acc); } .k-late { background: var(--danger); } .k-done { background: var(--ok); } .k-ms, .k-msdone { background: var(--violet); }
.cal { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.cal-h { display: grid; grid-template-columns: repeat(7, 1fr); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cal-h span { padding: 6px 8px; font-size: 11.5px; font-weight: 600; color: var(--tx-3); }
.cal-g { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-d { min-height: 96px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.cal-d:nth-child(7n) { border-right: 0; }
.cal-d.out { background: var(--surface-2); color: var(--tx-3); }
.cal-d.we .cal-num { color: var(--tx-3); }
.cal-num { font-size: 12px; font-weight: 500; margin-bottom: 2px; }
.cal-d.now .cal-num { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--acc); color: var(--on-acc); }
.cal-e { display: block; width: 100%; text-align: left; font-size: 11px; line-height: 1.3; padding: 2px 5px; border-radius: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--surface-3); color: var(--tx); }
.cal-e.k-task { background: var(--acc-soft); color: var(--acc); }
.cal-e.k-late { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.cal-e.k-done { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.cal-e.k-ms, .cal-e.k-msdone { background: color-mix(in srgb, var(--violet) 12%, transparent); color: var(--violet); }
.cal-e:hover { filter: brightness(.96); }
.cal-more { font-size: 11px; color: var(--tx-3); padding-left: 5px; }

/* ---------- этапы, история, знания, риски, релизы, решения, корзина ---------- */
.ms-list { display: flex; flex-direction: column; gap: 4px; }
.ms { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); text-align: left; color: var(--tx); }
.ms:hover { border-color: var(--line-2); box-shadow: var(--shadow-1); }
.ms-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: none; }
.ms-active .ms-dot { background: var(--st-progress); } .ms-done .ms-dot { background: var(--ok); } .ms.late .ms-dot { background: var(--danger); }
.ms-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ms-main b { font-weight: 600; }
.ms-main span { color: var(--tx-3); font-size: 12px; }
.ms-dates { color: var(--tx-2); font-size: 12px; white-space: nowrap; }
.hist { display: flex; flex-direction: column; margin-bottom: 14px; }
.h-day { font-size: 12px; font-weight: 600; color: var(--tx-3); padding: 16px 0 6px; }
.h-day:first-child { padding-top: 0; }
.h-row { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; }
.h-row time { width: 38px; flex: none; color: var(--tx-3); font-size: 12px; padding-top: 2px; }
.h-ic { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-3); color: var(--tx-2); flex: none; }
.h-ic svg { width: 12px; height: 12px; }
.h-ic.k-done { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.h-ic.k-started { background: color-mix(in srgb, var(--st-progress) 18%, transparent); color: color-mix(in srgb, var(--st-progress) 70%, var(--tx)); }
.h-ic.k-review { background: var(--acc-soft); color: var(--acc); }
.h-ic.k-release, .h-ic.k-milestone { background: color-mix(in srgb, var(--violet) 14%, transparent); color: var(--violet); }
.h-b { flex: 1; min-width: 0; }
.h-l { color: var(--tx-2); font-size: 12px; margin-right: 6px; }
.h-t { color: var(--tx); font-weight: 500; }
.h-x { margin-top: 3px; color: var(--tx-2); font-size: 12.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.kb { display: flex; flex-direction: column; gap: 6px; }
.kb-it { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); }
.kb-ic { width: 28px; height: 28px; border-radius: var(--r-1); background: var(--surface-3); display: inline-flex; align-items: center; justify-content: center; color: var(--tx-2); flex: none; }
.kb-b { flex: 1; min-width: 0; }
.kb-t { font-weight: 600; color: var(--tx); }
.kb-u { display: block; color: var(--tx-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-n { margin-top: 4px; color: var(--tx-2); line-height: 1.5; }
.risks { display: flex; flex-direction: column; gap: 4px; }
.risk { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); color: var(--tx); }
.risk:hover { text-decoration: none; border-color: var(--line-2); box-shadow: var(--shadow-1); }
.risk-ic { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--surface-3); color: var(--tx-2); }
.risk-ic.k-overdue, .risk-ic.k-stuck { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.risk-ic.k-blocked { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }
.risk-ic.k-review { background: var(--acc-soft); color: var(--acc); }
.risk-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.risk-b b { font-weight: 500; }
.risk-b span { color: var(--tx-3); font-size: 12px; }
.risk-w { color: var(--tx-2); font-size: 12px; white-space: nowrap; }
.rel-list, .dec-list { display: flex; flex-direction: column; gap: 10px; }
.rel, .dec { padding: 12px 14px; border-radius: var(--r-3); border: 1px solid var(--line); background: var(--surface); }
.rel header, .dec header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.rel header time, .dec header time { color: var(--tx-3); font-size: 12px; white-space: nowrap; }
.rel h3, .dec h3 { font-size: 14px; font-weight: 600; flex: 1; }
.rel p, .dec p { color: var(--tx-2); line-height: 1.5; margin-bottom: 8px; }
.rel-tasks { margin: 0 0 8px; padding: 0 0 0 4px; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.rel-tasks a { color: var(--tx); }
.rel-tasks .gone { color: var(--tx-3); text-decoration: line-through; }
.rel footer, .dec footer { font-size: 12px; }
/* Подпись решения отстоит от текста: раньше отступ давал абзац-обёртка, теперь текст — блок разметки */
.dec .md + footer { margin-top: 6px; }
.del-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.del { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); }
.del-b { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.del-b span { font-size: 12px; color: var(--tx-2); }
.del-b .muted { font-size: 11.5px; }

/* ---------- настройки ---------- */
.set { margin-bottom: 28px; }
.set h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; }
.set > p.muted { margin-bottom: 10px; line-height: 1.5; }
.set-acts { display: flex; gap: 8px; margin-top: 8px; }
.mem-list, .board-list { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface); padding: 4px; }
.mem { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: var(--r-1); min-height: 40px; }
.mem:hover { background: var(--surface-2); }
.mem-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mem-n b { font-weight: 500; }
.mem-n span { font-size: 12px; color: var(--tx-3); }
.danger-zone h2 { color: var(--danger); }

/* ---------- аналитика ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.stat { padding: 10px 12px; border-radius: var(--r-2); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.stat b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.stat span { color: var(--tx-3); font-size: 12px; }
.stat.danger b { color: var(--danger); } .stat.warn b { color: var(--warn); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; margin-top: 12px; }
.dc { padding: 12px 14px 14px; border-radius: var(--r-3); border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.dc h3 { font-size: 12.5px; font-weight: 600; color: var(--tx-2); margin-bottom: 10px; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart .cgrid { stroke: var(--line); stroke-width: 1; }
.chart .axl, .chart .bx { font-size: 9.5px; fill: var(--tx-3); }
.hb { display: flex; flex-direction: column; gap: 6px; }
.hb-r { display: grid; grid-template-columns: minmax(90px, 140px) 1fr 36px; align-items: center; gap: 10px; font-size: 12.5px; }
.hb-l { color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-t { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.hb-t i { display: block; height: 100%; border-radius: 3px; }
.hb-v { text-align: right; font-weight: 600; }
.mini-list { display: flex; flex-direction: column; }
.mini-list a { display: flex; align-items: center; gap: 8px; padding: 5px 6px; margin: 0 -6px; border-radius: var(--r-1); color: var(--tx); }
.mini-list a:hover { background: var(--surface-2); text-decoration: none; }
.mini-list a > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-list em { font-style: normal; color: var(--tx-3); font-size: 12px; white-space: nowrap; }
.cycle { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 8px; }
.cycle div { display: flex; flex-direction: column; }
.cycle b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.cycle span { color: var(--tx-2); font-size: 12px; }
.cycle em { font-style: normal; color: var(--tx-3); font-size: 11px; }
.ov-table { display: flex; flex-direction: column; }
.ov-h, .ov-r { display: grid; grid-template-columns: minmax(180px, 1fr) 110px 70px 90px 60px 80px 100px; gap: 12px; align-items: center; padding: 6px 6px; }
.ov-h { font-size: 11.5px; font-weight: 600; color: var(--tx-3); border-bottom: 1px solid var(--line); }
.ov-r { color: var(--tx); border-radius: var(--r-1); }
.ov-r:hover { background: var(--surface-2); text-decoration: none; }
.ov-r > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-tip] { cursor: default; }
#tip { position: fixed; z-index: 950; pointer-events: none; padding: 5px 8px; font-size: 12px; border-radius: var(--r-1); background: var(--tx); color: var(--bg); box-shadow: var(--shadow-2); white-space: nowrap; }

/* ---------- аналитика проекта (TR-25) и «Обзор» (TR-26) ---------- */
.an-bar { gap: 10px; }
.an-note { max-width: 900px; margin-bottom: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); color: var(--tx-2); font-size: 12.5px; line-height: 1.5; }
.an-sub { margin: 4px 0 6px; font-size: 11.5px; font-weight: 600; color: var(--tx-3); }
.stat em { font-style: normal; font-size: 11.5px; color: var(--tx-3); }
button.stat { font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
button.stat:hover:not(:disabled) { border-color: var(--line-2); box-shadow: var(--shadow-1); }
button.stat:disabled { cursor: default; }
button.stat:disabled b { color: var(--tx-3); }
.an-stats { margin-bottom: 10px; }
.an-flow-h { display: flex; align-items: baseline; flex-wrap: wrap; gap: 12px; margin-bottom: 6px; }
.an-flow-h h3 { margin-bottom: 0; }
.an-legend { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--tx-3); }
.an-legend i { display: inline-block; width: 10px; height: 10px; margin-left: 8px; border-radius: 2px; }
.an-legend i:first-child { margin-left: 0; }
.chart .an-b-cr, .an-legend .an-b-cr { fill: color-mix(in srgb, var(--tx-3) 50%, var(--surface)); background: color-mix(in srgb, var(--tx-3) 50%, var(--surface)); }
.chart .an-b-dn, .an-legend .an-b-dn { fill: var(--acc); background: var(--acc); }
.an-legend .an-lg-pre { border: 1px solid var(--line-2); background: repeating-linear-gradient(45deg, var(--line-2) 0 2px, transparent 2px 5px); }
.an-hatch { fill: var(--line); }
.chart .an-hot { fill: transparent; }
.chart .an-hot.on { cursor: pointer; }
.chart .an-hot.on:hover { fill: color-mix(in srgb, var(--acc) 7%, transparent); }
.an-hb { width: 100%; margin: 0 -4px; padding: 2px 4px; border: 0; border-radius: var(--r-1); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.an-hb:hover:not(:disabled) { background: var(--surface-2); }
.an-hb:disabled { cursor: default; }
.an-hb:disabled .hb-v { color: var(--tx-3); font-weight: 500; }
.an-hb .hb-l { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.an-hb .hb-l > span { overflow: hidden; text-overflow: ellipsis; }
.an-hb .hb-t i { background: var(--acc); }
.an-big { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.an-big b, .an-n.big { font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.an-big span { font-size: 12.5px; color: var(--tx-3); }
.an-n { margin: 0 -4px; padding: 0 4px; border: 0; border-radius: var(--r-1); background: none; font: inherit; font-variant-numeric: tabular-nums; color: var(--tx); text-align: left; cursor: pointer; }
.an-n:hover { background: var(--acc-soft); color: var(--acc); }
.an-n.zero { color: var(--tx-3); cursor: default; }
.an-lines, .an-list { display: flex; flex-direction: column; }
.an-list { max-height: min(60vh, 520px); overflow-y: auto; }
.an-row { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0 -6px; padding: 5px 6px; border: 0; border-radius: var(--r-1); background: none; font: inherit; color: var(--tx); text-align: left; cursor: pointer; }
.an-row:hover { background: var(--surface-2); }
.an-row-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-row-s { font-size: 12px; color: var(--tx-3); white-space: nowrap; }
.an-tbl { display: flex; flex-direction: column; }
.an-tr { display: grid; grid-template-columns: minmax(110px, 1fr) repeat(4, 76px); align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.an-tr:last-child { border-bottom: 0; }
.an-th { font-size: 11.5px; font-weight: 600; color: var(--tx-3); }
.an-th > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-tn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-one { max-width: 520px; }
/* Разрезы — таблицы в пять колонок: в карточку сетки на 320 точек они не помещаются */
.grid2.an-wide { grid-template-columns: repeat(auto-fill, minmax(460px, 1fr)); }
.an-hb.hb-r { grid-template-columns: minmax(130px, 180px) 1fr 36px; }
.ov-table.an .ov-h, .ov-table.an .ov-r { grid-template-columns: minmax(180px, 1fr) repeat(8, minmax(60px, 84px)); }
.ov-table.an.est .ov-h, .ov-table.an.est .ov-r { grid-template-columns: minmax(180px, 1fr) repeat(9, minmax(60px, 84px)); }
.ov-r .zero { font-style: normal; color: var(--tx-3); }
@media (max-width: 720px) {
  .grid2.an-wide { grid-template-columns: 1fr; }
  .an-tr { grid-template-columns: minmax(90px, 1fr) repeat(4, 52px); }
  .ov-table.an .ov-h, .ov-table.an .ov-r, .ov-table.an.est .ov-h, .ov-table.an.est .ov-r { grid-template-columns: 1fr 64px 64px; }
}

/* ---------- адаптив ---------- */
@media (max-width: 1100px) { .props { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  :root { --panel-w: 100vw; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; z-index: 400; transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: none; }
  body.side-open .side { transform: none; box-shadow: var(--shadow-3); }
  .side-close { display: inline-flex; }
  .side-bg { display: block; position: fixed; inset: 0; z-index: 390; background: rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.side-open .side-bg { opacity: 1; pointer-events: auto; }
  .top-menu { display: inline-flex; }
  .page { padding: 16px 16px 40px; }
  .phead, .board-bar { padding-left: 16px; padding-right: 16px; }
  .board { padding: 12px 16px 16px; }
  .col { width: 260px; }
  .plist-h { display: none; }
  .prow { grid-template-columns: 40px 1fr; grid-template-rows: auto auto; }
  .prow-bar, .prow-n, .prow-act { display: none; }
  .prow-meta { grid-column: 2; }
  .urow { grid-template-columns: 32px 1fr auto; }
  .urow-n, .urow-st { display: none; }
  .ov-h, .ov-r { grid-template-columns: 1fr 70px 60px; }
  .ov-h > :nth-child(n+4), .ov-r > :nth-child(n+4) { display: none; }
  .cal-d { min-height: 64px; }
  .cal-e { display: none; }
  .cal-d .cal-e:first-of-type { display: block; }
  .fld-row { flex-direction: column; gap: 0; }
  .fld.w-key { width: 100%; }
  .in-search .in { width: 160px; }
  .trow-p { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- план работ ---------- */

/* ---------- лента: обсуждение и события ---------- */
.feed { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.feed .cmt { margin: 2px 0; }
.ev { display: flex; align-items: center; gap: 8px; color: var(--tx-2); font-size: 12.5px; min-height: 22px; }
.ev-ic { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex: none; border-radius: 50%; background: var(--surface-2); color: var(--tx-3); }
.ev-ic svg { width: 12px; height: 12px; }
.ev-ic.bot { background: var(--acc-soft); color: var(--acc); }
.ev-t { flex: 1; min-width: 0; }
.ev-t b { font-weight: 600; color: var(--tx-2); }
.ev time { color: var(--tx-3); font-size: 11.5px; white-space: nowrap; }
.av-bot { background: var(--acc-soft); color: var(--acc); }
.av-bot svg { width: 68%; height: 68%; }

/* ---------- доски ---------- */
.seg.boards .seg-b.add { padding: 0 6px; color: var(--tx-3); }
.seg.boards .seg-b.add:hover { color: var(--tx); background: var(--surface); }
.seg.boards .seg-b.add svg { width: 14px; height: 14px; }

/* ---------- форма новой задачи: дополнения ---------- */
.nt-cmt { width: 100%; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); resize: none; font-size: 13px; line-height: 1.5; outline: 0; padding: 7px 10px; min-height: 44px; margin-bottom: 8px; }
.nt-cmt:focus { border-color: var(--acc); background: var(--surface); }
.nt-cmt::placeholder { color: var(--tx-3); }
.nt-files { display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap; padding-bottom: 4px; }
.nt-flist { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.nt-file { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 4px 0 9px; border-radius: var(--r-2); background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; }
.nt-file em { font-style: normal; color: var(--tx-3); }
/* «Оценка, ч» — подпись плюс узкое поле внутри пилюли */
label.pill-in { display: inline-flex; align-items: center; gap: 6px; }
label.pill-in .pill-l { color: var(--tx-3); white-space: nowrap; }
label.pill-in input { border: 0; background: transparent; outline: 0; width: 46px; padding: 0; font: inherit; color: inherit; }
/* «Этап» и «Метки» — самостоятельные поля-пилюли: держим ширину, иначе рвут ряд */
input.pill-in { flex: 0 0 auto; width: 150px; cursor: text; }
input.pill-in.wide { width: 190px; }
input.pill-in::placeholder { color: var(--tx-3); }

/* ---------- панель фильтров ---------- */
.filter-pop { width: 340px; max-width: calc(100vw - 16px); padding: 8px; max-height: 70vh; overflow: auto; }
.fgroup { padding: 4px 2px 8px; }
.fg-h { font-size: 11.5px; font-weight: 600; color: var(--tx-3); margin-bottom: 6px; }
.fg-b { display: flex; flex-wrap: wrap; gap: 4px; }
.fchip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); color: var(--tx-2); font-size: 12.5px; max-width: 100%; }
.fchip:hover { background: var(--surface-2); color: var(--tx); }
.fchip.on { background: var(--acc); border-color: var(--acc); color: var(--on-acc); }
.fchip.on .av { box-shadow: 0 0 0 1px rgba(255, 255, 255, .5); }
.fchip .av, .fchip .pri { flex: none; }
.fchip.on .pri rect { fill: rgba(255, 255, 255, .45); }
.fchip.on .pri rect.on { fill: #fff; }
.filter-f { border-top: 1px solid var(--line); padding-top: 6px; display: flex; justify-content: flex-end; }

/* ---------- доски в боковом меню ---------- */
.nav-boards { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 14px; padding-left: 8px; border-left: 1px solid var(--line); }
.nav-board { display: flex; align-items: center; gap: 6px; height: 26px; padding: 0 8px; border-radius: var(--r-2); color: var(--tx-2); font-size: 12.5px; text-align: left; }
.nav-board:hover { background: var(--surface-3); color: var(--tx); }
.nav-board.on { background: var(--surface); color: var(--tx); font-weight: 500; box-shadow: var(--shadow-1); }
.nav-board i { margin-left: auto; font-style: normal; font-size: 11px; color: var(--tx-3); }
.nav-board.add { color: var(--tx-3); }
.nav-board.add svg { width: 13px; height: 13px; }

/* ---------- план только для чтения ---------- */

/* ---------- история задачи ---------- */
.hist-task { display: flex; flex-direction: column; gap: 6px; }
.hist-task .ev { min-height: 20px; }

/* ---------- перетаскивание колонок ---------- */
.col-h { cursor: grab; user-select: none; }
.col-h:active { cursor: grabbing; }
.col-h .col-t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-grip { display: inline-flex; color: var(--tx-3); opacity: 0; transition: opacity .12s; flex: none; margin-left: -2px; }
.col-grip svg { width: 14px; height: 14px; }
.col:hover .col-grip { opacity: 1; }
.col.col-drag { opacity: .5; }
.col.col-over { outline: 2px dashed var(--acc); outline-offset: -2px; }
/* Меню системной колонки нужно редко: появляется при наведении на колонку. Без наведения
   оно не занимает места — иначе «На проверке» рядом с «Пакетом» обрезалась бы всегда.
   Нулевая ширина, а не display: none, чтобы до кнопки можно было дойти клавиатурой. */
.col-h .col-menu.sys { width: 0; overflow: hidden; opacity: 0; transition: opacity .12s; }
.col:hover .col-h .col-menu.sys, .col-h:focus-within .col-menu.sys { width: 26px; opacity: 1; }
@media (hover: none) { .col-h .col-menu.sys { width: 26px; opacity: 1; } }
.sf-flow { margin-top: 16px; }
.sf-flow .fld { flex: 1; margin-bottom: 0; }

/* ---------- миниатюры вложений ---------- */
.thumb { margin: 0; display: block; width: 132px; flex: none; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; background: var(--surface-2); cursor: zoom-in; transition: border-color .12s, box-shadow .12s; }
.thumb:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.thumb:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.thumb img { display: block; width: 100%; height: 88px; object-fit: cover; background: var(--surface-3); }
.thumb figcaption { display: block; padding: 4px 6px; font-size: 11px; color: var(--tx-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb.in-cmt { margin-top: 6px; width: 168px; }
.thumb.in-cmt img { height: 110px; }
/* Несколько картинок в комментарии — рядом, переносятся по ширине ленты */
.cmt-thumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.cmt-thumbs .thumb.in-cmt { margin-top: 6px; }
/* Выбранные, но ещё не отправленные вложения — там же, где будут после отправки */
.cmt-picked { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; padding: 6px 0 2px; }
.cmt-picked:empty { display: none; }
.cmt-picked .thumb.in-cmt { margin-top: 0; width: 124px; }
.cmt-picked .thumb.in-cmt img { height: 78px; }
.cmt-pick-w, .cmt-picked .thumb, .cmt-picked .cmt-pick { position: relative; }
.cmt-pick { display: inline-flex; align-items: center; gap: 6px; padding: 5px 30px 5px 9px; border: 1px solid var(--line); border-radius: var(--r-2); background: var(--surface-2); font-size: 12.5px; max-width: 100%; }
.cmt-pick .thumb-x, .cmt-pick-w .cmt-pick + .thumb-x { top: 50%; right: 5px; transform: translateY(-50%); width: 18px; height: 18px; }
.cmt-pick em { font-style: normal; color: var(--tx-3); }
.cmt-pick svg { width: 14px; height: 14px; color: var(--tx-3); }
.cmt-picked .thumb-x, .cmt-pick-w .thumb-x { opacity: 1; }
.cmt-pick-w { display: inline-flex; }
.cmt-new.dropping .cmt-new-b { box-shadow: 0 0 0 2px var(--acc); border-radius: var(--r-2); }
.ce-box.dropping { box-shadow: 0 0 0 2px var(--acc); border-radius: var(--r-2); }
.file-img { align-items: flex-start; }
.file-img .file-b { padding-top: 4px; }

/* ---------- сворачиваемая история ---------- */
.sec-toggle { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; margin-bottom: 0; padding: 2px 0; }
.sec-toggle h3 { font-size: 13px; font-weight: 600; display: flex; align-items: center; }
.sec-chev { display: inline-flex; color: var(--tx-3); transition: transform .15s var(--ease); }
.hist-sec.open .sec-chev { transform: rotate(180deg); }
.hist-sec .hist-task { margin-top: 10px; }

/* миниатюры в форме создания задачи */
.nt-thumb { position: relative; width: 112px; }
.nt-thumb img { height: 74px; }
.thumb-x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(10, 10, 14, .62); color: #fff; opacity: 0; transition: opacity .12s; }
.thumb-x svg { width: 12px; height: 12px; }
.nt-thumb:hover .thumb-x, .thumb-x:focus-visible { opacity: 1; }
.nt-flist { align-items: flex-start; }
.nt-file svg { width: 13px; height: 13px; color: var(--tx-3); }

/* ---------- приёмка на карточке ---------- */
.card-acc { display: flex; gap: 6px; margin-top: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
.card-acc .btn { flex: 1; justify-content: center; height: 26px; }
.card:hover .card-acc { border-top-color: var(--line-2); }
/* «Пакетом» ужат на пару точек: при наведении рядом появляется меню колонки, и без этого
   «На проверке» обрезалась бы многоточием */
.col-h .btn.btn-sm { height: 24px; padding: 0 6px; font-size: 12px; margin-right: 2px; }
.mono-sm { font-family: var(--mono); font-size: 12px; line-height: 1.5; }

/* ---------- приёмка внутри карточки и предложение шаблона ---------- */
.panel-acc { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 10px; border-radius: var(--r-2); background: var(--acc-soft); color: var(--acc); font-weight: 500; }
/* Пока задача на проверке, полоса с «Принять» и «Вернуть» держится сверху: отчёт
   читают внизу ленты, и без этого после чтения приходится листать обратно.
   Верхняя тень закрашивает отступ прокрутки над полосой — иначе в него видно,
   как проезжает содержимое. */
.panel-acc.stick { position: sticky; top: 0; z-index: 3; box-shadow: 0 -16px 0 0 var(--surface); }
.panel-acc > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.tpl-btn { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 8px; padding: 4px 8px; border-radius: var(--r-1); color: var(--tx-2); font-size: 12.5px; background: var(--surface-2); }
.tpl-btn:hover { color: var(--tx); background: var(--surface-3); }
.tpl-btn svg { width: 14px; height: 14px; color: var(--tx-3); }

/* ---------- сметы ---------- */
.elist { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.erow { display: grid; grid-template-columns: minmax(200px, 1fr) 118px 118px 104px 116px; gap: 14px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--tx); }
.erow:last-child { border-bottom: 0; }
.erow:hover { background: var(--surface-2); text-decoration: none; }
.erow.off { opacity: .6; }
.erow-main { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.erow-main b { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.erow-main span { color: var(--tx-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.erow-n { display: flex; flex-direction: column; }
.erow-n b { font-weight: 600; font-size: 14px; }
.erow-n span { color: var(--tx-3); font-size: 11.5px; }

/* Список инструкций: название и дата, без колонок сметы. */
.irow { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--tx); }
.irow:last-child { border-bottom: 0; }
.irow:hover { background: var(--surface-2); text-decoration: none; }
.irow b { font-weight: 600; min-width: 0; }
.irow time { flex: none; color: var(--tx-3); font-size: 12.5px; white-space: nowrap; }
@media (max-width: 560px) {
  .irow { flex-wrap: wrap; gap: 2px 16px; }
}
.form-acts { display: flex; align-items: center; gap: 8px; margin-top: 16px; }
.form-acts .sp { flex: 1; }

.est-doc-h { margin-bottom: 14px; }
.est-doc-h h1 { font-size: 21px; font-weight: 600; letter-spacing: -.02em; }
.est-doc-h > p { color: var(--tx-2); margin-top: 4px; max-width: 76ch; }
.est-meta { font-size: 12px; color: var(--tx-3); margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.est-tot { display: grid; grid-template-columns: repeat(auto-fit, minmax(164px, 1fr)); gap: 8px; margin-bottom: 18px; }
.est-tot .stat b { font-size: 19px; }
.est-tot .stat i { font-style: normal; font-size: 11.5px; color: var(--tx-3); }
.est-tot .stat.acc { border-color: color-mix(in srgb, var(--acc) 35%, var(--line)); background: var(--acc-soft); }
.est-tot .stat.acc b { color: var(--acc); }
.est-tot .stat.opt { border-style: dashed; }

.est-soon { margin-top: 0; padding-top: 0; border-top: 0; margin-bottom: 18px; }
.est-soon .sec-h h3 { gap: 6px; }
.est-soon .sec-h svg { width: 14px; height: 14px; color: var(--tx-3); }
.est-soon-r { display: grid; grid-template-columns: 90px 118px 1fr auto; gap: 12px; align-items: center; padding: 5px 10px; border-radius: var(--r-2); font-size: 13px; }
.est-soon-r:nth-child(odd) { background: var(--surface-2); }
.est-soon-d { font-weight: 600; }
.est-soon-w { color: var(--tx-3); font-size: 12px; }
.est-soon-r.late .est-soon-d, .est-soon-r.late .est-soon-w { color: var(--danger); }
.est-soon-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.est-table { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.est-g + .est-g .est-g-h { border-top: 1px solid var(--line); }
.est-g-h { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.est-g-t { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--tx-2); }
.est.can .est-g-t { cursor: text; border-radius: var(--r-1); padding: 1px 5px; margin-left: -5px; }
.est.can .est-g-t:hover { background: var(--surface-3); color: var(--tx); }
.est-g-s { flex: 1; text-align: right; font-size: 12px; color: var(--tx-3); }
.est-g-add, .est-g-more { width: 22px; height: 22px; }
.est-g-add svg, .est-g-more svg { width: 14px; height: 14px; }

.eit { display: grid; grid-template-columns: 22px minmax(190px, 1fr) 128px 56px 92px 108px 112px 28px; gap: 8px; align-items: start; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.est:not(.can) .eit { grid-template-columns: minmax(190px, 1fr) 128px 56px 92px 108px 112px; }
.eit:last-child { border-bottom: 0; }
.eit:hover { background: var(--surface-2); }
.eit.drag { opacity: .4; }
.eit.over { box-shadow: inset 0 -2px 0 var(--acc); }
.eit-grip { display: flex; justify-content: center; padding-top: 3px; color: var(--tx-3); opacity: 0; cursor: grab; }
.eit:hover .eit-grip { opacity: 1; }
.eit-grip svg { width: 14px; height: 14px; }
.eit-main { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.eit-l1 { display: flex; align-items: center; gap: 6px; min-width: 0; }
.eit-l1 b { font-weight: 500; }
.eit-flags { display: inline-flex; gap: 4px; flex: none; }
.eit-sub { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 12px; color: var(--tx-3); }
.eit-sub i { font-style: normal; color: var(--line-2); flex: none; }
.eit-sub svg { width: 12px; height: 12px; flex: none; }
.eit-price, .eit-qty, .eit-sum, .eit-date { display: flex; align-items: center; gap: 2px; padding-top: 1px; font-size: 13px; min-height: 22px; }
.eit-price { justify-content: flex-end; }
.eit-price .ein { flex: none; width: 74px; text-align: right; }
.eit-date .ein-date.empty { opacity: 0; transition: opacity .12s; }
.eit:hover .ein-date.empty, .ein-date.empty:focus { opacity: 1; }
.eit-price i, .eit-qty i { font-style: normal; color: var(--tx-3); flex: none; }
.eit-qty { justify-content: flex-end; color: var(--tx-2); }
.eit-qty .ein-qty { width: 34px; flex: none; }
.eit-per { justify-self: start; align-self: start; height: 22px; padding: 0 7px; border-radius: var(--r-1); color: var(--tx-2); font-size: 12.5px; white-space: nowrap; }
.est.can .eit-per:hover { background: var(--surface-3); color: var(--tx); }
.eit-sum { justify-content: flex-end; font-weight: 500; }
.eit-date { justify-content: flex-end; color: var(--tx-2); }
.eit-more { opacity: 0; }
.eit:hover .eit-more, .eit:focus-within .eit-more { opacity: 1; }
.est.can .eit-d-t { display: none; }
.est-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px; color: var(--tx-3); }
.est-add { display: flex; gap: 8px; margin-top: 10px; }
.est-log-b { display: flex; flex-direction: column; }
.est-log-r { display: grid; grid-template-columns: 84px 130px minmax(160px, 1fr) minmax(120px, 1fr); gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--tx-2); }
.est-log-r:last-child { border-bottom: 0; }
.est-log-r i { font-style: normal; color: var(--tx-3); text-decoration: line-through; }
.est-log-r b { font-weight: 500; color: var(--tx); }

/* Поля правятся на месте: до наведения строка читается как документ, а не как форма. */
.ein { width: 100%; min-width: 0; height: 21px; padding: 0 4px; margin-left: -4px; border: 1px solid transparent; border-radius: var(--r-1); background: none; color: inherit; font: inherit; }
.ein::placeholder { color: var(--tx-3); opacity: .65; }
.ein:hover { background: var(--surface-3); }
.ein:focus { background: var(--surface); border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-soft); outline: none; }
.ein-t { height: 22px; font-weight: 500; color: var(--tx); }
.ein-num { text-align: right; }
.ein-date { text-align: right; font-size: 12.5px; }

/* ---------- касса ---------- */
.cash-lead { margin-top: 0; max-width: 72ch; }
.fld.w-date { width: 168px; flex: none; }
.cash-filter { width: auto; max-width: 240px; height: 28px; font-size: 12.5px; }
.cash-list { display: flex; flex-direction: column; gap: 8px; }
.cash-card { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.cash-top { display: flex; align-items: center; gap: 12px; padding: 10px 8px 4px 12px; }
.cash-date { width: 108px; flex: none; color: var(--tx-3); font-size: 12.5px; }
.cash-sum { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.cash-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cash-title b { font-weight: 550; }
.cash-title > span { color: var(--tx-3); font-size: 12.5px; }
.cash-parts { list-style: none; margin: 0; padding: 0 12px 10px 132px; }
.cash-parts li { font-size: 12.5px; color: var(--tx-2); padding: 1px 0; }
.cash-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.cash-picks:empty { display: none; }
.cash-pick { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; height: 26px; padding: 0 2px 0 8px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; }
.cash-pick b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cash-pick > span { color: var(--tx-3); font-size: 11.5px; white-space: nowrap; }
.cash-pick .ib { width: 22px; height: 22px; flex: none; }
.cash-note { white-space: pre-line; }
@media (max-width: 720px) {
  .cash-date { width: auto; }
  .cash-parts { padding-left: 12px; }
  .cash-top { flex-wrap: wrap; }
}

/* Печать: остаётся документ — шапка, итоги, таблица. Служебное и интерфейс уходят. */

/* ---------- обсуждения ---------- */
.ifilter { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }
.ilist { display: flex; flex-direction: column; gap: 6px; }
.irow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); color: var(--tx); }
.irow:hover { background: var(--surface-2); border-color: var(--line-2); text-decoration: none; }
.irow-b { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.irow-b b { font-weight: 550; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.irow-b .muted { font-size: 12px; }
.irow-n { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--tx-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.irow-n svg { width: 13px; height: 13px; }
/* состояние обсуждения: три, а не колонки доски */
.ist { display: inline-flex; align-items: center; gap: 4px; flex: none; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.ist svg { width: 13px; height: 13px; }
.ist.open { color: var(--acc); background: var(--acc-soft); }
.ist.resolved { color: var(--ok); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.ist.rejected { color: var(--tx-3); background: var(--surface-3); }
.panel-issue { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; height: 22px; padding: 0 8px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); color: var(--tx-2); font-size: 12px; }
.panel-issue:hover { color: var(--tx); background: var(--surface-3); text-decoration: none; }
.panel-issue svg { width: 13px; height: 13px; flex: none; }
.panel-issue span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { display: inline-flex; align-items: center; gap: 5px; color: var(--tx-3); font-size: 12.5px; }
.back:hover { color: var(--tx); text-decoration: none; }
.back svg { width: 14px; height: 14px; }
/* Лента крутится сама, поле ответа всегда внизу экрана (TR-32). */
.page.issue {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: 16px;
  overflow: hidden;
}
.issue-main { flex: 1; min-height: 0; overflow: auto; padding-bottom: 8px; }
.page.issue > .cmt-new {
  flex: none;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.issue-h { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.issue-h h1 { flex: 1; min-width: 0; font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.issue-meta { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--tx-2); }
.issue-body { margin-top: 14px; font-size: 14px; line-height: 1.6; color: var(--tx); }
.issue-res { display: flex; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line); }
.issue-res > svg { width: 18px; height: 18px; flex: none; color: var(--ok); margin-top: 1px; }
.issue-res b { display: block; font-size: 13px; margin-bottom: 3px; }
.issue-res p { font-size: 13.5px; line-height: 1.55; margin-bottom: 4px; }
.issue-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ilinks { display: flex; flex-direction: column; gap: 2px; }
.ilink { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--r-2); }
.ilink:hover { background: var(--surface-2); }
.ilink > svg { width: 15px; height: 15px; flex: none; }
.ilink a { flex: 1; min-width: 0; color: var(--tx); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ilink a:hover { text-decoration: none; color: var(--acc); }
.ilink .mono { color: var(--tx-3); margin-right: 4px; }
.ilink .ib { opacity: 0; }
.ilink:hover .ib { opacity: 1; }
.ilpick { margin-top: 10px; max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.ilpick-it { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px; border-radius: var(--r-2); text-align: left; color: var(--tx); }
.ilpick-it:hover { background: var(--surface-2); }
.ilpick-it > svg { width: 15px; height: 15px; flex: none; }
.ilpick-it .mono { color: var(--tx-3); flex: none; }
.ilpick-t { flex: 1; min-width: 0; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.issue.dropping { outline: 2px dashed var(--acc); outline-offset: 6px; border-radius: var(--r-3); }


/* ---------- секреты ---------- */
/* Страница раздела — во всю ширину, как остальные: ограничение есть только у .page.narrow. */
.vlock { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--tx-2); font-size: 12.5px; }
.vlock svg { width: 14px; height: 14px; }
.vlock:hover { background: var(--surface-2); color: var(--tx); }
.vlock.on { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--surface)); }
.vtabs { margin: 0 0 14px; border-bottom: 1px solid var(--line); }
.vtabs .ptab { background: none; border-top: 0; border-left: 0; border-right: 0; cursor: pointer; }
.vtabs .ptab.on { color: var(--tx); border-bottom-color: var(--acc); }
.vsetup { display: flex; gap: 12px; padding: 14px 16px; margin-bottom: 12px; border-radius: var(--r-3); border: 1px solid color-mix(in srgb, var(--acc) 35%, var(--line)); background: color-mix(in srgb, var(--acc) 5%, var(--surface)); }
.vsetup.quiet { border-color: var(--line); background: var(--surface); }
.vsetup > svg { width: 18px; height: 18px; flex: none; color: var(--acc); margin-top: 1px; }
.vsetup.quiet > svg { color: var(--tx-3); }
.vsetup b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.vsetup p { color: var(--tx-2); font-size: 13px; line-height: 1.5; margin-bottom: 10px; max-width: 640px; }
.vbar .vq { max-width: 320px; }
.vlist { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); overflow: hidden; }
.vrow { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--tx); }
.vrow:last-child { border-bottom: 0; }
.vrow:hover { background: var(--surface-2); text-decoration: none; }
.vrow.noacc .vrow-main b { color: var(--tx-2); }
.vic { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; border-radius: var(--r-2); background: var(--surface-3); color: var(--tx-2); }
.vic svg { width: 16px; height: 16px; }
.vic.lg { width: 40px; height: 40px; }
.vic.lg svg { width: 20px; height: 20px; }
.vrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vrow-main b { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vrow-main span { color: var(--tx-3); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vchips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vnone { padding: 16px; }
.vmine { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 10px 14px; border-radius: var(--r-2); background: var(--surface-2); color: var(--tx-2); font-size: 12.5px; }
.vmine > svg { width: 15px; height: 15px; color: var(--tx-3); }
.vmine .sp { flex: 1; }
.vpeople { display: flex; flex-direction: column; gap: 2px; }
.vperson { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-radius: var(--r-2); }
.vperson:hover { background: var(--surface-2); }
.vp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.vp-main b { font-weight: 550; font-size: 13.5px; }
.vp-main .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vp-key { font-size: 12px; color: var(--tx-2); white-space: nowrap; }
.vp-gap { width: 110px; }
.vlog { display: flex; flex-direction: column; }
.vlog-r { display: grid; grid-template-columns: 132px minmax(90px, 150px) minmax(0, 1fr) minmax(0, 180px) 110px; gap: 10px; align-items: baseline; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.vlog-r:last-child { border-bottom: 0; }
.vlog-r time { color: var(--tx-3); font-variant-numeric: tabular-nums; }
.vlog-r b { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlog-a { color: var(--tx-2); }
.vlog-s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vlog-ip { font-family: var(--mono); font-size: 11.5px; text-align: right; overflow: hidden; text-overflow: ellipsis; }
.vsecret .vlog-r { grid-template-columns: 132px minmax(90px, 150px) minmax(0, 1fr) 110px; }
.vhead { display: flex; align-items: center; gap: 12px; margin: 10px 0 14px; }
.vhead h1 { font-size: 22px; font-weight: 600; letter-spacing: -.01em; }
.vhead .muted { font-size: 12.5px; margin-top: 2px; }
.vwarn { display: flex; gap: 10px; padding: 12px 14px; margin-bottom: 14px; border-radius: var(--r-3); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); }
.vwarn > svg { width: 18px; height: 18px; flex: none; color: var(--danger); margin-top: 1px; }
.vwarn b { display: block; font-size: 13px; margin-bottom: 2px; }
.vwarn p { font-size: 13px; color: var(--tx-2); line-height: 1.5; }
.vmeta { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px; }
.vm { display: flex; flex-direction: column; gap: 3px; padding: 9px 12px; border-radius: var(--r-2); background: var(--surface-2); min-width: 0; }
.vm span { font-size: 11.5px; color: var(--tx-3); }
.vm b { font-weight: 500; font-size: 13px; overflow-wrap: anywhere; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vbox { display: flex; gap: 12px; padding: 16px; border-radius: var(--r-3); border: 1px dashed var(--line-2); background: var(--surface); }
.vbox > svg { width: 20px; height: 20px; flex: none; color: var(--tx-3); margin-top: 1px; }
.vbox b { display: block; font-size: 13.5px; margin-bottom: 3px; }
.vbox p { color: var(--tx-2); font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.vfields { border: 1px solid var(--line); border-radius: var(--r-3); background: var(--surface); }
.vf { display: grid; grid-template-columns: 180px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.vf:last-child { border-bottom: 0; }
.vf-l { font-size: 12px; color: var(--tx-3); }
.vf-v { font-family: var(--mono); font-size: 13px; overflow-wrap: anywhere; white-space: pre-wrap; min-width: 0; }
.vf-v.ml { max-height: 240px; overflow: auto; }
.vf-v.hidden-v { color: var(--tx-3); letter-spacing: .08em; white-space: nowrap; }
.vf-acts { display: flex; gap: 2px; }
.vnote { margin-top: 10px; padding: 10px 12px; border-radius: var(--r-2); background: var(--surface-2); }
.vnote-t { margin-top: 4px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
/* Скрытие символов в полях ключей и значений. Не type=password: такое поле браузер
   предлагает запомнить в своём менеджере паролей — вместе с адресом трекера. */
.vk-in.masked { -webkit-text-security: disc; }
.vk-file-row { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; }
.vshow { display: inline-flex; align-items: center; gap: 5px; color: var(--tx-3); font-size: 12.5px; background: none; border: 0; padding: 2px 0; cursor: pointer; }
.vshow:hover { color: var(--tx); }
.vshow svg { width: 14px; height: 14px; }
.vk-go { display: flex; justify-content: flex-start; margin: 6px 0 12px; }
.vkey { margin: 10px 0; padding: 14px; border-radius: var(--r-3); background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; font-weight: 600; letter-spacing: .04em; line-height: 1.7; text-align: center; overflow-wrap: anywhere; user-select: all; }
.vkey-acts { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.vk-f { display: flex; justify-content: flex-end; gap: 8px; padding: 4px 0 8px; }
.vform .vkinds { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.vform .fchip svg { width: 13px; height: 13px; }
.vform .fld span em { font-style: normal; font-weight: 400; }
.vcheck { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 13px; color: var(--tx-2); cursor: pointer; }
.vextra { display: flex; flex-direction: column; gap: 6px; margin: -2px 0 14px; align-items: flex-start; }
.vextra-r { display: grid; grid-template-columns: 180px minmax(0, 1fr) 30px; gap: 6px; width: 100%; }
.vk-print { display: none; }
@media (max-width: 720px) {
  .vf { grid-template-columns: minmax(0, 1fr) auto; }
  .vf-l { grid-column: 1 / -1; }
  .vlog-r, .vsecret .vlog-r { grid-template-columns: 1fr; gap: 2px; }
  .vlog-ip { text-align: left; }
  .vp-key { display: none; }
}

@media print {
  /* На бумаге всегда светлая палитра: в тёмной теме документ ушёл бы белым по белому —
     фон браузер не печатает, а цвет текста остаётся светлым. */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --surface: #fff; --surface-2: #fff; --surface-3: #F2F2F4; --side: #fff;
    --line: #DDDDE2; --line-2: #C8C8D0; --tx: #14141A; --tx-2: #44444C; --tx-3: #75757E;
    --acc: #3F4AAE; --acc-soft: #FFFFFF; --ok: #1F7A46; --warn: #96650B; --danger: #B22B2B;
  }
  body, body.app { overflow: visible !important; height: auto !important; background: #fff !important; }
  body.app #app { display: block !important; height: auto !important; }
  .side, .side-bg, .top, #panel, .toast, #pushes, .ov, .menu-pop, .est-add, .est-log, .est-soon-w, .cash-more, .cash-filter { display: none !important; }
  .main { height: auto !important; display: block !important; }
  .view { display: block !important; height: auto !important; overflow: visible !important; }
  .page { padding: 0 !important; }
  .eit-grip, .eit-more, .est-g-add, .eit-acc, .eit .ein-date { display: none !important; }
  .est.can .eit-d-t { display: inline !important; }
  /* Ручка и «ещё» сняты — колонок остаётся шесть. Оставить восемь нельзя:
     скрытые ячейки выпадают из сетки, и всё содержимое съезжает на колонку влево. */
  .est.can .eit { grid-template-columns: minmax(190px, 1fr) 128px 56px 92px 108px 112px; }
  /* Поля печатаются как текст: по ширине содержимого и без пустых подсказок.
     Строка, где заполнять было нечего, на лист не идёт вместе со своим разделителем. */
  .ein { border-color: transparent !important; background: none !important; box-shadow: none !important; width: auto !important; field-sizing: content; max-width: 100%; }
  .eit-price .ein { text-align: left; }
  .est-soon-r { grid-template-columns: 90px 1fr auto; }
  .ein:placeholder-shown { display: none !important; }
  .eit-sub:not(:has(.ein:not(:placeholder-shown))) { display: none !important; }
  .eit-sub:has(.ein:placeholder-shown) > i { display: none !important; }
  .est-table, .est-tot { border-color: #ccc; }
  .est-g, .est-soon-r, .stat { break-inside: avoid; }
  .eit { break-inside: avoid; border-bottom-color: #eee; }
  .est-doc-h h1 { font-size: 19px; }
  a[href]::after { content: none !important; }
}
@page { margin: 14mm; }

/* Лист с ключом восстановления: при печати из диалога на бумагу идёт только он. */
@media print {
  body.printing-key.app #app, body.printing-key > *:not(.vk-print) { display: none !important; }
  body.printing-key .vk-print { display: block !important; padding: 12mm 4mm; color: #000; }
  .vk-print h1 { font-size: 18pt; margin-bottom: 14pt; }
  .vk-print-key { font: 700 17pt/1.8 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; padding: 12pt; border: 1.5pt solid #000; border-radius: 6pt; margin-bottom: 16pt; text-align: center; overflow-wrap: anywhere; }
  .vk-print p { font-size: 11pt; line-height: 1.5; margin-bottom: 6pt; }
}

/* Сложность — нейтральная оценка, цвет приоритета остаётся отдельным сигналом. */
.card-complexity { margin-top: 6px; }
.complexity { white-space: nowrap; color: var(--tx-2); }
