/* Самостоятельные документы: КА, объектная смета и ССР */
.s-kamode .s-gridbar, .s-kamode .s-cost, .s-kamode .s-keys, .s-kamode .s-meter,
.s-stroymode .s-gridbar, .s-stroymode .s-cost, .s-stroymode .s-keys, .s-stroymode .s-meter { display: none; }
.ka-panel { max-width: 1440px; margin: 0 auto; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--paper); overflow: clip; }
.ka-panel[hidden], .st-bar[hidden], .st-os-pick[hidden] { display: none !important; }
.ka-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ka-panel-head h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.ka-panel-head p { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.45; }
.ka-panel-head .btn { flex: none; }
.ka-panel-body { padding: 14px 16px 18px; }
.ka-help { margin: 0 0 12px; font-size: 13px; line-height: 1.5; }
.ka-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface); font-size: 12.5px; }
.ka-warn { flex: 1 1 100%; min-width: 0; font-size: 12.5px; color: var(--ink-2); }
#s_kaPanel { width: 100%; max-width: none; margin: 0; border: 0; border-radius: 0; background: transparent; overflow: visible; }
#s_kaPanel .ka-panel-head { padding: 6px 0 12px; border: 0; background: transparent; }
#s_kaPanel .ka-panel-body { padding: 0; }
#s_kaPanel .ka-foot { padding: 10px 0; border-top: 0; background: transparent; }

.ka-ihg, .ka-ofg { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px 8px; min-width: 0; }
.ka-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 11px; color: var(--muted); }
.ka-f > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-f input, .ka-f select { height: 32px; min-width: 0; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; }
.ka-f input:focus, .ka-f select:focus { outline: 2px solid var(--action); outline-offset: 1px; border-color: transparent; }
.ka-f input::placeholder { color: var(--muted); opacity: .8; }
.ka-w2 { grid-column: span 2; } .ka-w3 { grid-column: span 3; } .ka-w4 { grid-column: span 4; }

.ka-cand { margin-bottom: 12px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; background: var(--surface); }
.ka-cand summary { cursor: pointer; }
.ka-candh { font-size: 13.5px; }
.ka-candtools { margin: 8px 0 3px; }
.ka-cand ul { list-style: none; margin: 0; padding: 0; }
.ka-cand li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ka-cand li .btn { flex: none; min-height: 30px; padding: 0 10px; font-size: 12.5px; }

