/* Общие стили формы документа витрины. */
.card { padding: 16px; background: var(--surface); }
.input {
  width: 100%; min-width: 0; min-height: 44px; margin-top: 4px; padding: 8px 10px;
  background: var(--surface); border: 1px solid var(--control-line); border-radius: 12px;
}
.input[aria-invalid="true"] { border-color: var(--danger); }
.form-row { display: grid; gap: 8px; }
.form-row label { min-width: 0; }
.hint, .muted, .small, .cap { color: var(--ink-2); font-size: 13px; }
.chips, .row-between { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.row-between { justify-content: space-between; }
.chip { display: inline-flex; align-items: center; padding: 4px 10px; min-height: 44px; border-radius: 12px; background: var(--fill); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--fill); border-radius: 14px; }
.seg > * {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 4px 8px;
  border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  color: var(--ink); font-weight: 700; text-decoration: none; text-align: center;
}
.tools .seg .on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-raise); }
.check { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }
.check input { width: 18px; height: 18px; flex: none; accent-color: var(--info); }
.link-btn { border: 0; background: transparent; cursor: pointer; color: var(--info); text-decoration: underline; min-height: 44px; }
.msg { padding: 10px 14px; border-radius: 12px; background: var(--fill); }
.msg-error { background: var(--danger-soft); color: var(--danger); }
.msg-success { background: var(--success-soft); color: var(--success); }
.t { width: 100%; border-collapse: collapse; }
.t :is(th, td) { border-bottom: 1px solid var(--line); text-align: start; }
.t .n { text-align: end; font-variant-numeric: tabular-nums; }
.t input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--info); }
.toasts {
  position: fixed; inset: auto 16px 16px auto; z-index: 5;
  width: min(360px, calc(100% - 32px)); display: grid; gap: 8px;
}
.toast { padding: 12px 16px; border-radius: 14px; color: var(--surface); background: var(--ink); }
.toast--err { background: var(--danger-soft); color: var(--danger); }
.crumbs { color: var(--text-2); margin-bottom: 6px; }
.crumbs a { color: inherit; }
.tl-narrow { max-width: 640px; margin: 24px auto; }

