.section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.section-actions .button {
    gap: 8px;
}

.export-builder {
    max-width: 1180px;
}

.export-heading {
    margin-bottom: 22px;
}

.export-heading h1 {
    margin-bottom: 0;
}

.export-summary {
    display: grid;
    margin: 0 0 28px;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) minmax(140px, 0.7fr);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.export-summary div {
    min-width: 0;
    padding: 16px 18px;
    border-right: 1px solid var(--border);
}

.export-summary div:last-child {
    border-right: 0;
}

.export-summary dt {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.export-summary dd {
    margin: 0;
    color: var(--blue-dark);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.export-form {
    display: grid;
    gap: 26px;
}

.export-section {
    min-width: 0;
    margin: 0;
    padding: 22px 0 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.export-section > legend,
.export-legend-row legend {
    padding: 0;
    color: var(--blue-dark);
    font-size: 1rem;
    font-weight: 900;
}

.export-legend-row {
    display: flex;
    margin-bottom: 16px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.export-inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.text-command {
    min-height: 36px;
    padding: 0 10px;
    color: var(--blue);
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
    font-weight: 800;
}

.text-command:hover {
    border-color: var(--blue);
    background: var(--blue-soft);
}

.segmented-control {
    display: inline-grid;
    min-width: min(100%, 360px);
    margin-top: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.segmented-control label {
    position: relative;
    min-width: 0;
    cursor: pointer;
}

.segmented-control label + label {
    border-left: 1px solid var(--border);
}

.segmented-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.segmented-control span {
    display: grid;
    min-height: 44px;
    padding: 8px 14px;
    color: var(--blue-dark);
    place-items: center;
    font-weight: 800;
    text-align: center;
}

.segmented-control input:checked + span {
    color: var(--white);
    background: var(--blue);
}

.segmented-control input:focus-visible + span {
    outline: 3px solid var(--focus);
    outline-offset: -3px;
}

.segmented-control-wide {
    min-width: min(100%, 520px);
}

.export-date-grid,
.export-option-grid {
    display: grid;
    margin-bottom: 16px;
    grid-template-columns: repeat(2, minmax(0, 240px));
    gap: 14px;
}

.export-check-list {
    display: grid;
    gap: 6px;
}

.export-record-list {
    max-height: 320px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--soft);
    overflow-y: auto;
}

.export-check-row {
    display: flex;
    min-width: 0;
    min-height: 42px;
    padding: 9px 11px;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: var(--surface);
    cursor: pointer;
}

.export-check-row:hover {
    border-color: var(--border);
}

.export-check-row input,
.toggle-option input {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin: 2px 0 0;
    accent-color: var(--orange);
}

.export-check-row span {
    min-width: 0;
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.export-field-search {
    max-width: 540px;
    margin-bottom: 18px;
}

.export-field-groups {
    display: grid;
    gap: 20px;
}

.export-field-group {
    min-width: 0;
}

.export-field-group h2 {
    margin: 0 0 9px;
    color: var(--blue);
    font-size: 0.92rem;
}

.export-field-group .export-check-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.toggle-option {
    display: flex;
    min-height: 44px;
    padding: 10px 12px;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--blue-dark);
    cursor: pointer;
    font-weight: 800;
}

.export-submit-row {
    padding-top: 4px;
}

@media (max-width: 760px) {
    .section-heading-with-action {
        align-items: stretch;
    }

    .section-actions,
    .section-actions .button {
        width: 100%;
    }

    .export-summary,
    .export-date-grid,
    .export-option-grid,
    .export-field-group .export-check-list {
        grid-template-columns: 1fr;
    }

    .export-summary div {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .export-summary div:last-child {
        border-bottom: 0;
    }

    .export-date-grid,
    .export-option-grid {
        gap: 10px;
    }

    .export-submit-row .button {
        width: 100%;
    }
}

@media (max-width: 460px) {
    .segmented-control {
        width: 100%;
        grid-template-columns: 1fr;
    }

    .segmented-control label + label {
        border-top: 1px solid var(--border);
        border-left: 0;
    }
}
