/* Телефонные медиазапросы: кроме ширины окна - сенсорный экран и узкая сторона экрана устройства (телефон лежа,
   широкий веб-вью, «Версия для ПК» в браузере). Пояснение - в начале style.css (01.11.2026). */
/* Вкладка «Смета» (est-ui.js): лист сметы, журналы работ и товаров, спецификации, окно выбора строки, лист печати. */

/* ───── вкладка в шапке и место в окне ───── */
.tab.est-tab { flex: none; border-color: var(--accent); color: var(--accent-ink, var(--accent)); background: var(--surface); font-weight: 800; }
.tab.est-tab small { font-weight: 700; margin-left: 4px; opacity: .85; }
.tab.est-tab.active { background: var(--accent); color: var(--accent-fg, #fff); }
.app.est-on > .panel, .app.est-on > .stage { display: none; }
.res.est-go { cursor: pointer; } /* плашки «Смета» и «Всего» над чертежом открывают вкладку */
.est-view { grid-column: 1 / -1; min-height: 0; overflow-y: auto; scrollbar-width: thin; padding-bottom: 24px; }

/* ───── панель вкладки: страницы и действия ───── */
.est-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 0 10px; background: var(--bg); }
.est-seg { flex: none; }
.est-seg .seg-btn { padding: 7px 14px; }
.est-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.est-find { border: 1px solid var(--line2); background: var(--surface); color: var(--text); border-radius: var(--r-sm); padding: 6px 9px; min-width: 0; width: 220px; }
.est-jnote { color: var(--dim); font-size: 12px; }

/* ───── лист ───── */
.est-sheet { max-width: 1180px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 22px 22px; }
.est-sheet.wide { max-width: 1400px; }
.est-head h1 { margin: 0; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; }
.est-sub { color: var(--muted); font-weight: 600; margin-top: 2px; }
.est-head .est-sub { max-width: 980px; }
.est-who { color: var(--muted); font-size: 13px; }
/* заказ дилера у дилера: «Заказ комплектующих» / «Смета для клиента» (27.10.2026) и клиент дилера в смете для клиента */
.est-mode { display: inline-flex; margin: 0 0 12px; }
.est-cwho { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 8px; font-size: 13px; }
.est-cwho label { display: flex; flex-direction: column; gap: 2px; color: var(--muted); flex: 1 1 220px; max-width: 420px; }
.est-cwho input { font: inherit; color: var(--text); }
.est-note { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding: 9px 12px; border: 1px solid rgba(183,121,31,.35); background: rgba(183,121,31,.07); color: var(--warn); border-radius: var(--r-sm); font-weight: 600; font-size: 13px; }
.est-note span { flex: 1 1 320px; }
.est-note.info { color: var(--accent-ink, var(--accent)); border-color: var(--accent-line); background: var(--accent-soft); }
/* заказ 1С из сметы (est-ui.js, o1cHtml): заявка в работе - info, заказ создан - ok, отказ - err; пояснения и предупреждения 1С - строками ниже */
.est-o1c small, .est-o1c ul { flex: 1 1 100%; font-weight: 500; }
.est-o1c ul { margin: 0; padding-left: 18px; }
.est-o1c.ok { color: var(--ok); border-color: rgba(18,150,94,.4); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: rgba(18,150,94,.07); background: color-mix(in srgb, var(--ok) 8%, transparent); }
.est-o1c.err { color: var(--err); border-color: rgba(210,59,59,.4); border-color: color-mix(in srgb, var(--err) 45%, transparent); background: rgba(210,59,59,.06); background: color-mix(in srgb, var(--err) 7%, transparent); }

/* ───── блок потолка: чертеж с допами и калькуляция ───── */
.est-room { margin-top: 18px; padding-top: 14px; border-top: 3px solid var(--accent); }
.est-room-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 10px; }
.est-room-head h2 { margin: 0; font-size: 17px; }
.est-room-head h2 .n { color: var(--accent-ink, var(--accent)); }
.est-room-head .btn { margin-left: auto; }
.est-chips { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.est-chips span { background: var(--surface2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 600; color: var(--muted); }
.est-room-body { display: grid; grid-template-columns: minmax(260px, 400px) minmax(0, 1fr); gap: 18px; align-items: start; }
.est-room-body.one { grid-template-columns: minmax(0, 1fr); }
.est-svg { display: block; width: 100%; height: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); }
.est-svg * { cursor: default !important; pointer-events: none; }
.est-nodraw { border: 1px dashed var(--line2); border-radius: var(--r-md); padding: 28px 12px; text-align: center; color: var(--dim); }
.est-legend { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.est-legend li { display: grid; grid-template-columns: minmax(48px, auto) 1fr auto; gap: 8px; padding: 3px 2px; border-bottom: 1px solid var(--line); }
.est-legend li b { color: var(--accent-ink, var(--accent)); white-space: nowrap; }
.est-legend li i { font-style: normal; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.est-legend.none { color: var(--dim); font-size: 12px; margin-top: 6px; }
.est-scroll { overflow-x: auto; }

/* ───── таблица калькуляции ───── */
.est-tbl { margin-top: 0; }
.est-tbl th.q, .est-tbl th.p, .est-tbl th.s { text-align: right; }
.est-tbl td.no { width: 30px; color: var(--dim); font-weight: 700; }
.est-tbl td.nm { min-width: 168px; }
.est-tbl td.nm .t { font-weight: 600; }
.est-tbl .tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; vertical-align: 1px; background: var(--accent-soft); color: var(--accent-ink, var(--accent)); }
.est-tbl .tag.g { background: rgba(18,150,94,.1); color: var(--ok); }
.est-tbl .mk { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 700; white-space: nowrap; }
.est-tbl td.un { color: var(--muted); white-space: nowrap; }
.est-tbl td.q, .est-tbl td.p, .est-tbl td.s { text-align: right; white-space: nowrap; }
.est-tbl td.q input { width: 72px; text-align: right; }
.est-tbl td.p input { width: 90px; text-align: right; }
.est-tbl td.s { font-weight: 700; min-width: 96px; }
.est-tbl td.x { width: 28px; text-align: right; }
/* скидка строки (21.10.2026): процент и цена со скидкой - как в заказе 1С; своя скидка строки выделена, у остальных - скидка на все строки */
.est-tbl th.dc, .est-tbl th.dp, .est-tbl td.dc, .est-tbl td.dp { text-align: right; white-space: nowrap; }
.est-tbl th.dc, .est-tbl th.dp { white-space: normal; line-height: 1.15; } /* заголовок в две строки: таблица помещается рядом с чертежом */
.est-tbl td.dc input { width: 56px; text-align: right; }
.est-tbl td.dp input { width: 90px; text-align: right; }
.est-tbl td.dc.own input { border-color: var(--accent); background: var(--accent-soft); }
.est-tbl td.dp input:placeholder-shown, .est-tbl td.dc input:placeholder-shown { color: var(--muted); }
/* цена со скидкой - зеленым и чуть жирнее (05.11.2026, владелец: «цену в поле со скидкой подсвечивай зеленым и чуть жирнее шрифт и так
   же в итого»): поле с введенной скидкой и цена со скидкой текстом; итоги со скидкой - класс dsc (est-ui.js), ниже и в .est-total */
.est-tbl td.dp, .est-tbl td.dp input:not(:placeholder-shown) { color: var(--ok); font-weight: 600; }
.est-tbl tr.est-kid td.dp { color: var(--ok); font-weight: 400; }
.est-tbl tr.dsc td.s { color: var(--ok); font-weight: 900; }
.est-tbl tr.pman td.p input { border-color: var(--warn); background: rgba(183,121,31,.07); }
.est-tbl td.p .est-ic { margin: 0 2px 0 0; }
.est-tbl tr.over td.q input { border-color: var(--warn); background: rgba(183,121,31,.07); }
.est-ic { border: 0; background: none; color: var(--warn); cursor: pointer; font-size: 15px; padding: 2px 3px; margin-left: 2px; border-radius: 6px; }
@media (hover: hover) { .est-ic:hover { background: var(--surface2); } }
.est-ic.off { visibility: hidden; }
.est-tbl tr.est-kid td { color: var(--muted); font-size: 12px; padding-top: 1px; padding-bottom: 1px; border-bottom-style: dashed; }
.est-tbl tr.est-kid td.nm { padding-left: 16px; }
.est-tbl tr.est-kid td.nm::before { content: '↳ '; color: var(--dim); }
.est-tbl tr.est-kid td.nm small { margin-left: 8px; color: var(--dim); }
.est-tbl tr.est-kid td.s { font-weight: 600; }
.est-tbl tr.est-empty td { color: var(--dim); text-align: center; padding: 14px 6px; }
.est-tbl tfoot td { border-bottom: 0; border-top: 2px solid var(--accent-soft); padding-top: 7px; font-weight: 800; }
.est-tbl tfoot td small { margin-left: 10px; color: var(--dim); font-weight: 600; font-size: 12px; }
.est-hidden { margin-top: 8px; font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.est-hidden .chip { padding: 2px 9px; font-size: 12px; }
.est-add { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
/* кнопки добавления строк сметы и накладной заказа дилера: крупные и выделены, «+ Товар» - самая яркая (20.10.2026: накладная -
   построитель 173, розничная смета - 174) */
.est-add .est-add-btn { justify-content: center; min-height: 42px; padding: 10px 20px; border-radius: var(--r-md); font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.est-add .est-add-btn.w { background: var(--accent-soft); border: 1.5px solid var(--accent-ink); color: var(--accent-ink); }
@media (hover: hover) { .est-add .est-add-btn.w:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #fff); } }
.est-add .est-add-btn.g { border: 1.5px solid var(--accent); color: var(--accent-fg, #fff); background: linear-gradient(135deg, var(--accent-top) 0%, var(--accent) 55%, var(--accent-hot) 100%); box-shadow: 0 3px 10px var(--accent-glow); }
@media (hover: hover) { .est-add .est-add-btn.g:hover { background: var(--accent-hot); border-color: var(--accent-hot); box-shadow: 0 2px 6px var(--accent-glow); } }
@media (max-width: 520px), screen and (pointer: coarse) and (max-device-width: 520px), screen and (pointer: coarse) and (max-device-height: 520px) { .est-add .est-add-btn { flex: 1 1 0; } }

/* ───── итог ───── */
.est-total { margin-top: 22px; padding-top: 14px; border-top: 3px solid var(--accent); display: flex; justify-content: flex-end; }
.est-total table { border-collapse: collapse; min-width: min(520px, 100%); font-variant-numeric: tabular-nums; }
.est-total td { padding: 5px 4px; border-bottom: 1px solid var(--line); }
.est-total td:last-child { text-align: right; white-space: nowrap; font-weight: 700; padding-left: 24px; }
.est-total td small { display: block; color: var(--dim); font-weight: 600; font-size: 12px; }
.est-total tr.sum td { font-weight: 800; }
.est-total tr.disc td { color: var(--muted); }
.est-total tr.grand td { border-bottom: 0; font-size: 20px; font-weight: 800; padding-top: 10px; }
.est-total tr.grand td:last-child { color: var(--accent-ink, var(--accent)); font-size: 24px; }
.est-total tr.grand.dsc td:last-child { color: var(--ok); font-weight: 900; } /* итог со скидкой - зеленым, как цена со скидкой */
.est-disc { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.est-disc input { width: 76px; text-align: right; }

/* ───── журналы ───── */
.est-jr { margin-top: 12px; }
.est-jr td { padding: 3px 4px; }
.est-jr td.nm { min-width: 220px; width: 34%; }
.est-jr td.un { width: 84px; }
.est-jr td.p { width: 110px; }
.est-jr td.p input { text-align: right; }
.est-jr td.by { width: 20%; min-width: 150px; }
.est-jr td.on { width: 16%; min-width: 130px; }
.est-jr td.sp { white-space: nowrap; color: var(--dim); font-size: 12px; }
.est-jr td.sp .btn.ghost { border-color: var(--line); }
.est-jr td.x { width: 28px; text-align: right; }
.est-jr select.sel { width: 100%; padding: 7px 6px; }
.est-jr tr.est-empty td { color: var(--dim); text-align: center; padding: 18px 8px; }
.est-start { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin-top: 12px; font-size: 12px; }
.est-start span { max-width: 520px; text-align: left; }

/* ───── окна: выбор строки, спецификация ───── */
.dlg.est-pick { width: min(640px, 94vw); }
.dlg.est-spec { width: min(760px, 94vw); }
.dlg.est-pick .est-find { width: 100%; }
.est-pick-list { margin-top: 10px; max-height: min(46vh, 420px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.est-pick-list .hint { padding: 12px; margin: 0; }
.est-pick-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 10px; cursor: pointer; color: var(--text); }
.est-pick-row:last-child { border-bottom: 0; }
@media (hover: hover) { .est-pick-row:hover { background: var(--accent-soft); } }
.est-pick-row:disabled { color: var(--dim); cursor: default; background: none; }
.est-pick-row .nm { font-weight: 600; }
.est-pick-row .nm small { display: block; font-weight: 500; color: var(--dim); font-size: 12px; }
.est-pick-row .pr { white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.est-own { margin-top: 14px; }
.est-own .set-head { margin: 10px 0 6px; font-size: 13px; }
.est-own-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 76px 100px auto; gap: 6px; align-items: center; }
/* набор подряд (20.10.2026): подсказка под поиском, отметка «в заказе» у строки, строка «добавлено» под списком, окно количества */
.est-pick-keys { margin-top: 6px; font-size: 12px; color: var(--dim); line-height: 1.35; }
@media (pointer: coarse) { .est-pick-keys .k { display: none; } }
.est-pick-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.est-pick-row .nm small.in { color: var(--ok); font-weight: 700; }
.est-pick-log { display: flex; align-items: center; gap: 8px 12px; margin-top: 8px; padding: 8px 10px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 13px; }
.est-pick-log[hidden] { display: none; }
.est-pick-log.bad { background: var(--surface2); color: var(--warn); font-weight: 600; }
.est-pick-log .est-pick-msg { flex: 1 1 auto; min-width: 0; display: flex; gap: 6px; align-items: baseline; }
.est-pick-log .ok { color: var(--ok); font-weight: 800; }
.est-pick-log .t { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.est-pick-log .t small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; }
.est-pick-log .btn { flex: none; }
.dlg.est-qty { width: min(400px, 92vw); }
.est-qty-nm { font-weight: 700; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.est-qty-sub { margin-top: 4px; color: var(--muted); font-size: 13px; }
.est-qty-sub:empty { display: none; }
.est-qty-row { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.est-qty-row input { flex: 1 1 auto; min-width: 0; font-size: 22px; font-weight: 700; text-align: center; padding: 8px 10px; font-variant-numeric: tabular-nums; }
.est-qty-row .un { flex: none; color: var(--muted); font-weight: 600; min-width: 28px; }
.est-qty-row .btn.icon { flex: none; width: 44px; height: 44px; font-size: 20px; font-weight: 700; }
.est-qty-sum { min-height: 18px; margin-top: 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.est-qty-sum.bad { color: var(--warn); font-weight: 600; }
.est-qty-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.est-qty-acts .btn { min-width: 110px; }
.est-qty-keys { margin-top: 10px; font-size: 11.5px; color: var(--dim); }
@media (pointer: coarse) { .est-qty-keys { display: none; } }
.est-tbl tr.est-flash td { animation: est-flash 1.6s ease-out; }
@keyframes est-flash { from { background: var(--accent-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) { .est-tbl tr.est-flash td { animation: none; background: var(--accent-soft); } }
.est-jr td.pd { width: 96px; }
.est-jr td.pd input { text-align: right; }
.est-jr td.pd input:placeholder-shown { background: var(--surface2); }
.est-spec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.est-spec-title b { font-size: 16px; }
.est-spec-title span { color: var(--muted); font-size: 13px; }
.est-spec-foot { margin-top: 10px; color: var(--muted); font-size: 13px; }
.est-spec-foot b { color: var(--text); }

@media (max-width: 960px), screen and (pointer: coarse) and (max-device-width: 540px), screen and (pointer: coarse) and (max-device-height: 540px) {
  .est-view { overflow: visible; }
  .est-bar { position: static; }
  .est-tools { margin-left: 0; }
  .est-sheet { padding: 12px 12px 16px; }
  .est-room-body { grid-template-columns: minmax(0, 1fr); }
  .est-draw { max-width: 460px; }
  .est-find { width: 100%; }
}
@media (max-width: 520px), screen and (pointer: coarse) and (max-device-width: 520px), screen and (pointer: coarse) and (max-device-height: 520px) {
  .est-seg .seg-btn { padding: 7px 8px; }
  .est-own-row { grid-template-columns: 1fr 1fr; }
  .est-own-row input[type=text]:first-child { grid-column: 1 / -1; }
  .est-pick-log { flex-wrap: wrap; }
  .est-qty-acts .btn { flex: 1 1 0; min-width: 0; }
  .est-tbl td.q input { width: 60px; padding: 5px 4px; } .est-tbl td.p input { width: 68px; padding: 5px 4px; }
  .est-tbl td.dc input { width: 46px; padding: 5px 4px; } .est-tbl td.dp input { width: 68px; padding: 5px 4px; }
  .est-tbl td.nm { min-width: 120px; } .est-tbl td.s { min-width: 70px; } .est-tbl td.no { width: 16px; }
  .est-tbl .tag { margin-left: 0; display: table; } /* вид строки - под названием */
  .est-total table { min-width: 100%; }
}

/* ───── лист печати сметы (#printSheet: виден только при печати - style.css) ───── */
.pe { font-size: 12px; color: #000; }
.pe-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 3px solid #0B6BD3; padding-bottom: 6px; margin-bottom: 10px; }
.pe-head svg { height: 40px; width: auto; }
.pe-meta { text-align: right; font-size: 11px; color: #444; }
.pe h1 { margin: 0; font-size: 20px; }
.pe-sub { color: #444; margin-top: 2px; }
.pe-room { margin-top: 12px; break-inside: avoid; page-break-inside: avoid; }
.pe-room h2 { display: flex; justify-content: space-between; align-items: flex-end; gap: 4mm; margin: 0 0 6px; font-size: 14px; border-bottom: 2px solid #0B6BD3; padding-bottom: 3px; }
.pe-room h2 small { font-weight: 400; color: #555; font-size: 11px; margin-left: 6px; }
/* печать = PDF сметы (07.11.2026): план помещения с выносками объектов и допы рядом, штрих-код изделия справа в строке помещения,
   отступы объектов таблицей, в конце итог, примечание и подпись клиента на одной странице */
.pe-code { flex: 0 0 auto; height: 10mm; width: auto; }
.pe-plan { display: grid; grid-template-columns: 112mm minmax(0, 1fr); gap: 5mm; align-items: start; margin-bottom: 2mm; }
.pe-draw svg { display: block; width: 100%; height: auto; border: 1px solid #ddd; border-radius: 6px; }
.pe-lg { list-style: none; margin: 0; padding: 0; font-size: 10.5px; }
.pe-lg li { padding: 1px 0; }
.pe-cap { margin: 2mm 0 1mm; font-size: 9.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: #0B6BD3; }
.pe-fix td { font-size: 10.5px; padding: 1px 4px; }
.pe-note { margin: 1mm 0 3mm; font-size: 9.5px; color: #555; }
.pe-end { break-inside: avoid; page-break-inside: avoid; }
.pe-sign { margin-top: 8mm; font-size: 12px; }
.pe-sign-row { display: grid; grid-template-columns: 1fr 1.6fr .8fr; gap: 8mm; margin-top: 9mm; }
.pe-sign-row span { display: block; min-height: 5mm; padding: 0 2px; border-bottom: 1px solid #000; }
.pe-sign-row small { display: block; margin-top: 1mm; font-size: 9.5px; color: #555; }
/* смета помещения на листе печати - блоком, как в PDF для монтажников и PDF сметы (07.11.2026, est-ui.js estBox): рамка, суммы
   справа, ИТОГО белым по синему; цвета фона - и при печати без фоновых рисунков */
.pe-est { margin: 1mm 0 3mm; padding: 1.5mm 2.5mm 2mm; border: 2px solid #0B6BD3; border-radius: 2.5mm; background: #f6faff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.pe-est h3 { margin: 0 0 1mm; font-size: 9.5px; letter-spacing: .4px; text-transform: uppercase; color: #0B6BD3; }
.pe-est table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pe-est th, .pe-est td { border-bottom: 1px solid #d9dde6; padding: 2px 4px; text-align: left; vertical-align: top; }
.pe-est th { font-size: 9.5px; text-transform: uppercase; color: #0B6BD3; }
.pe-est th:last-child, .pe-est td:last-child { text-align: right; white-space: nowrap; }
.pe-est td:first-child { font-weight: 700; }
.pe-est tr.kid td { color: #555; font-size: 10.5px; }
.pe-est tr.tot td { border: 0; padding: 4px 6px; background: #0B6BD3; color: #fff; font-size: 14px; font-weight: 800; }
.pe-tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.pe-tbl th { text-align: left; font-size: 9.5px; text-transform: uppercase; color: #0B6BD3; border-bottom: 2px solid #cfe1f6; padding: 2px 4px; }
.pe-tbl td { border-bottom: 1px solid #ddd; padding: 2px 4px; vertical-align: top; }
.pe-tbl .r { text-align: right; white-space: nowrap; }
.pe-tbl tr.kid td { color: #555; font-size: 10.5px; }
.pe-tbl tr.kid td:nth-child(2) { padding-left: 14px; }
.pe-tbl tfoot td { border-bottom: 0; border-top: 2px solid #cfe1f6; font-weight: 700; }
.pe-total { margin: 14px 0 0 auto; border-collapse: collapse; min-width: 90mm; font-variant-numeric: tabular-nums; }
.pe-total td { padding: 3px 4px; border-bottom: 1px solid #ddd; }
.pe-total td:last-child { text-align: right; white-space: nowrap; font-weight: 700; padding-left: 10mm; }
.pe-total tr.sum td { font-weight: 700; }
.pe-total tr.grand td { border-bottom: 0; border-top: 3px solid #0B6BD3; font-size: 16px; font-weight: 800; padding-top: 6px; }
.pe-foot { margin-top: 10px; font-size: 10px; color: #777; }
/* строка шапки листа (20.10.2026): долг дилера, прайс объекта (вид цен 1С, без выбора) и оплата - одной строкой, на узком экране с переносом */
.est-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 8px; font-size: 13px; }
.est-meta .est-debt { display: inline-flex; align-items: baseline; gap: 6px; margin: 0; padding: 3px 10px; font-size: 13px; font-weight: 700; border-radius: 999px; }
.est-meta .est-debt small { font-size: 12px; }
.est-kind, .est-pay { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; cursor: help; }
.est-kind > span, .est-pay > span { color: var(--muted); }
.est-kind small, .est-pay small { color: var(--muted); }
/* заказ дилера: выбор оплаты (СБП | наличные) и строка скидки за наличную оплату в итогах */
.est-pay .seg { flex: 0 0 auto; margin: 0; cursor: default; }
.est-total tr.disc.cash td { color: inherit; font-weight: 700; }
.est-tbl td.p .p1c { display: inline-block; min-width: 4em; text-align: right; font-weight: 600; }
.est-tbl td.p .p1c.plock { font-weight: 500; cursor: help; } /* цена строки журнала без права ручных цен в 1С (16.10.2026) */
.est-tbl small.c1c { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 999px; font-size: 10px; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.est-tbl small.c1c.miss { background: transparent; color: var(--warn); }
.est-tbl small.c1c.need { background: rgba(183,121,31,.14); color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
/* пометки цены («нет в 1С», «пересчет после записи», «выберите фактуру») - под полем цены, в две строки: колонка цены не шире
   поля, таблица помещения с колонками скидки помещается в 1366 px (21.10.2026) */
.est-tbl td.p small.c1c.miss, .est-tbl td.p small.c1c.need { display: block; width: fit-content; max-width: 92px; margin: 3px 0 0 auto; white-space: normal; text-align: right; line-height: 1.25; }
/* оплата заказа 1С из сметы (12.10.2026, pay-ui.js): окно оплаты и оплаты заказа под итогом */
.dlg.est-payw { width: min(580px, 94vw); }
.dlg.est-payw .est-note { margin-top: 10px; }
.dlg.est-payw .est-note ul { flex: 1 1 100%; margin: 0; padding-left: 18px; font-weight: 500; }
.payw-order { margin-top: 10px; font-size: 13px; color: var(--muted); }
.payw-order:first-child { margin-top: 0; }
.payw-order b { color: var(--text); }
.payw-nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.payw-nums div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 7px 10px; min-width: 0; }
.payw-nums span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.payw-nums b { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payw-nums .rest { border-color: var(--accent-line); background: var(--accent-soft); }
.payw-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 10px; }
.payw-row > span { flex: 0 0 104px; color: var(--muted); font-weight: 600; font-size: 13px; }
.payw-row .sel, .payw-row input { flex: 1 1 200px; width: auto; }
.payw-row input[data-pw="sum"] { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.payw-seg { margin-top: 14px; }
.payw-hint { margin-top: 6px; min-height: 18px; font-size: 13px; color: var(--muted); }
.payw-hint b { color: var(--warn); }
.payw-debt { margin-top: 8px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.payw-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.payw-wait { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 14px; padding: 12px 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-sm); }
.payw-wait small { color: var(--muted); }
.payw-list { margin-top: 14px; }
.payw-qrpaid { margin-top: 8px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.payw-qrbox { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 14px 18px; margin-top: 14px; }
.payw-qr { flex: 0 0 auto; width: 240px; height: 240px; max-width: 100%; box-sizing: border-box; padding: 8px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-sm); image-rendering: pixelated; }
.payw-qr.none { display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; font-size: 13px; line-height: 1.4; color: var(--muted); image-rendering: auto; }
.payw-qrside { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 13px; line-height: 1.4; }
.payw-qrsum { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.payw-qrstate { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-sm); }
.payw-qrstate b { display: block; }
.payw-qrstate small { display: block; margin-top: 2px; color: var(--muted); }
.payw-qrmeta { margin-top: 10px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.payw-qrfor { margin-top: 12px; padding: 10px 12px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.payw-paid { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 14px; padding: 22px 16px; text-align: center; color: var(--ok); border: 1px solid rgba(18,150,94,.4); border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: rgba(18,150,94,.07); background: color-mix(in srgb, var(--ok) 8%, transparent); border-radius: var(--r-sm); }
.payw-paid-mark { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 800; color: var(--on-ok, #fff); background: var(--ok); }
.payw-paid-title { font-size: 24px; font-weight: 800; }
.payw-paid-sum { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }
.payw-paid-what { font-size: 14px; line-height: 1.45; color: var(--text); overflow-wrap: anywhere; }
.payw-paid small { max-width: 460px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.payw-list summary { cursor: pointer; font-weight: 700; font-size: 13px; }
.est-pays { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.est-pays header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.est-pays header h2 { margin: 0; font-size: 15px; }
.est-pays header small { flex: 1 1 200px; color: var(--muted); }
.est-pays-sum { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.est-pays-sum b { color: var(--text); font-variant-numeric: tabular-nums; }
.est-pays-sum .rest b { color: var(--accent-ink, var(--accent)); }
.est-pays-none { margin-top: 8px; font-size: 13px; color: var(--dim); }
.est-pays-tbl { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.est-pays-tbl th { text-align: left; padding: 3px 6px 3px 0; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border-bottom: 1px solid var(--line); }
.est-pays-tbl td { padding: 5px 6px 5px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.est-pays-tbl .s { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-right: 16px; }
.est-pays-tbl td small { display: block; color: var(--dim); font-size: 11.5px; }
.est-pays-tbl tr.off td { color: var(--dim); }
@media (max-width: 520px), screen and (pointer: coarse) and (max-device-width: 520px), screen and (pointer: coarse) and (max-device-height: 520px) { .payw-nums b { font-size: 14px; } .payw-row > span { flex-basis: 100%; } .payw-foot .btn { flex: 1 1 auto; } .est-pays-tbl th:first-child, .est-pays-tbl td:first-child { width: 78px; }
  .payw-qrbox { justify-content: center; } .payw-qrside { align-items: stretch; text-align: center; } .payw-seg .seg-btn { padding-left: 8px; padding-right: 8px; } }
/* блок «Себестоимость в 1С» под итогом заказа дилера (cost-ui.js, 20.10.2026): рамка и сводка - как у «Оплата заказа в 1С» */
.est-cost h3 { margin: 12px 0 0; font-size: 13px; font-weight: 700; }
.est-cost h3 b { font-variant-numeric: tabular-nums; }
.est-cost h3 small { margin-left: 6px; font-weight: 400; color: var(--muted); }
.est-cost-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.est-cost-tbl { min-width: 640px; }
.est-cost-zp { min-width: 520px; }
.est-cost-tbl td:first-child { max-width: 320px; overflow-wrap: anywhere; }
.est-cost-tbl .s small.u { display: inline; }
.est-cost-tbl tfoot td { padding: 5px 6px 5px 0; font-weight: 800; border-top: 1px solid var(--line); }
.est-cost .s.neg, .est-cost b.neg { color: var(--err); }
.est-cost-note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.est-cost-note span { flex: 1 1 260px; }
.est-cost-note.list { display: block; }
.est-cost-note.list span { display: block; }
.est-cost-note.err { color: var(--err); }
.est-cost-warn { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--dim); }
.est-cost-rows { margin-top: 8px; }
.est-cost-rows summary { cursor: pointer; font-size: 13px; color: var(--accent-ink, var(--accent)); }
@media print { .est-pays { display: none; } }
/* «Зарплата по заказу (1С)» под итогом (salary1c-ui.js, 27.10.2026): заказы 1С объекта, строки исполнителей, отметки */
.est-sal1c .sal1c-order { margin-top: 12px; padding-top: 2px; border-top: 1px dashed var(--line); }
.est-sal1c header + .sal1c-order, .est-sal1c .est-pays-sum + .sal1c-order { border-top: 0; }
.est-sal1c .sal1c-team { margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.est-sal1c .sal1c-team small { color: var(--dim); }
.sal1c-tbl { min-width: 620px; }
.sal1c-tbl tr.sal1c-sub td { padding-top: 9px; font-size: 12px; font-weight: 700; color: var(--muted); }
.sal1c-tbl .dim { font-weight: 400; color: var(--dim); }
.sal1c-mark { font-size: 11.5px; font-weight: 700; }
.sal1c-mark.done { color: var(--ok); }
.sal1c-mark.wait { color: var(--accent-ink, var(--accent)); }
/* «Монтажникам по ставкам 1С» в блоке зарплаты (salary1c-ui.js, zpmount.js, 07.11.2026): ЗП бригады по смете, как «Рассчитать ЗП» монтажа 1С */
.est-sal1c .sal1c-mount { margin-top: 10px; }
.sal1c-mz { min-width: 440px; }
.sal1c-mz td:first-child { overflow-wrap: anywhere; }
.sal1c-mz tfoot td { padding: 5px 6px 5px 0; font-weight: 800; border-top: 1px solid var(--line); }
.sal1c-mz .mz-q { display: none; }
/* телефон: работа и сумма, «количество × ставка» - строкой под работой */
@media (max-width: 520px), screen and (pointer: coarse) and (max-device-width: 520px), screen and (pointer: coarse) and (max-device-height: 520px) {
  .sal1c-mz { min-width: 0; }
  .est-pays-tbl.sal1c-mz th:first-child, .est-pays-tbl.sal1c-mz td:first-child { width: auto; }
  .sal1c-mz th:nth-child(2), .sal1c-mz th:nth-child(3), .sal1c-mz tbody td:nth-child(2), .sal1c-mz tbody td:nth-child(3) { display: none; }
  .sal1c-mz .mz-q { display: block; } }
/* заказ дилера - накладная (09.10.2026): потолок - строка товара с номером изделия, его строки - под ним с чертой слева */
.est-inv { margin-top: 16px; }
.est-inv-tbl th.cd, .est-inv-tbl td.cd { width: 70px; white-space: nowrap; }
.est-code { display: inline-block; border: 1px solid var(--accent-line); background: var(--surface); color: var(--accent-ink, var(--accent)); border-radius: 6px; padding: 1px 7px; font: inherit; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; cursor: pointer; }
@media (hover: hover) { button.est-code:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-fg, #fff); } }
.est-code.sub { border-color: transparent; background: none; padding: 1px 0; color: var(--dim); font-size: 12px; font-weight: 700; cursor: default; }
.est-inv-tbl tbody.est-grp { border-top: 2px solid var(--accent-line); }
.est-inv-tbl tr.ceil td, .est-inv-tbl tr.est-ceil0 td { background: var(--accent-soft); }
.est-inv-tbl tr.ceil td.nm .t { font-weight: 800; }
.est-inv-tbl tr.est-ceil0 td.nm .t { font-weight: 700; color: var(--muted); }
.est-inv-tbl td.nm small.sub { display: block; margin-top: 1px; color: var(--muted); font-size: 12px; font-weight: 600; }
.est-inv-tbl tr.est-ceil0 td.nm small.sub { color: var(--warn); }
.est-inv-tbl tr.att td.nm { box-shadow: inset 3px 0 0 var(--accent); padding-left: 14px; }
.est-inv-tbl tr.att ~ tr.est-kid td.nm { box-shadow: inset 3px 0 0 var(--accent); padding-left: 28px; }
.est-inv-tbl tr.est-gsum td { border-bottom: 0; padding-top: 5px; padding-bottom: 9px; font-weight: 800; }
.est-inv-tbl tr.est-gsum td[colspan] { text-align: right; color: var(--muted); }
.est-inv-tbl tr.est-gsum td small { margin-left: 10px; color: var(--dim); font-weight: 600; font-size: 12px; }
.est-inv-tbl tr.est-gh td { padding-top: 10px; color: var(--muted); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
/* пояснение блока «Материалы по чертежу» заказа дилера по чертежу (26.10.2026): строкой ниже, обычным регистром */
.est-inv-tbl tr.est-gh td small { display: block; margin-top: 2px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--dim); }
.est-inv-tbl tr.est-ghid td { font-size: 12px; color: var(--dim); }
.est-inv-tbl tr.est-ghid .chip { padding: 2px 9px; font-size: 12px; }
.est-inv-add label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; color: var(--muted); font-size: 13px; font-weight: 600; }
.est-inv-add select.sel { width: auto; min-width: 0; max-width: min(340px, 100%); padding: 5px 6px; }
@media (max-width: 520px), screen and (pointer: coarse) and (max-device-width: 520px), screen and (pointer: coarse) and (max-device-height: 520px) { .est-inv-tbl th.cd, .est-inv-tbl td.cd { width: 50px; } .est-code { font-size: 12px; padding: 1px 4px; } .est-inv-tbl tr.est-gsum td small { display: none; } }
/* накладная на бумаге */
.pe-inv { margin-top: 10px; }
.pe-inv tbody { break-inside: avoid; page-break-inside: avoid; }
.pe-inv tbody tr:first-child td { border-top: 1.5px solid #0B6BD3; }
.pe-inv td.cd { white-space: nowrap; font-weight: 700; color: #0B6BD3; }
.pe-inv td small { display: block; font-weight: 400; color: #555; font-size: 10.5px; }
.pe-inv tr.ceil td { font-weight: 700; }
.pe-inv tr.att td.cd { color: #777; font-weight: 400; }
.pe-inv tr.att td:nth-child(3) { border-left: 2px solid #0B6BD3; padding-left: 8px; }
.pe-inv tr.gsum td { font-weight: 700; border-bottom: 0; }
.pe-inv tr.gsum td[colspan] { text-align: right; }
.pe-inv tr.gh td { color: #555; font-weight: 700; font-size: 10.5px; text-transform: uppercase; padding-top: 6px; }

/* спецификации работ из комплектующих 1С (09.10.2026): материалы «в цене работы», пометки журналов, поиск 1С в окне спецификации */
.est-tbl tr.est-kid.inc td.nm::before { content: ''; }
.est-tbl tr.est-kid.inc td.nm small { margin-left: 0; display: block; white-space: normal; line-height: 1.35; color: var(--dim); }
.est-jr .jmeta { display: flex; flex-wrap: wrap; gap: 3px 8px; margin: 3px 0 1px; font-size: 11.5px; line-height: 1.3; }
.est-jr .jcode { color: var(--dim); font-variant-numeric: tabular-nums; }
.jmark { display: inline-flex; align-items: center; gap: 4px; padding: 1px 4px 1px 7px; border-radius: 6px; background: rgba(183,121,31,.12); color: var(--warn); font-weight: 600; font-size: 11.5px; line-height: 1.35; }
.jmark .x { min-width: 18px; height: 18px; padding: 0; font-size: 14px; line-height: 1; color: var(--warn); }
.est-jr tr.marked td.nm { box-shadow: inset 3px 0 0 var(--warn); }
.est-tools .btn.on { background: rgba(183,121,31,.14); border-color: var(--warn); color: var(--warn); }
.est-spec-title .jmark { flex-basis: 100%; justify-content: flex-start; }
.dlg.est-spec { width: min(860px, 96vw); }
.dlg.est-spec th.in, .dlg.est-spec td.in { width: 76px; white-space: nowrap; }
.dlg.est-spec td.in .chk { font-size: 12px; color: var(--muted); }
.dlg.est-spec td.s .dim, .dlg.est-spec td.p .dim { color: var(--dim); font-size: 12px; font-weight: 500; }
.dlg.est-spec tr.miss td { color: var(--warn); font-size: 12px; }
.est-own .est-find { width: 100%; }
.est-spec1c { margin: 6px 0 10px; max-height: min(34vh, 300px); overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-sm); }
.est-spec1c:empty { display: none; }
.est-spec1c .hint { padding: 10px 12px; margin: 0; }

/* запуск заказа 1С в работу из сметы (16.10.2026, work-ui.js): кнопка [В работу | ▾] со списком и окно запуска */
.est-split { position: relative; display: inline-flex; }
.est-split > .btn:first-child { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.est-split > .est-split-arrow { margin-left: -1px; padding-left: 7px; padding-right: 7px; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-color: rgba(255,255,255,.4); }
.est-split > .btn.ghost:first-child { border-color: var(--line); }
.est-split-list { position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; display: flex; flex-direction: column; min-width: 250px; max-width: calc(100vw - 32px); padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); }
.est-split-list.left { left: 0; right: auto; }
.est-split-list button { display: flex; align-items: center; text-align: left; white-space: normal; background: none; border: 0; padding: 8px 10px; border-radius: var(--r-sm); cursor: pointer; color: var(--text); font-weight: 600; font-size: 13px; }
@media (hover: hover) { .est-split-list button:hover, .est-split-list button:focus-visible { background: var(--surface2); } }
.dlg.est-workw { width: min(580px, 94vw); }
.dlg.est-workw .est-note { margin-top: 10px; }
.dlg.est-workw .est-note ul { flex: 1 1 100%; margin: 0; padding-left: 18px; font-weight: 500; }
.dlg.est-workw .payw-row input[type=date] { flex: 0 1 180px; }
.workw-have { margin-top: 10px; font-size: 13px; }
.workw-have ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); }
.workw-com { align-items: flex-start; }
.workw-com > span { padding-top: 8px; }
.workw-com textarea { flex: 1 1 200px; min-height: 64px; }
.workw-none { flex: 1 1 200px; font-size: 13px; color: var(--dim); }
/* окно «Возврат» (return-ui.js, 16.10.2026): строки заказа 1С к возврату, возвраты заказа и выдача денег */
.dlg.est-retw { width: min(680px, 94vw); }
.dlg.est-retw .est-note { margin-top: 10px; }
.dlg.est-retw .est-note ul { flex: 1 1 100%; margin: 0; padding-left: 18px; font-weight: 500; }
.retw-cap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin-top: 14px; }
.retw-cap span { display: flex; gap: 6px; }
.retw-lines { margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 46vh; overflow: auto; }
.retw-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); }
.retw-line:first-child { border-top: 0; }
.retw-line.on { background: var(--accent-soft); }
.retw-line.off { color: var(--dim); }
.retw-pick { display: flex; align-items: flex-start; gap: 8px; min-width: 0; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.retw-line.off .retw-pick { cursor: default; }
.retw-pick input { flex: 0 0 auto; margin-top: 2px; }
.retw-name { min-width: 0; overflow-wrap: anywhere; }
.retw-name small { font-weight: 500; color: var(--muted); }
.retw-meta { grid-column: 1; padding-left: 24px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.retw-meta b { font-weight: 600; }
.retw-qty { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.retw-qty input { width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.retw-qty input[aria-invalid="true"] { border-color: var(--err); }
.retw-rets { margin-top: 16px; font-size: 13px; }
.retw-rets ul { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.retw-rets > small { display: block; margin-top: 6px; color: var(--muted); }
.retw-ret { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); overflow-wrap: anywhere; }
.retw-ret.ok { border-color: rgba(18,150,94,.4); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.retw-ret > .btn { margin-top: 6px; }
.retw-retl { margin-top: 3px; font-size: 12px; color: var(--muted); }
.retw-pay { margin-top: 8px; padding-top: 2px; border-top: 1px dashed var(--line); }
.retw-pay .payw-foot { margin-top: 10px; }
@media (max-width: 520px), screen and (pointer: coarse) and (max-device-width: 520px), screen and (pointer: coarse) and (max-device-height: 520px) {
  .retw-line { grid-template-columns: minmax(0, 1fr); }
  .retw-qty { grid-column: 1; grid-row: auto; padding-left: 24px; }
}

/* ── Доставка заказа дилера (delivery-ui.js, 26.10.2026): галка в шапке, адрес с подсказками, дата и время ── */
.est-dlv-on { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; user-select: none; }
.est-dlv-on input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.est-dlv { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-md); }
.dlv-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px 10px; align-items: end; }
.dlv-f { display: flex; flex-direction: column; gap: 3px; min-width: 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.dlv-f > span { display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.dlv-f input { font-size: 14px; font-weight: 500; }
.est-dlv input[type=time] { border: 1px solid var(--line2); background: var(--field); color: var(--text); border-radius: var(--r-sm); padding: 7px 9px; min-width: 0; width: 100%; }
.dlv-pin { font-weight: 700; color: var(--ok, #1a8f4c); }
.dlv-addr { position: relative; min-width: 0; grid-column: span 3; }
.dlv-who { grid-column: span 2; }
.dlv-note { grid-column: span 3; }
.dlv-sug { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; margin-top: 2px; max-height: 300px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line2); border-radius: var(--r-sm); box-shadow: 0 10px 28px rgba(15, 23, 42, .18); }
.dlv-sug[hidden] { display: none; }
.dlv-sug-it { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font: inherit; font-size: 14px; cursor: pointer; }
.dlv-sug-it:last-child { border-bottom: 0; }
@media (hover: hover) { .dlv-sug-it:hover, .dlv-sug-it.on { background: var(--accent-soft); } }
.dlv-sug-it b { font-weight: 600; }
.dlv-sug-it small { color: var(--muted); font-size: 12px; }
.dlv-sug-it i { margin-left: auto; color: var(--warn); font-style: normal; font-size: 12px; }
.dlv-sug-note { padding: 8px 10px; color: var(--muted); font-size: 13px; }
.dlv-state { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--accent-ink, var(--accent)); }
.dlv-state.warn { color: var(--warn); }
.dlv-state.ok { color: var(--ok, #1a8f4c); }
.est-note.est-dlv-off.ok { color: var(--ok, #1a8f4c); }
@media (max-width: 760px), screen and (pointer: coarse) and (max-device-width: 540px), screen and (pointer: coarse) and (max-device-height: 540px) {
  .dlv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dlv-addr, .dlv-date, .dlv-who, .dlv-phone, .dlv-note { grid-column: 1 / -1; }
}
@media print { .est-dlv, .est-dlv-on { display: none; } }