.tl-form > .card, .tl-bridge, .tl-fb { margin-bottom: 12px; }
.tl-form .form-row { margin: 10px 0; }
.tl-form .card h2 { margin-bottom: 4px; }
.tl-form .form-row { grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.tl-wide { grid-column: 1 / -1; }
@media (min-width: 720px) { .tl-wide { grid-column: span 2; } }
.tl-seg { margin: 10px 0 4px; max-width: 360px; }
.tl-inn { display: flex; gap: 8px; align-items: center; }
.tl-inn .input { flex: 1; min-width: 0; }
.tl-more { margin-top: 6px; }
.tl-more summary { cursor: pointer; color: var(--text-2); font-size: 14px; padding: 8px 0; }
.stack-l { display: flex; flex-direction: column; gap: 6px; font: 500 14px/1.3 var(--font); margin-top: 10px; }
.stack-l .input { margin: 0; }
.tl-form select.input, .tl-map select.input { padding-right: 8px; }

/* строки работ: на телефоне — карточки, на компьютере — строка таблицы */
.tl-lines { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.tl-line { display: grid; gap: 6px 8px; grid-template-columns: 22px repeat(3, minmax(0, 1fr)) 44px; grid-template-areas:
  "n name name name del" "n unit qty price del" "n sum sum sum del"; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: end; }
.tl-lines.ks .tl-line { grid-template-areas: "n name name name del" "n pos code code del" "n unit qty price del" "n sum sum sum del"; }
.tl-line label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-line .input { margin: 0; min-height: 44px; padding: 0 8px; }
.tl-line textarea.input { padding: 8px; resize: vertical; line-height: 1.35; }
.tl-n { grid-area: n; align-self: start; padding-top: 22px; color: var(--text-3); font-size: 13px; }
.tl-name { grid-area: name; } .tl-unit { grid-area: unit; } .tl-qty { grid-area: qty; } .tl-price { grid-area: price; }
.tl-pos { grid-area: pos; } .tl-code { grid-area: code; }
.tl-sum { grid-area: sum; display: flex; justify-content: space-between; align-items: baseline; font-variant-numeric: tabular-nums; }
.tl-del { grid-area: del; align-self: start; margin-top: 18px; width: 44px; font-size: 20px; color: var(--text-2); }
.tl-qty .input, .tl-price .input { text-align: right; }
@media (min-width: 960px) {
  .tl-line { grid-template-columns: 22px minmax(0, 1fr) 70px 90px 110px 120px 44px; grid-template-areas: "n name unit qty price sum del"; padding: 6px 0; }
  .tl-lines.ks .tl-line { grid-template-columns: 22px 44px 132px minmax(160px, 1fr) 66px 66px 88px 104px 44px; grid-template-areas: "n pos code name unit qty price sum del"; }
  .tl-line .cap { display: none; }
  .tl-line:first-child .cap { display: block; }
  .tl-n, .tl-del { padding-top: 10px; margin-top: 0; }
  .tl-line:first-child .tl-n, .tl-line:first-child .tl-del { padding-top: 26px; }
  .tl-sum { flex-direction: column; align-items: flex-end; justify-content: center; padding-bottom: 8px; }
}
.tl-stage { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border-radius: var(--r); padding: 6px 6px 6px 10px; }
.tl-stage .input { margin: 0; font-weight: 600; background: transparent; border-color: transparent; }
.tl-stage .btn { flex: 0 0 44px; font-size: 20px; }
.tl-total { margin-top: 12px; border-top: 2px solid var(--line-strong); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.tl-total div { display: flex; justify-content: space-between; gap: 12px; font-variant-numeric: tabular-nums; }
.tl-total div.muted { font-size: 14px; }

.tl-dl { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
@media (max-width: 520px) { .tl-dl .btn { flex: 1 1 calc(50% - 8px); padding: 0 10px; } }
.tl-get { border-color: var(--accent); }

/* загрузка Excel */
.tl-drop { display: flex; align-items: center; gap: 14px; padding: 22px; border: 2px dashed var(--line-strong); border-radius: var(--r-lg); cursor: pointer; margin: 10px 0; }
.tl-drop:hover, .tl-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.tl-drop.is-busy { opacity: .6; pointer-events: none; }
.tl-drop span { display: flex; flex-direction: column; } .tl-drop small { color: var(--text-2); }
.tl-map { grid-template-columns: repeat(auto-fit, minmax(min(46%, 170px), 1fr)); }
.tl-map label { font-size: 13px; }
.tl-xl-wrap { max-height: 60vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); margin: 8px 0; }
.tl-xl { font-size: 13px; }
.tl-xl th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.tl-xl td { padding: 6px 8px; }
.tl-xl .tl-xn { min-width: 200px; }
.tl-warn { color: var(--warn); font-size: 12px; display: block; }
.tl-xl-bar { flex-wrap: wrap; gap: 8px; }
.tl-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

.tl-bridge { background: var(--accent-soft); border-color: var(--accent); }
.tl-fb .seg { max-width: 360px; margin: 8px 0; }
.tl-fb textarea { margin: 0 0 8px; padding: 10px 12px; }

/* 1.13: поделиться ценами */
.tl-share { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.tl-share .check { align-items: flex-start; min-height: 0; }
.tl-share .check span { line-height: 1.4; }
.tl-city { margin: 0 0 0 32px; color: var(--text-2); }
.tl-city .link-btn { font-size: 13px; padding: 0; }
.tl-city-in { display: flex; flex-direction: column; gap: 4px; margin-left: 32px; max-width: 360px; }
.tl-city-in .input { margin: 0; }
