.epd-excel-xml-upload-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.epd-excel-xml-template-line {
    margin: 0.75rem 0 0;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.4;
}

.epd-excel-xml-template-line a {
    color: #047857;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.epd-excel-xml-template-line a:hover {
    color: #065f46;
}

.epd-excel-xml-format__option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    flex: 1;
    padding: 1rem 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.epd-excel-xml-format__option:has(input:checked) {
    border-color: #059669;
    background: #ecfdf5;
}

.epd-excel-xml-format__option input {
    margin-top: 0.25rem;
}

.epd-excel-xml-format__option span {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.epd-excel-xml-format__option strong {
    color: #0f172a;
    font-size: 0.9375rem;
}

.epd-excel-xml-format__option small {
    color: #64748b;
    font-size: 0.8125rem;
}

.epd-excel-xml-input {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.epd-excel-xml-input--area {
    resize: vertical;
    min-height: 2.5rem;
}

.epd-excel-xml-input:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

.epd-excel-xml-combo-field {
    margin-top: 0.25rem;
    margin-bottom: 0.65rem;
}

.epd-excel-xml-combo-field .bp-combobox {
    width: 100%;
}

.epd-excel-xml-combo-field .bp-combobox__input.epd-excel-xml-input {
    margin-top: 0;
    margin-bottom: 0;
}

.epd-excel-xml-combo-field .bp-combobox__filter.epd-excel-xml-input {
    margin-top: 0;
    margin-bottom: 0;
}

.epd-excel-xml-preview__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.epd-excel-xml-preview__title {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
}

.epd-excel-xml-preview__source {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    color: #64748b;
}

.epd-excel-xml-preview__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #ecfdf5;
    color: #047857;
    font-size: 0.75rem;
    font-weight: 600;
}

.epd-excel-xml-warnings {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.875rem;
}

.epd-excel-xml-warnings ul {
    margin: 0;
    padding-left: 1.1rem;
}

.epd-excel-xml-preview__layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.epd-excel-xml-preview__main {
    min-width: 0;
    flex: 1;
}

.epd-excel-xml-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.5rem;
    margin: 0 -0.25rem;
    scrollbar-width: thin;
}

.epd-excel-xml-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    color: #475569;
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.epd-excel-xml-nav__link:hover {
    background: #f1f5f9;
    color: #0f172a;
}

.epd-excel-xml-nav__link.is-active {
    background: #e2e8f0;
    color: #0f172a;
    font-weight: 600;
}

.epd-excel-xml-nav__link--parent {
    width: 100%;
    justify-content: space-between;
}

.epd-excel-xml-nav__group {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    flex-shrink: 0;
}

.epd-excel-xml-nav__children {
    display: none;
}

.epd-excel-xml-nav__child {
    display: block;
    padding: 0.35rem 0.75rem 0.35rem 1.35rem;
    border-radius: 0.5rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
}

.epd-excel-xml-nav__child:hover,
.epd-excel-xml-nav__child.is-active {
    background: #f1f5f9;
    color: #0f172a;
}

.epd-excel-xml-nav__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.2rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    color: #334155;
    font-size: 0.6875rem;
    font-weight: 700;
}

.epd-excel-xml-preview__block {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scroll-margin-top: 5.5rem;
}

.epd-excel-xml-preview__section {
    scroll-margin-top: 5.5rem;
}

.epd-excel-xml-cargo-table tbody tr {
    scroll-margin-top: 5.5rem;
}

@media (min-width: 960px) {
    .epd-excel-xml-preview__layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.25rem;
    }

    .epd-excel-xml-nav {
        position: sticky;
        top: 5rem;
        flex: 0 0 13.5rem;
        flex-direction: column;
        flex-wrap: nowrap;
        overflow: visible;
        gap: 0.15rem;
        padding: 0;
        margin: 0;
        max-height: calc(100vh - 6rem);
        overflow-y: auto;
    }

    .epd-excel-xml-nav__link {
        width: 100%;
        white-space: normal;
    }

    .epd-excel-xml-nav__group {
        width: 100%;
    }

    .epd-excel-xml-nav__children {
        display: flex;
        flex-direction: column;
        gap: 0.1rem;
        margin-top: 0.1rem;
        margin-bottom: 0.15rem;
    }
}

.epd-excel-xml-preview__grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.epd-excel-xml-preview__section {
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
    background: #f8fafc;
}

.epd-excel-xml-preview__section h3 {
    margin: 0 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 700;
    color: #334155;
}

.epd-excel-xml-preview__section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem 0.85rem;
    margin-bottom: 0.75rem;
}

.epd-excel-xml-preview__section-head h3 {
    margin: 0;
}

.epd-excel-xml-same-toggle {
    display: inline-flex !important;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.epd-excel-xml-same-toggle__input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.epd-excel-xml-same-toggle__track {
    position: relative;
    display: inline-block;
    width: 2.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    border-radius: 999px;
    background: #cbd5e1;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.12);
    transition: background-color 0.18s ease;
}

.epd-excel-xml-same-toggle__thumb {
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1rem;
    height: 1rem;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2);
    transition: transform 0.18s ease;
}

