/* ============================================================================
   Компоненты «Экономики проектов» поверх оболочки. Только токены оболочки:
   радиусы 12/16/26/30, промежуток var(--gap)=18, кегли --fs-*, цвета ролей.
   ========================================================================== */
.boot { display: grid; place-items: center; gap: 14px; padding: 18vh 0; color: var(--muted); }
.boot__mark { width: 38px; height: 38px; border-radius: 13px; background: linear-gradient(145deg, #64d2ff, #0a84ff 55%, #0050c8); animation: breathe 1.4s ease-in-out infinite; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.colref { display: inline-block; font: 700 10.5px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; color: var(--accent-text); background: var(--accent-soft); border-radius: 6px; padding: 3px 5px; vertical-align: 1px; }
.req { color: var(--bad); font-style: normal; margin-left: -2px; }
.r { text-align: right; }
.v-err { color: var(--bad); font-weight: 700; }
.v-warn { color: var(--warn); font-weight: 600; }
.is-hidden { visibility: hidden; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--warn); }
.dot--error { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); } .dot--warn { box-shadow: 0 0 0 3px var(--warn-soft); }

/* верх */
.top__sep { color: var(--line-2); padding: 0 2px; }
.top__mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px; }
.top__variant { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; color: var(--accent-text); border-radius: 8px; padding: 0 4px; margin-left: -4px; }
.top__variant:hover { background: var(--accent-soft); }
.top__hello small > * { flex: none; }
.seg--sm button { height: 26px; padding: 0 11px; font-size: var(--fs-xs); }
.side__role { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.side__role-label { font-size: var(--fs-2xs); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; white-space: nowrap; padding-left: 10px; }
.side__role .seg { display: flex; }
.side__role .seg button { flex: 1; justify-content: center; }
html.is-rail .side__role { display: none; }
.snav__count.is-warn { background: var(--warn-soft); color: var(--warn); }

/* капсула 1С */
.erp { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 4px 0 14px; border-radius: 99px; background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: var(--glow), 0 8px 18px -12px #0f1e3c59; }
.erp__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.erp__text b { font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.erp__text small { font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; white-space: nowrap; }
.erp__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--out); flex: none; }
.erp--good .erp__dot { background: var(--good); } .erp--warn .erp__dot { background: var(--warn); } .erp--bad .erp__dot { background: var(--bad); } .erp--info .erp__dot { background: var(--info); }
.erp__btn { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.erp__btn:hover { background: var(--card); color: var(--accent-text); }
.erp__btn svg { width: 18px; height: 18px; transition: transform .6s var(--ease); }
.erp__btn:hover svg { transform: rotate(180deg); }
.erp__btn.is-spinning svg { animation: spin 1.1s linear infinite; }
.erp--static { height: 38px; }
.card .erp { box-shadow: inset 0 0 0 1px var(--line); -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--card-2); }
.erp-states { display: flex; flex-direction: column; gap: 8px; }
.erp-states__row { display: grid; grid-template-columns: 108px auto 1fr; align-items: center; gap: 12px; }
.erp-states__row code { font-size: 11px; color: var(--muted); }
.erp-states__row small { font-size: var(--fs-xs); }
.erp-states--compact .erp-states__row { grid-template-columns: 108px 1fr; }
@media (width <= 1179px) { .top .erp__text small { display: none; } }
@media (width <= 999px) { .top .erp__text { display: none; } .top .erp { padding: 0 4px; } .top__mode button { padding: 0 10px; } .top__mode button svg + * { display: none; } }

/* заметки */
.note { display: flex; gap: 10px; padding: 11px 13px; border-radius: 14px; font-size: var(--fs-sm); background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); margin-bottom: 10px; }
.note > svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.note b { font-weight: 700; display: block; margin-bottom: 2px; }
.note p { color: var(--ink-2); font-weight: 500; }
.note p + p { margin-top: 4px; }
.note--info { background: var(--info-soft); box-shadow: none; } .note--info > svg { color: var(--info); }
.note--warn { background: var(--warn-soft); box-shadow: none; } .note--warn > svg { color: var(--warn); }
.note--bad { background: var(--bad-soft); box-shadow: none; } .note--bad > svg { color: var(--bad); }
.note--good { background: var(--good-soft); box-shadow: none; } .note--good > svg { color: var(--good); }
.rules { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: var(--fs-sm); display: flex; flex-direction: column; gap: 6px; }
.row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ===================================================== экономика: раунды */
.ep { display: flex; flex-direction: column; gap: var(--gap); padding-top: 8px; }
.ep-strip { display: flex; flex-direction: column; gap: 10px; }
.ep-strip__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 4px; }
.ep-rounds { display: grid; gap: var(--gap); grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ep-round { text-align: left; cursor: pointer; min-height: 118px; transition: transform .45s var(--ease); font: inherit; container-type: inline-size; }
.ep-round:hover { transform: translateY(-3px); }
.ep-round.is-active { box-shadow: var(--glow), inset 0 0 0 2px var(--accent), 0 14px 30px -16px var(--accent-glow); }
.ep-round.is-idle .kpi__value { color: var(--tile-muted); }
.ep-round .kpi__label { white-space: nowrap; min-width: 0; }
.ep-round__t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ep-round .kpi__label .delta { margin-left: auto; flex: none; }
@container (width < 230px) { .ep-round__t { display: none; } }
.ep-round__n { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 6px; border-radius: 99px; background: #ffffff8c; color: var(--tile-ink); font-size: var(--fs-2xs); font-weight: 700; }
[data-theme=dark] .ep-round__n { background: #ffffff1f; }
.ep-round.is-active .ep-round__n { background: var(--accent); color: #fff; }
.ep-round .kpi__value { display: flex; align-items: baseline; gap: 5px; font-size: clamp(15px, 11cqi, var(--fs-3xl)); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; }
.ep-round .kpi__value small { font-size: var(--fs-2xs); color: var(--tile-muted); font-weight: 700; letter-spacing: 0; }
.ep-round .kpi__foot { flex-direction: column; align-items: stretch; gap: 8px; }
.ep-round .meter { height: 6px; background: #1218261a; }
[data-theme=dark] .ep-round .meter { background: #ffffff1f; }
.ep-round .meter i { background: var(--data); transform-origin: 0; }
.ep-round__vat { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (width <= 1399px) { .ep-rounds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* сетка списка и колонки */
.ep-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
.ep-side { position: sticky; top: 96px; }
@media (width <= 1179px) { .ep-grid { grid-template-columns: minmax(0, 1fr); } .ep-side { position: static; display: grid; grid-template-columns: 1fr 1fr; } }
@media (width <= 760px) { .ep-side { grid-template-columns: minmax(0, 1fr); } .ep-rounds { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -14px; padding: 2px 14px 6px; gap: 10px; } .ep-rounds::-webkit-scrollbar { display: none; } .ep-round { flex: 0 0 74%; scroll-snap-align: start; } }

.ep-list { overflow: hidden; container-type: inline-size; container-name: eplist; }
.ep-list .chead { padding: 16px 20px 0; margin-bottom: 12px; }
.ep-list__sub b { color: var(--ink); font-weight: 600; }
.ep-list__tb { padding: 0 20px; }
.ep-list__tb .inwrap { flex: 1 1 260px; max-width: 420px; }
.ep-list__head, .ep-row { display: grid; grid-template-columns: 26px minmax(0, 1.5fr) minmax(0, 1fr) 58px 104px 118px 18px; align-items: center; column-gap: 12px; padding: 0 14px 0 18px; }
.ep-list__head { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; height: 34px; border-bottom: 1px solid var(--line); }
.ep-list__head > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-list__body { position: relative; }
.ep-list__body.is-virtual .ep-row { position: absolute; left: 0; right: 0; }
.ep-row { height: 64px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: var(--fs-md); font-weight: 600; transition: background .2s; }
.ep-row:hover, .ep-row:focus-visible { background: var(--card-2); outline: none; }
.ep-row:focus-visible { box-shadow: inset 3px 0 0 var(--accent); }
.ep-row .c-n, .ep-list__head .c-n { color: var(--muted); font-size: var(--fs-sm); }
.ep-row .cell__text small, .ep-row .two small { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-row__name b { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.22; font-size: var(--fs-md); }
.ep-row .two { min-width: 0; display: flex; flex-direction: column; align-items: flex-end; }
.ep-row .two > b { font-weight: 600; white-space: nowrap; }
.ep-row__total > b { font-weight: 700; }
.ep-row__flag { display: flex; align-items: center; justify-content: flex-end; color: var(--muted); }
.ep-row__flag .dot { margin-right: -2px; }
.ep-row.is-error { box-shadow: inset 3px 0 0 var(--bad); }
.ep-row.is-warn { box-shadow: inset 3px 0 0 var(--warn); }
.ep-mod { display: inline-block; padding: 0 6px; border-radius: 99px; background: var(--card-3); font-size: var(--fs-2xs); font-weight: 700; line-height: 17px; color: var(--ink-2); }
.ep-mod--disc { background: var(--good-soft); color: var(--good); }
.ep-mod--empty { background: var(--warn-soft); color: var(--warn); }
.ep-row .delta { padding: 0 6px; line-height: 17px; }
.ep-list__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 18px; padding: 14px 20px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.ep-list__foot b { color: var(--ink); }
@container eplist (width >= 980px) { .ep-list__head, .ep-row { grid-template-columns: 30px minmax(0, 1.6fr) minmax(0, 1fr) 70px 124px 140px 22px; column-gap: 16px; } }
@container eplist (width < 600px) {
  .ep-list__head { display: none; }
  .ep-list .chead, .ep-list__tb, .ep-list__foot { padding-left: 16px; padding-right: 16px; }
  .ep-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name total" "offer price"; height: 64px; padding: 8px 16px; row-gap: 0; align-content: center; }
  .ep-row > .c-n, .ep-row > .ep-row__qty, .ep-row > .ep-row__flag { display: none; }
  .ep-row > .ep-row__name { grid-area: name; } .ep-row > .ep-row__total { grid-area: total; }
  .ep-row > .ep-row__offer { grid-area: offer; } .ep-row > .ep-row__price { grid-area: price; }
  .ep-row > .ep-row__offer b { display: none; } .ep-row > .ep-row__price b { display: none; }
  .ep-row > .ep-row__offer small, .ep-row > .ep-row__price small { font-size: var(--fs-xs); }
  .ep-row > .ep-row__total small { display: none; }
  .ep-list__body:not(.is-virtual) .ep-row { height: auto; min-height: 64px; padding: 12px 16px; row-gap: 4px; align-items: start; }
  .ep-list__body:not(.is-virtual) .ep-row > .ep-row__total, .ep-list__body:not(.is-virtual) .ep-row > .ep-row__price { align-self: start; }
  .ep-list__body.is-virtual .ep-row__name b { -webkit-line-clamp: 1; }
  .ep-list__body.is-virtual .ep-row__name small { display: none; }
}

/* боковые карточки */
.rate-head, .rate-row { display: grid; grid-template-columns: 44px 1fr 1.15fr; gap: 8px; align-items: baseline; }
.rate-head > span:not(:first-child) { text-align: right; }
.rate-head { font-size: var(--fs-2xs); color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.rate-head .pill { height: 16px; font-size: 9.5px; padding: 0 6px; vertical-align: 1px; }
.rate-row { padding: 5px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); }
.rate-row:last-child { border-bottom: 0; }
.rate-row > span, .rate-row > small { text-align: right; }
.ep-rates .section-label { margin: 12px 0 2px; }
.checks { display: flex; flex-direction: column; gap: 4px; }
.check-row { display: flex; gap: 9px; align-items: flex-start; text-align: left; padding: 8px 10px; border-radius: 12px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.check-row:hover { background: var(--card-2); }
.check-row svg { margin-top: 1px; flex: none; }
.check-row--error svg { color: var(--bad); } .check-row--warn svg { color: var(--warn); } .check-row--info svg { color: var(--info); }
.ep-checks .chead .pill { flex: none; }

/* редактор позиции */
.pos { display: flex; flex-direction: column; gap: 22px; }
.pos__issues .note:last-child { margin-bottom: 0; }
.pos__sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.pos__sec-h h3 { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.005em; }
.pos__sec-h small { color: var(--muted); font-weight: 600; }
.pos__calc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; padding: 12px; border-radius: 16px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); }
.field--calc > span { font-size: var(--fs-xs); color: var(--muted); }
.field--calc > span i { display: inline-grid; color: var(--muted); cursor: help; }
.calc { font-size: var(--fs-lg); font-weight: 700; font-variant-numeric: tabular-nums; min-height: 22px; display: block; }
.calc.is-err { color: var(--bad); } .calc.is-warn { color: var(--warn); }
.field__err { font-size: var(--fs-xs); }
.input.num { text-align: right; font-variant-numeric: tabular-nums; }

/* курсы */
.rates__hint { font-size: var(--fs-sm); margin: 12px 0; }
.rates-table { display: flex; flex-direction: column; gap: 6px; }
.rates-table__h, .rates-table__r { display: grid; grid-template-columns: 78px 96px minmax(110px, 1fr) 96px 118px; gap: 8px; align-items: center; }
.rates-table__h { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.rates-table__r .select--sm { height: 38px; }
.rates-table__r .input { height: 38px; }
@media (width <= 760px) { .rates-table__h { display: none; } .rates-table__r { grid-template-columns: 1fr 1fr; padding-bottom: 8px; border-bottom: 1px solid var(--line); } }

/* вставка */
.paste__area { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; white-space: pre; }
.paste__map { margin-top: 14px; overflow-x: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-xs); }
.paste__map-h, .paste__map-r { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(110px, 1fr); }
.paste__map-h span { padding: 8px 10px; font-weight: 700; background: var(--card-2); border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paste__map-r span { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paste__map .is-skip { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--card-3) 6px 8px); color: var(--muted); text-decoration: line-through; }
.paste__map .is-out { color: var(--muted); opacity: .6; }
.paste__stats { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: var(--fs-sm); font-weight: 600; }
.paste__stats span { display: flex; align-items: center; gap: 6px; }
.choice { display: flex; flex-direction: column; gap: 8px; }
.choice__opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); cursor: pointer; }
.choice__opt:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--accent-soft); }
.choice__opt input { margin-top: 3px; accent-color: var(--accent); }
.choice__opt b { display: block; font-weight: 600; }
.choice__opt small { color: var(--muted); font-size: var(--fs-sm); }

/* сравнение раундов */
.cmp-bars { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.cmp-bar { display: grid; grid-template-columns: 30px 1fr 150px 60px; align-items: center; gap: 10px; font-size: var(--fs-sm); font-weight: 600; }
.cmp-bar i { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--data-2), var(--data)); width: calc(var(--w) * 100%); transform-origin: 0; }
.cmp-bar b { text-align: right; }
.cmp-wrap { max-height: 46vh; overflow: auto; border-radius: 14px; box-shadow: inset 0 0 0 1px var(--line); }
.cmp { font-size: var(--fs-sm); }
.cmp td, .cmp th { padding: 8px 10px; }
.cmp thead th { position: sticky; top: 0; background: var(--glass-solid); z-index: 1; }
.cmp__name { display: block; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp tfoot td { border-top: 1px solid var(--line-2); }

/* ===================================================== Excel-режим */
.xs { display: flex; flex-direction: column; overflow: hidden; margin-top: 8px; }
.xs-top { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); }
.xs-fbar { display: flex; align-items: center; gap: 8px; height: 36px; border-radius: 12px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); padding: 0 6px 0 4px; min-width: 0; }
.xs-ref { min-width: 64px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: var(--card); box-shadow: inset 0 0 0 1px var(--line); font: 700 12px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.xs-fx { color: var(--muted); display: grid; }
.xs-fval { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--fs-md); font-weight: 600; }
.xs-formula { color: var(--accent-text); font-size: 12px; }
.xs-lock { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 600; }
.xs-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.xs-search { flex: 0 1 280px; }
.xs-search .input { height: 36px; }
.xs-tools .chip { height: 30px; padding: 0 12px; font-size: var(--fs-xs); }
.xs-tools .chips { gap: 4px; }
/* Непрозрачная подложка закреплённых областей сетки (--glass-solid полупрозрачный — сквозь него просвечивают прокручиваемые колонки) */
.xs { --xs-solid: #f5f7fb; }
[data-theme=dark] .xs { --xs-solid: #171c25; }
.xs-scroll { position: relative; overflow: auto; height: calc(100dvh - 268px); min-height: 360px; outline: none; overscroll-behavior: contain; background: color-mix(in oklab, var(--card) 60%, transparent); }
.xs-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.xs-canvas { position: relative; min-width: 100%; }
.xs-head { position: sticky; top: 0; z-index: 5; }
.xs-body { position: relative; }
.xs-row { display: flex; height: 30px; }
.xs-body .xs-row { position: absolute; left: 0; }
.xs-g { position: sticky; left: 0; z-index: 3; width: 52px; flex: none; display: grid; place-items: center; font: 600 11px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); background: var(--xs-solid); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line); cursor: default; user-select: none; }
.xs-g.is-hl { color: var(--accent-text); background: color-mix(in oklab, var(--accent-soft-solid) 70%, var(--xs-solid)); }
.xs-corner { cursor: pointer; font-size: 10px; }
.xs-c { flex: none; height: 100%; padding: 0 8px; display: flex; align-items: center; font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); color: var(--paper-ink); cursor: cell; user-select: none; }
[data-theme=dark] .xs-c { background: #141a24; color: var(--ink); }
.xs-c.is-num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.xs-c.is-f { background: color-mix(in oklab, var(--paper) 88%, #7e8ba3); color: var(--ink-2); cursor: default; }
[data-theme=dark] .xs-c.is-f { background: #1c2330; color: var(--ink-2); }
.xs-c.is-sep { background: repeating-linear-gradient(135deg, transparent 0 4px, var(--line) 4px 5px), var(--card-2); padding: 0; cursor: default; }
.xs-c.is-err { color: var(--bad); font-weight: 700; }
.xs-c.is-warn { color: var(--warn); font-weight: 600; }
.xs-c.is-ghost { background: color-mix(in oklab, var(--paper) 94%, #7e8ba3); }
[data-theme=dark] .xs-c.is-ghost { background: #10151d; }
.xs-c.is-frozen { position: sticky; z-index: 2; }
.xs-c.is-frozen + .xs-c:not(.is-frozen) { box-shadow: inset 4px 0 6px -4px #0f1e3c40; }
.xs-c.is-sel { background-image: linear-gradient(var(--accent-soft), var(--accent-soft)); }
.xs-c.is-act { box-shadow: inset 0 0 0 2px var(--accent) !important; z-index: 2; }
.xs-c.is-frozen.is-act { z-index: 4; }
.xs-row.has-issue .xs-g { color: var(--bad); }
.xs-row--total .xs-c { background: var(--xs-solid); color: var(--ink-2); font-weight: 600; border-bottom-color: var(--line); }
.xs-row--total .xs-c.is-val { color: var(--ink); font-weight: 700; justify-content: flex-end; font-variant-numeric: tabular-nums; background: color-mix(in oklab, var(--accent-soft-solid) 55%, var(--xs-solid)); }
.xs-row--total .xs-c.is-err { color: var(--bad); }
.xs-row--total .xs-c small { font-size: 11px; color: var(--muted); font-weight: 700; }
.xs-row--group { height: 26px; }
.xs-c--grp { font-size: 11px; font-weight: 700; letter-spacing: .02em; color: var(--ink); background: var(--xs-solid); justify-content: flex-start; }
.xs-grp--req { background: linear-gradient(var(--tile-1), var(--tile-1)), var(--xs-solid); }
.xs-grp--offer { background: linear-gradient(var(--tile-2), var(--tile-2)), var(--xs-solid); }
.xs-grp--kp { background: linear-gradient(var(--tile-3), var(--tile-3)), var(--xs-solid); }
.xs-grp--r1, .xs-grp--r2, .xs-grp--r3, .xs-grp--r4, .xs-grp--r5 { background: linear-gradient(var(--tile-4), var(--tile-4)), var(--xs-solid); }
.xs-row--letters { height: 22px; }
.xs-c--letter { justify-content: center; font: 600 10.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); background: var(--xs-solid); cursor: pointer; }
.xs-c--letter.is-f { color: color-mix(in oklab, var(--muted) 60%, transparent); }
.xs-c--letter.is-hl, .xs-c--hdr.is-hl { color: var(--accent-text); background: color-mix(in oklab, var(--accent-soft-solid) 70%, var(--xs-solid)); }
.xs-row--hdr { height: 46px; }
.xs-c--hdr { white-space: normal; line-height: 1.15; font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--xs-solid); align-items: center; gap: 4px; cursor: pointer; border-bottom: 1px solid var(--line-2); }
.xs-c--hdr i { display: inline-grid; color: var(--muted); flex: none; }
.xs-c--hdr i svg { width: 12px; height: 12px; }
.xs-editor { position: absolute; z-index: 8; border: 0; padding: 0 8px; font: 500 12.5px var(--font); background: var(--paper); color: var(--paper-ink); box-shadow: 0 0 0 2px var(--accent), 0 10px 24px -8px #0f1e3c59; border-radius: 3px; outline: none; }
[data-theme=dark] .xs-editor { background: #0b1018; color: var(--ink); }
.xs-status { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px; padding: 9px 16px; font-size: var(--fs-xs); font-weight: 600; color: var(--muted); border-top: 1px solid var(--line); }
.xs-status b { color: var(--ink); }
.xs-status__ok { display: inline-flex; align-items: center; gap: 4px; color: var(--good); }
@media (width <= 760px) { .xs-scroll { height: calc(100dvh - 300px); } .xs-row { height: 36px; } .xs-c { font-size: 13px; } .xs-tools .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; } .xs-keys { display: none; } }

/* ===================================================== ТКП */
.tkp-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
@media (width <= 1179px) { .tkp-grid { grid-template-columns: minmax(0, 1fr); } }
.tkp-paper { padding: 34px 36px 40px; font-size: 12.5px; font-weight: 500; line-height: 1.45; }
.tkp-paper__head { display: flex; align-items: center; gap: 18px; padding-bottom: 14px; border-bottom: 2px solid #0b122026; margin-bottom: 18px; }
.tkp-paper__head small { color: #4a5263; font-weight: 600; line-height: 1.5; }
.tkp-logo { width: 150px; height: 52px; border-radius: 8px; display: grid; place-items: center; background: repeating-linear-gradient(135deg, #e7ecf3 0 8px, #f2f5fa 8px 16px); color: #6a7488; font-weight: 700; letter-spacing: .12em; font-size: 11px; flex: none; }
.tkp-paper__meta { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 18px; }
.tkp-paper__meta .r { text-align: right; max-width: 55%; }
.tkp-paper__title { text-align: center; font-size: 17px; letter-spacing: .04em; font-weight: 700; margin: 10px 0 4px; }
.tkp-paper__tag { text-align: center; color: var(--info); font-weight: 700; font-size: 11.5px; margin-bottom: 8px; }
.tkp-paper__p { margin: 10px 0; text-align: justify; }
.tkp-paper__small { font-size: 11px; color: #4a5263; }
.tkp-table-wrap { overflow-x: auto; margin: 14px 0; border-radius: 8px; box-shadow: 0 0 0 1px #0b122033; }
.tkp-table { border-collapse: collapse; width: 100%; font-size: 10.5px; min-width: 1300px; table-layout: fixed; }
.tkp-table td { overflow-wrap: anywhere; }
.tkp-table th { background: #eef2f8; font-weight: 700; padding: 6px 5px; border: 1px solid #0b122022; vertical-align: bottom; line-height: 1.2; }
.tkp-table td { padding: 5px; border: 1px solid #0b12201a; text-align: center; vertical-align: top; }
.tkp-table td.l { text-align: left; }
.tkp-table td:nth-child(14) { font-size: 10px; } .tkp-table td.n { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tkp-table tfoot td { background: #f6f8fb; }
.tkp-terms { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 10px 0; }
.tkp-terms dt { color: #4a5263; font-weight: 600; }
.tkp-terms dd { margin: 0; }
.tkp-terms dd span { color: #4a5263; font-style: italic; }
.tkp-paper__sign { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 28px; }
.vat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.vat-cell { display: flex; flex-direction: column; gap: 3px; }
.vat-cell small { font-size: var(--fs-2xs); color: var(--muted); text-align: center; font-weight: 700; }
.vat-cell .input { height: 36px; padding: 0 8px; text-align: center; }

/* альтернативы и история */
.alt-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.alt.is-current { box-shadow: var(--glow), inset 0 0 0 2px var(--accent), var(--shadow); }
.hist-grid { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
@media (width <= 1179px) { .hist-grid { grid-template-columns: minmax(0, 1fr); } }
.hist-cells { margin-top: 6px; font-size: var(--fs-xs); }
.hist-cells summary { cursor: pointer; color: var(--accent-text); font-weight: 600; }
.hist-cells div { padding: 2px 0; color: var(--ink-2); }

/* ===================================================== админка */
.kpis--adm { margin-bottom: var(--gap); }
.adm-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
.adm-wide { grid-column: 1 / -1; }
@media (width <= 999px) { .adm-grid { grid-template-columns: minmax(0, 1fr); } }
.wbars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-bottom: 22px; position: relative; }
.wbars__c { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.wbars__c i { width: 70%; max-width: 34px; min-height: 3px; border-radius: 8px 8px 3px 3px; background: color-mix(in oklab, var(--data) 70%, var(--card)); transform-origin: 50% 100%; }
.wbars__c:last-child i { background: var(--data); box-shadow: 0 6px 14px -6px var(--data); }
.wbars__c small { position: absolute; bottom: -20px; font-size: var(--fs-2xs); color: var(--muted); font-weight: 600; }
.split { display: flex; gap: 3px; height: 14px; margin: 6px 0 16px; }
.split__seg { min-width: 6px; position: relative; }
.split__seg i { position: absolute; inset: 0; border-radius: 5px; transform-origin: 0; }
.split-list { display: flex; flex-direction: column; }
.split-list div { display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-weight: 600; font-size: var(--fs-md); }
.split-list div:last-child { border-bottom: 0; }
.split-list i { width: 10px; height: 10px; border-radius: 3px; }
.mgr-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) 90px 28px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--line); }
.mgr-row:last-child { border-bottom: 0; }
.mgr-row__bar { height: 6px; border-radius: 6px; background: var(--card-3); overflow: hidden; }
.mgr-row__bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--data-2), var(--data)); transform-origin: 0; }
.mgr-row b { text-align: right; }
.feed a.feed__row { border-radius: 12px; margin: 0 -8px; padding: 10px 8px; align-items: center; }
.feed a.feed__row:hover { background: var(--card-2); }
.adm-tb { padding: 16px 20px 0; }
.adm-tb .select--sm { height: 40px; }
.adm-date { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.adm-date .input { height: 40px; width: 150px; border-radius: 99px; }
.adm-table .cell__text b { max-width: 380px; }
.adm-table td.num, .adm-table td:nth-child(8), .adm-table td:nth-child(2) { white-space: nowrap; }
.adm-table td:nth-child(7) { text-align: center; }
@media (max-width: 1599px) { .adm-table .cell__text b { max-width: 300px; } .adm-table th:nth-child(7), .adm-table td:nth-child(7) { display: none; } }
@media (max-width: 1299px) { .adm-table .cell__text b { max-width: 240px; } }
.pager { display: flex; align-items: center; gap: 8px; padding: 12px 20px 16px; font-size: var(--fs-sm); }
.purge { display: flex; align-items: center; gap: 8px; }
.purge .meter { width: 60px; height: 6px; }
.purge small { color: var(--muted); font-weight: 600; white-space: nowrap; }
.adm-grid--card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rebind-check p { margin-top: 10px; font-size: var(--fs-sm); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tpl-grid { display: grid; gap: var(--gap); grid-template-columns: 320px minmax(0, 1fr); align-items: start; }
@media (width <= 1179px) { .tpl-grid { grid-template-columns: minmax(0, 1fr); } }
.tpl-card { text-align: left; width: 100%; cursor: pointer; font: inherit; color: inherit; }
.tpl-card.is-on { box-shadow: var(--glow), inset 0 0 0 2px var(--accent), var(--shadow); }
.tpl-card__c { font-size: var(--fs-sm); margin-bottom: 8px; }
.tpl-builder .chead { padding: 16px 20px 0; }
.tpl-table-wrap { max-height: calc(100dvh - 280px); overflow: auto; }
.tpl-table { font-size: var(--fs-sm); }
.tpl-table th { position: sticky; top: 0; background: var(--glass-solid); z-index: 1; }
.tpl-table td { padding: 7px 12px; }
.tpl-f code { font-size: 11px; color: var(--ink-2); white-space: nowrap; }
.tpl-table tr.is-new td { background: var(--accent-soft); }
.input--cell { height: 32px; border-radius: 10px; font-size: var(--fs-sm); }
.fx-check { display: block; font-size: var(--fs-xs); margin-top: 3px; font-weight: 600; }
.verify-run .verify__big { margin-top: 6px; }
.verify__big { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 14px; border-radius: 16px; background: var(--good-soft); margin-bottom: 10px; }
.verify__big.bad { background: var(--bad-soft); }
.verify__big b { font-size: var(--fs-3xl); color: var(--ink); }
.verify__big span { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; flex-basis: 100%; }
.dir-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 18px 20px; }
.dir-item { padding: 12px 14px; border-radius: 16px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--line); display: flex; flex-direction: column; gap: 2px; }
.dir-item b { font-size: var(--fs-lg); }
.q-meter { display: flex; align-items: center; gap: 8px; }
.q-meter .meter { width: 90px; height: 6px; }
.denied { max-width: 560px; margin: 10vh auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 34px; }
.denied h1 { font-size: var(--fs-3xl); font-weight: 600; letter-spacing: -.015em; }

/* ===================================================== варианты компоновки */
.lv-grid { display: grid; gap: var(--gap); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (width <= 1279px) { .lv-grid { grid-template-columns: minmax(0, 1fr); } }
.lv__d { font-size: var(--fs-sm); color: var(--ink-2); margin: 14px 0 10px; }
.lv__pc { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: var(--fs-sm); }
.lv__pc ul { margin: 6px 0 0; padding-left: 16px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.lv-dots { letter-spacing: .15em; color: var(--muted); } .lv-dots.good { color: var(--good); }
.lv-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; }
.lv-answers b { display: block; margin-bottom: 4px; }
.lv-answers p { color: var(--ink-2); font-size: var(--fs-sm); }
@media (width <= 999px) { .lv-answers { grid-template-columns: minmax(0, 1fr); } }
.wf { position: relative; display: flex; gap: 6px; height: 190px; padding: 8px; border-radius: 16px; background: var(--wall); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.wf i, .wf b { display: block; border-radius: 6px; background: var(--glass-hi); box-shadow: inset 0 0 0 1px var(--line); }
.wf-side { width: 22%; flex: none; border-radius: 10px !important; }
.wf-side--rail { width: 8%; }
.wf-main { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wf-top { height: 14px; background: transparent !important; box-shadow: none !important; border-bottom: 2px solid var(--line-2); border-radius: 0 !important; }
.wf-row6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.wf-row6 i { height: 30px; background: var(--tile-1); }
.wf-row6 i:first-child { background: var(--accent-soft-solid); box-shadow: inset 0 0 0 2px var(--accent); }
.wf-split { flex: 1; display: grid; grid-template-columns: 1fr 30%; gap: 6px; min-height: 0; }
.wf-list { display: flex !important; flex-direction: column; gap: 4px; padding: 6px; }
.wf-list b { height: 10px; background: var(--card-3); box-shadow: none; }
.wf-col { display: flex; flex-direction: column; gap: 6px; } .wf-col i { flex: 1; }
.wf-3 { flex: 1; display: grid; grid-template-columns: 26% 1fr 26%; gap: 6px; }
.wf-form { display: flex !important; flex-direction: column; gap: 6px; padding: 8px; }
.wf-form b { height: 14px; background: var(--card-3); box-shadow: none; }
.wf-sheet { flex: 1; display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 4px; background: var(--paper) !important; }
.wf-sheet b { background: repeating-linear-gradient(90deg, var(--line) 0 1px, transparent 1px 14px), repeating-linear-gradient(0deg, var(--line) 0 1px, transparent 1px 8px); box-shadow: none; border-radius: 0; }
.wf-foot { height: 20px; background: var(--tile-3) !important; }
.wf-drawer { position: absolute; right: 8px; top: 8px; bottom: 8px; width: 26%; background: var(--glass-solid) !important; box-shadow: var(--shadow) !important; border-radius: 12px !important; }

/* фокус и состояния */
.btn:focus-visible, .chip:focus-visible, .ibtn:focus-visible { outline-offset: 3px; border-radius: 99px; }
.input:disabled { opacity: .6; }
.keys .row-set { padding: 10px 0; }
.nowrap { white-space: nowrap; }

/* Таблицы-каталоги на телефоне: строка → карточка (имя + сумма/действие, подпись + статус) */
@media (width <= 760px) {
  .table--stack thead { display: none; }
  .table--stack, .table--stack tbody, .table--stack tr { display: block; width: 100%; }
  .table--stack tr { padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .table--stack td { display: block; padding: 2px 0; border: 0; text-align: left; }
  .table--stack tr:has(.m-main) { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 6px; align-items: center; }
  .table--stack tr:has(.m-main) td { display: none; }
  .table--stack tr:has(.m-main) td.m-main { display: block; grid-column: 1; grid-row: 1; min-width: 0; }
  .table--stack tr:has(.m-main) td.m-sub { display: block; grid-column: 1; grid-row: 2; }
  .table--stack tr:has(.m-main) td.m-tag { display: block; grid-column: 2; grid-row: 2; text-align: right; }
  .table--stack tr:has(.m-main) td.m-end { display: block; grid-column: 2; grid-row: 1; text-align: right; }
  .table--stack tr:has(.m-main):not(:has(.m-end)) td:last-child:has(button) { display: block; grid-column: 2; grid-row: 1; }
  .table--stack tr:has(.m-end) td:last-child:has(button) { display: block; grid-column: 1 / -1; grid-row: 3; }
  .table--stack .cell__text b { max-width: none !important; white-space: normal; }
}
