/* Board (chess-front) — стили нового модуля рейсов с сегментами-«ходами». */

.lw-board {
    display: flex;
    flex-direction: column;
    gap: calc(12px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    min-height: 200px;
}

.lw-board-strip-host {
    display: flex;
    flex-direction: column;
    gap: calc(10px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}

.lw-board-strip {
    display: flex;
    flex-direction: column;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}

.lw-board-card-slot {
    cursor: pointer;
}

.lw-board-card-slot.is-selected {
    cursor: default;
}

/* === Карточка рейса === */
.lw-board-trip-card {
    background: var(--lw-surface, #fff);
    border: 1px solid var(--lw-border, #e2e8f0);
    border-radius: var(--lw-radius, 10px);
    box-shadow: var(--lw-shadow, 0 1px 2px rgba(15, 23, 42, 0.06));
    padding: calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(12px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    display: flex;
    flex-direction: column;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.lw-board-trip-card.is-selected {
    border-color: #6366f1;
    box-shadow:
        0 0 0 2px rgba(99, 102, 241, 0.18),
        0 4px 12px rgba(15, 23, 42, 0.06);
    background: var(--ui-selected, #f8fafc);
}

.lw-board-trip-card.is-edit-active {
    border-color: #d97706;
    background: #fffbeb;
}

.lw-board-trip-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: calc(10px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}

.lw-board-trip-title-wrap {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: wrap;
}

.lw-board-trip-no {
    display: inline-flex;
    min-width: 28px;
    height: 22px;
    padding: 0 calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--ui-control, #e0e7ff);
    color: #4338ca;
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    letter-spacing: 0.02em;
}

.lw-line-kind-chip {
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lw-board-mixed-edit-physical,
.lw-board-mixed-edit-service {
    margin-bottom: calc(12px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}

.lw-board-edit-section-title {
    margin-top: calc(8px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}

.lw-board-trip-title {
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    color: var(--lw-ink, #0f172a);
    font-size: calc(14px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}

.lw-board-trip-sub {
    display: block;
    color: var(--lw-muted, #64748b);
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    line-height: calc(1.35 * var(--ui-leading-scale, 1));
    word-break: normal;
}

.lw-board-trip-goods {
    text-align: right;
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
    white-space: nowrap;
}

.lw-board-trip-goods strong {
    display: block;
    font-size: calc(14px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-ink, #0f172a);
    font-variant-numeric: tabular-nums;
}

.lw-board-trip-goods-label {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}

/* === Capacity bars === */
.lw-board-bars {
    display: flex;
    flex-direction: column;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}

.lw-board-bar-head {
    display: flex;
    justify-content: space-between;
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
}

.lw-board-bar-track {
    height: 6px;
    background: var(--ui-control, #f1f5f9);
    border-radius: 999px;
    overflow: hidden;
}

.lw-board-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #4338ca);
    border-radius: 999px;
}

.lw-board-bar-fill.is-warn {
    background: linear-gradient(90deg, #f59e0b, #d97706);
}

/* === Сегменты === */
.lw-board-segments {
    display: flex;
    flex-direction: column;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) 0;
    border-top: 1px dashed var(--lw-border, #e2e8f0);
}

.lw-board-segments-preview {
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) 0 0;
}

.lw-board-segments-title {
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.lw-board-segment-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    counter-reset: lw-seg;
}

.lw-board-segment-row {
    display: flex;
    flex-direction: column;
    gap: calc(2px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}

.lw-board-segment-tile {
    display: grid;
    grid-template-columns: 28px auto 1fr minmax(96px, auto);
    align-items: start;
    position: relative;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    width: 100%;
    padding: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    background: var(--lw-surface-muted, #f8fafc);
    border: 1px solid transparent;
    border-radius: var(--lw-radius-sm, 6px);
    color: var(--lw-ink, #0f172a);
    text-align: left;
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}

.lw-board-segment-tile:hover {
    background: var(--ui-control, #eef2ff);
    border-color: #c7d2fe;
}

.lw-board-segment-tile.is-selected {
    background: var(--ui-selected, #eef2ff);
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.12);
}

.lw-board-segment-tile.has-engine-hint::after {
    content: '↓';
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    color: #15803d;
    line-height: calc(1 * var(--ui-leading-scale, 1));
}

.lw-board-engine-tip {
    position: fixed;
    z-index: 12000;
    min-width: 220px;
    max-width: 360px;
    padding: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    pointer-events: auto;
}
.lw-board-engine-tip-head {
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    margin-bottom: calc(6px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    color: var(--ui-ink, #334155);
}
.lw-board-engine-tip-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    align-items: center;
    padding: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) 0;
    border-top: 1px solid #f1f5f9;
}
.lw-board-engine-tip-row:first-of-type {
    border-top: none;
}
.lw-board-engine-tip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lw-board-engine-tip-delta {
    font-variant-numeric: tabular-nums;
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    white-space: nowrap;
}
.lw-board-engine-tip-delta.is-good {
    color: #15803d;
}
.lw-board-engine-tip-delta.is-bad {
    color: #b91c1c;
}
.lw-board-engine-tip-empty {
    color: var(--ui-muted, #64748b);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-bpick-forbid.is-forbidden {
    color: #b91c1c;
}
.lw-bpick-forbid.is-forbidden .iconify {
    color: #b91c1c;
}
.lw-bpick-row.is-forbidden-wh {
    opacity: 0.72;
    border-left: 3px solid #b91c1c;
}
.lw-board-engine-map-tip {
    position: fixed;
    z-index: 12001;
    max-width: 280px;
    pointer-events: none;
}
.lw-map-engine-hint {
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
}
.lw-map-engine-hint.is-good {
    color: #15803d;
}
.lw-map-engine-hint-actions {
    display: flex;
    flex-wrap: wrap;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    margin-top: calc(4px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}
.lw-map-engine-hint-actions .lw-map-engine-apply {
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}
.lw-map-engine-hint.is-bad {
    color: #b91c1c;
}
.lw-map-semi-auto-btns {
    display: inline-flex;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    vertical-align: middle;
}

.lw-board-segment-no {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--ui-control, #e0e7ff);
    color: #4338ca;
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}

.lw-board-segment-arrow {
    display: inline-flex;
    align-items: center;
    gap: calc(2px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    color: #6366f1;
}

.lw-board-segment-text {
    color: var(--lw-ink, #0f172a);
    line-height: calc(1.35 * var(--ui-leading-scale, 1));
    min-width: 0;
}

.lw-board-segment-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: calc(1px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    color: var(--lw-muted, #64748b);
    font-variant-numeric: tabular-nums;
    text-align: right;
    line-height: calc(1.35 * var(--ui-leading-scale, 1));
    min-width: 0;
}

.lw-board-segment-leg-phase {
    display: inline-block;
    padding: calc(1px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-radius: 4px;
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    line-height: calc(1.4 * var(--ui-leading-scale, 1));
}

.lw-board-segment-leg-phase--mobilization {
    background: var(--ui-control, #dbeafe);
    color: #1d4ed8;
}

.lw-board-segment-leg-phase--demobilization {
    background: #ffedd5;
    color: #c2410c;
}

.lw-board-segment-cost-total {
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-ink, #0f172a);
    white-space: nowrap;
}

.lw-board-segment-cost-line {
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
    white-space: nowrap;
}

.lw-board-segment-products {
    margin: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1)) 0 calc(4px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    padding: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    background: #fff;
    border: 1px solid var(--lw-border, #e2e8f0);
    border-radius: var(--lw-radius-sm, 6px);
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    overflow: visible;
}

.lw-board-segment-products > summary {
    cursor: pointer;
    color: var(--lw-muted, #64748b);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}

.lw-board-segment-products-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    margin-top: calc(4px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}

.lw-board-segment-products-table col.lw-board-segprod-thumb-col {
    width: 36px;
}

.lw-board-segment-products-table col.lw-board-segprod-phys-col {
    width: 28%;
}

.lw-board-segment-products-table col.lw-board-segprod-qty-col {
    width: 8%;
}

.lw-board-segment-products-table th,
.lw-board-segment-products-table td {
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-bottom: 1px solid #f1f5f9;
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}

.lw-board-segment-products-table th {
    color: var(--lw-muted, #64748b);
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    text-align: left;
}

.lw-board-segment-products-table .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lw-board-segprod-foot td {
    padding: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-top: 1px solid var(--lw-border, #cbd5e1);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    color: var(--lw-ink, #0f172a);
    background: var(--ui-control, #f8fafc);
}

.lw-board-segprod-foot .num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lw-board-segments-empty {
    color: var(--lw-muted, #64748b);
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    padding: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) 0;
}

.lw-board-svc-lines-table col.lw-board-svc-stage-col {
    width: 30%;
}

.lw-board-svc-lines-table col.lw-board-svc-vol-col {
    width: 50%;
}

.lw-board-svc-lines-table col.lw-board-svc-total-col {
    width: 20%;
}

.lw-board-svc-group-head td {
    padding-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-bottom: none;
    background: var(--ui-control, #f8fafc);
}

.lw-board-svc-group-title {
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-ink, #0f172a);
}

.lw-board-svc-group-total {
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    font-variant-numeric: tabular-nums;
    color: var(--lw-ink, #0f172a);
}

.lw-board-svc-phase-row td {
    color: var(--lw-muted, #64748b);
    vertical-align: top;
}

.lw-board-svc-phase-label {
    padding-left: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    white-space: nowrap;
}

.lw-board-svc-phase-vol {
    font-variant-numeric: tabular-nums;
    color: var(--lw-ink, #0f172a);
    word-break: normal;
}

.lw-board-svc-phase-total {
    font-weight: clamp(100, calc(500 + var(--ui-weight-offset, 0)), 900);
    color: var(--lw-ink, #0f172a);
}

.lw-board-svc-group-head:not(:first-child) td {
    padding-top: calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}

/* === Footer === */
.lw-board-trip-footer {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-top: 1px dashed var(--lw-border, #e2e8f0);
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}

.lw-board-cost-summary {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    min-height: 32px;
    width: 100%;
}

.lw-board-cost-metrics {
    display: flex;
    align-items: stretch;
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.lw-board-cost-metric {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: calc(1px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding: 0 calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-left: 1px solid var(--lw-border, #e2e8f0);
    flex-shrink: 0;
}

.lw-board-cost-metric:first-child {
    border-left: none;
    padding-left: 0;
}

.lw-board-cost-metric-label {
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    line-height: calc(1.2 * var(--ui-leading-scale, 1));
    color: var(--lw-muted, #64748b);
}

.lw-board-cost-metric-value {
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    line-height: calc(1.25 * var(--ui-leading-scale, 1));
    color: var(--lw-ink, #0f172a);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.lw-board-cost-summary-end {
    display: flex;
    align-items: center;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-shrink: 0;
    margin-left: auto;
}

.lw-board-trip-total {
    display: inline-flex;
    align-items: baseline;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-radius: 4px;
    background: var(--ui-control, #f8fafc);
    white-space: nowrap;
}

.lw-board-trip-total-label {
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
}

.lw-board-trip-total-value {
    color: var(--lw-ink, #0f172a);
    font-variant-numeric: tabular-nums;
}

.lw-board-trip-details-toggle {
    display: inline-flex;
    align-items: center;
    gap: calc(2px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--lw-muted, #64748b);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    line-height: calc(1 * var(--ui-leading-scale, 1));
    white-space: nowrap;
    cursor: pointer;
}

.lw-board-trip-details-toggle:hover {
    background: var(--ui-control, #f1f5f9);
    color: var(--lw-ink, #0f172a);
}

.lw-board-trip-details-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.2s ease;
}

.lw-board-trip-footer.is-details-open .lw-board-trip-details-panel {
    grid-template-rows: 1fr;
}

.lw-board-trip-details-panel-inner {
    overflow: hidden;
    min-height: 0;
}

.lw-board-trip-footer.is-details-open .lw-board-trip-details-panel-inner {
    padding-top: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    margin-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    border-top: 1px solid var(--lw-border, #e2e8f0);
}

/* legacy aliases removed: lw-board-cost-rows, lw-board-cost-row */

/* === Player === */
.lw-board-player-host {
    border-top: 1px solid var(--lw-border, #e2e8f0);
    padding: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}

.lw-board-player {
    display: flex;
    flex-direction: column;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}

.lw-board-player-controls {
    display: flex;
    align-items: center;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: wrap;
}

.lw-board-player-info {
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
    margin-left: auto;
    font-variant-numeric: tabular-nums;
}

.lw-board-player-chips {
    display: flex;
    flex-wrap: wrap;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}

.lw-board-player-chip {
    border: 1px solid var(--lw-border, #e2e8f0);
    background: #fff;
    color: var(--lw-ink, #0f172a);
    border-radius: 999px;
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    cursor: pointer;
}

.lw-board-player-chip.is-selected {
    background: var(--ui-selected, #6366f1);
    border-color: #6366f1;
    color: var(--ui-ink, #fff);
}

.lw-board-player-chip:hover {
    border-color: #6366f1;
}

.lw-board-player-expand-sku {
    display: inline-flex;
    align-items: center;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
    user-select: none;
}

.lw-board-player-expand-sku input {
    margin: 0;
}

.lw-board-segment-products.is-player-open > summary {
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    color: var(--lw-ink, #0f172a);
}

.lw-board-segment-products-table tbody tr.is-player-sku-active {
    background: rgba(99, 102, 241, 0.12);
    box-shadow: inset 0 0 0 1px #6366f1;
}

.lw-board-segment-row.is-player-leg-active {
    background: rgba(139, 92, 246, 0.1);
    box-shadow: inset 0 0 0 1px #8b5cf6;
}

.lw-board-segment-tile.is-player-leg-active {
    background: rgba(139, 92, 246, 0.12);
    box-shadow: inset 0 0 0 2px #8b5cf6;
}

/* === Этап 5: тулбар редактирования === */
.lw-board-toolbar-host {
    display: flex;
    flex-direction: column;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding-bottom: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-bottom: 1px solid var(--lw-border, #e2e8f0);
}
.lw-board-toolbar {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: wrap;
}
/* Переключатель просмотр ↔ редактирование — одна иконка, без дублирующего бейджа «Просмотр». */
.lw-board-mode-toggle {
    flex-shrink: 0;
}
/* Список нарушений — отдельная строка на всю ширину под кнопками (над рейсами). */
.lw-board-toolbar-msg {
    width: 100%;
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--ui-ink, #475569);
    line-height: calc(1.35 * var(--ui-leading-scale, 1));
}
.lw-board-toolbar-msg:empty {
    display: none;
}
.lw-board-toolbar-msg:not(:empty) {
    color: #b91c1c;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    max-height: 120px;
    overflow-y: auto;
}
.lw-board-status-badge {
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ui-ink, #475569);
    margin-left: auto;
}
.lw-board-status-badge.is-ok,
.lw-board-edit-badge.is-ok {
    background: #dcfce7;
    color: #166534;
}
.lw-board-status-badge.is-violation,
.lw-board-edit-badge.is-violation {
    background: #fee2e2;
    color: #b91c1c;
}
.lw-board-status-badge.is-estimate,
.lw-board-edit-badge.is-estimate {
    background: #fef3c7;
    color: #92400e;
}
.lw-board-status-badge.is-view {
    background: #e2e8f0;
    color: var(--ui-ink, #475569);
}

/* === Этап 5: редактируемое тело рейса === */
.lw-board-edit-body {
    display: flex;
    flex-direction: column;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    border-top: 1px dashed var(--lw-border, #e2e8f0);
    padding-top: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}
.lw-board-edit-tariff {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-edit-section {
    border: 1px solid var(--lw-border, #e2e8f0);
    border-radius: var(--lw-radius-sm, 6px);
    padding: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    display: flex;
    flex-direction: column;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    background: #fff;
}

/* Mixed trip edit: service block (symmetric to physical section) */
.lw-board-trip-edit-service {
    display: flex;
    flex-direction: column;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    margin-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    padding-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-top: 1px dashed var(--lw-border, #e2e8f0);
}
.lw-board-service-edit-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-service-edit-row .lw-board-pick-offer,
.lw-board-service-edit-row .lw-board-pick-workforce {
    min-width: 0;
    flex: 1 1 140px;
}

.lw-board-edit-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-edit-section-ctrls {
    display: inline-flex;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}
.lw-board-edit-sku {
    display: grid;
    grid-template-columns: auto 1fr auto 72px auto;
    align-items: center;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}

.lw-board-edit-tariff-head {
    display: inline-flex;
    align-items: center;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    min-width: 0;
}

.lw-board-edit-view {
    flex-shrink: 0;
    color: var(--lw-muted, #64748b);
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}

.lw-board-edit-view:hover {
    color: #d97706;
}
.lw-board-edit-sku-namewrap {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: calc(1.25 * var(--ui-leading-scale, 1));
}
.lw-board-edit-sku-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
}
.lw-board-edit-sku-sub {
    font-size: calc(10.5px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lw-board-edit-sku-price {
    color: var(--lw-muted, #64748b);
    font-variant-numeric: tabular-nums;
}
.lw-board-edit-del-route {
    color: #b91c1c;
}
.lw-board-edit-qty {
    width: 72px;
    padding: calc(3px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border: 1px solid var(--lw-border, #cbd5e1);
    border-radius: 4px;
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-edit-hint {
    grid-column: 1 / -1;
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    min-height: 0;
}
.lw-board-edit-status {
    padding-top: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}
.lw-board-edit-est {
    display: flex;
    flex-wrap: wrap;
    gap: calc(10px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    align-items: center;
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
}
.lw-board-edit-est strong {
    color: var(--lw-ink, #0f172a);
    font-variant-numeric: tabular-nums;
}
.lw-board-edit-badge {
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-radius: 999px;
    background: var(--ui-control, #f1f5f9);
}
.lw-board-edit-violations {
    margin-top: calc(4px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: #b91c1c;
}
.lw-board-edit-violation-item {
    line-height: calc(1.35 * var(--ui-leading-scale, 1));
}
.lw-board-edit-cart-fill {
    margin-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    color: #b45309;
}
.lw-board-edit-cart-fill.is-ok {
    color: #15803d;
}

.lw-map-marker-popup .lw-map-edit-add-sku,
.lw-map-marker-popup .lw-map-edit-open-sku,
.lw-map-marker-popup .lw-map-edit-open-tariff,
.lw-map-marker-popup .lw-map-edit-set-tariff {
    margin-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}

/* === Этап 5: пикер (модалка) === */
.lw-bpick-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    padding: calc(16px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}
.lw-bpick-panel {
    background: #fff;
    border-radius: 12px;
    width: min(720px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.25);
}
.lw-bpick-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(12px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(14px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-bottom: 1px solid var(--lw-border, #e2e8f0);
}
.lw-bpick-controls {
    display: flex;
    flex-wrap: wrap;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    align-items: center;
    padding: calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(14px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-bottom: 1px solid var(--lw-border, #e2e8f0);
}
.lw-bpick-select {
    padding: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border: 1px solid var(--lw-border, #cbd5e1);
    border-radius: 6px;
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-bpick-veh {
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    display: inline-flex;
    align-items: center;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}
.lw-bpick-list {
    overflow-y: auto;
    padding: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(14px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(14px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    display: flex;
    flex-direction: column;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}
.lw-bpick-row.is-incompatible {
    opacity: 0.55;
}
.lw-bpick-row.is-incompatible .lw-bpick-add:disabled {
    cursor: not-allowed;
}
/* Подсветка строки после «Показать в списке» (из попапа карты). */
.lw-bpick-row.is-list-focused {
    box-shadow: 0 0 0 2px #6366f1, 0 0 0 6px rgba(99, 102, 241, 0.18);
    border-color: #6366f1;
    animation: lw-bpick-focus-pulse 0.6s ease-out;
}
@keyframes lw-bpick-focus-pulse {
    0% { box-shadow: 0 0 0 2px #6366f1, 0 0 0 12px rgba(99, 102, 241, 0.32); }
    100% { box-shadow: 0 0 0 2px #6366f1, 0 0 0 6px rgba(99, 102, 241, 0.18); }
}
/* Плашка «показано со снятыми фильтрами» над списком пикера. */
.lw-bpick-relax-banner {
    margin: 0 calc(14px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    padding: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    line-height: calc(1.35 * var(--ui-leading-scale, 1));
    color: #1e3a8a;
    background: var(--ui-control, #eff6ff);
    border: 1px solid #bfdbfe;
    border-radius: 6px;
}
.lw-bpick-relax-banner.is-error {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}
.lw-bpick-row {
    border: 1px solid var(--lw-border, #e2e8f0);
    border-radius: 8px;
    padding: calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    display: flex;
    flex-direction: column;
    gap: calc(4px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-bpick-head {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}
.lw-bpick-pin.is-pinned {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
}
.lw-bpick-act .lw-bpick-pin {
    flex-shrink: 0;
}
.lw-bpick-sub {
    color: var(--lw-muted, #64748b);
}
.lw-bpick-sku {
    font-size: calc(10.5px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #94a3b8);
}
.lw-bpick-prices {
    display: flex;
    flex-wrap: wrap;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    align-items: center;
}
.lw-bpick-price {
    font-variant-numeric: tabular-nums;
}
.lw-bpick-logi {
    color: #2563eb;
}
.lw-bpick-info {
    cursor: help;
    color: var(--lw-muted, #94a3b8);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-bpick-stock,
.lw-bpick-dims {
    color: var(--lw-muted, #64748b);
    font-variant-numeric: tabular-nums;
}
.lw-bpick-badge {
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    padding: calc(1px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-radius: 999px;
    background: var(--ui-control, #f1f5f9);
    color: var(--ui-ink, #475569);
}
.lw-bpick-badge.is-good,
.lw-bpick-fit.is-good {
    background: #dcfce7;
    color: #166534;
}
.lw-bpick-badge.is-bad,
.lw-bpick-fit.is-bad {
    background: #fee2e2;
    color: #b91c1c;
}
.lw-bpick-badge.is-selected {
    background: var(--ui-selected, #dbeafe);
    color: var(--ui-ink, #1d4ed8);
}
.lw-bpick-row.is-selected-tariff {
    border-color: #6366f1;
    box-shadow: inset 0 0 0 1px #6366f1;
}
.lw-bpick-act .ds-btn.is-current-tariff {
    opacity: 0.85;
}
.lw-bpick-fit {
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    padding: calc(1px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-radius: 999px;
}
.lw-bpick-act {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    margin-top: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}
.lw-bpick-qty {
    width: 80px;
    padding: calc(3px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border: 1px solid var(--lw-border, #cbd5e1);
    border-radius: 4px;
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-bpick-empty {
    padding: calc(16px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    text-align: center;
}

/* === Пикер: док в колонку доски (центрируется в матрице, не перекрывает карту) === */
.lw-bpick-overlay--docked {
    position: absolute;
    inset: 0;
    z-index: 100; /* над контентом доски; под сайдбаром (2000) и large popup (10000) */
    padding: calc(10px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}
.lw-bpick-overlay--docked .lw-bpick-panel {
    width: 100%;
    max-width: 760px;
    height: 100%;
    max-height: 100%;
}

/* Кнопка «Показать на карте» в строке пикера — прижата вправо в шапке */
.lw-bpick-view {
    margin-left: auto;
    flex-shrink: 0;
}

/* === Пикер: богатые блоки (единый источник с попапами карты) === */
.lw-bpick-rich {
    display: flex;
    flex-wrap: wrap;
    gap: calc(10px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1)) calc(14px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    align-items: flex-start;
    padding-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    margin-top: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    border-top: 1px dashed var(--lw-border, #e2e8f0);
}
.lw-bpick-rich-media {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: wrap;
}
.lw-bpick-rich-meta {
    display: flex;
    align-items: center;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: wrap;
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
}
.lw-bpick-rich-load {
    white-space: nowrap;
}
.lw-bpick-rich-prices {
    display: flex;
    gap: calc(16px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: wrap;
    margin-left: auto;
}
.lw-bpick-rich-col {
    min-width: 132px;
}
.lw-bpick-rich-h {
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--lw-muted, #94a3b8);
    margin-bottom: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    text-align: right;
}

/* Тариф: сетка метрик со «Среднее / ±%» (как столбцы попапа точки перевозчика) */
.lw-bpick-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1)) calc(12px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    margin-top: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    border-top: 1px dashed var(--lw-border, #e2e8f0);
}
.lw-bpick-metric {
    display: flex;
    flex-direction: column;
    gap: calc(1px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}
.lw-bpick-metric-l {
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    color: var(--lw-muted, #94a3b8);
}
.lw-bpick-metric-v {
    font-variant-numeric: tabular-nums;
    line-height: calc(1.25 * var(--ui-leading-scale, 1));
}
.lw-bpick-cap {
    color: var(--lw-muted, #64748b);
}

/* === Вместимость ТС (общий вид в пикере и large-попапе перевозчика) === */
.lw-lp-veh-cap {
    margin-top: calc(3px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    display: flex;
    align-items: center;
    gap: calc(6px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: wrap;
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #64748b);
}
.lw-lp-veh-cap-l {
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(700 + var(--ui-weight-offset, 0)), 900);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--lw-muted, #94a3b8);
}

/* === Fit-бейджи «что под что подходит» (единый класс: пикер + попапы карты) === */
.lw-fit-badge {
    display: inline-flex;
    align-items: center;
    gap: calc(3px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    padding: calc(1px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-radius: 999px;
    background: var(--ui-control, #f1f5f9);
    color: var(--ui-ink, #475569);
    white-space: nowrap;
    vertical-align: middle;
    cursor: help;
}
.lw-lp-veh-name .lw-fit-badge {
    margin-left: calc(6px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}
.lw-fit-badge.is-good {
    background: #dcfce7;
    color: #166534;
}
.lw-fit-badge.is-warn {
    background: #fef9c3;
    color: #854d0e;
}
.lw-fit-badge.is-bad {
    background: #fee2e2;
    color: #b91c1c;
}
.lw-fit-badge.is-neutral {
    background: #e0f2fe;
    color: #075985;
}
.lw-fit-badge .iconify {
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-fit-badge-n {
    font-variant-numeric: tabular-nums;
}
.lw-lp-prod-veh {
    margin-top: calc(3px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}

/* Склад: аналитика (дистанции, отклонения, полнота корзины) — как попап «Подробнее» */
.lw-bpick-an-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: calc(2px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1)) calc(14px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    padding-top: calc(6px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    margin-top: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    border-top: 1px dashed var(--lw-border, #e2e8f0);
}
.lw-bpick-an {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: calc(8px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
}
.lw-bpick-an-l {
    color: var(--lw-muted, #64748b);
}
.lw-bpick-an-v {
    font-variant-numeric: tabular-nums;
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
}

/* Фидбэк-фиксы 2026-05-29: шапка (3-я строка тарифа), товар в сегменте, детали рейса, пустая доска. */
.lw-board-trip-sub2 {
    color: var(--lw-muted, #94a3b8);
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-trip-sub3 {
    color: var(--lw-muted, #94a3b8);
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-segment-addr {
    display: block;
    color: var(--lw-muted, #94a3b8);
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    margin-top: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}
.lw-board-segment-more {
    margin-top: calc(4px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-segment-more-rows {
    color: var(--lw-muted, #94a3b8);
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    padding: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) 0 0 calc(12px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}
.lw-board-segprod-thumb-head {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    padding: 0;
    border-bottom-color: transparent;
}

.lw-board-segprod-thumb-cell {
    width: 36px;
    padding: calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(2px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) 0;
    vertical-align: middle;
}

.lw-board-segprod-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
}

.lw-board-segprod-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.lw-board-segprod-name {
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    color: var(--lw-ink, #0f172a);
}

button.lw-board-segprod-name {
    display: block;
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    color: inherit;
    text-align: left;
    cursor: pointer;
    max-width: 100%;
}

.lw-board-segprod-copy:hover,
.lw-board-segprod-copy:focus-visible {
    color: #4338ca;
    text-decoration: underline dotted;
    outline: none;
}

.lw-board-segprod-copy.is-copy-flash {
    color: #16a34a;
}

.lw-board-segprod-sku {
    padding: 0;
    margin: 0;
    border: none;
    background: none;
    font: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    color: var(--lw-muted, #94a3b8);
    cursor: pointer;
}

.lw-board-segprod-phys {
    vertical-align: top;
    overflow: visible;
    position: relative;
}

.lw-board-segprod-phys-stack {
    display: flex;
    flex-direction: column;
    gap: calc(1px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    line-height: calc(1.3 * var(--ui-leading-scale, 1));
    min-width: 0;
}

.lw-board-segprod-phys-vol {
    display: inline-flex;
    align-items: center;
    gap: calc(3px * var(--ui-space-scale, 1) * var(--ui-gap-scale, 1));
    flex-wrap: nowrap;
}

.lw-board-segprod-qty {
    white-space: nowrap;
    vertical-align: top;
}

.lw-board-segment-products-table tbody tr:has(.lw-board-segprod-dims-btn:hover) {
    position: relative;
    z-index: 10;
}

.lw-board-segprod-dims-wrap {
    display: inline-flex;
    align-items: center;
    position: relative;
    vertical-align: middle;
    margin-left: calc(2px * var(--ui-space-scale, 1) * var(--ui-margin-scale, 1));
}

.lw-board-segprod-dims-wrap:has(.lw-board-segprod-dims-btn:hover) {
    z-index: 120;
}

.lw-board-segprod-dims-btn:hover {
    color: #4338ca;
}

.lw-board-segprod-dims-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    color: var(--ui-muted, #64748b);
    cursor: help;
    line-height: calc(1 * var(--ui-leading-scale, 1));
}

.lw-board-segprod-dims-pop {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    transform: translateX(-50%);
    z-index: 120;
    padding: calc(4px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) calc(8px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    background: #1e293b;
    color: var(--ui-on-action, #f8fafc);
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    white-space: nowrap;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    pointer-events: none;
}

.lw-board-segprod-dims-btn:hover + .lw-board-segprod-dims-pop {
    display: block;
}

.lw-board-segprod-sub {
    color: var(--lw-muted, #94a3b8);
    font-size: calc(10px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-detail-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
    font-size: calc(12px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-detail-table td {
    padding: calc(3px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1)) 0;
    vertical-align: top;
}
.lw-board-detail-label {
    width: 58%;
    color: var(--lw-muted, #64748b);
    padding-right: calc(12px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    line-height: calc(1.35 * var(--ui-leading-scale, 1));
}
.lw-board-detail-label.is-nested {
    padding-left: calc(12px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    font-size: calc(11px * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
}
.lw-board-detail-value {
    color: var(--lw-ink, #0f172a);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.lw-board-detail-section td {
    font-weight: clamp(100, calc(600 + var(--ui-weight-offset, 0)), 900);
    font-size: calc(0.72rem * var(--ui-type-scale, 1) + var(--ui-type-offset, 0px));
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--ds-text-muted, #64748b);
    padding-top: calc(0.65rem * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    padding-bottom: calc(0.2rem * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
    border-top: 1px solid var(--ds-border-subtle, #e2e8f0);
}
.lw-board-empty {
    padding: calc(12px * var(--ui-space-scale, 1) * var(--ui-padding-scale, 1));
}
