:root{
  color-scheme:light;
  --bg:#EDF0F4; --surface:#FFFFFF; --sel:#EAF1FB;
  --ink:#152130; --ink2:#4A586A; --line:#D3DAE3; --line2:#E6EBF1;
  --accent:#1B3556; --accent-fg:#FFFFFF; --focus:#1B6BD6;
  --st-todo:#5F6B79; --st-progress:#2159A3; --st-review:#6746A8; --st-rework:#BB3F0B; --st-done:#1B7549; --st-blocked:#A32B4B;
  --tint-rework:#FCEEE7; --tint-review:#F1ECFA; --tint-none:#F3F6F9; --col:#F6F8FB; --shadow:0 1px 2px rgba(21,33,48,.08); --shadow-lg:0 12px 40px rgba(21,33,48,.28);
  --ok-bg:#1B7549; --ok-fg:#FFFFFF; --warn:#B3261E;
  --badge-bg:#6746A8; --badge-fg:#FFFFFF;
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
}
@media (prefers-color-scheme:dark){
  :root{
    color-scheme:dark;
    --bg:#0F151C; --surface:#172029; --sel:#1F2D3D;
    --ink:#E6EBF0; --ink2:#A6B1BE; --line:#2B3743; --line2:#212C37;
    --accent:#8DB4E8; --accent-fg:#0B1520; --focus:#7DB0F5;
    --st-todo:#A3AEBB; --st-progress:#7FB0EE; --st-review:#B9A5E2; --st-rework:#F0966F; --st-done:#5CC38F; --st-blocked:#EE8CA6;
    --tint-rework:#2E1D16; --tint-review:#221C31; --tint-none:#1B252F; --col:#121A22; --shadow:none; --shadow-lg:0 12px 40px rgba(0,0,0,.6);
    --ok-bg:#4DB784; --ok-fg:#0C1A13; --warn:#F28B82;
    --badge-bg:#B9A5E2; --badge-fg:#1A1230;
  }
}
*{box-sizing:border-box}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;background:var(--bg);color:var(--ink);font:400 16px/1.5 system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;-webkit-text-size-adjust:100%}
button,input,select,textarea{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.app{width:100%;margin:0 auto;padding:0 16px 72px}
@media (min-width:1200px){.app{padding-left:24px;padding-right:24px}}
.boot{padding:40px 0;color:var(--ink2)}

.top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 24px;padding:18px 0 12px}
.top-actions{display:flex;align-items:center;gap:8px}
/* Логотип в шапке: ОДИН заменяемый файл логотипа в public/brand (сейчас чёрный логотип TaskControl, позже — логотип заказчика). Белая подложка, чтобы в тёмной теме чёрный логотип был виден. */
.brand-row{display:flex;align-items:center;gap:12px;min-width:0}
.company-logo{display:block;flex:none;width:40px;height:40px;object-fit:contain;border-radius:8px;background:#fff;padding:2px}
.auth-logo{width:56px;height:56px;margin:0 0 8px}
.brand h1{margin:0;font-size:22px;line-height:1.2;font-weight:700;letter-spacing:-.01em}
.brand p{margin:2px 0 0;color:var(--ink2);font-size:14px}
/* Подпись экземпляра (APP_INSTANCE_LABEL, например DEMO) — есть только если задана. */
.inst{display:inline-block;vertical-align:middle;margin-left:10px;padding:0 8px;border:1.5px solid var(--st-rework);border-radius:6px;color:var(--st-rework);font-size:12px;font-weight:700;line-height:20px;letter-spacing:.06em;white-space:nowrap}
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--line);overflow-x:auto}
.tab{background:none;border:0;padding:10px 16px;font-weight:600;color:var(--ink2);cursor:pointer;border-bottom:3px solid transparent;margin-bottom:-1px;white-space:nowrap}
.tab[aria-selected="true"]{color:var(--ink);border-bottom-color:var(--accent)}
.badge{display:inline-block;min-width:20px;padding:0 6px;margin-left:8px;border-radius:10px;background:var(--badge-bg);color:var(--badge-fg);font-size:12px;line-height:20px;text-align:center}

.authcard{max-width:440px;margin:10vh auto 0;background:var(--surface);border:1px solid var(--line);border-radius:8px;padding:28px}
.authcard h1{margin:0 0 6px;font-size:24px}
.authcard p{margin:0 0 16px;color:var(--ink2)}
.authcard .btns{margin-top:18px}
/* DEV-ENV: подготовленные учётные записи на экране входа (только DEMO/TEST) */
.devpick{margin:0 0 16px}
.devlist{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:8px}
.devlist[hidden],.devlist li[hidden]{display:none}
.devacc{font:inherit;padding:6px 10px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);cursor:pointer;text-align:left}
.devacc:hover{border-color:var(--ink2)}
.devacc.sel{border-color:var(--accent);outline:2px solid var(--accent);outline-offset:-2px;font-weight:600}
.err{color:var(--warn);font-weight:600;margin:10px 0 0}

.toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:10px 0}
.panel.flush .toolbar{padding:12px 14px;border-bottom:1px solid var(--line)}
.view>.toolbar{padding:13px 15px}/* панель доски — на тех же отступах (с учётом рамки 1px), что и во «flush»-панелях списка и порядка: переключатель вида не смещается между видами */
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{border:1px solid var(--line);background:transparent;border-radius:16px;padding:4px 12px;font-size:14px;cursor:pointer}
.chip[aria-pressed="true"]{background:var(--accent);color:var(--accent-fg);border-color:var(--accent)}
.chipn{font-weight:700;margin-left:2px}
.seg{margin-left:auto;display:inline-flex;border:1px solid var(--line);border-radius:16px;overflow:hidden;flex:none}
.seg-b{border:0;background:transparent;padding:4px 14px;font-size:14px;cursor:pointer}
.seg-b+.seg-b{border-left:1px solid var(--line)}
.seg-b[aria-pressed="true"]{background:var(--accent);color:var(--accent-fg)}

.s-NEW,.s-ACCEPTED,.s-CANCELLED{--st:var(--st-todo)} .s-IN_PROGRESS{--st:var(--st-progress)} .s-WAITING_FOR_REVIEW{--st:var(--st-review)} .s-NEEDS_CHANGES{--st:var(--st-rework)} .s-COMPLETED{--st:var(--st-done)} .s-BLOCKED{--st:var(--st-blocked)}
.s-CANCELLED .rt{text-decoration:line-through}
.st{display:inline-flex;align-items:center;gap:6px;color:var(--st);font-weight:600}
.st::before{content:"";width:8px;height:8px;border-radius:50%;background:currentColor;flex:none}