/* Позиции КА — компактное дерево в одной таблице, без изменения общей таблицы сметы. */
#s_kaPanel .ka-grid { max-width: 100%; margin-bottom: 12px; overflow: auto; overscroll-behavior-x: contain; isolation: isolate; }
#s_kaPanel .ka-table { --ka-n-width: 58px; --ka-code-width: 190px; --ka-name-width: 280px; --ka-header-row: 48px; min-width: 1320px; font-size: 11px; }
#s_kaPanel .ka-table col.ka-c-n { width: var(--ka-n-width); }
#s_kaPanel .ka-table col.ka-c-ksr { width: 108px; }
#s_kaPanel .ka-table col.ka-c-unit { width: 54px; }
#s_kaPanel .ka-table col.ka-c-priceVat, #s_kaPanel .ka-table col.ka-c-price { width: 84px; }
#s_kaPanel .ka-table col.ka-c-vat { width: 50px; }
#s_kaPanel .ka-table col.ka-c-trPct { width: 62px; }
#s_kaPanel .ka-table col.ka-c-trSum { width: 76px; }
#s_kaPanel .ka-table col.ka-c-zsrPct { width: 54px; }
#s_kaPanel .ka-table col.ka-c-zsr { width: 74px; }
#s_kaPanel .ka-table col.ka-c-est { width: 88px; }
#s_kaPanel .ka-table col.ka-c-date { width: 106px; }
#s_kaPanel .ka-table col.ka-c-supplier { width: 158px; }
#s_kaPanel .ka-table col.ka-c-m { width: 36px; }
#s_kaPanel .ka-table thead { position: static; }
#s_kaPanel .ka-table th { position: sticky; top: 0; z-index: 6; height: var(--ka-header-row); padding: 4px 2px; font-size: 10px; }
#s_kaPanel .ka-table .ka-header-sub th { top: var(--ka-header-row); }
#s_kaPanel .ka-table th[rowspan="2"] { height: calc(var(--ka-header-row) * 2); vertical-align: middle; }
#s_kaPanel .ka-table .ka-header-group { text-align: center; }
#s_kaPanel .ka-table .ka-th-text { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
#s_kaPanel .ka-table td { padding: 3px; vertical-align: middle; }
#s_kaPanel .ka-table :is(th, td)[data-col="n"] { position: sticky; left: 0; z-index: 4; }
#s_kaPanel .ka-table :is(th, td)[data-col="name"] { position: sticky; left: var(--ka-n-width); z-index: 4; }
#s_kaPanel .ka-table th[data-col="n"], #s_kaPanel .ka-table th[data-col="name"] { z-index: 8; }
#s_kaPanel .ka-table .ka-line { cursor: default; outline: none; }
#s_kaPanel .ka-table .ka-line.ka-keyfocus:focus-visible { outline: 2px solid var(--action); outline-offset: -2px; }
#s_kaPanel .ka-it.open .ka-line > td { border-bottom-color: var(--line-strong); }
#s_kaPanel .ka-numcell { display: flex; align-items: center; justify-content: center; gap: 4px; min-height: 20px; }
#s_kaPanel .ka-toggle { position: static; flex: 0 0 18px; width: 18px; height: 18px; margin: 0; vertical-align: middle; }
#s_kaPanel .ka-n { font: 600 12px/18px var(--sans); color: var(--ink-2); }
#s_kaPanel .ka-headtxt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#s_kaPanel .ka-name-open { display: block; min-width: 0; color: var(--ink); text-align: left; white-space: normal; }
#s_kaPanel .ka-headtxt b { display: block; overflow: visible; overflow-wrap: anywhere; word-break: break-word; white-space: normal; font-size: 12px; line-height: 1.3; }
#s_kaPanel .ka-parent-meta { display: flex; align-items: center; gap: 5px; min-width: 0; color: var(--muted); font-size: 10px; white-space: nowrap; }
#s_kaPanel .ka-code { max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
#s_kaPanel .ka-parent-kind { flex: none; }
#s_kaPanel .ka-cnt { flex: none; margin-left: auto; color: var(--muted); }
#s_kaPanel .ka-cnt.ok { color: var(--ok); }
#s_kaPanel .ka-parent-meta .s-link { flex: none; font-size: 10px; }
#s_kaPanel .ka-parent-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
#s_kaPanel .ka-parent-est { font-weight: 700; }
#s_kaPanel .ka-parent-supplier span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#s_kaPanel .ka-cell-input { width: 100%; min-width: 0; height: 24px; padding: 0 3px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-size: 11px; box-sizing: border-box; }
#s_kaPanel .ka-cell-input:hover { border-color: var(--line-strong); background: var(--paper); }
#s_kaPanel .ka-cell-input:focus { border-color: var(--action); background: var(--paper); outline: 2px solid var(--action-soft); }
#s_kaPanel .ka-cell-input.ka-num { text-align: right; font-variant-numeric: tabular-nums; }
#s_kaPanel .ka-cell-input.ka-center { text-align: center; }
#s_kaPanel td.ka-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#s_kaPanel td.ka-center { text-align: center; white-space: nowrap; }
#s_kaPanel .ka-calculated { color: var(--ink-2); }
#s_kaPanel .ka-est { font-weight: 600; }
#s_kaPanel .ka-of > td { background: var(--paper); }
#s_kaPanel .ka-of.win > td { background: color-mix(in srgb, var(--ok) 7%, var(--surface)); }
#s_kaPanel .ka-of.win > td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
#s_kaPanel .ka-of.win .ka-est { color: var(--ok); }
#s_kaPanel .ka-of[hidden] { display: none !important; }
#s_kaPanel .ka-of td.ka-offer-num { padding-left: 21px; color: var(--ink-2); white-space: nowrap; }
#s_kaPanel .ka-of.win .ka-offer-num span::after { content: ' ✓'; color: var(--ok); }
#s_kaPanel .ka-ksr-compact { display: flex; align-items: center; gap: 2px; min-width: 0; }
#s_kaPanel .ka-ksr-compact input { width: 100%; min-width: 0; height: 24px; padding: 0 3px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink); font: inherit; font-size: 11px; }
#s_kaPanel .ka-ksr-compact input:focus { border-color: var(--action); background: var(--paper); outline: 2px solid var(--action-soft); }
#s_kaPanel .ka-ksr-compact .s-ic { position: static; flex: 0 0 22px; width: 22px; height: 24px; }
#s_kaPanel .ka-supplier-pick { display: flex; align-items: center; justify-content: space-between; gap: 3px; width: 100%; min-width: 0; height: 24px; padding: 0 4px; border: 1px solid var(--line-strong); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; cursor: pointer; }
#s_kaPanel .ka-supplier-pick > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#s_kaPanel .ka-supplier-pick.empty { border-style: dashed; color: var(--muted); }
#s_kaPanel .ka-line .ka-del, #s_kaPanel .ka-offer-edit { position: static; margin: 0; }
#s_kaPanel .ka-line .ka-del { opacity: .45; }
#s_kaPanel .ka-line:hover .ka-del, #s_kaPanel .ka-line.s-cur .ka-del, #s_kaPanel .ka-line .ka-del:focus-visible { opacity: 1; }
.ka-link { margin: 8px 0 0; font-size: 12.5px; }
.ka-letter { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px 8px; margin-top: 10px; }
.ka-sign { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ka-sign summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.ka-sign[open] summary { margin-bottom: 10px; }
.ka-empty { margin: 4px 0 12px; }
.ka-ihg, .ka-ofg { gap: 4px 6px; }
.ka-f { gap: 2px; }
.ka-f input, .ka-f select { height: 28px; padding: 0 6px; }
.ka-link { margin-top: 5px; }
.ka-letter { gap: 4px 6px; margin-top: 6px; }
.ka-code-problems { margin: 4px 0 0; padding: 5px 7px; }

/* Общая стройка, но отдельные тела ОС и ССР */
.st-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; max-width: 1440px; margin: 0 auto 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.st-pick { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--muted); min-width: min(310px, 100%); }
.st-pick select { height: 36px; min-width: 0; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600; }
.st-os-pick { margin-left: auto; }
.st-bar .btn { min-height: 36px; }
.st-saved { font-size: 12.5px; align-self: center; }
.st-bar .ka-warn { flex-basis: 100%; }
.st-sec { margin: 0 0 16px; }
.st-sec > h3 { margin: 0 0 8px; font-size: 15px; }
.st-sec > h3 .muted { font-weight: 400; font-size: 13px; }
.st-obj { padding: 12px; }
.st-obj .ka-ih { display: flex; align-items: flex-start; gap: 10px; }
.st-obj .ka-ih .ka-ihg { flex: 1; }
.st-obj .ka-del { position: static; flex: none; margin-top: 14px; }
.st-os { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.st-ls { list-style: none; margin: 10px 0 0; padding: 0; }
.st-ls li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto auto; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 13px; }
.st-ls li + li { margin-top: 4px; }
.st-lt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-lr { font: 500 12px/1 var(--sans); color: var(--muted); }
.st-lv { min-width: 110px; text-align: right; font-variant-numeric: tabular-nums; }
.st-add { height: 34px; max-width: 360px; padding: 0 8px; border: 1px dashed var(--line-strong); border-radius: 7px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; }
.st-hint { font-size: 12.5px; }
.st-empty { max-width: 640px; margin: 20px auto; font-size: 14px; line-height: 1.5; }
.st-source { padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.st-source p { margin: 0 0 10px; font-size: 13px; }
.st-sum { overflow-x: auto; }
.st-tab { width: 100%; border-collapse: collapse; font-size: 13px; background: var(--surface); }
.st-tab th, .st-tab td { padding: 6px 8px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.st-tab th { background: var(--g-head, var(--paper)); font-size: 12px; font-weight: 600; color: var(--ink-2); }
.st-tab .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.st-tab td:first-child { width: 36px; text-align: center; color: var(--muted); }
.st-tab td:nth-child(2) { width: 130px; font-size: 12px; color: var(--ink-2); }
.st-tab tr.st-ch td { background: var(--paper); font-weight: 600; text-align: left; color: var(--ink); width: auto; font-size: 13px; }
.st-it td { font-weight: 600; }
.st-all td { font-weight: 700; background: var(--paper); }
.st-lvl { margin: 6px 0 0; font-size: 12.5px; }
.st-source .btn { margin: 0 8px 6px 0; }
.st-discount summary { cursor: pointer; }
.st-ch-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 7px 12px; }
.st-ch-actions { display: flex; flex-wrap: wrap; gap: 5px; font-weight: 400; }
.st-ch-actions .btn { min-height: 28px; padding: 3px 8px; font-size: 11.5px; }
.st-manual-dlg { width: min(620px, calc(100vw - 28px)); max-height: calc(100vh - 36px); padding: 0; overflow: auto; }
.st-manual-fields { display: grid; gap: 11px; padding: 14px 16px; }
.st-manual-fields .ka-f > span { white-space: normal; }
.st-manual-fields .err:empty { display: none; }
.st-k { display: grid; grid-template-columns: minmax(0, 1fr) 110px auto 30px; align-items: center; gap: 9px; margin: 8px 0; }
.st-k input[data-kname], .st-k input[data-kpz] { min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; }
.st-k .chk { font-size: 12px; }
.st-kv { text-align: right; }
.st-tab .st-est-name { padding: 0; font-size: 13px; text-align: left; }
.st-tab .st-row-actions { white-space: nowrap; text-align: right; }
.st-row-actions select { max-width: 88px; height: 28px; margin-right: 5px; padding: 0 3px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 11px; }
.st-pickdlg { width: min(720px, calc(100vw - 28px)); max-height: min(760px, calc(100vh - 36px)); padding: 0; overflow: auto; }
.st-pick-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; padding: 14px 16px 10px; }
.st-pick-all { grid-column: 1 / -1; font-size: 13px; }
.st-pick-list { max-height: 390px; overflow-y: auto; margin: 0 16px; border: 1px solid var(--line); border-radius: 9px; }
.st-pick-est { display: flex; align-items: flex-start; gap: 9px; padding: 9px 10px; font-size: 13.5px; cursor: pointer; }
.st-pick-est + .st-pick-est { border-top: 1px solid var(--line); }
.st-pick-est input { flex: none; margin-top: 3px; }
.st-pick-est small { display: block; margin-top: 3px; color: var(--muted); }
.st-pick-est.is-used { opacity: .58; cursor: default; }
.st-pick-list > p { padding: 12px; }
.st-pick-foot { display: flex; align-items: center; justify-content: flex-end; gap: 9px; padding: 14px 16px; }
.st-pick-foot > span { margin-right: auto; }

