@import url("/static/fonts/inter.css");

:root {
  color-scheme: light;
  --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f9fafb; --text: #111827; --muted: #6b7280; --faint: #9ca3af;
  --border: #e5e7eb; --border-strong: #d1d5db; --hover: #f3f4f6;
  --accent: #2563eb; --accent-strong: #1d4ed8; --accent-soft: #eef3ff; --accent-ring: rgba(37, 99, 235, .18);
  --ok: #15803d; --ok-soft: #ecfdf3; --warn: #b45309; --warn-soft: #fffbeb;
  --err: #b91c1c; --err-soft: #fef2f2; --info: #2563eb; --info-soft: #eef3ff;
  --radius: 10px; --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05); --shadow-md: 0 4px 12px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --side-w: 236px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.02em; line-height: 1.25; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 10px; letter-spacing: -.01em; }
h3 { font-size: 12px; font-weight: 600; margin: 0 0 8px; color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; } .nowrap { white-space: nowrap; } .right { text-align: right; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
svg.ico { width: 18px; height: 18px; flex: none; vertical-align: -4px; }

/* каркас */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { border-right: 1px solid var(--border); background: var(--surface); padding: 16px 12px 12px;
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 2px; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text); font-weight: 700;
  font-size: 17px; letter-spacing: -.02em; line-height: 1; }
.brand:hover { text-decoration: none; }
.brand .logo { width: 30px; height: 30px; flex: none; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--faint); letter-spacing: .01em; margin-top: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm);
  color: var(--text); font-weight: 500; font-size: 13.5px; transition: background .12s; }
.nav a .ico { color: var(--faint); }
.nav .soon { display: flex; align-items: center; gap: 10px; padding: 7px 10px; color: var(--faint); cursor: default; }
.nav .soon > span { white-space: nowrap; }
.nav .soon .tag { margin-left: auto; font-size: 10.5px; font-weight: 600; padding: 1px 6px; border-radius: 99px; background: var(--hover); color: var(--muted); }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a.on .ico { color: var(--accent); }
.nav a .cnt { margin-left: auto; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px;
  background: var(--hover); color: var(--muted); }
.nav .sep { height: 1px; background: var(--border); margin: 10px 8px; }
.nav .grp { font-size: 11px; font-weight: 600; color: var(--faint); text-transform: uppercase; letter-spacing: .06em;
  padding: 12px 10px 4px; }
.side .me { margin-top: auto; padding: 12px 8px 4px; font-size: 12.5px; color: var(--muted);
  border-top: 1px solid var(--border); display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; align-items: center; }
.side .me .ava { grid-row: span 2; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-weight: 600; font-size: 13px; }
.side .me b { color: var(--text); font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .me .links { grid-column: 2; display: flex; gap: 12px; margin-top: 4px; }
.side .me .links a, .side .me .links button { font-size: 12.5px; color: var(--muted); }
.side .me .links a:hover, .side .me .links button:hover { color: var(--accent); }
.main { padding: 24px 32px 72px; min-width: 0; }
.head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.head .grow { flex: 1; }
.head > h1 + .muted { font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--hover);
  padding: 2px 9px; border-radius: 99px; }

/* элементы */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, box-shadow .12s; }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgba(37, 99, 235, .3), inset 0 1px 0 rgba(255,255,255,.12); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.danger { color: var(--err); }
.btn.ghost { border-color: transparent; background: transparent; box-shadow: none; }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
input, select, textarea { font: inherit; font-size: 13.5px; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); height: 34px; padding: 0 10px; width: 100%;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, .03); transition: border-color .12s, box-shadow .12s; }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { height: auto; padding: 8px 10px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
input[type=checkbox], input[type=radio] { width: 16px; height: 16px; padding: 0; accent-color: var(--accent);
  vertical-align: middle; flex: none; box-shadow: none; }
label { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 4px; }
.field { margin-bottom: 12px; }
.row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 400; color: var(--text); margin: 0; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 6px; font-size: 12px;
  font-weight: 500; background: var(--hover); color: var(--muted); white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.badge.info { background: var(--info-soft); color: var(--info); }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-right: 5px; }
.spin { display: inline-block; width: 11px; height: 11px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: s .7s linear infinite; vertical-align: -1px; margin-right: 5px; }
@keyframes s { to { transform: rotate(360deg); } }