.row{display:block;width:100%;text-align:left;background:none;border:0;border-bottom:1px solid var(--line2);border-left:4px solid var(--st);padding:12px 14px;cursor:pointer}
.row[aria-current="true"],.row:hover{background:var(--sel)}
.row.sub{padding-left:32px;font-size:14px}
.rt{display:block;font-weight:600;line-height:1.35}
.rm{display:flex;flex-wrap:wrap;gap:2px 14px;margin-top:4px;font-size:13px;color:var(--ink2)}
/* ---------- Простой список (этап E.1) ---------- */
/* Статус — плашка с текстом и значком-формой (не только цвет): ○ новая, ◐ принята, ▶ в работе, ‖ ожидание, ◉ проверка, ↺ доработка, ✓ готово, ✕ отменена. */
.sbadge{padding:0 9px 0 7px;border:1px solid currentColor;border-radius:11px;font-size:13px;line-height:20px;white-space:nowrap}
.sbadge::before{width:auto;height:auto;border-radius:0;background:none;font-size:12px;line-height:1}
.s-NEW .sbadge::before{content:"\25CB"} .s-ACCEPTED .sbadge::before{content:"\25D0"} .s-IN_PROGRESS .sbadge::before{content:"\25B6"} .s-BLOCKED .sbadge::before{content:"\2016"}
.s-WAITING_FOR_REVIEW .sbadge::before{content:"\25C9"} .s-NEEDS_CHANGES .sbadge::before{content:"\21BA"} .s-COMPLETED .sbadge::before{content:"\2713"} .s-CANCELLED .sbadge::before{content:"\2715"}
.s-COMPLETED .sbadge{background:var(--tint-none)} .s-CANCELLED .sbadge{border-style:dashed}
.pr{white-space:nowrap}
.pr-HIGH{color:var(--st-rework);font-weight:700} .pr-LOW{color:var(--ink2);font-style:italic}
.lrow{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;cursor:default;padding:0}
.lrow:hover{background:none}
.lrow.needs{background:var(--tint-none)}
.lmain{flex:1 1 260px;min-width:0;text-align:left;background:none;border:0;padding:12px 14px;cursor:pointer;color:inherit;font:inherit}
.lmain:hover,.lmain[aria-current="true"]{background:var(--sel)}
.lrow.sub{padding:0}
.lrow.sub .lmain{padding-left:32px}
.lrow .rm{align-items:center;gap:4px 12px;font-size:13px}
.rt{overflow-wrap:anywhere}
.btn.busy{cursor:progress}
.btn.busy::after{content:"…";margin-left:2px}
.lact{display:flex;flex-wrap:wrap;gap:6px;padding:0 14px 0 0;flex:none}
.lrow.sub .lact{padding-right:14px}
.lrow .msg{flex-basis:100%;margin:0;padding:0 14px 10px}
@media (max-width:860px){
  .lmain{flex-basis:100%;padding-bottom:6px}
  .lact{flex-basis:100%;padding:0 14px 12px}
  .lrow.sub .lact{padding-left:32px}
  .lact .btn{flex:1 1 auto;min-height:40px}
  .toolbar .seg{width:100%}
  .toolbar .seg-b{flex:1;padding:8px 6px}
}
.overdue{color:var(--warn);font-weight:600}
.soon{color:var(--st-rework);font-weight:600}
.empty{padding:28px 18px;color:var(--ink2)}
.empty strong{display:block;color:var(--ink);margin-bottom:4px}

.detail{padding:24px 28px 32px;min-width:0}
.view{margin-top:14px}
.panel.flush{padding:0;overflow:hidden}
.detail h2{margin:0;font-size:24px;line-height:1.25;font-weight:700;letter-spacing:-.01em}
.detail h2:focus{outline:none}
.detail h3,.panel h3{margin:28px 0 10px;font-size:17px;font-weight:700}
.crumb{margin:0 0 6px;color:var(--ink2);font-size:14px}
.statusline{display:flex;align-items:center;gap:16px;margin-top:8px;min-height:38px}
.stamp{display:inline-block;border:2px solid var(--st-done);color:var(--st-done);padding:1px 12px;border-radius:4px;font-weight:700;transform:rotate(-4deg)}
.stamp.pop{animation:stamp .38s cubic-bezier(.2,.9,.3,1.35)}
@keyframes stamp{from{transform:rotate(-4deg) scale(1.9);opacity:0}to{transform:rotate(-4deg) scale(1);opacity:1}}
.facts{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:6px 18px;margin:16px 0}
.facts dt{color:var(--ink2)} .facts dd{margin:0}
.desc{margin:0 0 4px;max-width:70ch;white-space:pre-wrap}
/* H.2: блок машинного перевода (отдельно подписан, оригинал выше остаётся) */
.tr{margin:8px 0 12px}
.tr:focus{outline:none}
.tr-box{background:var(--tint-none);border-left:4px solid var(--st-rework);padding:8px 12px;margin:0 0 6px;max-width:70ch}
.tr-lbl{margin:0 0 4px;font-size:.85em}
.tr-title{margin:0 0 4px;font-weight:600;white-space:pre-wrap}
.tr-item{margin:6px 0 0;max-width:68ch}
.tr-copy{display:flex;flex-wrap:wrap;gap:6px;margin:4px 0}
.tr-rl{margin:4px 0}
.tt-fs{border:0;margin:0;padding:0;min-width:0}
.tt-list{display:flex;flex-wrap:wrap;gap:4px 16px}
.tt-opt{display:inline-flex;align-items:center;gap:8px;min-height:44px;cursor:pointer}
.tt-opt input{width:20px;height:20px;flex:none}
/* 20.102: «Переводчики» — карточка подключения; узкий экран: поля на всю ширину, кнопки переносятся */
.tc-row{border:1px solid var(--line);border-radius:8px;margin:12px 0;padding:8px 12px;min-width:0}
.tc-row legend{font-weight:600;padding:0 6px}
.tc-row input[type=text]{width:100%;max-width:100%;box-sizing:border-box}
.tc-row .tt-opt{display:flex;min-height:44px}
.tc-btns{display:flex;flex-wrap:wrap;gap:8px}
.tr-cpf{margin:6px 0 0}
.tr-text{margin:0;white-space:pre-wrap}

.pin{background:var(--tint-rework);border-left:4px solid var(--st-rework);padding:12px 14px;margin:16px 0}
.pin b{display:block;margin-bottom:4px}
.pin p{margin:0;white-space:pre-wrap;max-width:70ch}
.pin small{display:block;margin-top:6px;color:var(--ink2)}