.epd-excel-xml-same-toggle__input:checked + .epd-excel-xml-same-toggle__track {
    background: #0f766e;
}

.epd-excel-xml-same-toggle__input:checked + .epd-excel-xml-same-toggle__track .epd-excel-xml-same-toggle__thumb {
    transform: translateX(1rem);
}

.epd-excel-xml-same-toggle__input:focus-visible + .epd-excel-xml-same-toggle__track {
    outline: 2px solid #14b8a6;
    outline-offset: 2px;
}

.epd-excel-xml-same-toggle__input:checked ~ .epd-excel-xml-same-toggle__text {
    color: #0f766e;
}

.epd-excel-xml-same-toggle:hover .epd-excel-xml-same-toggle__track {
    filter: brightness(0.97);
}

.epd-excel-xml-preview__section label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

/* label { display:block } выше иначе перебивает Tailwind .hidden */
.epd-excel-xml-preview__section .hidden,
.epd-excel-xml-tool .epd-excel-xml-zakzvgo-only.hidden,
.epd-excel-xml-tool .epd-excel-xml-porexp-only.hidden,
.epd-excel-xml-nav .hidden {
    display: none !important;
}

.epd-excel-xml-inn-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.epd-excel-xml-inn-row__field {
    flex: 1;
}

.epd-excel-xml-inn-btn {
    flex-shrink: 0;
    margin-bottom: 0.65rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid #059669;
    border-radius: 0.5rem;
    background: #fff;
    color: #047857;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.epd-excel-xml-inn-btn:hover {
    background: #ecfdf5;
}

.epd-excel-xml-inn-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.epd-excel-xml-preview__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.epd-excel-xml-dt {
    margin-bottom: 0.75rem;
}

.epd-excel-xml-route-block {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.epd-excel-xml-route-block:first-of-type {
    margin-top: 0;
}

.epd-excel-xml-route-block--load {
    border-color: #a7f3d0;
    background: #f0fdf4;
    border-left: 3px solid #059669;
}

.epd-excel-xml-route-block--unload {
    border-color: #bfdbfe;
    background: #f8fafc;
    border-left: 3px solid #2563eb;
}

.epd-excel-xml-route-block__title {
    margin: 0 0 0.65rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #334155;
}

.epd-excel-xml-route-block--load .epd-excel-xml-route-block__title {
    color: #047857;
}

.epd-excel-xml-route-block--unload .epd-excel-xml-route-block__title {
    color: #1d4ed8;
}

.epd-excel-xml-route-block .epd-excel-xml-dt {
    margin-bottom: 0;
}

.epd-excel-xml-route-block .epd-excel-xml-input:last-child {
    margin-bottom: 0.65rem;
}

.epd-excel-xml-dt__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.epd-excel-xml-dt__row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-end;
}

.epd-excel-xml-dt__field {
    flex: 1 1 6.5rem;
    min-width: 0;
    margin: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.epd-excel-xml-dt__tz {
    flex: 1.2 1 7.5rem;
}

.epd-excel-xml-dt__field .epd-excel-xml-input {
    margin-bottom: 0;
}

.epd-excel-xml-preview__section--wide {
    /* full width in stacked layout */
}

.epd-excel-xml-cargo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.epd-excel-xml-cargo-head h3 {
    margin: 0;
}

.epd-excel-xml-cargo-add {
    padding: 0.4rem 0.75rem;
    border: 1px solid #059669;
    border-radius: 0.5rem;
    background: #fff;
    color: #047857;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.epd-excel-xml-cargo-add:hover {
    background: #ecfdf5;
}

.epd-excel-xml-cargo-table-wrap {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.epd-excel-xml-cargo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

.epd-excel-xml-cargo-table th {
    text-align: left;
    padding: 0.35rem 0.4rem;
    color: #64748b;
    font-weight: 600;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.epd-excel-xml-cargo-table td {
    padding: 0.25rem 0.25rem;
    vertical-align: middle;
}

.epd-excel-xml-cargo-table .epd-excel-xml-input {
    margin: 0;
    min-width: 0;
}

.epd-excel-xml-cargo-table .epd-excel-xml-cargo-name {
    min-width: 12rem;
}

.epd-excel-xml-cargo-table .epd-excel-xml-cargo-num {
    width: 5.5rem;
}

.epd-excel-xml-cargo-del {
    border: none;
    background: transparent;
    color: #b91c1c;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
}

.epd-excel-xml-cargo-totals {
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
}

.epd-excel-xml-cargo-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    font-size: 0.875rem;
    color: #475569;
}

.epd-excel-xml-cargo-summary strong {
    color: #0f172a;
    font-weight: 700;
}

.epd-excel-xml-hint {
    margin: -0.25rem 0 0;
    font-size: 0.75rem;
    color: #94a3b8;
}