/* таблицы */
.tbl-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: auto;
  box-shadow: var(--shadow-sm); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.clickable { cursor: pointer; }
.tbl .sub { color: var(--muted); font-size: 12.5px; }
.tbl .cb { width: 34px; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }

/* фильтры и панель действий */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.filters .wide { grid-column: span 2; }
.bulkbar { display: none; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px;
  background: #111827; color: #fff; border-radius: var(--radius); box-shadow: var(--shadow-md); }
.bulkbar.show { display: flex; }
.bulkbar .btn { background: transparent; color: #fff; border-color: #374151; box-shadow: none; }
.bulkbar .btn:hover { background: #1f2937; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; margin-top: 10px; }

/* загрузка */
.drop { border: 1.5px dashed var(--border-strong); border-radius: var(--radius); padding: 16px 18px;
  display: flex; align-items: center; gap: 14px; background: var(--surface); margin-bottom: 12px; transition: border-color .12s, background .12s; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop .grow { flex: 1; }
.drop code { background: var(--hover); padding: 2px 7px; border-radius: 6px; font-family: var(--mono); font-size: 12px; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 420px; background: #111827; color: #fff;
  padding: 12px 14px; border-radius: var(--radius); font-size: 13px; box-shadow: var(--shadow-lg); z-index: 50; }
.toast ul { margin: 6px 0 0; padding-left: 18px; }

/* карточка документа */
.doc-grid { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); gap: 16px; align-items: start; }
.viewer { position: sticky; top: 12px; height: calc(100vh - 24px); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); }
.viewer .bar { display: flex; gap: 6px; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--border);
  font-size: 12.5px; color: var(--muted); background: var(--surface-2); }
.viewer iframe, .viewer .img { flex: 1; width: 100%; border: 0; overflow: auto; background: #e9ebef; }
.viewer .img img { display: block; max-width: 100%; margin: 0 auto; transform-origin: top center; }
.stages { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 8px; }
.stage { font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--hover); color: var(--faint); }
.stage.success { background: var(--ok-soft); color: var(--ok); }
.stage.in_progress { background: var(--info-soft); color: var(--info); }
.stage.error { background: var(--err-soft); color: var(--err); }
.stage.skipped { color: var(--muted); }
.issues { list-style: none; margin: 0; padding: 0; }
.issues li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 11px; border-radius: var(--radius-sm); margin-bottom: 5px;
  font-size: 13.5px; }
.issues li.error { background: var(--err-soft); color: var(--err); }
.issues li.warning { background: var(--warn-soft); color: var(--warn); }
.issues li.acked { background: var(--hover); color: var(--muted); text-decoration: line-through; }
.issues li .grow { flex: 1; }
.parties { display: grid; grid-template-columns: 1fr 36px 1fr; gap: 10px; align-items: start; }
.parties .swap { margin-top: 26px; }
.party { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.party.client { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.party .tag { font-size: 11px; color: var(--accent); font-weight: 600; }
.lines { width: 100%; min-width: 940px; border-collapse: collapse; font-size: 12.5px; }
.lines th { font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted);
  text-align: left; padding: 6px 3px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.lines td { padding: 3px; border-bottom: 1px solid var(--border); vertical-align: top; }
.lines input, .lines textarea { height: 28px; padding: 0 5px; font-size: 12.5px; border-color: transparent;
  background: transparent; box-shadow: none; border-radius: 6px; }
.lines textarea { height: 28px; min-height: 28px; padding: 5px; line-height: 1.3; resize: vertical; }
.lines input:hover, .lines textarea:hover { border-color: var(--border); }
.lines input:focus, .lines textarea:focus { background: var(--surface); border-color: var(--accent); }
.lines .n input { text-align: right; font-variant-numeric: tabular-nums; }
.lines tr.bad td { background: var(--err-soft); }
.lines tr.edited td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; cursor: pointer; padding: 3px 6px; border-radius: 6px; color: var(--muted); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--hover); }
.menu .pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 6px; min-width: 220px; }
.menu .pop button, .menu .pop a { display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 7px 9px; border-radius: 6px; font: inherit; font-size: 13.5px; color: var(--text); cursor: pointer; }
.menu .pop button:hover, .menu .pop a:hover { background: var(--hover); text-decoration: none; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; max-width: 360px; margin-left: auto; font-size: 13.5px; }
.totals input { text-align: right; height: 30px; }
.actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px;
  display: flex; gap: 8px; align-items: center; }