.act{margin:20px 0;padding:14px 16px;background:var(--tint-none);border-left:4px solid var(--st,var(--line))}
.act.review{background:var(--tint-review)}
.act p{margin:0 0 10px}
.act .lbl{display:block;font-weight:600;margin-bottom:4px}
.btns{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.msg{margin:10px 0 0;color:var(--warn);font-weight:600}

textarea,input[type=text],input[type=email],input[type=tel],input[type=password],input[type=date],input:not([type]),select{width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:6px;background:var(--surface)}
textarea{resize:vertical;min-height:72px}
.field{margin:0 0 14px;max-width:560px}
.field>label{display:block;font-weight:600;margin-bottom:4px}
.two{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;max-width:560px}

.btn{font-weight:600;padding:9px 16px;border-radius:6px;border:1px solid transparent;cursor:pointer;line-height:1.3}
.btn.sm{padding:6px 12px;font-size:14px}
.btn.primary{background:var(--accent);color:var(--accent-fg)}
.btn.ok{background:var(--ok-bg);color:var(--ok-fg)}
.btn.warn{background:transparent;border-color:var(--st-rework);color:var(--st-rework)}
.btn.ghost{background:transparent;border-color:var(--line);color:var(--ink)}
.btn.danger{background:transparent;border-color:var(--warn);color:var(--warn)}
.btn[disabled]{opacity:.6;cursor:default}
.link{background:none;border:0;padding:0;color:var(--accent);text-decoration:underline;cursor:pointer}

.subs{border-top:1px solid var(--line)}
.hist{list-style:none;margin:0;padding:0 0 0 4px}
.hist li{border-left:2px solid var(--line);padding:0 0 16px 16px;position:relative}
.hist li::before{content:"";position:absolute;left:-6px;top:6px;width:10px;height:10px;border-radius:50%;background:var(--surface);border:2px solid var(--st-todo)}
.hist li.k-NEEDS_CHANGES::before{border-color:var(--st-rework)}
.hist li.k-COMPLETED::before{border-color:var(--st-done)}
.hist li.k-WAITING_FOR_REVIEW::before{border-color:var(--st-review)}
.hist li.k-BLOCKED::before{border-color:var(--st-blocked)}
.hh{display:flex;flex-wrap:wrap;gap:0 12px;align-items:baseline}
.hh time{color:var(--ink2);font-size:13px}
.hn{margin:6px 0 0;padding:8px 10px;background:var(--tint-none);white-space:pre-wrap;max-width:68ch}
.k-NEEDS_CHANGES .hn{background:var(--tint-rework)}
.progress{height:8px;background:var(--line);border-radius:4px;overflow:hidden;max-width:320px;margin:4px 0 12px}
.progress>span{display:block;height:100%;background:var(--st-done)}
.result{white-space:pre-wrap;background:var(--tint-none);padding:8px 10px;max-width:68ch}
.auditlog{list-style:none;margin:0;padding:0}
.auditlog li{border-bottom:1px solid var(--line2);padding:10px 0}
.auditlog .ah{display:flex;flex-wrap:wrap;gap:2px 12px;align-items:baseline}
.auditlog .ah time,.auditlog .av{color:var(--ink2);font-size:13px}
.auditlog .av{white-space:pre-wrap;word-break:break-word;margin-top:2px}
.owner-tools{display:flex;flex-wrap:wrap;gap:8px;margin-top:28px;padding-top:16px;border-top:1px solid var(--line)}

.panel{background:var(--surface);border:1px solid var(--line);border-radius:8px;margin-top:16px;padding:24px 28px 32px}
.panel h2{margin:0 0 6px;font-size:22px}
.panel p{max-width:72ch}
.panel h3:first-of-type{margin-top:18px}
.callout{background:var(--tint-review);border-left:4px solid var(--st-review);padding:10px 14px;margin:14px 0;max-width:72ch}
.ubox{border:1px solid var(--line);border-radius:6px;padding:12px 16px 8px;margin:0 0 14px;max-width:760px}
.ubox legend{padding:0 6px;font-weight:700}
.ubox .meta{margin:0 0 10px;color:var(--ink2);font-size:14px}
.crow{display:grid;grid-template-columns:170px minmax(0,1fr);gap:6px 14px;align-items:center;margin-bottom:10px}
.chk{display:flex;align-items:center;gap:8px;font-weight:500}
.chk input{width:18px;height:18px;flex:none}
.warnline{grid-column:2;color:var(--warn);font-size:13px;margin-top:-4px}
.hint{color:var(--ink2);font-size:14px}
ol.hint{padding-left:20px;margin:8px 0}
.okt{color:var(--st-done);font-weight:600}
.copyrow{display:flex;gap:8px;max-width:640px;margin:6px 0 10px}
.copyrow input{flex:1 1 auto;width:auto;font-size:14px}
.addrow{display:flex;flex-wrap:wrap;gap:8px;max-width:640px}
.addrow input{flex:1 1 180px;width:auto}
.feed,.log{list-style:none;margin:0;padding:0;max-width:820px}
.feed li,.log li{padding:10px 0 10px 12px;border-bottom:1px solid var(--line2);border-left:4px solid transparent}
.feed li.unread{border-left-color:var(--st-review);background:var(--tint-review)}
.feed time,.log time{color:var(--ink2);font-size:13px}
.ntf-h{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline}
.ntf-new{font-size:12px;font-weight:600;color:var(--st-review)}
.ntf-a{display:flex;flex-wrap:wrap;gap:4px 16px;margin-top:4px}
.nlist{margin:4px 0 4px 20px;padding:0}
.nlist li{border:0;padding:2px 0;background:none}
.feed li{overflow-wrap:anywhere}
.ent-h{display:flex;flex-wrap:wrap;gap:2px 12px;align-items:baseline;font-size:14px}
.ent-b{margin-top:2px;max-width:70ch;font-size:14px}
.s-failed{color:var(--warn);font-weight:600} .s-sent{color:var(--st-done);font-weight:600} .s-skipped,.s-pending{color:var(--ink2);font-weight:600}
.srv{display:grid;grid-template-columns:max-content 1fr;gap:4px 16px;max-width:640px}

@media (max-width:860px){
  .detail,.panel{padding:18px 16px 28px}
  .panel.flush{padding:0}
  .top-actions .btn.primary{display:none}
  .board{grid-auto-columns:minmax(260px,82vw)}
  .chips{flex-wrap:nowrap;overflow-x:auto;max-width:100%;padding-bottom:4px}
  .chip{white-space:nowrap;flex:none}
  .crow{grid-template-columns:1fr}
  .warnline{grid-column:1}
  .authcard{margin-top:4vh;padding:20px}
}
.badge-role{font-size:13px;font-weight:600;color:var(--ink2)}
.ustatus{font-size:12px;font-weight:700;padding:1px 8px;border-radius:10px;border:1px solid var(--line);color:var(--ink2)}
.ustatus.st-ACTIVE{color:var(--st-done);border-color:var(--st-done)}
.ustatus.st-PENDING{color:var(--st-progress);border-color:var(--st-progress)}
.ustatus.st-INACTIVE,.ustatus.st-DISABLED{color:var(--warn);border-color:var(--warn)}
.ubox h4{margin:12px 0 6px}
.sched{display:flex;flex-wrap:wrap;gap:6px 16px;margin:0 0 10px}
.sday,.sbrk{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 8px}
.sday strong{min-width:28px}
.mins{width:5.5em}
input.tm{width:7em}
.stime{max-width:none;grid-template-columns:repeat(2,max-content);gap:6px 24px}
.stime label{display:block;font-weight:600;margin-bottom:4px}
.stime .ferr{display:block;width:0;min-width:100%}
.stime .ferr:empty{display:none}
.ferr{color:var(--warn);font-weight:600;font-size:14px}
.ferr:empty{display:none}
input[aria-invalid=true]{border-color:var(--warn)}
.sbrk select,.sday select{width:auto}
.perms{list-style:none;margin:0 0 8px;padding:0}
.perms li{padding:8px 0;border-top:1px solid var(--line2)}
.ubox select{max-width:100%}
@media (prefers-reduced-motion:reduce){.stamp.pop{animation:none}}

/* ---------- Панель показателей ---------- */
.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:14px}
.stat{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:12px 16px;cursor:pointer;box-shadow:var(--shadow)}
.stat:hover{border-color:var(--accent)}
.stat-n{font-size:28px;font-weight:700;line-height:1.1;letter-spacing:-.02em}
.stat-l{color:var(--ink2);font-size:14px}
.stat.review .stat-n{color:var(--st-review)} .stat.good .stat-n{color:var(--st-done)} .stat.bad .stat-n{color:var(--warn)}

/* ---------- Доска ---------- */
.board{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(172px,1fr);gap:10px;overflow-x:auto;padding:2px 2px 14px;scroll-snap-type:x proximity}
.board.single{grid-auto-columns:minmax(260px,440px)}
@media (max-width:1100px){.board{grid-auto-columns:minmax(210px,1fr)}}
@media (max-width:860px){.board{grid-auto-columns:minmax(260px,82vw)}.board.single{grid-auto-columns:minmax(260px,100%)}}
.col{display:flex;flex-direction:column;min-width:0;max-height:calc(100vh - 290px);min-height:160px;background:var(--col);border:1px solid var(--line);border-radius:10px;scroll-snap-align:start}
.col-h{display:flex;align-items:center;justify-content:space-between;margin:0;padding:10px 12px;font-size:14px;border-top:3px solid var(--st);border-radius:10px 10px 0 0}
.col-n{min-width:22px;padding:0 7px;border-radius:11px;background:var(--line2);color:var(--ink2);font-size:12px;font-weight:700;line-height:22px;text-align:center}
.col-b{display:flex;flex-direction:column;gap:8px;padding:0 8px 10px;overflow-y:auto}
.col-empty{margin:6px 4px;color:var(--ink2);font-size:13px}
.card{display:flex;flex-direction:column;gap:6px;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--st);border-radius:8px;padding:10px 12px;cursor:pointer;box-shadow:var(--shadow)}
.card:hover,.card[aria-current="true"]{border-color:var(--accent);border-left-color:var(--st)}
.card.needs{box-shadow:0 0 0 2px var(--st-review)}
.card-t{font-weight:600;line-height:1.3;word-break:break-word}
.card-par,.card-rev{color:var(--ink2);font-size:12px}
.card-pills{display:flex;flex-wrap:wrap;gap:4px}
.pill{display:inline-block;padding:0 8px;border-radius:10px;font-size:12px;font-weight:700;line-height:20px;border:1px solid var(--line);color:var(--ink2)}
.pill.act{background:var(--badge-bg);border-color:var(--badge-bg);color:var(--badge-fg)}
.pill.over{border-color:var(--warn);color:var(--warn)}
.pill.res{border-color:var(--st-done);color:var(--st-done)}
.pill.pr-HIGH{border-color:var(--st-rework);color:var(--st-rework)}
.card-people{display:flex;align-items:center;gap:6px;font-size:13px}
.ava{display:inline-flex;align-items:center;justify-content:center;width:22px;height:22px;border-radius:50%;background:var(--sel);color:var(--accent);font-size:11px;font-weight:700;flex:none}
.card-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--ink2)}
.mini{display:inline-flex;align-items:center;gap:6px;font-weight:600}
.mini-bar{display:inline-block;width:40px;height:6px;border-radius:3px;background:var(--line);overflow:hidden}
.mini-bar>span{display:block;height:100%;background:var(--st-done)}
.archive{margin:2px 0 0}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:10px}
.cards .card{height:100%}