@media (max-width: 860px) {
  #s_kaPanel .ka-grid { overflow: visible; border: 0; }
  #s_kaPanel .ka-table { display: block; min-width: 0; }
  #s_kaPanel .ka-table tbody.ka-it { display: block; margin-bottom: 8px; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; }
  #s_kaPanel .ka-table tr.ka-line, #s_kaPanel .ka-table tr.ka-of { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px 8px; padding: 7px 6px; }
  #s_kaPanel .ka-table tr.ka-of[hidden] { display: none !important; }
  #s_kaPanel .ka-table td { min-width: 0; overflow: visible; }
  #s_kaPanel .ka-table td::before { display: block; margin-bottom: 2px; color: var(--muted); font-size: 10px; content: attr(data-label); }
  #s_kaPanel .ka-table td[data-col="n"] { grid-column: 1; grid-row: 1; }
  #s_kaPanel .ka-table td[data-col="m"] { grid-column: 2; grid-row: 1; justify-self: end; }
  #s_kaPanel .ka-table td[data-col="ksr"], #s_kaPanel .ka-table td[data-col="name"], #s_kaPanel .ka-table td[data-col="supplier"] { grid-column: 1 / -1; }
  #s_kaPanel .ka-table .ka-of td[data-col="ksr"] { display: none; }
  #s_kaPanel .ka-table .ka-parent-meta { flex-wrap: wrap; white-space: normal; }
  #s_kaPanel .ka-table .ka-code { max-width: 100%; }
  #s_kaPanel .ka-table .ka-cell-input, #s_kaPanel .ka-ksr-compact input { height: 32px; border-color: var(--line); background: var(--paper); }
  #s_kaPanel .ka-table .ka-toggle { width: 24px; height: 24px; flex-basis: 24px; }
  #s_kaPanel .ka-table .ka-of td.ka-offer-num { padding-left: 3px; }
  #s_kaPanel .ka-table .ka-supplier-pick { height: 32px; }
}
@media (max-width: 760px) {
  .ka-panel-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .ka-panel-body { padding: 12px 10px 16px; }
  .ka-foot { flex-wrap: wrap; padding: 10px; }
  .ka-ihg, .ka-ofg, .ka-letter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ka-w3, .ka-w4 { grid-column: 1 / -1; }
  .st-os-pick { margin-left: 0; }
  .st-pick { flex: 1 1 240px; }
  .st-ls li { grid-template-columns: minmax(0, 1fr) auto auto; }
  .st-lr { display: none; }
  .st-pick-tools { grid-template-columns: minmax(0, 1fr); padding: 12px 10px 8px; }
  .st-pick-all { grid-column: auto; }
  .st-pick-list { margin: 0 10px; }
  .st-pick-foot { flex-wrap: wrap; padding: 12px 10px; }
  .st-pick-foot > span { flex-basis: 100%; }
  .st-tab { min-width: 940px; }
}
@media (prefers-reduced-motion: reduce) { .ka-chev { transition: none; } }