.actions .grow { flex: 1; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 5px 10px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tabs a { padding: 8px 12px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color .12s; }
.tabs a.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a .muted { font-size: 11.5px; font-weight: 600; padding: 0 6px; border-radius: 99px; background: var(--hover); margin-left: 2px; }
.tabs a.on .muted { background: var(--accent-soft); color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat .v { font-size: 28px; font-weight: 600; letter-spacing: -.03em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-top: 10px; }
.bars div { flex: 1; background: var(--accent); opacity: .8; border-radius: 3px 3px 0 0; min-height: 1px; position: relative; }
.bars div:hover { opacity: 1; }
.alert { padding: 10px 13px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 12px; }
.alert.ok { background: var(--ok-soft); color: var(--ok); } .alert.err { background: var(--err-soft); color: var(--err); }
.alert.info { background: var(--info-soft); color: var(--info); } .alert.warn { background: var(--warn-soft); color: var(--warn); }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin: 6px 0; }
@media (max-width: 1100px) { .doc-grid { grid-template-columns: minmax(0, 1fr); } .viewer { position: static; height: 70vh; } }

body.wide .doc-grid { grid-template-columns: minmax(0, 1fr); }
body.wide .viewer { display: none; }
.show-viewer { display: none; }
body.wide .show-viewer { display: inline-flex; }

.catbtn { background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px 5px; text-align: left;
  width: 100%; cursor: pointer; font: inherit; color: var(--text); line-height: 1.25; }
.catbtn:hover { border-color: var(--border); background: var(--surface); }
dialog { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 18px; }
dialog::backdrop { background: rgba(17, 24, 39, .4); backdrop-filter: blur(2px); }

.catline { display: flex; align-items: center; gap: 4px; padding: 0 5px 3px; font-size: 11.5px; }
.catline .catbtn { width: auto; padding: 1px 6px; border: 1px dashed var(--border-strong); color: var(--muted); }
.catline .catbtn.set { border-style: solid; border-color: var(--ok-soft); background: var(--ok-soft); color: var(--ok); }

/* страницы без входа: вход, регистрация, сообщения */
.auth { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); min-height: 100vh; }
.auth-side { background-color: #0b1220; color: #fff; padding: 40px 48px; display: flex; flex-direction: column;
  background-image: radial-gradient(900px 600px at 20% -10%, rgba(37, 99, 235, .55), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, rgba(124, 58, 237, .35), transparent 60%); }
.auth-side .brand { color: #fff; padding: 0; font-size: 18px; }
.auth-side .brand small { color: rgba(255,255,255,.55); }
.auth-side h1 { font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1.15; margin: auto 0 18px; max-width: 460px; }
.auth-side p.lead { font-size: 15.5px; color: rgba(255,255,255,.72); margin: 0 0 28px; max-width: 440px; line-height: 1.55; }
.auth-side ul { list-style: none; margin: 0 0 auto; padding: 0; display: grid; gap: 14px; max-width: 460px; }
.auth-side li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; color: rgba(255,255,255,.88); }
.auth-side li .ico { width: 20px; height: 20px; color: #7fb0ff; margin-top: 1px; }
.auth-side .foot { margin-top: 32px; font-size: 12.5px; color: rgba(255,255,255,.45); display: flex; gap: 16px; flex-wrap: wrap; }
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box.wide { max-width: 560px; }
.auth-box h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 4px; }
.auth-box .sub { color: var(--muted); margin: 0 0 20px; }
.auth-box .card { padding: 22px; }
.auth-box .btn.primary { width: 100%; height: 38px; font-size: 14px; margin-top: 4px; }
.auth-box .after { text-align: center; margin-top: 16px; color: var(--muted); font-size: 13px; }
.auth-box .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.auth-box .kinds { display: grid; gap: 6px; margin-bottom: 12px; }
.auth-box .kinds label { display: flex; gap: 9px; align-items: center; padding: 9px 11px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 400; color: var(--text); margin: 0; cursor: pointer; }
.auth-box .kinds label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.auth-box .kinds input { width: 16px; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { padding: 20px 20px 24px; }
  .auth-side h1 { font-size: 24px; margin: 20px 0 10px; }
  .auth-side p.lead { font-size: 14px; margin-bottom: 14px; }
  .auth-side ul, .auth-side .foot { display: none; }
  .auth-main { padding: 24px 16px 40px; justify-content: flex-start; }
}
.page { max-width: 760px; margin: 0 auto; padding: 32px 20px 60px; }
.page .brand { padding: 0 0 22px; }
.page .card { padding: 24px; }
.login { max-width: 360px; margin: 12vh auto; padding: 0 16px; }

