/* Визуальный язык — из макета design/mockup и design/flows/kit.css.
   Шрифт системный: ни одного внешнего запроса при загрузке страницы. */
:root {
  --text: #1A1D23; --muted: #5B6270; --faint: #8A909B;
  --line: #E3E6EB; --line-soft: #EEF0F3; --control: #D5D9E0;
  --bg: #FFFFFF; --side: #F6F7F9; --soft: #F4F5F7; --hover: #EEF1F5;
  --accent: #3355D6; --accent-hover: #2A49C0; --accent-soft: #E4E9F7; --accent-text: #1F3FA8;
  --link: #2448C2;
  --danger: #B42318; --danger-bg: #8E2416; --danger-soft: #FBE9E7;
  --warn-bg: #FDF6E3; --warn-line: #F0DDA8; --warn-text: #5C4300;
  --ok-bg: #EEF6F1; --ok-line: #BFE0CC; --ok-text: #17613A;
  --focus: 0 0 0 3px rgba(51, 85, 214, .28);
  --shadow: 0 8px 28px rgba(16, 24, 40, .14), 0 2px 6px rgba(16, 24, 40, .08);
  --radius: 8px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 12px; border-radius: 6px; }
.skip:focus { top: 8px; }

/* ---------- элементы ---------- */
.btn { height: 36px; padding: 0 14px; border-radius: var(--radius); border: 1px solid var(--control); background: #fff;
  color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 14px;
  font-weight: 500; white-space: nowrap; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--danger-bg); border-color: var(--danger-bg); color: #fff; font-weight: 600; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 6px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn .ico { width: 18px; height: 18px; flex: 0 0 auto; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label, .label { font-size: 13px; font-weight: 600; color: #3E444F; }
.input, .select, .textarea { width: 100%; height: 40px; border: 1px solid var(--control); border-radius: var(--radius);
  padding: 0 12px; background: #fff; font-size: 15px; transition: border-color .12s, box-shadow .12s; }
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: #C4321F; }
.input-code { font-size: 26px; letter-spacing: 10px; text-align: center; height: 56px; font-variant-numeric: tabular-nums; }
.hint { font-size: 13px; color: var(--muted); }
.err-text { font-size: 13px; color: var(--danger); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }

.alert { border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin-bottom: 16px; border: 1px solid; }
.alert-err { background: var(--danger-soft); border-color: #F4C7C0; color: #7A1B10; }
.alert-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-text); }
.alert-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }

.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 13px; margin: 20px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.2px; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); position: relative; flex: 0 0 auto; }
.logo-mark::after { content: ""; position: absolute; left: 9px; top: 5px; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg); }

