/* welgrant — стили. Системный шрифтовой стек, светлая и тёмная темы, один акцент. */
:root {
  --bg: #f3f5f7; --surface: #ffffff; --surface-2: #f7f9fa; --ink: #16212b; --muted: #5a6873; --line: #d8dee3; --line-2: #e8ecef;
  --accent: #2e6390; --accent-ink: #ffffff; --accent-soft: #e3edf5;
  --danger: #b4232c; --danger-soft: #fbe5e6; --warn: #9a6400; --warn-soft: #fdf0d2; --ok: #1f7a4d; --ok-soft: #dff3e8;
  --info: #2e6390; --info-soft: #e3edf5; --gray: #6b7680; --gray-soft: #eceff2;
  --tech: #b47a1c; --dev: #2e6390; --ai: #23806f; --test: #6b4e9b;
  --tech-soft: #f4e7cf; --dev-soft: #dce7f1; --ai-soft: #d6ece7; --test-soft: #e6dff2;
  --stage1: #eef2f5; --stage2: #eff4f1; --shadow: 0 1px 2px rgba(22,33,43,.06), 0 2px 8px rgba(22,33,43,.05);
  --radius: 10px; --focus: #2e6390; color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11171c; --surface: #182129; --surface-2: #1d2832; --ink: #e6ecf0; --muted: #97a6b1; --line: #2a3640; --line-2: #222d36;
    --accent: #6aa2d2; --accent-ink: #0d1620; --accent-soft: #1c2e3e;
    --danger: #ff8a8f; --danger-soft: #3c1b1e; --warn: #e4b35a; --warn-soft: #3a2e1a; --ok: #5fc48d; --ok-soft: #173520;
    --info: #6aa2d2; --info-soft: #1c2e3e; --gray: #97a6b1; --gray-soft: #222d36;
    --tech: #d9a04a; --dev: #6aa2d2; --ai: #5cc2ae; --test: #a78bd6;
    --tech-soft: #3a2e1a; --dev-soft: #1c2e3e; --ai-soft: #173530; --test-soft: #2b2340;
    --stage1: #1a242c; --stage2: #192722; --shadow: none; --focus: #8fc1ea; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0 0 12px; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 22px 0 10px; font-weight: 650; }
h3 { font-size: 15px; margin: 14px 0 8px; font-weight: 650; }
p { margin: 0 0 8px; }
small, .muted { color: var(--muted); }
.muted { font-size: 13px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; background: var(--gray-soft); padding: 1px 5px; border-radius: 4px; }
pre { white-space: pre-wrap; font: inherit; margin: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- каркас ---- */
.layout { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 14px; font-weight: 700; font-size: 16px; }
.brand .logo { width: 28px; height: 28px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 15px; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--ink); font-size: 14px; min-height: 38px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a .ico { width: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.nav a.active .ico { color: var(--accent); }
.nav .sep { height: 1px; background: var(--line); margin: 8px 10px; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 10px 22px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .search { flex: 1; max-width: 460px; position: relative; }
.topbar .search input { width: 100%; }
.topbar .spacer { flex: 1; }
.burger { display: none; }
.content { padding: 20px 22px 60px; max-width: 1280px; }
.search-results { position: absolute; top: 100%; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 30; }
.search-results a { display: block; padding: 8px 12px; border-bottom: 1px solid var(--line-2); color: var(--ink); }
.search-results a:hover { background: var(--surface-2); text-decoration: none; }
.search-results .cat { padding: 6px 12px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: none; }

/* ---- элементы ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 8px; cursor: pointer; min-height: 38px; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.ok { color: var(--ok); border-color: var(--ok); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: 13px; }
.btn.icon { padding: 6px 10px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
input[type=text], input[type=password], input[type=date], input[type=number], input[type=search], input[type=time], input[type=email], input[type=tel], input[type=url], select, textarea {
  width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 8px 10px; min-height: 38px; }
textarea { min-height: 80px; resize: vertical; }
select { appearance: auto; }
label.field { display: block; margin: 0 0 12px; }
label.field > span, .field-label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 3px; }
.check { display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; }
.check input { width: 18px; height: 18px; margin-top: 2px; flex: none; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 16px; }
.form-grid .wide { grid-column: 1 / -1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin-bottom: 14px; }
.card.tight { padding: 10px 12px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .n { font-size: 24px; font-weight: 700; line-height: 1.15; overflow-wrap: anywhere; }
.stat { min-width: 0; }
.stat .l { font-size: 13px; color: var(--muted); }
.stat.danger .n { color: var(--danger); }
.stat.warn .n { color: var(--warn); }
.stat.ok .n { color: var(--ok); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 16px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--gray-soft); color: var(--gray); white-space: nowrap; line-height: 1.5; }
.badge.hard { background: var(--danger-soft); color: var(--danger); }
.badge.internal { background: var(--gray-soft); color: var(--gray); }
.badge.external { background: var(--info-soft); color: var(--info); }
.badge.new { background: var(--gray-soft); color: var(--gray); }
.badge.progress { background: var(--info-soft); color: var(--info); }
.badge.review { background: var(--warn-soft); color: var(--warn); }
.badge.done { background: var(--ok-soft); color: var(--ok); }
.badge.blocked { background: var(--danger-soft); color: var(--danger); }
.badge.cancelled { background: var(--gray-soft); color: var(--gray); text-decoration: line-through; }
.badge.overdue { background: var(--danger); color: #fff; }
.badge.soon { background: var(--warn-soft); color: var(--warn); }
.badge.type { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); font-weight: 500; }
.badge.rel-estimated { background: var(--warn-soft); color: var(--warn); }
.badge.rel-undefined { background: var(--gray-soft); color: var(--gray); }
.badge.rel-confirmed { background: var(--ok-soft); color: var(--ok); }
.badge.tech { background: var(--tech-soft); color: var(--tech); }
.badge.dev { background: var(--dev-soft); color: var(--dev); }
.badge.ai { background: var(--ai-soft); color: var(--ai); }
.badge.test { background: var(--test-soft); color: var(--test); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.danger { background: var(--danger); } .dot.warn { background: var(--warn); } .dot.ok { background: var(--ok); } .dot.info { background: var(--info); } .dot.gray { background: var(--gray); }
.alert { padding: 10px 14px; border-radius: 8px; margin: 10px 0; border: 1px solid; }
.alert.danger { background: var(--danger-soft); border-color: var(--danger); color: var(--ink); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn); }
.alert.info { background: var(--info-soft); border-color: var(--info); }
.alert.ok { background: var(--ok-soft); border-color: var(--ok); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; z-index: 100; box-shadow: var(--shadow); max-width: 90vw; }
.toast.danger { background: var(--danger); color: #fff; }

/* ---- таблицы ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: 12.5px; color: var(--muted); font-weight: 600; background: var(--surface-2); white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.nowrap { white-space: nowrap; }
tr.total td { font-weight: 700; background: var(--surface-2); }
tr.overdue td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
tr.soon td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.cell-title a { color: var(--ink); font-weight: 500; }
.cell-sub { font-size: 12.5px; color: var(--muted); }

/* ---- списки пунктов ---- */
.item-list { display: flex; flex-direction: column; gap: 6px; }
.item-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: start; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.item-row.overdue { border-left: 4px solid var(--danger); }
.item-row.soon { border-left: 4px solid var(--warn); }
.item-row.done { opacity: .7; }
.item-row .t { font-weight: 500; }
.item-row .t a { color: var(--ink); }
.item-row .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.item-row .right { text-align: right; font-size: 13px; white-space: nowrap; }
.item-row .right .d { font-weight: 600; color: var(--ink); }
.item-row .right .left { color: var(--muted); }
.item-row .right .left.danger { color: var(--danger); font-weight: 600; }
.item-row .right .left.warn { color: var(--warn); font-weight: 600; }
.group-title { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font-weight: 650; }
.group-title .n { font-size: 13px; color: var(--muted); font-weight: 500; }
details.collapse > summary { cursor: pointer; font-weight: 600; padding: 6px 0; list-style: none; }
details.collapse > summary::before { content: "▸ "; color: var(--muted); }
details.collapse[open] > summary::before { content: "▾ "; }

/* ---- фильтры ---- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin: 6px 0 14px; }
.filters label { display: block; font-size: 12px; color: var(--muted); }
.filters label > * { display: inline-block; margin-top: 3px; }
.filters label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); min-height: 36px; }
.filters label.check input { min-width: 0; width: 18px; min-height: 0; margin: 0; }
.filters select, .filters input { min-width: 140px; width: auto; min-height: 36px; padding: 6px 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: 13px; min-height: 32px; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---- карточка пункта ---- */
.item-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.item-head h1 { margin: 0; flex: 1 1 400px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.due-big { font-size: 20px; font-weight: 700; }
.due-big.danger { color: var(--danger); }
.due-big.warn { color: var(--warn); }
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--line-2); counter-increment: s; }
.steps li:last-child { border-bottom: 0; }
.steps li::before { content: counter(s) "."; color: var(--muted); min-width: 22px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.steps input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; }
.steps .done { color: var(--muted); text-decoration: line-through; }
.steps label { flex: 1; cursor: pointer; display: flex; gap: 10px; }
.progress { height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; }
.progress > div { height: 100%; background: var(--accent); border-radius: 4px; }
.progress.ok > div { background: var(--ok); }
.progress.danger > div { background: var(--danger); }
.comments { display: flex; flex-direction: column; gap: 10px; }
.comment { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.comment .who { font-size: 13px; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; flex-wrap: wrap; }
.comment .who b { color: var(--ink); }
.comment p { margin: 0 0 4px; }
.comment ul { margin: 4px 0; padding-left: 20px; }
.comment.result { border-color: var(--ok); } .comment.reject { border-color: var(--danger); } .comment.block { border-color: var(--danger); } .comment.accept { border-color: var(--ok); }
.mention { color: var(--accent); font-weight: 600; }
.mention-list { position: absolute; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); z-index: 50; max-height: 220px; overflow: auto; }
.mention-list div { padding: 6px 12px; cursor: pointer; }
.mention-list div.sel, .mention-list div:hover { background: var(--accent-soft); }
.history li { font-size: 13px; color: var(--muted); margin: 3px 0; }
.history li b { color: var(--ink); font-weight: 500; }
.attach li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.attach li:last-child { border-bottom: 0; }

/* ---- модальные окна ---- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--surface); border-radius: 12px; max-width: 620px; width: 100%; max-height: 92vh; overflow: auto; padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.3); }
.modal.wide { max-width: 900px; }
.modal h2 { margin-top: 0; }
.modal .actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }

/* ---- диаграмма ---- */
.gantt-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.gantt svg { display: block; }
.gantt .grid line { stroke: var(--line-2); }
.gantt .stage-line { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; }
.gantt .today-line { stroke: var(--danger); stroke-width: 2; }
.gantt .today-label { fill: var(--danger); font-size: 11px; font-weight: 700; }
.gantt .month-label { font-size: 12px; font-weight: 600; fill: var(--ink); }
.gantt .month-cal { font-size: 11px; fill: var(--muted); }
.gantt .row-label { font-size: 13px; fill: var(--ink); cursor: pointer; }
.gantt .row-sub { font-size: 11px; fill: var(--muted); }
.gantt .row-bg-1 { fill: var(--stage1); } .gantt .row-bg-2 { fill: var(--stage2); }
.gantt .bar { rx: 4; stroke-width: 1.5; cursor: pointer; }
.gantt .bar.tech { fill: var(--tech-soft); stroke: var(--tech); } .gantt .bar.dev { fill: var(--dev-soft); stroke: var(--dev); }
.gantt .bar.ai { fill: var(--ai-soft); stroke: var(--ai); } .gantt .bar.test { fill: var(--test-soft); stroke: var(--test); }
.gantt .fact.tech { fill: var(--tech); } .gantt .fact.dev { fill: var(--dev); } .gantt .fact.ai { fill: var(--ai); } .gantt .fact.test { fill: var(--test); }
.gantt .fact { opacity: .75; pointer-events: none; }
.gantt .bar-text { font-size: 11px; fill: var(--ink); pointer-events: none; }
.gantt .cp { fill: var(--ink); cursor: pointer; } .gantt .cp.confirmed { fill: var(--ok); } .gantt .cp.missed { fill: var(--danger); } .gantt .cp.current { fill: var(--warn); }
.gantt .hard-mark { fill: var(--danger); cursor: pointer; }
.gantt .hard-label { font-size: 10.5px; fill: var(--danger); }
.gantt .actual-mark { stroke: var(--ink); stroke-width: 2; }
.gantt .stage-title { font-size: 12px; font-weight: 700; fill: var(--muted); letter-spacing: .04em; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 13px; margin: 8px 0; align-items: center; }
.legend .sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-right: 6px; vertical-align: -2px; }
.sw.tech { background: var(--tech); } .sw.dev { background: var(--dev); } .sw.ai { background: var(--ai); } .sw.test { background: var(--test); }

/* ---- риски ---- */
.heat-1 { background: var(--ok-soft); } .heat-2 { background: var(--ok-soft); } .heat-3 { background: var(--warn-soft); } .heat-4 { background: var(--warn-soft); } .heat-6 { background: var(--danger-soft); } .heat-9 { background: var(--danger-soft); }
.heat { font-weight: 700; text-align: center; border-radius: 6px; padding: 2px 8px; display: inline-block; min-width: 32px; }

/* ---- контрольные точки ---- */
.timeline { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 8px 0 16px; }
.tl { padding: 10px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-align: center; }
.tl .m { font-weight: 700; } .tl .s { font-size: 12px; color: var(--muted); }
.tl.confirmed { border-color: var(--ok); background: var(--ok-soft); } .tl.current { border-color: var(--warn); background: var(--warn-soft); } .tl.missed { border-color: var(--danger); background: var(--danger-soft); }

/* ---- вход ---- */
.auth { max-width: 400px; margin: 8vh auto; }
.auth .card { padding: 24px; }

/* ---- справка ---- */
.help h2 { border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.help .verbatim { white-space: pre-wrap; background: var(--surface-2); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 8px 0; }
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.onboard { border: 2px solid var(--accent); }
.onboard ol { padding-left: 20px; }

/* ---- знакомство, уведомления ---- */
.notif { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); align-items: flex-start; }
.notif.unread { background: var(--accent-soft); }
.notif .when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.bell { position: relative; }
.bell .cnt { position: absolute; top: -4px; right: -4px; background: var(--danger); color: #fff; font-size: 11px; border-radius: 999px; padding: 0 5px; min-width: 18px; text-align: center; line-height: 18px; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 12px; font-weight: 700; }

/* ---- бюджет ---- */
.limits li { display: flex; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line-2); }
.limits li:last-child { border-bottom: 0; }
.limits .bar { flex: 1; height: 8px; background: var(--gray-soft); border-radius: 4px; overflow: hidden; min-width: 80px; }
.limits .bar div { height: 100%; background: var(--ok); }
.limits .bar.over div { background: var(--danger); }
.pay-cell { font-size: 12.5px; line-height: 1.3; }
.pay-cell .f { color: var(--muted); }
.pay-cell .f.diff { color: var(--warn); font-weight: 600; }

/* ---- печать ---- */
@media print {
  .sidebar, .topbar, .btn, .filters, .no-print { display: none !important; }
  .layout { grid-template-columns: 1fr; }
  .content { padding: 0; max-width: none; }
  body { background: #fff; color: #000; }
  .card, .table-wrap, .item-row { box-shadow: none; break-inside: avoid; }
  a { color: #000; }
}

/* ---- телефон ---- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; max-width: 85vw; transform: translateX(-100%); transition: transform .2s; z-index: 50; height: 100vh; }
  .sidebar.open { transform: none; }
  .scrim.open { display: block; }
  .burger { display: inline-flex; }
  .topbar { padding: 8px 12px; }
  .topbar .search { max-width: none; }
  .content { padding: 14px 16px 60px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: repeat(2, 1fr); }
  .item-row { grid-template-columns: 1fr; }
  .item-row .right { text-align: left; white-space: normal; }
  h1 { font-size: 20px; }
  .kv { grid-template-columns: 1fr; gap: 2px; }
  .kv dt { margin-top: 6px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { padding: 14px; }
  .filters select, .filters input { min-width: 0; width: 100%; }
  .filters label { flex: 1 1 45%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .user-chip .name { display: none; }
  table.wide { min-width: 640px; }
}
ul.plain, ol.plain { list-style: none; padding: 0; margin: 0; }
ul.plain li { padding: 4px 0; }
td.clickable { cursor: pointer; }
.lim-text { flex: 1 1 260px; }
.pre pre { white-space: pre-wrap; }

.file-pick { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-pick input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.file-pick .fname { font-size: 13px; color: var(--muted); max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