/* тёмная тема: по системе или выбором в настройках */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark;
  --bg: #0f1115; --surface: #171a20; --surface-2: #1c2027; --text: #e6e8ec; --muted: #9aa1ab; --faint: #6b7280;
  --border: #272b33; --border-strong: #363b45; --hover: #20242c; --accent: #6ea0ff; --accent-strong: #8ab2ff; --accent-soft: #1c2740;
  --accent-ring: rgba(110, 160, 255, .25);
  --ok: #5cc98a; --ok-soft: #14301f; --warn: #e5b45a; --warn-soft: #332a14; --err: #ff7b72; --err-soft: #3a1b1a;
  --info: #6ea0ff; --info-soft: #1c2740; --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5); } }
:root[data-theme="dark"] { color-scheme: dark;
  --bg: #0f1115; --surface: #171a20; --surface-2: #1c2027; --text: #e6e8ec; --muted: #9aa1ab; --faint: #6b7280;
  --border: #272b33; --border-strong: #363b45; --hover: #20242c; --accent: #6ea0ff; --accent-strong: #8ab2ff; --accent-soft: #1c2740;
  --accent-ring: rgba(110, 160, 255, .25);
  --ok: #5cc98a; --ok-soft: #14301f; --warn: #e5b45a; --warn-soft: #332a14; --err: #ff7b72; --err-soft: #3a1b1a;
  --info: #6ea0ff; --info-soft: #1c2740; --shadow-sm: 0 1px 2px rgba(0,0,0,.3); --shadow-md: 0 4px 12px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.5); }
:root[data-theme="dark"] .btn.primary { color: #0b1220; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0b1220; } }
.bulkbar { background: #111827; }
/* узкое меню: только значки */
:root[data-compact="1"] .shell { grid-template-columns: 64px 1fr; }
:root[data-compact="1"] .side { padding: 16px 8px 12px; }
:root[data-compact="1"] .nav a { justify-content: center; padding: 9px 0; }
:root[data-compact="1"] .nav a span, :root[data-compact="1"] .nav .grp, :root[data-compact="1"] .nav a .cnt, :root[data-compact="1"] .nav .soon span, :root[data-compact="1"] .nav .soon .tag { display: none; }
:root[data-compact="1"] .brand { justify-content: center; padding: 2px 0 14px; }
:root[data-compact="1"] .brand > div { display: none; }
:root[data-compact="1"] .side .me { grid-template-columns: 1fr; justify-items: center; padding: 10px 0 0; }
:root[data-compact="1"] .side .me b, :root[data-compact="1"] .side .me > span { display: none; }
:root[data-compact="1"] .side .me .links { grid-column: 1; flex-direction: column; gap: 4px; align-items: center; }
/* в сетках отступ задаёт gap, а не соседство карточек */
.stats > .card + .card, [style*="grid"] > .card + .card, [style*="grid"] > div > .card:first-child { margin-top: 0; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; }

/* v1.5: выбор «чей учёт», переход к строке, фильтр строк */
.whose{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:8px;margin-top:8px}
.whose-card{display:flex;flex-direction:column;gap:3px;text-align:left;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);cursor:pointer;font:inherit}
.whose-card:hover{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-ring)}
.whose-card b{font-size:14px}
a.lnlink{color:inherit;text-decoration:underline dotted}
tr.flash td{animation:flash 1.6s ease-out}
@keyframes flash{0%{background:color-mix(in srgb,var(--warn-soft) 100%,transparent)}100%{background:transparent}}
.lines.only-nocat tr[data-cat="1"]{display:none}
.stages-box{margin:0 0 10px}.stages-box summary{cursor:pointer;list-style:none}.stages-box summary::-webkit-details-marker{display:none}.stages-box summary::before{content:"▸ "}.stages-box[open] summary::before{content:"▾ "}
.doc-tabs{margin:0 0 12px;overflow-x:auto;white-space:nowrap}
.doc-tabs a.stuck .muted{color:var(--warn);background:var(--warn-soft)}
.stuck-why{font-size:12px;color:var(--warn);margin-top:2px}
.more-filters{display:contents}
.more-filters>summary{list-style:none;cursor:pointer}
.more-filters>summary::-webkit-details-marker{display:none}
.filters-more{grid-column:1/-1;display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;padding:10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface)}
.camera-btn{display:none}
@media (pointer:coarse){.camera-btn{display:inline-flex}}
.tip{margin:-4px 0 14px;color:var(--muted)}
.tip summary{cursor:pointer;display:inline}
.tip>div{margin-top:6px;line-height:1.5}
/* v1.5: телефон — меню полосой сверху, без горизонтальной прокрутки страницы */
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { flex-direction: row; min-width: 0; height: auto; position: sticky; top: 0; z-index: 30; padding: 8px 12px; border-right: 0;
    border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
  .brand { padding: 0 6px 0 0; font-size: 15px; }
  .brand .logo { width: 26px; height: 26px; }
  .brand small { display: none; }
  .side .nav { display: flex; gap: 2px; overflow-x: auto; white-space: nowrap; flex: 1; scrollbar-width: none; }
  .side .nav::-webkit-scrollbar { display: none; }
  .side .nav .sep, .side .nav .grp, .side .me { display: none; }
  .nav a { padding: 6px 9px; font-size: 13px; }
  .nav a .ico { display: none; }
  .nav .soon { padding: 6px 9px; font-size: 13px; } .nav .soon .ico { display: none; }
  .main { padding: 14px 16px 60px; }
  .drop { flex-wrap: wrap; }
  .drop .grow { flex-basis: 100%; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters .wide { grid-column: 1 / -1; }
  .tbl-wrap { overflow-x: auto; }
  h1 { font-size: 20px; }
  .parties { grid-template-columns: 1fr; }
  #doc-table .tbl th:nth-child(3), #doc-table .tbl td:nth-child(3),
  #doc-table .tbl th:nth-child(4), #doc-table .tbl td:nth-child(4),
  #doc-table .tbl th:nth-child(5), #doc-table .tbl td:nth-child(5),
  #doc-table .tbl th:nth-child(8), #doc-table .tbl td:nth-child(8),
  #doc-table .tbl th:nth-child(9), #doc-table .tbl td:nth-child(9) { display: none; }
  .head a.btn:not(.primary) { display: none; }
  #doc-table .tbl td:nth-child(6), #doc-table .tbl td:nth-child(7) { white-space: nowrap; }
  .viewer { height: 55vh; } .whose { grid-template-columns: minmax(0,1fr); }
}
@media (pointer:coarse), (max-width: 760px) { .kbd-hint { display: none; } }
.onboarding{margin-bottom:12px}
.ob-bar{height:5px;background:var(--hover);border-radius:3px;overflow:hidden;margin-bottom:8px}
.ob-bar span{display:block;height:100%;background:linear-gradient(90deg,var(--accent),#22c55e);border-radius:3px}
.ob-steps{list-style:none;margin:0;padding:0}
.ob-steps li{display:flex;gap:12px;align-items:flex-start;padding:11px 0;border-top:1px solid var(--border)}
.ob-steps li:first-child{border-top:0}
.ob-steps li.done b{color:var(--muted);text-decoration:line-through}
.ob-num{flex:none;width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-size:12.5px;font-weight:600;background:var(--accent-soft);color:var(--accent)}
.ob-steps li.done .ob-num{background:var(--ok-soft);color:var(--ok)}
.ob-kinds{display:flex;gap:6px;flex-wrap:wrap;align-items:center;margin-top:8px}
.ob-steps .grow,.onboarding .grow{flex:1}
@media (max-width: 760px){.ob-steps li{flex-wrap:wrap}.ob-steps li>a.btn,.ob-steps li>label.btn{margin-left:38px}}
.ticket-body{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.5}
@media (max-width: 900px){.support-grid{grid-template-columns:minmax(0,1fr) !important}}
