:root {
  --bg: #f3f5f8; --panel: #fff; --line: #dfe4ea; --text: #1c2530; --muted: #6b7684;
  --brand: #00348c; --brand-dark: #002566; --accent: #db4437; --brand-soft: #e8eef8;
  --red: #c0392b; --red-bg: #fdecea; --orange: #b85c00; --orange-bg: #fff1e0;
  --yellow: #8a6d00; --yellow-bg: #fff8d6; --green: #1e7b45; --green-bg: #e5f5ec; --grey-bg: #eceff3;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 22px; margin: 0; font-weight: 650; }
h2 { font-size: 16px; margin: 0 0 12px; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }

.layout { display: flex; min-height: 100vh; }
.sidebar { width: 232px; flex: none; background: #fff; border-right: 1px solid var(--line); color: var(--text); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.brand { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 10px 16px; display: grid; gap: 8px; text-align: center; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.brand img { width: 100%; max-width: 180px; height: auto; margin: 0 auto; display: block; }
.brand:hover { text-decoration: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.sidebar nav a { color: var(--text); padding: 8px 10px; border-radius: 6px; }
.sidebar nav a:hover { background: #f1f4f8; text-decoration: none; }
.sidebar nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 16px 10px 4px; }
.userbox { border-top: 1px solid var(--line); padding: 12px 10px 0; font-size: 13px; display: grid; gap: 4px; }
.userbox a, .userbox .link { color: var(--muted); }
.user-name { color: var(--text); font-weight: 600; }
.content { flex: 1; min-width: 0; padding: 24px 28px 48px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.back { font-size: 13px; display: inline-block; margin-bottom: 4px; }
.actions { display: flex; gap: 8px; align-items: center; }
.actions form { margin: 0; }

.btn { display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; cursor: pointer; }
.btn:hover { background: #f6f8fa; text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.danger { color: var(--red); border-color: #e7b9b3; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.wide { width: 100%; padding: 10px; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); cursor: pointer; }
.link:hover { text-decoration: underline; }
.link.danger { color: var(--red); }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; color: var(--text); }
a.card:hover { border-color: var(--brand); text-decoration: none; }
.card.wide { grid-column: 1 / -1; }
.card.danger { background: var(--red-bg); border-color: #efb7b0; }
.card.danger .card-num { color: var(--red); }
.card-num { font-size: 26px; font-weight: 700; line-height: 1.2; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 18px; overflow-x: auto; }
.panel.flush { padding: 0; }
.panel.narrow { max-width: 760px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.pad { padding: 18px 20px; margin: 0; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a { padding: 6px 12px; border-radius: 999px; color: var(--muted); background: #fff; border: 1px solid var(--line); }
.tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabs a:hover { text-decoration: none; }
.search { display: flex; gap: 6px; }
.search input { width: 280px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; background: #fafbfc; white-space: nowrap; }
.table tbody tr:hover { background: #f8fafc; }
.table tfoot td { font-weight: 600; border-bottom: 0; background: #fafbfc; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .clip { max-width: 380px; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 10px; }
.row-actions form { display: inline; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; background: var(--grey-bg); color: #44505c; white-space: nowrap; }
.badge.overdue { background: var(--red-bg); color: var(--red); font-weight: 600; }
.badge.soon { background: var(--orange-bg); color: var(--orange); }
.badge.near { background: var(--yellow-bg); color: var(--yellow); }
.badge.ok, .badge.st-done, .badge.act-signed, .badge.act-paid { background: var(--green-bg); color: var(--green); }
.badge.st-active { background: var(--brand-soft); color: var(--brand); }
.badge.st-paused, .badge.act-sent { background: var(--yellow-bg); color: var(--yellow); }
.badge.st-cancelled { background: var(--grey-bg); color: var(--muted); }
h1 .badge { vertical-align: middle; font-weight: 500; }

.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.facts .span2 { grid-column: span 2; }
.facts .span3 { grid-column: 1 / -1; }
.facts dt { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.facts dd { margin: 2px 0 0; }

input, select, textarea { font: inherit; color: inherit; padding: 8px 10px; border: 1px solid #c9d1da; border-radius: 6px; background: #fff; max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9cc3e4; border-color: var(--brand); }
.form .field { margin-bottom: 14px; }
.form label { display: block; font-weight: 600; margin-bottom: 4px; }
.form input:not([type=checkbox]):not([type=file]), .form select, .form textarea { width: 100%; }
.form .help { font-size: 12px; color: var(--muted); margin-top: 3px; }
.form .req { color: var(--red); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--red); }
.error-text, .errorlist { color: var(--red); font-size: 13px; margin-top: 3px; }
.errorlist { list-style: none; padding: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 18px; }
.status-select { padding: 3px 6px; font-size: 13px; border-radius: 999px; }
.status-select.act-signed, .status-select.act-paid { background: var(--green-bg); }
.status-select.act-sent { background: var(--yellow-bg); }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; background: var(--green-bg); color: var(--green); border: 1px solid #b9e0c8; }
.flash.error { background: var(--red-bg); color: var(--red); border-color: #efb7b0; }
.errors { color: var(--red); }
.plain { padding-left: 18px; margin: 0; display: grid; gap: 6px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: linear-gradient(160deg, var(--brand-dark), var(--brand)); }
.login-card { background: #fff; border-radius: 14px; padding: 30px 28px; width: 100%; max-width: 360px; box-shadow: 0 16px 40px rgba(0,0,0,.25); display: grid; gap: 12px; }
.login-card h1 { text-align: center; font-size: 17px; color: var(--muted); font-weight: 600; }
.login-card p { margin: 0; text-align: center; }
.login-logo { width: 100%; max-width: 230px; height: auto; margin: 0 auto 6px; display: block; }
.login-card label { display: grid; gap: 4px; font-weight: 600; min-width: 0; }
.login-card input { width: 100%; min-width: 0; }

@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar { width: auto; height: auto; position: static; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { grid-template-columns: 120px 1fr; align-items: center; text-align: left; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .nav-title { width: 100%; padding-top: 8px; }
  .userbox { display: flex; gap: 14px; align-items: center; margin-top: 10px; }
  .content { padding: 16px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: 1fr; }
  .facts .span2 { grid-column: auto; }
  .search input { width: 100%; }
}

/* Диск */
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.item { display: inline-flex; gap: 8px; align-items: baseline; color: var(--text); font-weight: 500; }
.item .ico { flex: none; }
.bar { height: 6px; background: rgba(0,0,0,.08); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--green); transition: width .2s; }
[data-drop].dropping { outline: 2px dashed var(--brand); outline-offset: -4px; background: #f0f7fc; }
.toolbar .actions label.btn { cursor: pointer; }

/* Проекты */
.badge.pst-active, .badge.sst-work { background: var(--brand-soft); color: var(--brand); }
.badge.pst-issued, .badge.sst-issued { background: var(--green-bg); color: var(--green); }
.badge.pst-archive { background: var(--grey-bg); color: var(--muted); }
.badge.sst-review { background: var(--yellow-bg); color: var(--yellow); }
.badge.sst-remarks { background: var(--red-bg); color: var(--red); }
.upload-row { display: flex; gap: 8px; flex: 1; align-items: center; }
.upload-row input[type=text] { flex: 1; max-width: 520px; }
.hint { margin: -4px 0 12px; }
.versions { margin-top: 4px; font-size: 13px; }
.versions summary { cursor: pointer; color: var(--brand); }
.versions div { padding: 2px 0 2px 14px; }

/* Общение */
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; text-align: center; line-height: 20px; }
.count[hidden] { display: none; }
.thread-list { max-height: 420px; overflow-y: auto; display: grid; gap: 8px; padding: 2px 2px 10px; }
.msg { background: #f4f6f9; border-radius: 10px; padding: 8px 12px; max-width: 760px; justify-self: start; }
.msg.mine { background: var(--brand-soft); justify-self: end; }
.msg-head { display: flex; gap: 10px; align-items: baseline; }
.msg-head form { margin-left: auto; }
.msg-text { overflow-wrap: anywhere; margin-top: 2px; }
.thread-form { border-top: 1px solid var(--line); padding-top: 12px; display: grid; gap: 8px; }
.thread-form textarea { width: 100%; resize: vertical; }
.thread-actions { display: flex; gap: 8px; justify-content: space-between; }
.talk-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.note { display: block; padding: 8px 10px; border-radius: 8px; color: var(--text); border-left: 3px solid transparent; }
.note:hover { background: #f4f6f9; text-decoration: none; }
.note.unread { border-left-color: var(--accent); background: #fff6f4; }
@media (max-width: 900px) { .talk-grid { grid-template-columns: 1fr; } .upload-row { flex-wrap: wrap; } }

.table .over { color: var(--red); font-weight: 600; }
.flash.warning { background: var(--yellow-bg); color: var(--yellow); border-color: #ecd98a; }

/* Договор из скана */
.steps { display: flex; gap: 8px; margin: 0 0 14px; padding: 0; list-style: none; flex-wrap: wrap; }
.steps li { padding: 4px 12px; border-radius: 999px; background: var(--grey-bg); color: var(--muted); font-size: 13px; }
.steps li.current { background: var(--brand); color: #fff; }
.review-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.est-table input, .est-table select { width: 100%; }
.est-table td { vertical-align: middle; }
.busy { display: none; }
form.sending .busy { display: block; }
form.sending button { opacity: .5; pointer-events: none; }
@media (max-width: 1000px) { .review-grid { grid-template-columns: 1fr; } }

/* Меню: значки, шапка, белый логотип для тёмных тем */
.topbar { display: block; }
.menu-toggle { display: none; }
.brand img.logo-white { display: none; }
.sidebar-menu { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.sidebar nav a { display: flex; align-items: center; gap: 10px; }
.ico-svg { flex: none; opacity: .7; }
.sidebar nav a.active .ico-svg { opacity: 1; }
.sidebar nav .count { margin-left: auto; }

/* Телефон и узкий планшет */
@media (max-width: 900px) {
  .sidebar { padding: 0; position: sticky; top: 0; z-index: 20; height: auto; width: auto; }
  .topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; }
  .brand { display: flex; align-items: center; gap: 10px; border: 0; margin: 0; padding: 0; text-align: left; font-size: 11px; }
  .brand img { width: 92px; max-width: 92px; margin: 0; }
  .menu-toggle { display: inline-flex; position: relative; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); cursor: pointer; }
  .menu-toggle .ico-svg { opacity: 1; width: 24px; height: 24px; }
  .menu-toggle .count { position: absolute; top: -6px; right: -6px; }
  .sidebar-menu { display: none; padding: 6px 10px 12px; border-top: 1px solid var(--line); max-height: calc(100vh - 62px); overflow-y: auto; }
  .sidebar.open .sidebar-menu { display: flex; }
  .sidebar nav { flex-direction: column; flex-wrap: nowrap; gap: 2px; }
  .sidebar nav a { padding: 12px 10px; font-size: 16px; }
  .nav-title { padding-top: 12px; }
  .userbox { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 10px; padding: 12px 10px 0; font-size: 15px; }

  .content { padding: 14px 12px 44px; }
  h1 { font-size: 20px; }
  .page-head { align-items: flex-start; margin-bottom: 12px; }
  .actions { flex-wrap: wrap; }
  .btn { min-height: 42px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; }
  .btn.small { min-height: 36px; padding: 6px 12px; }
  .link { padding: 6px 0; }
  input, select, textarea { font-size: 16px; }
  .panel { padding: 14px; }
  .panel.flush { padding: 0; }
  .panel, .panel.flush { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { padding: 9px 10px; }
  .table .clip { min-width: 180px; max-width: 260px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { padding: 12px 14px; }
  .card-num { font-size: 22px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .tabs a { white-space: nowrap; padding: 8px 14px; }
  .search { width: 100%; }
  .search input { flex: 1; width: auto; min-width: 0; }
  .upload-row { flex-direction: column; align-items: stretch; }
  .upload-row input[type=text] { max-width: none; }
  .row-actions { white-space: normal; text-align: left; }
  .row-actions > * { margin: 0 12px 0 0; }
  .thread-list { max-height: 60vh; }
  .msg { max-width: 92%; }
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn { flex: 1; }
  .login-card { padding: 26px 20px; }
}

/* Главная: выполнение по договорам и диаграмма */
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: stretch; margin-bottom: 18px; }
.dash-grid .panel { margin-bottom: 0; }
.meter-row { display: block; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.meter-row:last-child { border-bottom: 0; }
.meter-row:hover { text-decoration: none; }
.meter-row:hover .meter-title { color: var(--brand); text-decoration: underline; }
.meter-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.meter-title { font-weight: 600; white-space: nowrap; }
.meter-sub { color: var(--muted); font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meter { height: 8px; border-radius: 4px; background: var(--grey-bg); margin: 6px 0 4px; overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 4px; background: var(--brand); min-width: 0; }
.meter-note { font-size: 12px; color: var(--muted); }
.meter-note b { color: var(--text); }

.bars { display: flex; align-items: stretch; gap: 2px; height: 220px; padding-top: 4px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; cursor: default; }
.bar-value { height: 20px; font-size: 12px; color: var(--text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line); background: linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / 100% 50%; }
.bar { width: 62%; max-width: 44px; min-height: 2px; background: var(--brand); border-radius: 4px 4px 0 0; opacity: .78; transition: opacity .15s; }
.bar-col.current .bar, .bar-col:hover .bar { opacity: 1; }
.bar-label { padding-top: 6px; font-size: 12px; color: var(--muted); }
.bar-col.current .bar-label { color: var(--text); font-weight: 600; }
.bars-table { margin-top: 10px; font-size: 13px; }
.bars-table summary { cursor: pointer; color: var(--muted); }
.bars-table .table td { padding: 5px 8px; }

/* Вход: фирменная половина и форма */
.login-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); padding: 0; background: var(--bg); min-height: 100vh; place-items: stretch; }
.login-side { background: linear-gradient(160deg, #00348c 0%, #001d52 100%); color: #dfe7f5; display: flex; flex-direction: column; justify-content: center; padding: 48px 56px; }
.login-side img { width: 100%; max-width: 320px; height: auto; margin-bottom: 28px; }
.login-lead { font-size: 22px; font-weight: 600; color: #fff; margin: 0 0 18px; line-height: 1.3; }
.login-side ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; }
.login-side li { padding-left: 18px; position: relative; }
.login-side li::before { content: ""; position: absolute; left: 0; top: .55em; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.login-card { align-self: center; justify-self: center; box-shadow: 0 10px 34px rgba(16, 24, 40, .1); border: 1px solid var(--line); }
.login-card .login-logo { display: none; }
.login-card h1 { font-size: 20px; color: var(--text); margin-bottom: 4px; }

@media (max-width: 900px) {
  .dash-grid { grid-template-columns: 1fr; }
  .bars { height: 180px; }
  .login-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .login-side { padding: 26px 22px; }
  .login-side img { max-width: 190px; margin-bottom: 14px; }
  .login-lead { font-size: 17px; margin-bottom: 0; }
  .login-side ul { display: none; }
  .login-card { align-self: start; margin: 20px 14px; width: auto; max-width: none; justify-self: stretch; }
}

/* Телефон: строки таблиц — карточками */
@media (max-width: 700px) {
  .table.as-cards, .table.as-cards tbody, .table.as-cards tfoot { display: block; }
  .table.as-cards thead { display: none; }
  .table.as-cards tr { display: block; padding: 10px 12px; border-bottom: 8px solid var(--bg); }
  .table.as-cards tbody tr:last-child { border-bottom: 0; }
  .table.as-cards td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 4px 0; border: 0; text-align: right; max-width: none; min-width: 0; white-space: normal; }
  .table.as-cards td:first-child { display: block; text-align: left; font-size: 16px; font-weight: 600; padding-bottom: 6px; }
  .table.as-cards td[data-label]::before { content: attr(data-label); flex: none; text-align: left; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
  .table.as-cards td:not([data-label]):not(:first-child) { justify-content: flex-start; flex-wrap: wrap; text-align: left; padding-top: 8px; }
  .table.as-cards td:empty { display: none; }
  .table.as-cards .clip { max-width: none; min-width: 0; }
  .table.as-cards .row-actions { text-align: left; }
  .table.as-cards tfoot tr { background: #fafbfc; }
  .table.as-cards tfoot td { font-size: 14px; }
  .table.as-cards tfoot td:first-child { font-size: 14px; }
  .panel.flush { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .panel.flush .table.as-cards tr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
  .panel.flush .table.as-cards tbody tr:last-child { border-bottom: 1px solid var(--line); }
}

/* Письма и КП */
.template-list { display: flex; gap: 8px; flex-wrap: wrap; }
.letter-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.items-table input { width: 100%; }
.items-table td { vertical-align: middle; padding: 6px 8px; }
.items-table .narrow-col { width: 90px; }
@media (max-width: 1000px) { .letter-grid { grid-template-columns: 1fr; } }

.badge.bst-prep { background: var(--grey-bg); color: #44505c; }
.badge.bst-submitted { background: var(--brand-soft); color: var(--brand); }
.badge.bst-rework { background: var(--red-bg); color: var(--red); }
.badge.bst-approved { background: var(--green-bg); color: var(--green); }

/* Логотип в меню без подписи */
.brand { padding-bottom: 14px; }

/* Телефон: ничего не должно раздвигать страницу вправо */
@media (max-width: 900px) {
  /* В колонке с переносом ширина строки считалась по самому широкому элементу (ряду вкладок) и растягивала страницу. */
  .toolbar { flex-wrap: nowrap; }
  .toolbar > * { min-width: 0; max-width: 100%; }
  h1, h2, dd, .meter-title, .msg-text, .note { overflow-wrap: anywhere; }
  .page-head > * { min-width: 0; max-width: 100%; }
  .actions { max-width: 100%; }
  .content { overflow-x: clip; }
}
@media (max-width: 700px) {
  /* Поле карточки: подпись слева, значение справа столбиком. Длинное значение переносится, а не выталкивает карточку. */
  .table.as-cards td[data-label] { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr); column-gap: 12px; justify-items: end; align-items: baseline; text-align: right; overflow-wrap: anywhere; }
  .table.as-cards td[data-label]::before { grid-column: 1; grid-row: 1 / span 12; justify-self: start; }
  .table.as-cards td[data-label] > * { grid-column: 2; min-width: 0; max-width: 100%; }
  .table.as-cards td:first-child, .table.as-cards td:not([data-label]) { overflow-wrap: anywhere; }
  .table.as-cards td .badge { white-space: normal; text-align: center; }
  .table.as-cards td form, .table.as-cards td select { max-width: 100%; }
}
/* Колонки сеток не должны раздвигаться содержимым (широкая таблица прокручивается внутри своей панели). */
.review-grid > *, .letter-grid > *, .talk-grid > *, .dash-grid > * { min-width: 0; }
@media (max-width: 900px) {
  .est-table, .items-table { min-width: 460px; }
}