.av { width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 600; display: inline-flex;
  align-items: center; justify-content: center; flex: 0 0 auto; overflow: hidden; background: #5B6270; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av-sm { width: 22px; height: 22px; font-size: 9px; }
.av-lg { width: 36px; height: 36px; font-size: 13px; }
.av-c0 { background: #3355D6; } .av-c1 { background: #B4541A; } .av-c2 { background: #1B7F6A; } .av-c3 { background: #7A3DB8; }
.av-c4 { background: #A3366B; } .av-c5 { background: #2F6F9F; } .av-c6 { background: #6B7A1F; } .av-c7 { background: #5B6270; }

/* ---------- вход и регистрация ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; background: var(--side); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.auth-card h1 { font-size: 22px; letter-spacing: -.3px; margin: 20px 0 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 24px; }
.auth-foot { margin-top: 20px; font-size: 13px; color: var(--muted); text-align: center; }
.btn-yandex { background: #fff; border-color: var(--control); }
.btn-yandex .ya { width: 20px; height: 20px; border-radius: 50%; background: #FC3F1D; color: #fff; font-weight: 700; font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center; }

/* ---------- каркас приложения ---------- */
.app { min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; grid-template-rows: 56px 1fr; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 20; }
.topbar .logo { min-width: 216px; }
.topbar .search { flex: 1; max-width: 560px; margin: 0 auto; }
.search-box { width: 100%; height: 36px; border-radius: var(--radius); background: #F1F3F6; border: 1px solid var(--line); display: flex; align-items: center; gap: 8px; padding: 0 12px; color: var(--muted); cursor: text; }
.search-box kbd { margin-left: auto; font: 12px var(--font); border: 1px solid var(--control); border-radius: 4px; padding: 0 5px; background: #fff; }
.icon-btn { width: 36px; height: 36px; border-radius: var(--radius); border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; position: relative; color: var(--muted); }
.icon-btn:hover { background: var(--hover); }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; border-radius: 9px; background: #C4321F; color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; height: calc(100vh - 56px); position: sticky; top: 56px; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 0 10px; border-radius: var(--radius); color: var(--text); }
.nav:hover { background: var(--hover); text-decoration: none; }
.nav[aria-current="page"] { background: var(--accent-soft); font-weight: 600; color: var(--accent-text); }
.nav .cnt { margin-left: auto; font-size: 12px; font-weight: 700; color: #fff; background: #C4321F; border-radius: 9px; padding: 1px 7px; }
.nav .sq { width: 12px; height: 12px; border-radius: 3px; flex: 0 0 auto; }
.side-h { margin: 16px 10px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; display: flex; align-items: center; }
.content { min-width: 0; padding: 24px 32px 48px; }
.page-h { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.page-h h1 { font-size: 22px; letter-spacing: -.3px; }

.empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.empty h2 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }

.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 50; }
.menu-pop[hidden] { display: none; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 34px; padding: 0 10px; border-radius: 6px; border: 0; background: transparent; text-align: left; cursor: pointer; color: var(--text); font-size: 14px; }
.mi:hover, .mi:focus-visible { background: var(--hover); text-decoration: none; }
.menu-h { padding: 8px 10px 6px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }

.toast-zone { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; }
.toast { background: #1A1D23; color: #fff; border-radius: 10px; padding: 10px 14px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow); font-size: 14px; }
.toast a, .toast button { color: #A9BCFF; background: none; border: 0; cursor: pointer; font-weight: 600; padding: 0; }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar .logo { min-width: 0; }
  .content { padding: 16px; }
}

/* Цвета проектов */
.c-blue { background: #3355D6; } .c-red { background: #D9534F; } .c-green { background: #2E9B5E; } .c-amber { background: #D99A1E; }
.c-purple { background: #7A3DB8; } .c-teal { background: #1B7F8A; } .c-pink { background: #C2417E; } .c-slate { background: #5B6270; }

/* ---------- чипы и статусы ---------- */
.chip { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 0; }
.chip-btn { cursor: pointer; }
.chip-btn:hover { filter: brightness(.96); }
.st-gray { background: #EEF0F3; color: #3E444F; } .st-blue { background: #E4EBFB; color: #1F3FA8; }
.st-amber { background: #FCEFD6; color: #6E4700; } .st-green { background: #DFF1E6; color: #17613A; }
.st-slate { background: #EFEFEF; color: var(--muted); } .st-red { background: #FBE3DF; color: #9E2A17; }
.st-purple { background: #F1E4F9; color: #622A87; } .st-teal { background: #DDEFF7; color: #0B5370; }
.ext { font-size: 11px; padding: 0 5px; border-radius: 4px; border: 1px solid var(--control); color: var(--muted); }
.overdue { color: var(--danger); font-weight: 600; }
.faint { color: var(--faint); }
.ell { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.av-none { border: 1.5px dashed #7A808C; background: transparent; }
.filter-chip { height: 28px; padding: 0 10px; border-radius: 14px; border: 1px solid #C9D3F2; background: #F4F6FD; color: var(--accent-text); font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.filter-chip:hover { background: #E9EEFB; text-decoration: none; }
.btn-on { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.icon-btn.sm { width: 26px; height: 26px; }
.input-sm { height: 32px; font-size: 14px; padding: 0 8px; }
.narrow { max-width: 640px; }
.swatch input { position: absolute; opacity: 0; }
.swatch .sq { display: inline-block; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch input:checked + .sq { box-shadow: 0 0 0 2px var(--text); }
.swatch input:focus-visible + .sq { box-shadow: var(--focus); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { padding: 0; }

/* ---------- проект ---------- */
.proj { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin: -24px -32px -48px; min-height: calc(100vh - 56px); }
.proj.with-pane { grid-template-columns: minmax(0, 1fr) minmax(420px, 44%); }
.proj-main { padding: 20px 32px 48px; min-width: 0; }
.phead { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.phead .pic { width: 28px; height: 28px; border-radius: 8px; }
.phead h1 { font-size: 22px; letter-spacing: -.3px; }
.tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 0 10px; }
.filters { width: 300px; left: 0; right: auto; padding: 12px; }
.filters fieldset { margin-bottom: 10px; }
.filters legend { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; margin-bottom: 6px; }
.seg { display: inline-flex; margin: 0 4px 6px 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { padding: 4px 10px; border: 1px solid var(--control); border-radius: 14px; font-size: 13px; }
.seg input:checked + span { background: var(--accent-soft); border-color: #C9D3F2; color: var(--accent-text); font-weight: 600; }
.seg input:focus-visible + span { box-shadow: var(--focus); }
.menu-pop.left { left: 0; right: auto; }

/* ---------- список ---------- */
.proj-main { container-type: inline-size; }
.list { --cols: 24px minmax(180px, 1fr) auto 180px 92px 128px var(--fcols,); }
.thead { display: grid; grid-template-columns: var(--cols); gap: 12px; padding: 8px; border-bottom: 1px solid var(--line); font-size: 12px; font-weight: 600; color: var(--muted); }
.sec { margin-top: 18px; }
.sec-h { display: flex; align-items: center; gap: 10px; padding: 4px 8px; }
.sec-h h2 { font-size: 16px; }
.sec-h .menu { margin-left: auto; opacity: 0; }
.sec-h:hover .menu, .sec-h .menu:focus-within { opacity: 1; }
.rows { list-style: none; margin: 0; padding: 0; }
.trow { display: grid; grid-template-columns: var(--cols, 24px minmax(180px, 1fr) auto 180px 92px 128px); gap: 12px; align-items: center; min-height: 42px; padding: 4px 8px; border-bottom: 1px solid var(--line-soft); cursor: pointer; background: #fff; }
.trow:hover { background: #F8F9FB; }
.trow.open { background: var(--accent-soft); }
.trow.sortable-ghost { opacity: .4; }
.trow.done .tname { color: var(--muted); text-decoration: line-through; text-decoration-color: #B5BAC3; }
.tname { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tname:hover { text-decoration: none; color: var(--link); }
.ms { color: #7A3DB8; font-size: 12px; margin-right: 4px; }
.badges { display: flex; gap: 6px; }
.badge-s { font-size: 12px; color: var(--muted); background: var(--soft); border-radius: 5px; padding: 1px 6px; white-space: nowrap; }
.c-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 14px; }
.c-due { font-size: 14px; }
.circle { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #7A808C; background: #fff; padding: 0; cursor: pointer; position: relative; flex: 0 0 auto; }
.circle:hover { border-color: #2E9B5E; background: #EEF6F1; }
.circle.done { background: #2E9B5E; border-color: #2E9B5E; }
.circle.done::after, .circle:hover::after { content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.circle:hover:not(.done)::after { border-color: #2E9B5E; }
span.circle { cursor: default; }
.quick { margin: 0; }
.quick-input { width: 100%; border: 0; background: transparent; height: 38px; padding: 0 8px 0 40px; font-size: 14px; color: var(--text); border-radius: 6px; }
.quick-input::placeholder { color: var(--faint); }
.quick-input:focus { outline: none; background: #F8F9FB; box-shadow: inset 0 0 0 1px var(--control); }
.add-sec { margin-top: 18px; }
.add-sec .quick-input { padding-left: 8px; font-weight: 600; }

/* ---------- карточка задачи ---------- */
.pane { border-left: 1px solid var(--line); background: #fff; position: sticky; top: 56px; height: calc(100vh - 56px); display: flex; flex-direction: column; min-width: 0; }
.pane-top { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pane-body { overflow-y: auto; padding: 16px 20px 40px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.t-title { width: 100%; font-size: 21px; font-weight: 700; letter-spacing: -.3px; line-height: 1.3; border: 1px solid transparent; border-radius: 8px; padding: 4px 6px; margin: 0 -6px 12px; resize: none; overflow: hidden; background: transparent; }
textarea.t-title:hover { border-color: var(--line); }
textarea.t-title:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.props { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; align-items: center; margin: 0 0 18px; }
.props dt { color: var(--muted); font-size: 14px; }
.props dd { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }
.props input[type=date] { width: auto; }
.proj-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.proj-link .sq { width: 10px; height: 10px; border-radius: 3px; }
.desc { white-space: pre-wrap; }
.picker { position: relative; }
.picker-pop { width: 320px; padding: 8px; }
.picker-list { max-height: 280px; overflow-y: auto; margin-top: 6px; }
.subtasks h3, .history h3 { font-size: 14px; margin: 18px 0 6px; display: flex; gap: 10px; align-items: baseline; }
.subtasks .trow { --cols: 24px minmax(0, 1fr) auto auto; cursor: default; }
.subtasks .quick-input { padding-left: 40px; }
.followers { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.history ol { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.history li { padding: 4px 0; color: #3E444F; }

/* ---------- доска ---------- */
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { width: 272px; flex: 0 0 272px; background: var(--side); border: 1px solid var(--line); border-radius: 12px; padding: 10px; transition: opacity .12s, border-color .12s; }
.col.ok { border-color: #8FB4F0; background: #F2F6FE; }
.col.no { opacity: .45; }
.col-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cards { list-style: none; margin: 0; padding: 0; min-height: 40px; display: flex; flex-direction: column; gap: 8px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px; cursor: grab; box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.kcard:hover { border-color: var(--control); }
.kcard.locked { cursor: default; }
.kcard.done .kname { color: var(--muted); }
.kcard.sortable-ghost { opacity: .4; }
.kname { color: var(--text); display: block; font-weight: 500; }
.kname:hover { text-decoration: none; color: var(--link); }
.kmeta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.col-empty { font-size: 13px; color: var(--faint); text-align: center; padding: 12px 0; margin: 0; border: 1.5px dashed var(--control); border-radius: 8px; }

/* ---------- календарь ---------- */
.cal-h { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.cal-h h2 { font-size: 18px; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--side); }
.cal-day { min-height: 112px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px 6px; min-width: 0; }
.cal-day.out { background: #FAFBFC; }
.cal-day.out .cal-n { color: var(--faint); }
.cal-day.today .cal-n { background: var(--accent); color: #fff; border-radius: 10px; padding: 0 7px; }
.cal-n { font-size: 12px; font-weight: 600; }
.cal-tasks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; min-height: 24px; }
.cal-t { font-size: 12px; background: var(--accent-soft); border-radius: 5px; padding: 2px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: grab; }
.cal-t a { color: var(--accent-text); }
.cal-t.done { background: var(--soft); }
.cal-t.done a { color: var(--muted); text-decoration: line-through; }
.cal-t.overdue { background: #FBE3DF; }
.cal-t.overdue a { color: #9E2A17; }

/* ---------- окна ---------- */
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .38); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 16px; }
.modal { background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow); }
.modal h2 { font-size: 18px; margin-bottom: 8px; }
.quote { margin: 10px 0 0; padding: 10px 12px; background: var(--soft); border-radius: 8px; white-space: pre-wrap; max-height: 200px; overflow: auto; }

/* Узкий список (например, рядом с карточкой): исполнитель — только аватаром. */
@container (max-width: 760px) {
  .list { --cols: 24px minmax(120px, 1fr) auto 28px 72px 112px; }
  .list .c-f { display: none; }
  .c-who .ell, .c-who .muted { display: none; }
  .thead span:nth-child(4) { visibility: hidden; }
}
@media (max-width: 1100px) {
  .proj.with-pane { grid-template-columns: minmax(0, 1fr); }
  .proj.with-pane .proj-main { display: none; }
}
@media (max-width: 900px) {
  .proj { margin: -16px; }
  .proj-main { padding: 16px; }
  .thead { display: none; }
  .trow { grid-template-columns: 24px minmax(0, 1fr) auto; }
  .trow .c-who, .trow .badges, .trow .c-f { display: none; }
  .trow .c-due { grid-column: 2; font-size: 12px; margin-top: -8px; }
  .trow .c-st { grid-column: 3; grid-row: 1; }
  .pane { position: static; height: auto; }
}

[hidden] { display: none !important; }

.nav-toggle { display: none; font-size: 18px; }
.filters { max-width: calc(100vw - 32px); }
@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  body.nav-open .side { display: flex; position: fixed; top: 56px; left: 0; bottom: 0; width: 280px; height: auto; z-index: 40; box-shadow: var(--shadow); }
  .topbar .search-box span, .topbar .search-box kbd { display: none; }
  .topbar .search { max-width: 44px; margin: 0 0 0 auto; }
  .trow .c-due { display: block; }
}
.history .h-text { color: var(--text); }

/* ---------- обсуждение ---------- */
.comments h3 { font-size: 14px; margin: 18px 0 8px; display: flex; gap: 10px; align-items: baseline; }
.comment-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.comment { display: flex; gap: 10px; }
.c-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.c-menu { margin-left: auto; opacity: 0; }
.comment:hover .c-menu, .c-menu:focus-within { opacity: 1; }
.c-body { margin: 2px 0 0; white-space: pre-wrap; word-break: break-word; }
.mention { background: var(--accent-soft); color: var(--accent-text); border-radius: 4px; padding: 0 3px; font-weight: 500; }
.composer { position: relative; }
.composer .textarea { min-height: 60px; }
.mention-pop { width: 300px; max-height: 260px; overflow-y: auto; top: auto; bottom: calc(100% - 4px); }
.mention-pop .mi.active { background: var(--accent-soft); }

/* ---------- входящие ---------- */
.narrow.wide { max-width: 860px; }
.ncards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ncard { position: relative; display: flex; gap: 12px; padding: 14px 14px 14px 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.ncard.unread { border-color: #C9D3F2; background: #FAFBFF; }
.udot { position: absolute; left: 8px; top: 22px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.n-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.n-title { font-weight: 600; color: var(--text); }
.n-lines { margin: 4px 0 0; padding-left: 18px; color: #3E444F; font-size: 14px; }
.n-actions { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.n-actions .input { width: auto; }
.n-reply { display: flex; gap: 8px; margin-top: 8px; }
.n-side { display: flex; flex-direction: column; gap: 4px; }
.settings-table { width: 100%; border-collapse: collapse; }
.settings-table th, .settings-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); font-weight: 400; }
.settings-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.settings-table td { width: 120px; text-align: center; }
.settings-table input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- люди и профиль ---------- */
.card-block { border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin-bottom: 20px; background: #fff; }
.card-block h2 { font-size: 16px; margin-bottom: 14px; }
.add-person { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; align-items: start; }
.add-person > button { justify-self: start; }
.people-table { width: 100%; border-collapse: collapse; }
.people-table th, .people-table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); font-weight: 400; vertical-align: middle; }
.people-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); }
.people-table tr.off { opacity: .6; }
.people-table .actions { width: 40px; }
.creds { background: #fff; border: 1px solid var(--ok-line); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 14px; white-space: pre-wrap; }
@media (max-width: 700px) { .add-person { grid-template-columns: 1fr; } .people-table th:nth-child(4), .people-table td:nth-child(4) { display: none; } }

/* ---------- настройки проекта ---------- */
.status-list, .access-list { list-style: none; margin: 0; padding: 0; }
.status-row, .access-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.status-row .input { max-width: 220px; }
.status-row .select { width: auto; }
.matrix-wrap { overflow-x: auto; }
.matrix { border-collapse: collapse; }
.matrix th, .matrix td { padding: 8px 10px; border: 1px solid var(--line-soft); text-align: center; font-weight: 400; }
.matrix tbody th { text-align: left; }
.matrix input { width: 18px; height: 18px; accent-color: var(--accent); }
.danger-zone .btn-danger { margin-top: 8px; }
.grant-list { margin-top: 8px; }
.grant-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); }
.c-f { font-size: 13px; min-width: 0; }
.req { color: var(--danger); margin-left: 2px; }
.field-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.opt-list { list-style: none; margin: 6px 0 0 0; padding: 0; width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
.opt-list form { display: inline-flex; gap: 4px; align-items: center; }

.select.compact { width: auto; height: 30px; font-size: 13px; }
.view-tab { display: inline-flex; align-items: center; }
.view-del { border: 0; background: none; color: var(--faint); cursor: pointer; padding: 0 4px; font-size: 16px; opacity: 0; }
.view-tab:hover .view-del, .view-del:focus-visible { opacity: 1; }
.save-view { margin-left: auto; align-self: center; }
.tabs { align-items: flex-end; flex-wrap: wrap; }

/* ---------- поиск ---------- */
.topbar .search { position: relative; }
.search-box input { border: 0; background: transparent; flex: 1; min-width: 0; font-size: 14px; height: 32px; }
.search-box input:focus { outline: none; }
.search-box:focus-within { border-color: var(--accent); box-shadow: var(--focus); background: #fff; }
.quick-results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: var(--shadow); z-index: 60; max-height: 70vh; overflow-y: auto; }
.quick-results:empty { display: none; }
.sr-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; padding: 10px 12px 4px; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; color: var(--text); }
a.sr-item:hover, a.sr-item:focus-visible { background: var(--accent-soft); text-decoration: none; box-shadow: none; border-radius: 0; }
.sr-all { display: block; padding: 10px 12px; border-top: 1px solid var(--line-soft); font-size: 13px; }
.sr-snippet { margin: -4px 12px 8px 12px; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.search-results { border: 1px solid var(--line); border-radius: 12px; padding: 6px 0; }

.proj-chip { display: inline-flex; align-items: center; gap: 2px; }
.x-btn { border: 0; background: none; color: var(--faint); cursor: pointer; font-size: 15px; padding: 0 4px; }
.x-btn:hover { color: var(--danger); }
.deps h3 { font-size: 14px; margin: 18px 0 6px; }
.dep-list { list-style: none; margin: 4px 0 8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dep-list li { display: flex; align-items: center; gap: 8px; }
.dep-add { position: relative; }
.dep-results .mi { border-radius: 6px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.home-grid .card-block h2 { margin-bottom: 8px; }
.home-grid .trow { --cols: 24px minmax(0, 1fr) auto auto; cursor: default; }
@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr; } }

.sel { position: absolute; left: -22px; width: 16px; height: 16px; opacity: 0; accent-color: var(--accent); }
.trow { position: relative; }
.trow:hover .sel, .sel:checked, .sel:focus-visible { opacity: 1; }
.list { padding-left: 24px; margin-left: -24px; }
.bulk-bar { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 70; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; box-shadow: var(--shadow); flex-wrap: wrap; max-width: calc(100vw - 32px); }
.bulk-count { font-weight: 600; }
.bulk-fail summary { cursor: pointer; color: #A9BCFF; }
.bulk-fail ul { margin: 6px 0 0; padding-left: 18px; }
.sr-create { padding: 8px 10px; }
.circle.muted-circle { border-style: dashed; border-color: #B5BAC3; }
.circle.muted-circle:hover { border-color: #7A808C; background: #fff; }
.circle.muted-circle:hover::after { content: none; }
.menu-note { margin: 4px 0 0; padding: 6px 10px 2px; border-top: 1px solid var(--line-soft); font-size: 12px; color: var(--muted); }
.n-act { justify-content: flex-start; white-space: nowrap; }
.n-actions label { align-self: center; }
@media (max-width: 700px) { .n-act-l { display: none; } }