/* Импорт КА, поставщики и групповые правки */
.ka-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; flex: none; }
.ka-dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.ka-dlg-head h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.ka-dlg-head p { margin: 4px 0 0; font-size: 12px; overflow-wrap: anywhere; }
.ka-dlg-head .s-ic { position: static; flex: none; }
.ka-dlg-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line); background: var(--surface); }
.ka-form-err { margin: 0; padding: 0 18px; color: var(--danger); font-size: 13px; white-space: normal; }
.ka-form-err:not(:empty) { padding-top: 10px; padding-bottom: 10px; }
.ka-import-dlg { width: min(1280px, calc(100vw - 30px)); max-width: none; max-height: calc(100vh - 30px); padding: 0; overflow: hidden; }
.ka-import-dlg[open] { display: flex; flex-direction: column; }
.ka-import-body { min-height: 0; padding: 14px 18px; overflow: auto; }
.ka-source-grid, .ka-map-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 10px 12px; }
.ka-source-grid { grid-template-columns: minmax(180px, 1fr) 170px 170px auto; }
.ka-map-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink-2); font-size: 12px; }
.ka-map-field > span { min-height: 16px; }
.ka-map-field small { color: var(--muted); line-height: 1.35; }
.ka-map-field input, .ka-map-field select, .ka-sup-tools input, .ka-bulk-fields > input, .ka-bulk-fields > select { width: 100%; min-width: 0; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; box-sizing: border-box; }
.ka-map-field input:focus, .ka-map-field select:focus, .ka-sup-tools input:focus { outline: 2px solid var(--action); outline-offset: 1px; }
.ka-import-hint { color: var(--ink-2); font-size: 12.5px; line-height: 1.45; }
.ka-entry, .ka-settings { margin-bottom: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ka-entry-line, .ka-settings-grid { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.ka-entry-line .btn { flex: none; }
.ka-inline-field { display: flex; flex-direction: column; gap: 3px; min-width: 150px; color: var(--ink-2); font-size: 11px; }
.ka-inline-field input, .ka-inline-field select, .ka-map-inline select { min-width: 0; min-height: 34px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 12px; }
.ka-header-check { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; color: var(--ink-2); font-size: 12px; }
.ka-paste-line { display: grid; grid-template-columns: minmax(180px, .7fr) minmax(260px, 2fr) auto; align-items: center; gap: 10px; margin-top: 10px; }
.ka-paste-line > label { color: var(--ink-2); font-size: 12px; line-height: 1.4; }
.ka-paste-line textarea { width: 100%; min-width: 0; padding: 8px; resize: vertical; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--paper); color: var(--ink); font: 12px/1.45 var(--mono, monospace); box-sizing: border-box; }
.ka-paste-line > div { display: flex; flex-direction: column; gap: 6px; }
.ka-price-mode { margin-bottom: 8px; }
.ka-fixed-grid { margin-top: 8px; }
.ka-fixed-grid .ka-inline-field { flex: 1 1 220px; }
.ka-map-notice { margin-left: auto; color: var(--ink-2); font-size: 12px; }
.ka-column-strip { display: flex; align-items: stretch; gap: 5px; max-width: 100%; padding: 4px 0 8px; overflow-x: auto; overscroll-behavior-x: contain; }
.ka-column-strip > span { align-self: center; flex: none; padding: 0 5px; color: var(--ink-2); font-size: 12px; }
.ka-col { display: grid; flex: 0 0 132px; gap: 2px; min-height: 56px; padding: 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); color: var(--ink); font: inherit; font-size: 11px; text-align: left; cursor: grab; }
.ka-col b { color: var(--action); font-size: 14px; }
.ka-col span, .ka-col small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-col small { color: var(--muted); }
.ka-col:hover, .ka-col:focus-visible { border-color: var(--action); background: var(--action-soft); outline: none; }
.ka-col.is-selected { border-color: var(--action); background: var(--action-soft); outline: 2px solid var(--action); outline-offset: 1px; }
.ka-col.is-dragging, .ka-map-chip.is-dragging { cursor: grabbing; opacity: .65; }
.ka-unified-scroll { max-width: 100%; max-height: min(52vh, 600px); overflow: auto; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); scrollbar-gutter: stable; }
.ka-unified { width: max-content; min-width: 100%; border-spacing: 0; border-collapse: separate; font-size: 11px; }
.ka-unified th, .ka-unified td { min-width: 148px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.ka-unified thead th { position: sticky; color: var(--ink); text-align: center; }
.ka-group-row th { top: 0; z-index: 9; height: 34px; background: var(--surface); font-size: 12px; }
.ka-target-row th { top: 34px; z-index: 8; height: 48px; background: var(--surface); font-size: 11px; }
.ka-mapping-row td { top: 82px; z-index: 7; min-width: 176px; height: 124px; padding: 5px; background: var(--surface); }
.ka-unified .ka-row-corner { left: 0; top: 0; z-index: 12; min-width: 94px; background: var(--surface); }
.ka-unified tbody th { position: sticky; left: 0; z-index: 5; min-width: 94px; background: var(--paper); font-weight: 600; }
.ka-unified tbody th label { display: block; margin-top: 5px; color: var(--ink-2); font-size: 10px; font-weight: 400; white-space: nowrap; }
.ka-unified tbody tr.has-error td, .ka-unified tbody tr.has-error th { background: color-mix(in srgb, var(--danger) 7%, var(--paper)); }
.ka-unified tbody tr.has-warning td, .ka-unified tbody tr.has-warning th { background: color-mix(in srgb, #c68a14 7%, var(--paper)); }
.ka-unified td small { display: block; margin-top: 4px; color: var(--ink-2); }
.ka-map-target { min-height: 112px; padding: 5px; border: 1px dashed var(--line-strong); border-radius: 7px; background: var(--paper); }
.ka-map-target.is-mapped { border-style: solid; border-color: var(--action); }
.ka-map-target.ka-drop-over { border-color: var(--action); background: var(--action-soft); outline: 2px solid var(--action); outline-offset: 1px; }
.ka-map-chip { display: grid; gap: 2px; min-height: 54px; margin-bottom: 4px; padding: 5px; border-radius: 6px; background: var(--action-soft); cursor: grab; }
.ka-map-chip b { color: var(--action); font-size: 15px; }
.ka-map-chip span, .ka-map-chip small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ka-map-chip small { color: var(--ink-2); }
.ka-map-empty { display: block; min-height: 54px; padding: 16px 4px 4px; color: var(--muted); text-align: center; }
.ka-map-inline { display: flex; align-items: stretch; gap: 4px; }
.ka-map-inline select { flex: 1; min-height: 32px; }
.ka-map-clear { flex: none; width: 32px; min-height: 32px; padding: 0; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink-2); font: inherit; font-size: 19px; line-height: 1; cursor: pointer; }
.ka-map-clear:hover, .ka-map-clear:focus-visible { border-color: var(--danger); color: var(--danger); outline: 2px solid var(--danger); outline-offset: 1px; }
.ka-map-clear[hidden] { display: none; }
.ka-problems { max-height: 118px; margin-top: 10px; padding: 8px 10px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 11.5px; }
.ka-problems > div + div { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.ka-problems ul { margin: 3px 0 0; padding-left: 18px; }
.ka-problems-ok { color: var(--ok); }
.ka-error-text { color: var(--danger); }
.ka-no-data { padding: 24px !important; color: var(--muted); text-align: center !important; }
.ka-import-mode { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; }
.ka-import-mode label { display: inline-flex; align-items: center; gap: 5px; }
.ka-map-set { min-width: 0; margin: 0 0 12px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.ka-map-set legend { padding: 0 5px; color: var(--ink); font-size: 13px; font-weight: 600; }
.ka-map-set .ka-map-grid + .ka-map-grid { margin-top: 10px; }
.ka-price-mode { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-bottom: 10px; font-size: 13px; }
.ka-price-mode label, .ka-map-set > label { display: inline-flex; align-items: center; gap: 7px; margin-right: 16px; }
.ka-import-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.ka-import-summary span { padding: 7px 10px; border-radius: 8px; background: var(--surface); font-size: 13px; }
.ka-preview-list { display: grid; gap: 10px; }
.ka-preview-row { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.ka-preview-row.has-error { border-color: var(--danger); }
.ka-preview-row.has-warning { border-color: color-mix(in srgb, #c68a14 65%, var(--line)); }
.ka-preview-main { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 12px; font-size: 12.5px; }
.ka-preview-main code { flex-basis: 100%; overflow-wrap: anywhere; color: var(--ink-2); }
.ka-exclude { display: inline-flex; align-items: center; gap: 5px; margin-left: auto; color: var(--ink-2); }
.ka-preview-offers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 9px; }
.ka-preview-offer { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); font-size: 11.5px; }
.ka-preview-offer span, .ka-preview-offer small { overflow-wrap: anywhere; }
.ka-row-errors, .ka-row-warnings { margin: 9px 0 0; padding-left: 20px; font-size: 12px; line-height: 1.45; }
.ka-row-errors { color: var(--danger); }
.ka-row-warnings { color: var(--ink-2); }
.ka-simple-dlg { width: calc(100vw - 16px); max-width: 1800px; max-height: calc(100dvh - 16px); padding: 0; overflow: auto; }
.ka-simple-body { min-width: 0; padding: 12px 12px 0; }
.ka-simple-table { width: 100%; table-layout: fixed; border-collapse: collapse; color: var(--ink); font-size: clamp(7px, .76vw, 12px); }
.ka-simple-table th, .ka-simple-table td { min-width: 0; padding: 5px 3px; border: 1px solid var(--line); text-align: left; }
.ka-simple-table th { position: sticky; top: 0; z-index: 2; height: 70px; background: var(--surface); vertical-align: top; }
.ka-simple-table td { height: 24px; overflow: hidden; background: var(--paper); white-space: nowrap; text-overflow: ellipsis; }
.ka-simple-label { display: block; padding-right: 11px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.ka-simple-source { display: block; min-width: 0; margin-top: 5px; padding: 2px 0; overflow: hidden; color: var(--ink-2); font-weight: 400; white-space: nowrap; text-overflow: ellipsis; cursor: grab; }
.ka-simple-source:hover, .ka-simple-source:focus-visible { color: var(--action); outline: 1px solid var(--action); }
.ka-simple-source.is-dragging { opacity: .55; cursor: grabbing; }
.ka-simple-table th.ka-drop-over { outline: 2px solid var(--action); outline-offset: -2px; background: var(--action-soft); }
.ka-simple-disable { position: absolute; top: 1px; right: 1px; width: 16px; height: 16px; padding: 0; border: 0; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.ka-simple-disable:hover, .ka-simple-disable:focus-visible { color: var(--danger); outline: 1px solid var(--danger); }
.ka-simple-table .ka-simple-disabled { color: var(--muted); background: color-mix(in srgb, var(--muted) 7%, var(--paper)); }
.ka-simple-table th[data-simple-slot="17"], .ka-simple-table .ka-simple-drop, .ka-simple-table td.ka-simple-disabled-first { border-left: 2px solid var(--line-strong); }
.ka-simple-table [data-simple-field^="gross"], .ka-simple-table [data-simple-field^="net"] { text-align: right; }
.ka-simple-table tbody tr.has-error td { color: var(--danger); }
.ka-simple-no-data { padding: 24px !important; color: var(--muted); text-align: center !important; }
.ka-simple-close { position: absolute; top: 2px; right: 2px; z-index: 4; }
.ka-simple-error:empty { display: none; }
.ka-simple-error { margin: 0; padding: 8px 12px 0; }
.ka-simple-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px 12px; }
.ka-simple-pages { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.ka-simple-pages .s-ic { position: static; width: 30px; height: 30px; }
.ka-simple-dlg { border: 1px solid #e2e8f0; border-radius: 16px; background: #fff; color: #0f172a; font-family: var(--sans); box-shadow: 0 24px 60px -12px rgba(15, 23, 42, .28); }
.ka-simple-dlg::backdrop { background: rgba(15, 23, 42, .58); backdrop-filter: blur(2px); }
.ka-simple-body { padding: 12px; background: #f8fafc; }
.ka-simple-table { border: 1px solid #e2e8f0; border-spacing: 0; border-collapse: separate; border-radius: 12px; overflow: hidden; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); font-family: inherit; font-size: 13px; }
.ka-simple-table th, .ka-simple-table td { padding: 6px 4px; border: 0; border-right: 1px solid #e2e8f0; border-bottom: 1px solid #f1f5f9; }
.ka-simple-table th { background: #f8fafc; color: #94a3b8; font-size: 11px; font-weight: 600; letter-spacing: .02em; }
.ka-simple-table td { height: 28px; background: #fff; color: #475569; }
.ka-simple-table tbody tr:hover td { background: #f8fafc; }
.ka-simple-table tbody tr:last-child td { border-bottom: 0; }
.ka-simple-label { color: inherit; font-weight: 600; }
.ka-simple-source { border-radius: 4px; color: #64748b; font-size: 10px; }
.ka-simple-source:hover, .ka-simple-source:focus-visible { background: #eff6ff; color: #2563eb; outline: 0; }
.ka-simple-table td[draggable] { cursor: grab; user-select: none; }
.ka-simple-source.is-dragging, .ka-simple-table td.is-dragging { opacity: .42; cursor: grabbing; }
.ka-simple-table td.is-dragging { background: #eff6ff; }
.ka-simple-table th.ka-drop-over, .ka-simple-table td.ka-drop-over { background: #eff6ff; outline: 2px solid #2563eb; outline-offset: -2px; }
.ka-simple-table td.ka-simple-shared { cursor: default; }
.ka-simple-drag-image { z-index: -1; border-collapse: collapse; background: #fff; color: #334155; font: 12px var(--sans); opacity: .9; pointer-events: none; }
.ka-simple-drag-image th, .ka-simple-drag-image td { max-width: 0; padding: 4px; border: 1px solid #93c5fd; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ka-simple-tools { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ka-simple-same { display: inline-flex; align-items: center; gap: 5px; color: #334155; font-size: 12px; white-space: nowrap; cursor: pointer; }
.ka-simple-same input { width: 15px; height: 15px; margin: 0; accent-color: #2563eb; }
.ka-simple-disable { border-radius: 4px; color: #94a3b8; }
.ka-simple-disable:hover, .ka-simple-disable:focus-visible { background: #f1f5f9; color: #334155; outline: 0; }
.ka-simple-table .ka-simple-disabled { background: #f8fafc; color: #94a3b8; }
.ka-simple-close { top: 5px; right: 5px; width: 36px; height: 36px; border-radius: 9px; background: #fff; color: #94a3b8; }
.ka-simple-close:hover { background: #f1f5f9; color: #334155; }
.ka-simple-foot { padding: 10px 12px; border-top: 1px solid #e2e8f0; background: #fff; }
.ka-simple-pages { gap: 2px; padding: 3px; border: 1px solid #e2e8f0; border-radius: 8px; background: #e2e8f0; }
.ka-simple-pages .s-ic { width: 28px; height: 26px; border: 0; border-radius: 5px; background: transparent; color: #64748b; }
.ka-simple-pages .s-ic:hover:not(:disabled) { background: #fff; color: #0f172a; }
.ka-simple-pages span { padding: 4px 7px; border-radius: 5px; background: #fff; color: #0f172a; box-shadow: 0 1px 2px rgba(15, 23, 42, .12); font-size: 12px; }
.ka-simple-foot .btn { display: inline-flex; align-items: center; justify-content: center; height: 34px; min-height: 34px; padding: 0 13px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #334155; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); font-size: 13px; font-weight: 600; }
.ka-simple-foot .btn:hover { border-color: #cbd5e1; background: #f1f5f9; }
.ka-simple-foot .btn-main { border-color: #2563eb; background: #2563eb; color: #fff; }
.ka-simple-foot .btn-main:hover { border-color: #1d4ed8; background: #1d4ed8; }
.ka-code-edit { display: flex; align-items: flex-end; gap: 8px; min-width: 0; }
.ka-code-edit .ka-f { flex: 1; }
.ka-code-edit .btn { flex: none; min-height: 32px; }
.ka-code-problems { margin: 4px 0 0; padding: 5px 7px; border-radius: 7px; background: color-mix(in srgb, var(--danger) 8%, transparent); color: var(--danger); font-size: 12px; }
.ka-field-missing input { border-color: var(--danger); }
.ka-of.ka-need-code { border-color: color-mix(in srgb, var(--danger) 65%, var(--line)); }
.ka-subhead .s-link { margin-left: auto; flex: none; }
.s-mydlg.ka-suppliers-dlg { width: min(1280px, calc(100vw - 32px)); height: 680px; max-height: 88vh; }
.ka-suppliers-dlg [hidden] { display: none !important; }
.ka-sup-body { display: grid; grid-template-columns: minmax(0, 1fr); flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: #f8fafc; }
.ka-sup-body.has-saved { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ka-sup-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.ka-saved-pane { border-left: 1px solid #e2e8f0; background: #f8fafc; }
.ka-saved-head { flex: none; padding: 14px 20px 12px; border-bottom: 1px solid #e2e8f0; background: #fff; }
.ka-saved-head h2 { margin: 0; color: #0f172a; font-size: 18px; line-height: 1.25; }
.ka-saved-head p { margin: 5px 0 0; color: #64748b; font-size: 12px; line-height: 1.45; }
.ka-saved-back { min-height: 30px; margin: 0 0 9px; padding: 0 10px; }
.ka-supplier-edit { width: min(760px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 36px); padding: 0; overflow: auto; }
.ka-item-dlg, .ka-offer-dlg { width: min(860px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 30px); padding: 0; overflow: auto; }
.ka-item-dlg { width: min(720px, calc(100vw - 28px)); }
.ka-dialog-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px 10px; padding: 14px 18px; }
.ka-dialog-fields .ka-w2 { grid-column: span 2; }
.ka-dialog-fields .ka-w3 { grid-column: span 3; }
.ka-dialog-fields .ka-w4 { grid-column: 1 / -1; }
.ka-dialog-fields textarea { width: 100%; min-width: 0; padding: 7px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; box-sizing: border-box; resize: vertical; }
.ka-dlg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.ka-item-dlg .ka-code-problems { margin: 0 18px 10px; }
.ka-item-dlg .ka-code-problems[hidden] { display: none; }
.ka-item-dlg .ka-link { padding: 0 18px; }
.ka-offer-summary { margin: 0; padding: 0 18px 12px; color: var(--ink-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.my-actions.ka-sup-tools { min-width: 0; padding: 12px 20px; gap: 10px; }
.ka-suppliers-dlg .ka-sup-tools .my-search { flex: 1 1 200px; width: auto; min-width: 0; }
.ka-suppliers-dlg .ka-sup-tools .my-search input { height: 32px; min-height: 0; padding: 0 12px 0 32px; border-color: #e2e8f0; background: #fff; color: #1e293b; }
.ka-suppliers-dlg .ka-sup-tools .my-search input:focus { border-color: #3b82f6; outline: none; box-shadow: 0 0 0 3px rgba(59, 130, 246, .12); }
.ka-sup-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ka-suppliers-dlg .btn:focus-visible { outline: 3px solid rgba(37, 99, 235, .25); outline-offset: 1px; }
.ka-suppliers-dlg .btn:disabled, .ka-suppliers-dlg .btn[aria-disabled="true"] { opacity: .6; cursor: wait; }
.ka-sup-list { flex: 1; min-width: 0; min-height: 0; padding: 16px 20px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.ka-sup-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 12px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .04); }
.ka-sup-card + .ka-sup-card { margin-top: 10px; }
.ka-sup-card:hover { border-color: #cbd5e1; box-shadow: 0 6px 16px -8px rgba(15, 23, 42, .25); }
.ka-sup-info { min-width: 0; }
.ka-sup-card b, .ka-sup-card span, .ka-sup-card small { display: block; overflow-wrap: anywhere; }
.ka-sup-card b { color: #0f172a; font-size: 13px; line-height: 1.4; }
.ka-sup-card span, .ka-sup-card small { margin-top: 3px; color: #64748b; font-size: 12px; }
.ka-sup-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; flex: none; }
.ka-sup-body.has-saved .ka-sup-card { align-items: stretch; flex-direction: column; }
.ka-sup-body.has-saved .ka-sup-actions { justify-content: flex-start; }
.ka-sup-actions .ka-saved-state { display: inline-flex; align-items: center; min-height: 30px; margin: 0; padding: 0 9px; border: 1px solid #a7f3d0; border-radius: 8px; background: #ecfdf5; color: #047857; font-weight: 600; }
.ka-sup-empty { margin: 0; padding: 24px 16px; border: 1px dashed #cbd5e1; border-radius: 12px; background: #fff; text-align: center; }
.ka-suppliers-dlg .ka-form-err { flex: none; max-height: 72px; margin: 0; overflow: auto; background: #fff; }
.ka-sup-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 14px 18px; }
.ka-sup-fields .ka-w3 { grid-column: 1 / -1; }
.ka-sup-fields textarea { width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; box-sizing: border-box; }
.ka-save-copy { display: flex; align-items: center; gap: 8px; margin: 0 18px 14px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.ka-save-copy[hidden] { display: none; }
.ka-save-copy input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--action); }
.ka-bulk-dlg { width: min(620px, calc(100vw - 28px)); max-width: none; max-height: calc(100vh - 36px); padding: 0; overflow: auto; }
.ka-bulk-count { padding: 0 18px; font-weight: 600; }
.ka-bulk-fields { display: grid; grid-template-columns: minmax(160px, .8fr) minmax(0, 1fr); align-items: center; gap: 10px 12px; padding: 0 18px; }
.ka-bulk-check { display: flex; align-items: center; gap: 7px; font-size: 13px; }
.ka-bulk-summary, #kaBulkError { margin: 12px 18px; font-size: 12.5px; line-height: 1.5; }
.ka-bulk-summary { padding: 9px; border-radius: 7px; background: var(--surface); color: var(--ink-2); }
.ka-simple-top { display: flex; align-items: center; min-height: 34px; padding: 0 0 9px; background: #f8fafc; }
.ka-simple-top .ka-simple-same { font-size: 13px; font-weight: 600; }
.ka-simple-table .ka-simple-unused { color: #b6c0ce; background: #f8fafc; cursor: default; }
.ka-simple-table td.ka-simple-unused { background: #fbfdff; }
.ka-simple-warning { margin: 0; padding: 0 12px; color: #8a5b00; font-size: 12px; line-height: 1.45; }
.ka-simple-warning:not(:empty) { padding-top: 8px; }
.ka-ksr-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 4px 6px; min-width: 0; }
.ka-ksr-field .btn { min-height: 28px; padding: 0 8px; font-size: 11px; }
.ka-ksr-field small { grid-column: 1 / -1; overflow: hidden; color: var(--muted); font-size: 10.5px; line-height: 1.25; white-space: nowrap; text-overflow: ellipsis; }
.ka-bulk-ksr { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ka-bulk-ksr input { width: 100%; min-width: 0; min-height: 36px; padding: 6px 9px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; box-sizing: border-box; }
.ka-bulk-ksr .btn { flex: none; min-height: 36px; font-size: 12px; }
.ka-ksr-dlg { width: min(900px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 30px); padding: 0; overflow: auto; }
.ka-ksr-tools { display: grid; grid-template-columns: minmax(190px, .7fr) minmax(240px, 1.3fr); gap: 10px; padding: 12px 18px; }
.ka-ksr-tools label { display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--ink-2); font-size: 11px; }
.ka-ksr-tools select, .ka-ksr-tools input { width: 100%; min-width: 0; height: 36px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; box-sizing: border-box; }
.ka-ksr-selected { margin: 0; padding: 0 18px 9px; color: var(--ink-2); font-size: 12px; }
.ka-ksr-content { min-height: 220px; max-height: 55vh; margin: 0 18px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.ka-ksr-content h3 { margin: 0; padding: 9px 11px; background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 600; }
.ka-ksr-special { padding-bottom: 7px; border-bottom: 1px solid var(--line-strong); }
.ka-ksr-result { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 10px; width: 100%; padding: 7px 11px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; }
.ka-ksr-result:hover, .ka-ksr-result:focus-visible, .ka-ksr-pick:hover, .ka-ksr-pick:focus-visible { background: var(--action-soft); outline: none; }
.ka-ksr-result b { font-variant-numeric: tabular-nums; }
.ka-ksr-result small { grid-column: 2; color: var(--muted); font-size: 11px; line-height: 1.35; }
.ka-ksr-tree, .ka-ksr-tree ul { margin: 0; padding: 0; list-style: none; }
.ka-ksr-tree ul { margin-left: 22px; border-left: 1px solid var(--line); }
.ka-ksr-row { display: flex; align-items: stretch; min-height: 38px; border-bottom: 1px solid var(--line); }
.ka-ksr-row > .s-ic { position: static; flex: 0 0 30px; width: 30px; height: auto; min-height: 38px; border-radius: 0; }
.ka-ksr-indent { flex: 0 0 30px; }
.ka-ksr-parent, .ka-ksr-pick { display: grid; grid-template-columns: 160px minmax(0, 1fr); align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 6px 9px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 12px; text-align: left; }
.ka-ksr-parent { cursor: pointer; }
.ka-ksr-parent span { color: var(--ink-2); }
.ka-ksr-content > .ka-ksr-fsbc > p { padding: 0 12px; font-size: 12px; }

@media (max-width: 760px) {
  #s_kaPanel .ka-panel-head { align-items: stretch; }
  .ka-head-actions { justify-content: flex-start; }
  .ka-import-dlg { width: calc(100vw - 12px); max-height: calc(100vh - 12px); }
  .ka-dlg-head, .ka-dlg-foot { padding-left: 12px; padding-right: 12px; }
  .ka-import-body { padding: 10px; }
  .ka-source-grid, .ka-map-grid { grid-template-columns: minmax(0, 1fr); }
  .ka-entry-line, .ka-settings-grid { align-items: stretch; }
  .ka-entry-line .ka-inline-field, .ka-settings-grid .ka-inline-field { flex: 1 1 100%; }
  .ka-entry-line .btn, .ka-entry-line .btn-main, .ka-settings .btn { min-height: 44px; }
  .ka-paste-line { grid-template-columns: minmax(0, 1fr); }
  .ka-paste-line > div { flex-direction: row; flex-wrap: wrap; }
  .ka-paste-line .btn { flex: 1; min-height: 44px; }
  .ka-unified-scroll { max-height: 48vh; }
  .ka-map-inline select, .ka-map-clear { min-height: 44px; }
  .ka-map-clear { width: 44px; }
  .ka-map-notice { flex-basis: 100%; margin-left: 0; }
  .ka-preview-offers { grid-template-columns: minmax(0, 1fr); }
  .ka-exclude { margin-left: 0; }
  .ka-simple-dlg { width: calc(100vw - 8px); max-height: calc(100dvh - 8px); }
  .ka-simple-body { padding: 8px 5px 0; }
  .ka-simple-table { font-size: 7px; }
  .ka-simple-table th, .ka-simple-table td { padding: 3px 1px; }
  .ka-simple-foot { padding: 8px 5px; gap: 5px; }
  .ka-simple-tools { gap: 5px; }
  .ka-simple-same { max-width: 68px; font-size: 9px; line-height: 1.15; white-space: normal; }
  .ka-simple-same input { flex: 0 0 auto; width: 13px; height: 13px; }
  .ka-simple-pages span { padding-left: 5px; padding-right: 5px; }
  .ka-simple-foot .btn { padding-left: 8px; padding-right: 8px; }
  .ka-code-edit { grid-column: 1 / -1; align-items: stretch; flex-direction: column; }
  .ka-dialog-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px; }
  .ka-dialog-fields .ka-w3 { grid-column: 1 / -1; }
  .ka-dlg-foot { flex-wrap: wrap; }
  .ka-offer-summary { padding-left: 12px; padding-right: 12px; }
  .ka-subhead { flex-wrap: wrap; }
  .ka-subhead .s-link { margin-left: 0; }
  .ka-sup-card { align-items: stretch; flex-direction: column; }
  .ka-sup-actions { justify-content: flex-start; }
  .ka-sup-fields { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .ka-sup-fields .ka-w3 { grid-column: auto; }
  .ka-bulk-fields { grid-template-columns: minmax(0, 1fr); }
  .ka-bulk-check { margin-top: 5px; }
  .ka-sup-tools { flex-wrap: wrap; }
  .ka-sup-tools input { flex-basis: 100%; }
  .ka-ksr-tools { grid-template-columns: minmax(0, 1fr); padding: 10px 12px; }
  .ka-ksr-content { margin: 0 12px; max-height: 52vh; }
  .ka-ksr-selected { padding-left: 12px; padding-right: 12px; }
  .ka-ksr-parent, .ka-ksr-pick { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ka-ksr-result { grid-template-columns: 88px minmax(0, 1fr); }
  .ka-ksr-field { grid-column: 1 / -1; }
}


.ka-doc-actions { margin-left: auto; }
.ka-view-switch { display: flex; gap: 2px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.ka-view-switch .btn { min-height: 30px; padding: 0 9px; border: 0; }
.ka-row-actions { display: flex; align-items: center; justify-content: center; gap: 0; }
.ka-row-actions .s-ic { position: static; width: 16px; min-width: 16px; height: 24px; padding: 0; }
.ka-offer-name { min-width: 0; }
.ka-pdf-indicator { display: block; max-width: 100%; margin: 2px 0 0; padding: 0; border: 0; background: transparent; color: var(--action); font: 10px/1.3 var(--sans); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.ka-pdf-indicator.missing { color: var(--danger); }
.ka-pdf-indicator:hover, .ka-pdf-indicator:focus-visible { text-decoration: underline; outline: 1px solid currentColor; outline-offset: 2px; }
.ka-menu-pop { position: fixed; z-index: 10000; display: grid; padding: 5px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); box-shadow: 0 12px 32px rgb(15 23 42 / .22); }
.ka-menu-pop button { min-height: 36px; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: 13px var(--sans); text-align: left; cursor: pointer; }
.ka-menu-pop button:hover, .ka-menu-pop button:focus-visible { background: var(--action-soft); outline: none; }
#s_kaPanel .ka-grid-full { max-width: 100%; overflow: auto; overscroll-behavior-x: contain; }
#s_kaPanel .ka-table-full { width: var(--ka-full-width, 0); min-width: 0; table-layout: fixed; }
#s_kaPanel .ka-table-full col.ka-c-n { width: var(--ka-n-width); }
#s_kaPanel .ka-table-full col.ka-c-code { width: var(--ka-code-width); }
#s_kaPanel .ka-table-full .ka-c-ksr { width: 125px; }
#s_kaPanel .ka-table-full .ka-c-regionCode { width: 76px; }
#s_kaPanel .ka-table-full col.ka-c-name, #s_kaPanel .ka-table-full .ka-c-offerName { width: var(--ka-name-width); }
#s_kaPanel .ka-table-full .ka-c-unit, #s_kaPanel .ka-table-full .ka-c-offerUnit { width: 88px; }
#s_kaPanel .ka-table-full .ka-c-delivery { width: 190px; }
#s_kaPanel .ka-table-full .ka-c-priceVat, #s_kaPanel .ka-table-full .ka-c-price, #s_kaPanel .ka-table-full .ka-c-est { width: 122px; }
#s_kaPanel .ka-table-full .ka-c-defl, #s_kaPanel .ka-table-full .ka-c-gosr { width: 120px; }
#s_kaPanel .ka-table-full .ka-c-conv { width: 90px; }
#s_kaPanel .ka-table-full .ka-c-unitP { width: 170px; }
#s_kaPanel .ka-table-full .ka-c-extraName { width: 180px; }
#s_kaPanel .ka-table-full .ka-c-extraPct { width: 80px; }
#s_kaPanel .ka-table-full .ka-c-extraSum { width: 110px; }
#s_kaPanel .ka-table-full .ka-c-country { width: 160px; }
#s_kaPanel .ka-table-full .ka-c-vat { width: 70px; }
#s_kaPanel .ka-table-full .ka-c-trPct { width: 82px; }
#s_kaPanel .ka-table-full .ka-c-trSum, #s_kaPanel .ka-table-full .ka-c-zsrPct, #s_kaPanel .ka-table-full .ka-c-zsr { width: 108px; }
#s_kaPanel .ka-table-full .ka-c-date { width: 118px; }
#s_kaPanel .ka-table-full .ka-c-inn, #s_kaPanel .ka-table-full .ka-c-kpp { width: 112px; }
#s_kaPanel .ka-table-full .ka-c-supplier { width: 210px; }
#s_kaPanel .ka-table-full .ka-c-site, #s_kaPanel .ka-table-full .ka-c-specLink { width: 200px; }
#s_kaPanel .ka-table-full .ka-c-place { width: 160px; }
#s_kaPanel .ka-table-full .ka-c-status { width: 150px; }
#s_kaPanel .ka-table-full .ka-c-type { width: 112px; }
#s_kaPanel .ka-table-full .ka-parent-value span, #s_kaPanel .ka-table-full .ka-inherited { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#s_kaPanel .ka-table-full td { overflow: hidden; }
#s_kaPanel .ka-table .ka-compact-inherited { display: block; height: 24px; max-width: 100%; overflow: hidden; line-height: 24px; text-overflow: ellipsis; white-space: nowrap; }
#s_kaPanel .ka-table .ka-parent-name-input { display: block; min-height: 24px; margin: 0; padding: 0 3px; resize: none; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; white-space: pre-wrap; font-size: 12px; font-weight: 700; line-height: 1.3; }
#s_kaPanel .ka-table .ka-parent-name-input:hover { border-color: transparent; background: transparent; }
#s_kaPanel .ka-table-full .ka-company-cell { display: flex; align-items: center; gap: 2px; }
#s_kaPanel .ka-table-full .ka-company-cell .s-ic { position: static; flex: 0 0 22px; width: 22px; height: 24px; }
#s_kaPanel .ka-cell-input.ka-manual { border-color: #b88000; background: color-mix(in srgb, #f3b71b 13%, var(--paper)); }
#s_kaPanel .ka-cell-input.ka-invalid, #s_kaPanel input.ka-invalid { border-color: var(--danger); outline-color: var(--danger); }
.ka-pdf-dlg, .ka-attach-dlg, .ka-preflight-dlg { width: min(780px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 30px); padding: 0; overflow: auto; }
.ka-pdf-fields, .ka-attach-body { padding: 14px 18px; }
.ka-pdf-fields > label { display: grid; gap: 5px; margin-bottom: 12px; color: var(--ink-2); font-size: 12px; }
.ka-pdf-fields select, .ka-bulk-files select { min-height: 36px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 7px; background: var(--paper); color: var(--ink); font: inherit; }
.ka-pdf-fields input[type="file"], .ka-bulk-files input[type="file"] { max-width: 100%; }
.ka-attach-list { display: grid; gap: 8px; }
.ka-attach-row { display: grid; grid-template-columns: minmax(180px, 1fr) 90px auto; align-items: end; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
.ka-attach-meta { min-width: 0; }
.ka-attach-meta b, .ka-attach-meta span { display: block; overflow-wrap: anywhere; }
.ka-attach-meta span { margin-top: 4px; color: var(--ink-2); font-size: 12px; }
.ka-attach-row > label { display: grid; gap: 4px; color: var(--ink-2); font-size: 11px; }
.ka-attach-row input { width: 80px; min-height: 32px; }
.ka-attach-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.ka-preflight-lead { padding: 0 18px; color: var(--danger); line-height: 1.5; }
.ka-preflight-list { max-height: 55vh; margin: 0 18px 16px; overflow: auto; }
.ka-preflight-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.ka-preflight-row > div { min-width: 0; }
.ka-preflight-row b, .ka-preflight-row span { display: block; overflow-wrap: anywhere; }
.ka-preflight-row span { margin-top: 3px; color: var(--ink-2); font-size: 12px; }
.ka-preflight-row p { margin: 4px 0 0; color: var(--danger); font-size: 12px; }
.ka-preflight-row .btn { flex: none; }
.ka-bulk-files { display: grid; gap: 6px; min-width: 0; }
.ka-bulk-files small { color: var(--ink-2); line-height: 1.35; }
.ka-import-report { width: min(720px, calc(100vw - 28px)); max-width: none; max-height: calc(100dvh - 30px); padding: 0; overflow: auto; }
.ka-import-report-list { max-height: 50vh; margin: 0 18px; overflow: auto; }
.ka-import-report-list details { margin: 6px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.ka-import-report-list ul { margin: 6px 0 0; padding-left: 20px; }
.ka-import-report-summary { padding: 0 18px; font-size: 14px; line-height: 1.5; }
.ka-simple-invalid { margin: 8px 12px 0; padding: 8px 10px; border: 1px solid #e5bd79; border-radius: 8px; background: #fff8e8; color: #7b5200; font-size: 12px; }
.ka-simple-invalid details { margin-top: 5px; }
.ka-simple-invalid ul { max-height: 160px; margin: 6px 0 0; padding-left: 20px; overflow: auto; }

@media (max-width: 860px) {
  #s_kaPanel .ka-grid-full { overflow: visible; }
  #s_kaPanel .ka-table-full { display: block; width: 100%; min-width: 0; }
  #s_kaPanel .ka-table-full tr.ka-line, #s_kaPanel .ka-table-full tr.ka-of { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #s_kaPanel .ka-table :is(th, td)[data-col="n"], #s_kaPanel .ka-table :is(th, td)[data-col="code"], #s_kaPanel .ka-table :is(th, td)[data-col="name"] { position: static; }
  #s_kaPanel .ka-table-full td { overflow: visible; }
  #s_kaPanel .ka-table-full td[data-col="name"], #s_kaPanel .ka-table-full td[data-col="offerName"], #s_kaPanel .ka-table-full td[data-col="specLink"] { grid-column: 1 / -1; }
  #s_kaPanel .ka-table .ka-parent-name-input { min-height: 32px; }
  #s_kaPanel .ka-table-full .ka-parent-value span, #s_kaPanel .ka-table-full .ka-inherited { white-space: normal; }
  .ka-attach-row { grid-template-columns: minmax(0, 1fr) 82px; }
  .ka-attach-actions { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .ka-doc-actions { margin-left: 0; }
  .ka-doc-actions .btn { min-height: 38px; }
  .ka-preflight-row { align-items: stretch; flex-direction: column; }
  .ka-preflight-row .btn { align-self: flex-start; }
  .ka-attach-row { grid-template-columns: minmax(0, 1fr); }
  .ka-attach-row input { width: 100%; }
  .ka-attach-actions { grid-column: auto; }
}
@media (max-width: 800px) {
  .ka-sup-body { position: relative; display: block; }
  .ka-sup-document { height: 100%; }
  .ka-saved-pane { position: absolute; inset: 0; z-index: 2; border-left: 0; }
  .ka-saved-head { padding: 12px; }
  .my-actions.ka-sup-tools { padding: 10px 12px; }
  .ka-sup-list { padding: 12px; }
}
@media (max-width: 500px) {
  .s-mydlg.ka-suppliers-dlg { width: calc(100vw - 16px); height: calc(100dvh - 24px); max-height: none; }
  .ka-sup-buttons { width: 100%; }
  .ka-sup-buttons .btn { flex: 1 1 auto; }
  .ka-saved-back { min-height: 34px; }
}