/* ---------- Окно ---------- */
.modal{position:fixed;inset:0;z-index:50}
.backdrop{position:absolute;inset:0;background:rgba(10,18,28,.55)}
.dialog{position:absolute;top:5vh;left:50%;transform:translateX(-50%);width:min(760px,calc(100vw - 32px));max-height:90vh;overflow-y:auto;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-lg);overscroll-behavior:contain}
.dialog.form{width:min(640px,calc(100vw - 32px))}
.close{position:absolute;top:10px;right:12px;width:36px;height:36px;border:0;border-radius:18px;background:transparent;color:var(--ink2);font-size:26px;line-height:1;cursor:pointer}
.close:hover{background:var(--sel)}
.dialog h2{padding-right:40px}
/* Закреплённая шапка окна задачи: sticky внутри прокручиваемого .dialog, отрицательные поля перекрывают отступы .dialog (они берутся от .card: 10px 12px); sticky считает от внутренней границы отступа, поэтому top = -padding */
.dlg-head{position:sticky;top:-10px;z-index:2;margin:-10px -12px 0;padding:14px 56px 10px 12px;background:var(--surface);border-bottom:1px solid var(--line);border-radius:12px 12px 0 0}
.dlg-head .close{z-index:1}
.dlg-head h2{padding-right:0;overflow-wrap:anywhere;font-size:20px;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:4;overflow:hidden}
.dlg-head .crumb .link{display:inline;font:inherit;text-align:left}
.dlg-head .crumb{margin:0 0 2px;max-height:3em;overflow:hidden;overflow-wrap:anywhere}
body.modal-open{overflow:hidden}
.fab{display:none;position:fixed;right:16px;bottom:16px;bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:40;width:56px;height:56px;border:0;border-radius:28px;background:var(--accent);color:var(--accent-fg);font-size:30px;line-height:1;align-items:center;justify-content:center;box-shadow:var(--shadow-lg);cursor:pointer}
/* Узкие экраны: правила обязаны стоять ПОСЛЕ базовых .fab и .dialog (та же специфичность — побеждает последнее).
   «+» показывается; окно — на весь экран (без полосы подложки внизу: нажатие на неё закрывало форму и теряло введённое). */
@media (max-width:860px){.fab{display:flex}.dialog{inset:0;width:100%;max-height:none;border-radius:0;transform:none}.dialog.form{width:100%}.dlg-head{border-radius:0}}

/* ---------- «В ожидании» ---------- */
.card-wait{font-size:13px;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;word-break:break-word}
.waitbox{margin:20px 0;padding:14px 16px;background:var(--tint-none);border-left:4px solid var(--st-blocked)}
.waitbox.bad{background:var(--tint-rework);border-left-color:var(--warn)}
.waitflag{margin:6px 0 0;color:var(--warn);font-weight:700}
.waitbox .facts{margin:10px 0}
.waitbox .lbl{display:block;font-weight:600;margin-bottom:4px}
.wlog{list-style:none;margin:0;padding:0 0 0 4px}
.wlog li{border-left:2px solid var(--line);padding:0 0 14px 16px;position:relative}
.wlog li::before{content:"";position:absolute;left:-6px;top:6px;width:10px;height:10px;border-radius:50%;background:var(--surface);border:2px solid var(--st-blocked)}
.wlog li.wl-resume::before{border-color:var(--st-done)}
.wlog li.wl-end::before{border-color:var(--ink2)}
.wl-ch{color:var(--ink2);font-size:14px}
.wl-h{margin:14px 0 6px}
.waitbox .chips{flex-wrap:wrap;overflow:visible;padding-bottom:0}
/* Этап D: порядок выполнения (очередь сотрудника) */
.qwrap{padding:12px 16px 16px}
.qlist{list-style:none;margin:8px 0 16px;padding:0;display:flex;flex-direction:column;gap:6px}
.qitem{display:flex;flex-wrap:wrap;align-items:flex-start;gap:8px 12px;background:var(--surface);border:1px solid var(--line);border-left:4px solid var(--st);border-radius:8px;padding:8px 10px}
.qn{min-width:28px;font-weight:700;font-size:18px;line-height:28px;text-align:center}
.qbody{flex:1 1 220px;min-width:0}
.qmeta{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:13px;color:var(--ink2);margin-top:2px}
.qwhy{font-size:13px;margin-top:2px}
.qbtns{display:flex;flex-wrap:wrap;gap:4px}
.qbtns .btn{min-width:40px}
.pill.dev{border-color:var(--warn);color:var(--warn)}
.pill.ord{border-color:var(--ink2)}

/* ---------- Этап E.1.1: ошибки у поля, окно подтверждения, причина отмены ---------- */
.msg.field-err{margin:6px 0 0}
.msg.ok{color:var(--st-done)}
.owner-tools .msg{flex-basis:100%;margin:0}
textarea[aria-invalid=true],select[aria-invalid=true]{border-color:var(--warn)}
.pin.cancelled{background:var(--tint-none);border-left-color:var(--ink2)}
.modal.sure{z-index:60}
.dialog.sure{top:12vh;width:min(480px,calc(100vw - 32px));max-height:80vh;padding:20px 20px 22px}
.dialog.sure h2{margin:0 0 6px;padding-right:0}
.dialog.sure .crumb{margin:0 0 10px;word-break:break-word}
@media (max-width:860px){.dialog.sure{inset:auto;top:10vh;left:50%;transform:translateX(-50%);width:calc(100vw - 32px);max-height:80vh;border-radius:12px}}/* Этап E.2: задачи по инициативе сотрудника (текст — основной признак, цвет и рамка — дополнение) */
.pill.selfp{border-style:dashed;border-color:var(--accent);color:var(--accent)}
.pill.selfs{border-color:var(--ink2)}
.pill.selfs.self-PENDING{border-color:var(--badge-bg);color:var(--badge-bg)}
.pill.selfs.self-REJECTED{border-color:var(--warn);color:var(--warn)}
.pill.selfs.self-APPROVED,.pill.selfs.self-DIRECT{border-color:var(--st-done);color:var(--st-done)}
.act.self{background:var(--tint-none)}
.props{list-style:none;margin:0 0 10px;padding:0}
.props li{padding:6px 0;border-top:1px solid var(--line)}
.props li:first-child{border-top:0}

/* ---------- Оформление установки (Instance Identity) ---------- */
/* Цвет установки — отдельная переменная --brand (одна на всех пользователей базы, не личная тема). Она нужна только для опознания установки: цветная полоса над страницей,
   название организации в заголовке и подчёркивание выбранной вкладки. Рабочие элементы (кнопки, ссылки, фильтры, плашки, рамки карточек) по-прежнему используют обычный
   --accent и от цвета установки не зависят, поэтому красный, розовый, оранжевый или зелёный цвет установки не похож на состояние задачи или ошибку.
   Цвета статусов (--st-*), предупреждений (--warn) и фон не меняются. Синий — вид по умолчанию: у него атрибута data-accent на странице нет, --brand равен прежнему --accent.
   Правило [data-accent="blue"] нужно только образцу цвета в настройках. Палитра подобрана по контрасту WCAG AA (≥ 4.5:1 как текст на фоне страницы, карточке и выделении) — проверяется тестом. */
:root{--brand:var(--accent)}
[data-accent="blue"]{--brand:#1B3556}
[data-accent="red"]{--brand:#A31F34}
[data-accent="pink"]{--brand:#B0245F}
[data-accent="purple"]{--brand:#5B2D91}
[data-accent="green"]{--brand:#25692F}
[data-accent="orange"]{--brand:#A64F00}
@media (prefers-color-scheme:dark){
  [data-accent="blue"]{--brand:#8DB4E8}
  [data-accent="red"]{--brand:#F29AA6}
  [data-accent="pink"]{--brand:#F5A0C8}
  [data-accent="purple"]{--brand:#C9B0F2}
  [data-accent="green"]{--brand:#84D49A}
  [data-accent="orange"]{--brand:#F4AA62}
}
/* Полоса над страницей — только при выбранном не синем цвете (у синего вид прежний). Название организации в заголовке и выбранная вкладка берут --brand (у синего он равен прежнему акценту). */
:root[data-accent] body::before{content:"";display:block;height:8px;background:var(--brand)}
.brand h1 .org,.authcard h1 .org{color:var(--brand)}
.tab[aria-selected="true"]{border-bottom-color:var(--brand)}
/* Длинное название без пробелов переносится и не растягивает страницу на телефоне. */
.brand{min-width:0}
.brand h1,.authcard h1{overflow-wrap:anywhere}
.accents{border:0;padding:0;margin-left:0;margin-right:0}
.accents legend{padding:0;font-weight:600;margin-bottom:6px}
.swatches{display:flex;flex-wrap:wrap;gap:6px 16px}
.swatch-opt{display:inline-flex;align-items:center;gap:8px;cursor:pointer}
.swatch-opt input{width:18px;height:18px;flex:none}
.sw{display:inline-block;width:18px;height:18px;border-radius:4px;background:var(--brand);border:1px solid var(--line)}
/* Workspace navigation and persistent, non-blocking storage information. */
.workspace-welcome { line-height: 1.6; overflow-wrap: anywhere; }
.privacy-footer { max-width: 1080px; margin: 1.5rem auto 2rem; padding: 0 1rem; font-size: .875rem; line-height: 1.65; }
.privacy-footer > a { display: inline-block; margin: 0 1rem .75rem 0; }
.privacy-footer details { border-top: 1px solid #9ca3af66; padding-top: .75rem; }
.privacy-footer summary { cursor: pointer; font-weight: 600; }
.privacy-footer p { max-width: 80ch; }
.privacy-footer a:focus-visible, .privacy-footer summary:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
.privacy-document { max-width: 850px; margin: 2rem auto; padding: 1.5rem; line-height: 1.75; overflow-wrap: anywhere; }
.privacy-document nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.privacy-document h1 { font-size: clamp(1.5rem, 5vw, 2.2rem); }
.privacy-draft { padding: 1rem; border: 1px solid #b98122; border-radius: .5rem; }
.top-actions { flex-wrap: wrap; }

/* Push: сводка и индикатор выполнения */
.pstat { margin: 6px 0 10px; padding-left: 18px; }
.pstat li { margin: 2px 0; }
.spin { display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: pfspin .8s linear infinite; }
@keyframes pfspin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
#pf-msg { min-height: 1.4em; }
/* P2: обзор руководителя — общий выбор сотрудника, сортировка, каталог */
.vctl{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:flex-end;margin:8px 0}
.vc-field{display:flex;flex-direction:column;gap:2px}
.vc-field label,.emp-filter label{font-weight:600;font-size:13px}
.emp-filter{display:flex;flex-wrap:wrap;align-items:flex-end;gap:6px}
.emp-filter select,.vc-field select{max-width:260px}
.emp-q{max-width:180px}
.qgroup{margin:0 0 20px}
.qgroup-h{margin:8px 0 4px;padding-top:8px;border-top:1px solid var(--line)}
.dlist{list-style:none;margin:8px 0;padding:0;display:flex;flex-direction:column;gap:8px}
.drow{border:1px solid var(--line);border-radius:8px;padding:8px 10px;background:var(--surface)}
.drow .meta{margin:4px 0}
.cnt-rev{margin-left:8px}
.pager{display:flex;align-items:center;gap:8px;margin:12px 0}

/* 20.114: автоматическое чтение — пометка перевода в списках и оригинал в окне задачи */
.tr-mark { display: inline-block; font-size: 0.68em; font-weight: 600; line-height: 1; padding: 2px 4px; margin-left: 2px; border: 1px solid currentColor; border-radius: 4px; opacity: 0.6; vertical-align: middle; letter-spacing: 0.03em; }
.tr-auto .tr-orig { margin-top: 6px; }
.tr-auto .tr-orig summary { cursor: pointer; font-size: 0.9em; opacity: 0.85; }
.tr-auto .tr-otitle { font-weight: 600; margin: 6px 0 2px; }

/* 20.117: компактный блок рабочего текста — текст в две строки (развёртывается до ~15 строк с прокруткой), рядом три маленьких значка с нормальной областью нажатия */
.wt { margin: 4px 0 8px; max-width: 68ch; }
.wt.result, .wt.desc { background: var(--tint-none); padding: 4px 6px 4px 10px; border-radius: 6px; }
.wt-row { display: flex; align-items: flex-start; gap: 2px; }
.wt-main { flex: 1 1 auto; min-width: 0; }
.wt-text { margin: 0; padding-top: 10px; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.wt-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.wt-open { max-height: 22.5em; overflow-y: auto; }
.wt-open:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wt-exp { display: inline-flex; align-items: center; font-size: 0.9em; padding: 0 2px; min-width: 44px; min-height: 44px; } /* 20.124 (W123-03): область нажатия ≥44×44, текст прежний */
.wt-exp[hidden] { display: none; }
.wt-acts { display: flex; flex: none; align-items: center; }
.wt-ic { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--ink2); cursor: pointer; }
.wt-ic:hover { color: var(--ink); background: var(--tint-none); }
.wt-ic:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.wt-st { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 44px; font-size: 0.68em; font-weight: 600; color: var(--ink2); letter-spacing: 0.03em; }
.wt-st:not(.wt-st-o):not(:has(svg)) { padding: 0 2px; }
.wt-svg { display: block; }
.wt-spin { animation: wt-rot 1.6s linear infinite; }
@keyframes wt-rot { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .wt-spin { animation: none; } }
.wt-menu { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.wt-menu .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; max-width: 100%; white-space: normal; text-align: center; } /* 20.124 (W123-03): пункты меню «Ещё» (и у названия) — область нажатия ≥44×44; общие .btn/.btn.sm не меняются */
.wt-cap { margin: 2px 0 4px; }
.wt .msg { margin: 2px 0 4px; }
.hist .wt { margin: 2px 0 4px; }
.pin .wt { margin: 2px 0; }
@media (max-width: 400px) { .wt-row { flex-wrap: wrap; } .wt-main { flex-basis: 100%; } .wt-acts { margin-left: auto; } .wt-text { padding-top: 4px; } }
.wt-bar { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 0 0 4px; max-width: 68ch; }

/* 20.132: язык и копирование названия задачи (строка списка и окно задачи): метка «EN · Перевод» / «RU · Оригинал», значок копирования и «Ещё» рядом с названием, а не внутри кнопки открытия задачи */
.lmain .rt { -webkit-user-select: text; user-select: text; }
.tl { display: flex; flex: none; align-items: center; padding-right: 8px; }
.tl-chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; background: none; border: 0; font: inherit; color: var(--ink2); cursor: pointer; }
.tl-static { cursor: default; }
.tl-pill { display: inline-block; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.4; letter-spacing: 0.02em; white-space: nowrap; }
button.tl-chip:hover .tl-pill { color: var(--ink); background: var(--tint-none); }
button.tl-swap { gap: 4px; }
button.tl-swap .tl-pill { border-color: var(--ink2); }
button.tl-swap .tl-svg { width: 14px; height: 14px; }
button.tl-chip:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 8px; }
.lrow .tl-menu, .lrow .tl-manual { flex-basis: 100%; margin: 0 14px 8px; }
.lrow.sub .tl-menu, .lrow.sub .tl-manual { margin-left: 32px; }
.tl-man-text { margin: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.wt-bar { flex-wrap: wrap; }
@media (max-width: 860px) { .tl { flex-basis: 100%; padding: 0 14px 4px; margin-top: -10px; } .lrow.sub .tl { padding-left: 32px; } }
.tl-ic { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0; background: none; border: 0; border-radius: 8px; color: var(--ink2); cursor: pointer; }
.tl-ic:hover { color: var(--ink); background: var(--tint-none); }
.tl-ic:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.tl-svg { display: block; }
.tl-menu { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 6px; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tl-menu .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; max-width: 100%; white-space: normal; text-align: center; }

/* 20.159-R1: компактная группа значков названия (метка направления, оригинал под переводом, сведения, настройки показа, копирование), панели под строкой, направление письма справа налево. */
.tl { flex-wrap: wrap; }
.dlg-head .dh-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 8px; }
.dlg-head .dh-row h2 { flex: 1 1 14em; min-width: 0; }
.dh-tools { flex: none; padding: 0; margin-left: -4px; }
.tl-under { display: block; margin-top: 2px; font-size: 13px; font-weight: 400; color: var(--ink2); overflow-wrap: anywhere; -webkit-user-select: text; user-select: text; }
.dlg-head .tl-under { margin: 0 0 4px; }
.wt-under { margin-top: 4px; }
[dir="rtl"] { unicode-bidi: isolate; }
.tl-under[dir="rtl"], .wt-text[dir="rtl"], .desc[dir="rtl"], h2[dir="rtl"], .tr-box[dir="rtl"] { text-align: right; }
.tl-pop { margin: 2px 0 6px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); max-width: 68ch; }
.tl-pop dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0 0 4px; }
.tl-pop dt { color: var(--ink2); }
.tl-pop dd { margin: 0; overflow-wrap: anywhere; }
.tl-cpo { display: flex; flex-wrap: wrap; gap: 6px; }
.tl-cpo .btn { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; max-width: 100%; white-space: normal; text-align: center; }
.lrow .tl-pop { flex-basis: 100%; margin: 0 14px 8px; }
.lrow.sub .tl-pop { margin-left: 32px; }
.td-opt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 0 4px; background: none; border: 0; border-radius: 8px; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.td-opt:hover { background: var(--tint-none); }
.td-opt:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.td-box { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 20px; height: 20px; border: 1.5px solid var(--ink2); border-radius: 5px; font-size: 14px; line-height: 1; }
.td-rad { border-radius: 50%; font-size: 10px; }
.td-opt[aria-checked="true"] .td-box { border-color: var(--focus); color: var(--focus); }
.tl-ic[aria-pressed="true"], .tl-ic[aria-expanded="true"] { color: var(--ink); background: var(--tint-none); }
@media (max-width: 860px) { .dlg-head .dh-row h2 { flex-basis: 100%; } .dh-tools { margin-left: -8px; } }
/* 7.010-R1: окно выбора области автоматического перевода, подсказка списка и запросы на подтверждение */
.dialog.sure.sc-dlg { width: min(620px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto; }
.sc-dlg .sc-nums { margin: 0 0 8px 30px; }
.sc-dlg h3 { margin: 14px 0 4px; }
.sc-gate { margin: 6px 16px; }
.sc-aprs { list-style: none; margin: 4px 0 8px; padding: 0; }
.sc-apr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 44px; }
@media (max-width: 860px) { .dialog.sure.sc-dlg { width: calc(100vw - 32px); max-height: 86vh; } .sc-dlg .sc-nums { margin-left: 4px; } }
/* WORKLOG-001 Core (010.00001-R1): количественные результаты в окне задачи и ссылка на журнал работ */
.tab-link{text-decoration:none;display:inline-flex;align-items:center}
.wl{margin:0 0 6px}
.wl-entry{border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:0 0 10px;max-width:560px}
.wl-entry .field{margin:0 0 10px}
.wl-entry input,.wl-entry select,.wl-form input{width:100%;max-width:100%}
.wl-list{list-style:none;margin:8px 0 0;padding:0}
.wl-f{border-top:1px solid var(--line2);padding:8px 0}
.wl-q{font-weight:700;font-variant-numeric:tabular-nums}
.wl-meta,.wl-note{color:var(--ink2);font-size:14px}
.wl-ACCEPTED .wl-st{color:var(--st-done);font-weight:600}
.wl-RECORDED .wl-st,.wl-DRAFT .wl-st{color:var(--warn);font-weight:600}
.wl-VOIDED .wl-main{text-decoration:line-through;color:var(--ink2)}
.wl-AMENDED .wl-st{color:var(--accent);font-weight:600}
.wl-INVALIDATED .wl-main{text-decoration:line-through;color:var(--ink2)}
.wl-INVALIDATED .wl-st{color:var(--warn);font-weight:600}
.wl-amend{border-left:3px solid var(--accent);padding-left:8px}
.wl-form{border-left:3px solid var(--accent);padding:6px 0 6px 10px;margin:8px 0 0;max-width:560px}
.wl-hist{margin:8px 0 0;padding-left:20px;font-size:14px}
/* 10.017-R1: быстрый ввод количества в окне задачи. Таблица прокручивается внутри блока (страница не уезжает вбок); кнопки и дни — не меньше 44 px; цвет — только дополнение к тексту. */
.wlq{border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:0 0 12px;max-width:100%;min-width:0}
.wlq-h{margin:0 0 8px;font-size:16px}
.wlq-nav{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 8px}
.wlq-nav .btn{min-height:44px}
.wlq-wk{font-weight:600;flex:1 1 140px;min-width:0;text-align:center}
.wlq-scroll{overflow-x:auto;max-width:100%}
.wlq-t{border-collapse:collapse;width:100%;font-size:14px}
.wlq-t th,.wlq-t td{border:1px solid var(--line2);padding:2px 4px;text-align:center;font-variant-numeric:tabular-nums;min-width:44px}
.wlq-t th[scope=row]{text-align:left;min-width:96px;font-weight:600}
/* the metric column stays in view while the days scroll sideways (320 px): the person always sees which row a figure belongs to */
.wlq-t th[scope=row],.wlq-t th.wlq-corner{position:sticky;left:0;z-index:1;background:var(--surface);max-width:34vw}
.wlq-t th.wlq-corner{z-index:2}
.wlq-t th[scope=row]{box-shadow:1px 0 0 var(--line2)}
.wlq-inv{color:var(--warn);font-weight:700;font-size:12px}
/* 10.036 (R1): the status of operations is the LAST thing of the block (below the table and the day editors), so its coming and going moves no button.
   10.038 (R1): it is part of the page flow and nothing more. It was `position: sticky; bottom: 0; max-height: 45vh`, which laid it OVER whatever stood at the lower edge of the task card: reproduced at 1100×700,
   375×667 and 320×568 (118, 214 and 256 px high) with a "+" about 40 px above the bottom — the second press of a double press landed on the banner and only +1 was recorded. A banner that covers a control
   cannot be made safe by its size, so it covers nothing: in the flow it takes its own room below the last control, grows downwards however long it gets, and is reached by scrolling like the rest of the block.
   An unresolved operation stays visible there, on its own cell ("…"), in the polite live region and (a keyboard recording) on the message line above the table. */
.wlq-bn{min-height:0;margin:6px 0 0}
.wlq-bn:not(:empty){padding:6px 8px;position:static;box-sizing:border-box;background:var(--surface);border-top:2px solid var(--warn)}
.wlq-gb .wlq-bn{margin:0}
.wlq-gb .wlq-bn:not(:empty){position:static;max-height:none;overflow:visible;border-top:0;padding:6px 0;background:none}
.wlq-rt{min-height:44px;min-width:44px}
.wlq-bl{margin:4px 0;overflow-wrap:anywhere}
.wlq-failed ul{margin:4px 0 0;padding-left:18px}
.wlq-failed li{margin:4px 0}
.wlq-gb{margin:0 0 8px}
.wlq-stale{margin:4px 0}
.wlq-u{font-weight:400;color:var(--ink2)}
.wlq-dh{display:block;width:100%;min-height:44px;min-width:44px;background:none;border:0;font:inherit;font-size:13px;color:inherit;cursor:pointer;padding:2px 4px;border-radius:6px}
.wlq-dh[aria-pressed=true]{background:var(--accent);color:var(--accent-fg);font-weight:700}
.wlq-td{background:var(--sel)}
.wlq-c.sel{outline:2px solid var(--accent);outline-offset:-2px;font-weight:700}
.wlq-c.ro{color:var(--ink2)}
.wlq-wt{font-weight:700;background:var(--sel)}
.wlq-none{color:var(--ink2)}
.wlq-m{color:var(--warn);font-weight:700}
.wlq-p{color:var(--ink2);margin-left:2px}
.wlq-leg{margin:6px 0 0}
.wlq-ed{border-top:1px solid var(--line2);margin-top:10px;padding-top:8px}
.wlq-edh{margin:0 0 6px}
.wlq-pm{display:flex;gap:10px;margin:6px 0 10px}
.wlq-b{min-width:72px;min-height:48px;font-size:20px}
.wlq-set{margin:0 0 6px}
.wlq-set input{width:100%;max-width:240px;min-height:44px}
.wlq-set .btns .btn{min-height:44px}
.wlq-st{min-height:1.5em;margin:4px 0 0}
.wlq-ok{color:var(--st-done);font-weight:600}
.wlq-busy{color:var(--ink2)}
.wlq-warn{color:var(--warn);font-weight:600}
.wlq [hidden]{display:none!important}
/* 10.028: inline quick entry. The −/+ occupy a RESERVED place in every editable cell (no layout shift); they are revealed by hover, by keyboard focus inside the cell and by a deliberate selection (touch). */
.wlq-ci{display:flex;align-items:center;justify-content:center;gap:2px;min-height:44px}
.wlq-cv{background:none;border:0;font:inherit;color:inherit;cursor:pointer;padding:2px 4px;min-width:36px;min-height:36px;border-radius:6px;touch-action:manipulation;font-variant-numeric:tabular-nums}
.wlq-cv:hover{background:var(--sel)}
.wlq-cv[aria-pressed=true]{outline:2px solid var(--accent);outline-offset:-2px}
.wlq-x,.wlq-xs{flex:0 0 32px;width:32px;height:32px}
.wlq-x{border:1px solid var(--line);border-radius:6px;background:var(--surface);color:inherit;font:inherit;font-size:18px;line-height:1;cursor:pointer;padding:0;touch-action:manipulation;opacity:0;pointer-events:none}
.wlq-c:hover .wlq-x,.wlq-c:focus-within .wlq-x,.wlq-c.selc .wlq-x{opacity:1;pointer-events:auto}
.wlq-x:disabled{cursor:not-allowed}
.wlq-c:hover .wlq-x:disabled,.wlq-c:focus-within .wlq-x:disabled,.wlq-c.selc .wlq-x:disabled{opacity:.35}
@media (hover:none){.wlq-c:hover:not(.selc):not(:focus-within) .wlq-x{opacity:0;pointer-events:none}.wlq-c:hover .wlq-cv:hover{background:none}}
@media (pointer:coarse){.wlq-x,.wlq-xs{flex-basis:44px;width:44px;height:44px}.wlq-cv{min-width:44px;min-height:44px}.wlq-ci{gap:4px}}
.wlq-dm{margin-left:2px;color:var(--warn)}
.wlq-wb{background:none;border:0;font:inherit;font-weight:700;color:inherit;cursor:pointer;min-height:44px;min-width:44px;padding:2px 6px;border-radius:6px}
.wlq-wb:hover,.wlq-wb[aria-expanded=true]{background:var(--sel)}
.wlq-er>td{padding:0;text-align:left;background:var(--surface)}
.wlq-ie,.wlq-ia{position:sticky;left:0;width:min(32rem,calc(100vw - 6rem));box-sizing:border-box;padding:8px 10px}
.wlq-ir{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-end}
.wlq-ir .field{margin:0;flex:1 1 9rem;min-width:0}
.wlq-ir input{width:100%;min-height:44px;box-sizing:border-box}
.wlq-ir .btns{display:flex;gap:6px;flex-wrap:wrap}
.wlq-ir .btn{min-height:44px;min-width:44px}
.wlq-id{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.wlq-id .btn{min-height:44px}
.wlq-live{min-height:1.4em;margin:4px 0 0;color:var(--ink2)}
/* 10.030: the day editor steps aside for an open inline editor (MINOR-1); the way to a cell's source results and their marking in the result list (MINOR-6). Buttons ≥ 44 px, text wraps at 320 px. */
.wlq-eh .btn,.wlq-srcb{min-height:44px;margin-top:4px}
.wlq-nav-h{margin:4px 0 0}
.wl-srch{border-left:3px solid var(--accent);padding:6px 0 6px 10px;margin:8px 0 0;overflow-wrap:anywhere}
.wl-srch .btn{min-height:44px}
.wl-src{background:var(--sel);box-shadow:inset 3px 0 0 var(--accent);padding-left:8px}
.wl-srcm{font-size:13px;font-weight:600;color:var(--accent)}
/* 10.032: one compact message line of keyboard recordings (inside the block, never over the table) and the numbered chooser of a shared key. */
/* 10.034 (C2): the message line is a STABLE slot (one 44 px control row, reserved whether or not it has text): a hint, "Saving", "Added" or "Too fast" appearing and going away after its timeout never moves the table
   (a "+" under the pointer stays under it). Transient messages are held to two lines; a refusal or an unconfirmed outcome (kept until closed, and listed in full in the banner too) is never cut. */
.wlq-toast{position:relative;box-sizing:border-box;height:44px;margin:0 0 6px;padding:0 8px;display:flex;align-items:center;gap:6px;border-left:3px solid transparent;font-size:14px;line-height:1.25;overflow-wrap:anywhere}
.wlq-toast:not(:empty){border-left-color:var(--line);background:var(--surface)}
.wlq-tt{flex:1 1 0;min-width:0;margin:4px 0}
/* 10.036 (R3): the line is EXACTLY 44 px, whatever it says: every kind of message shows at most two lines; a refusal or an unconfirmed outcome has a Details button with the whole text in a popover. */
.wlq-t-hint,.wlq-t-ok,.wlq-t-pending,.wlq-t-err,.wlq-t-held{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
.wlq-td{flex:0 0 auto}
.wlq-tdb{display:inline-flex;align-items:center;min-height:44px;min-width:44px;cursor:pointer;list-style:none}
.wlq-tdb::-webkit-details-marker{display:none}
.wlq-tp{position:absolute;top:100%;left:0;right:0;z-index:20;box-sizing:border-box;max-height:50vh;overflow:auto;border:1px solid var(--warn);border-radius:8px;padding:8px 10px;background:var(--surface);box-shadow:var(--shadow-lg);font-weight:600;color:var(--warn);overflow-wrap:anywhere}
.wlq-t-ok{color:var(--st-done);font-weight:600}
.wlq-t-pending,.wlq-t-hint{color:var(--ink2)}
.wlq-t-err,.wlq-t-held{color:var(--warn);font-weight:600}
.wlq-tx{min-height:44px;min-width:44px}
/* 10.040 (R1): the slot above the table holds, side by side, the status of operations that are NOT saved / NOT confirmed (a persistent button; derived from the same lists as the banner below the table, with no timer
   and no dismiss of its own) and the keyboard message line. Its height is fixed (10.042: 52 px, the height of the status) whether either is shown or not: the status appearing, changing or going moves nothing. The Details popover of
   the message line hangs from the whole slot (it keeps the full width). */
.wlq-msg{position:relative;display:flex;align-items:flex-start;min-height:52px;margin:0 0 6px}
.wlq-msg .wlq-toast{position:static;flex:1 1 0;min-width:0;margin:0}
.wlq-sum{flex:0 1 auto;min-width:0;max-width:45%}
.wlq-sum:empty{flex:0 0 0;width:0;max-width:0;overflow:hidden}
.wlq-sum:not(:empty){margin-right:6px}
.wlq-sumb{box-sizing:border-box;height:52px;min-width:44px;max-width:100%;display:flex;align-items:center;gap:6px;padding:0 10px;text-align:left;font-size:13px;line-height:1.15;font-weight:700;overflow:hidden;border:2px solid var(--warn);color:var(--warn);background:var(--surface);cursor:pointer}
.wlq-sumi{flex:0 0 auto;font-size:16px}
.wlq-sumt{min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}
.wlq-sumd{flex:0 0 auto;font-weight:400;color:var(--ink2);white-space:nowrap}
/* 10.042-R1 (review 10.041-R1, MINOR-1 / discoverability): the copy of the status on the line UNDER the table (the lower rows end there; the slot above leaves the window as soon as a lower row is worked on). It is in the
   flow below the last control, so it moves nothing that is pressed; it wraps under the line's text on a narrow screen. */
.wlq-lr{display:flex;flex-wrap:wrap;align-items:flex-start;gap:4px 6px;margin:4px 0 0}
.wlq-lr .wlq-live{flex:1 1 12rem;min-width:0;margin:0}
.wlq-sum2:not(:empty){flex:0 1 auto;max-width:100%;margin-right:0}
.wlq-sum2 .wlq-sumb{height:auto;min-height:44px;padding:4px 10px}
.wlq-sum2 .wlq-sumt{display:block;-webkit-line-clamp:unset;line-clamp:unset;overflow:visible}
/* MINOR-1: the status took up to 62 % of the one row it shared with the message line; in Russian the message text was left about 0 px wide at 375 / 320 px and its Close button went past the edge of the window.
   The status is now at most 45 % of the row and holds its text in up to THREE lines of 13 px (52 px, the height of the slot): the three kinds of operations in Russian are never cut. At 640 px and below the two no longer
   share a row: each has its own full-width row of a FIXED height (reserved whether or not it has text, so nothing moves when either appears or goes): 52 px for the status ("Details" gives way to a chevron: the
   whole button is the control), 44 px for the message line (its Details button is a little narrower). */
@media (max-width:640px){
  .wlq-msg{flex-direction:column;align-items:stretch;min-height:0}
  .wlq-msg .wlq-sum,.wlq-msg .wlq-sum:empty{flex:0 0 52px;box-sizing:border-box;width:auto;max-width:none;height:52px;margin:0 0 4px;overflow:visible}
  .wlq-msg .wlq-toast{flex:0 0 44px;width:auto}
  .wlq-sumb{width:100%}
  .wlq-sumd{display:none}
  .wlq-sumb::after{content:'\203A';flex:0 0 auto;font-size:20px;line-height:1;margin-left:auto}
  .wlq-toast .wlq-tdb.btn.sm{padding:0 6px;font-size:13px}
  .wlq-toast .wlq-tx.btn.sm{padding:0 6px}
  .wlq-lr{flex-direction:column}
  .wlq-lr .wlq-live{flex:0 0 auto}
  .wlq-sum2:not(:empty){width:100%}
}
/* a refused press stays on its own cell: a frame, and a mark over the corner of the number (absolute: no room is taken, no button moves) */
.wlq-c.fx{box-shadow:inset 0 0 0 2px var(--warn)}
/* 10.042-R1 (MINOR-4): the selection outline (2 px, drawn 0–2 px inside the edge) covered the 2 px failure frame of a selected cell (the frame starts 1 px inside, behind the cell's 1 px border: 1–3 px). The outline of a
   refused cell moves inward (3–5 px) so both rings are seen in full, the warning frame outside and the selection inside; the ⚠ mark and the accessible name (reason) are unchanged, so the failure is never told by colour alone. */
.wlq-c.fx.sel{outline-offset:-5px}
.wlq-c.fx .wlq-fx{font-size:12px}
.wlq-cv{position:relative}
.wlq-fx{position:absolute;top:0;right:0;font-size:11px;line-height:1;color:var(--warn);font-weight:700;pointer-events:none}
/* 10.034 (C2): the numbered chooser is a popover over the top of the table (a zero-height anchor in the flow): opening and closing it moves nothing; it sits below the banner of unresolved operations, never over it. */
.wlq-chs{position:relative;height:0}
.wlq-ch{position:absolute;top:0;left:0;right:0;z-index:20;box-sizing:border-box;border:1px solid var(--accent);border-radius:8px;padding:6px 10px;margin:0;background:var(--surface);box-shadow:var(--shadow-lg)}
.wlq-chh{margin:0 0 4px;font-weight:600}
.wlq-ch .btns{display:flex;flex-wrap:wrap;gap:6px}
.wlq-ch .btn{min-height:44px}
.wlq-ch kbd{display:inline-block;min-width:1.4em;padding:0 4px;border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;font:inherit;font-size:12px;font-weight:700;text-align:center}
.wlq-kt{display:inline-block;margin:4px 12px 4px 0}
.wlq-kt select{min-height:44px}
.wlq-kb{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 8px}
.wlq-kb .btn{min-height:44px}
.wlq-qkt.on{background:var(--accent);color:var(--accent-fg)}
/* 10.036 (R2): the mode line is a grid cell with invisible copies of the texts it can show, so it is as high as the highest of them at every width and a change of the text moves nothing.
   10.038 (R1): one copy per row of the table (laid out by the browser), not one for the name with the most characters. */
.wlq-qw{display:grid;flex:1 1 14rem;min-width:0}
.wlq-qw>span{grid-area:1/1;min-width:0;overflow-wrap:anywhere}
.wlq-qg{visibility:hidden;pointer-events:none;user-select:none}
.wlq-qr>th,.wlq-qr>td{background:var(--sel)}
.wlq-qr>th[scope=row]{box-shadow:inset 4px 0 0 var(--accent),1px 0 0 var(--line2)}
.wlq-kh{display:inline-block;min-width:1.4em;padding:0 4px;border:1px solid var(--line);border-bottom-width:2px;border-radius:4px;font:inherit;font-size:12px;text-align:center;font-weight:600;color:var(--ink2)}
.wlq-kc{border:1px solid var(--line2);border-radius:8px;padding:8px 10px;margin:0 0 8px}
.wlq-kl{list-style:none;margin:6px 0;padding:0}
.wlq-kl li{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:4px 0}
.wlq-kl .btn{min-height:44px}
.wlq-kn{flex:1 1 8rem;min-width:0;overflow-wrap:anywhere}

.wlq-rv{border:1px solid var(--warn);border-radius:8px;padding:8px 10px}
.wlq-rg{border-top:1px solid var(--line2);margin-top:8px;padding-top:6px}
.wlq-rg .btns{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}

/* 10.044-R1 (review 10.043-R1, MAJOR F1): the count of unresolved operations in the STICKY header of the task card. The slot is 56 × 44 px, present on every card that shows the table, empty or not, so the header has the
   same size with no, one or many unresolved operations and nothing in or below it moves. It sits beside the title (in the title's row: on a narrow screen the title gives up 64 px of its own row, the row of the
   tools below it is unchanged). No overlay, no negative margin: it takes its own place in the flow of the header. */
.dlg-head .dh-row .wlq-hs{flex:0 0 56px;box-sizing:border-box;width:56px;height:44px;align-self:flex-start;display:flex;align-items:center;justify-content:center}
.wlq-hsb{box-sizing:border-box;width:56px;height:44px;min-width:0;max-width:100%;display:flex;align-items:center;justify-content:center;gap:3px;padding:0 4px;font-size:14px;line-height:1;font-weight:700;overflow:hidden;border:2px solid var(--warn);color:var(--warn);background:var(--surface);cursor:pointer}
.wlq-hsi{flex:0 0 auto;font-size:16px}
.wlq-hsn{flex:0 0 auto}
@media (max-width:860px){.dlg-head .dh-row.has-wlh h2{flex-basis:calc(100% - 64px)}}
