.merge-page {
    padding-bottom: 64px;
}

.merge-breadcrumb {
    padding-top: 22px;
    padding-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--muted);
    font-size: .87rem;
}

.merge-breadcrumb a {
    color: var(--primary);
    font-weight: 700;
}

.merge-heading {
    padding: 8px 0 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.merge-title-icon {
    width: 64px;
    height: 64px;
    flex: 0 0 64px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #fff0f0;
    color: #e72727;
}

.merge-title-icon svg {
    width: 42px;
    height: 42px;
}

.merge-heading h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -.045em;
    line-height: 1.05;
}

.merge-heading p {
    margin: 7px 0 0;
    color: var(--muted);
}

.merge-promo {
    margin-bottom: 18px;
}

.merge-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(300px, .9fr);
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(20,35,50,.05);
}

.merge-main {
    padding: 20px;
    border-right: 1px solid var(--border);
}

.merge-dropzone {
    min-height: 330px;
    padding: 36px 24px;
    display: grid;
    place-items: center;
    align-content: center;
    text-align: center;
    border: 2px dashed #b5c3d0;
    border-radius: 16px;
    background: #fbfcfd;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.merge-dropzone:hover,
.merge-dropzone.drag-over {
    border-color: var(--primary);
    background: #f5fbf8;
}

.merge-dropzone.drag-over {
    transform: scale(.995);
}

.merge-dropzone h2 {
    margin: 16px 0 5px;
    font-size: 1.18rem;
}

.merge-dropzone p {
    margin: 0 0 20px;
    color: var(--muted);
}

.merge-drop-icon {
    position: relative;
    width: 118px;
    height: 82px;
}

.pdf-paper {
    position: absolute;
    top: 0;
    width: 52px;
    height: 68px;
    display: grid;
    place-items: end center;
    padding-bottom: 13px;
    border: 2px solid #aab7c4;
    border-radius: 6px;
    background: #fff;
    color: #fff;
    font-size: .72rem;
    font-weight: 900;
}

.pdf-paper::before {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 11px;
    height: 20px;
    border-radius: 4px;
    background: #e72727;
    z-index: 0;
}

.pdf-paper {
    z-index: 1;
}

.pdf-paper.left {
    left: 8px;
    transform: rotate(-2deg);
}

.pdf-paper.right {
    right: 8px;
    transform: rotate(2deg);
}

.pdf-paper {
    isolation: isolate;
}

.pdf-paper::after {
    content: "PDF";
    position: absolute;
    bottom: 13px;
    left: 0;
    right: 0;
    z-index: 2;
}

.merge-plus,
.pdf-plus {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid #aab7c4;
    border-radius: 50%;
    background: #fff;
    color: #455667;
    font-size: 1.5rem;
    z-index: 4;
}

.merge-select-button {
    border: 0;
    border-radius: 12px;
    padding: 13px 20px;
    background: #e72727;
    color: #fff;
    font-weight: 850;
    cursor: pointer;
}

.merge-select-button:hover {
    background: #c91e1e;
}

.merge-privacy-note {
    margin: 18px 0;
    display: flex;
    justify-content: center;
    gap: 9px;
    color: var(--muted);
    font-size: .86rem;
}

.merge-files-section {
    margin-top: 20px;
}

.merge-files-header {
    margin-bottom: 13px;
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
}

.merge-files-header h2 {
    margin: 0;
    font-size: 1.08rem;
}

.merge-files-header p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .82rem;
}

.merge-add-more {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 11px;
    background: #fff;
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}

.merge-file-list {
    display: grid;
    gap: 9px;
}

.merge-file-card {
    padding: 11px 13px;
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    cursor: grab;
}

.merge-file-card.dragging {
    opacity: .55;
}

.merge-file-handle {
    color: #95a2ad;
    font-size: 1.2rem;
    user-select: none;
}

.merge-file-name {
    min-width: 0;
}

.merge-file-name strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .88rem;
}

.merge-file-name span {
    color: var(--muted);
    font-size: .75rem;
}

.merge-file-index {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #f1f5f3;
    color: var(--primary-dark);
    font-size: .78rem;
    font-weight: 850;
}

.merge-file-remove {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: #fff3f3;
    color: #bc3333;
    font-size: 1rem;
    cursor: pointer;
}

.merge-how {
    margin-top: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
}

.merge-how > h2 {
    margin: 0 0 15px;
    font-size: 1rem;
}

.merge-how-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}

.merge-how-grid article {
    display: flex;
    gap: 10px;
}

.merge-how-grid article > span {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: .76rem;
    font-weight: 900;
}

.merge-how-grid h3 {
    margin: 1px 0 4px;
    font-size: .86rem;
}

.merge-how-grid p {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.5;
}

.merge-sidebar {
    padding: 24px 22px;
    display: flex;
    flex-direction: column;
}

.merge-sidebar-heading {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
}

.merge-sidebar-heading h2 {
    margin: 0;
    font-size: 1.02rem;
}

.merge-sidebar-heading p {
    margin: 0;
    color: var(--muted);
    font-size: .78rem;
}

.merge-empty-state {
    margin-top: 18px;
    padding: 14px;
    display: flex;
    gap: 10px;
    border: 1px solid #cde0f7;
    border-radius: 11px;
    background: #f4f9ff;
    color: #315f96;
    font-size: .82rem;
}

.merge-empty-state p {
    margin: 0;
}

.merge-benefits {
    margin: 26px 0;
    display: grid;
    gap: 20px;
}

.merge-benefits article {
    display: flex;
    gap: 11px;
}

.benefit-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid #24a261;
    color: #14864c;
    font-weight: 900;
}

.merge-benefits strong {
    display: block;
    font-size: .86rem;
}

.merge-benefits p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: .77rem;
    line-height: 1.4;
}

.merge-progress {
    margin: auto 0 14px;
}

.merge-progress-top {
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: .78rem;
}

.merge-progress-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #e9eeec;
}

.merge-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width .2s ease;
}

.merge-message {
    margin-bottom: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: .8rem;
}

.merge-message.error {
    border: 1px solid #f0cccc;
    background: #fff2f2;
    color: #963939;
}

.merge-message.success {
    border: 1px solid #cce7dc;
    background: #edf8f3;
    color: #1f654f;
}

.merge-primary,
.merge-secondary {
    width: 100%;
    min-height: 46px;
    border-radius: 11px;
    font-weight: 850;
    cursor: pointer;
}

.merge-primary {
    margin-top: auto;
    border: 0;
    background: #e72727;
    color: #fff;
}

.merge-primary:hover:not(:disabled) {
    background: #c91e1e;
}

.merge-primary:disabled {
    background: #f5c7c7;
    color: #b66c6c;
    cursor: not-allowed;
}

.merge-secondary {
    margin-top: 10px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text);
}

.merge-secondary:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.merge-tip {
    margin-top: 20px;
    padding: 15px 18px;
    display: flex;
    gap: 11px;
    border: 1px solid #f1dede;
    border-radius: 13px;
    background: #fff8f8;
}

.merge-tip p {
    margin: 0;
    font-size: .84rem;
}

.merge-info {
    max-width: 920px;
    padding-top: 48px;
}

.merge-info h2 {
    margin: 26px 0 8px;
    font-size: 1.35rem;
}

.merge-info p {
    margin: 0;
    color: var(--muted);
}

.merge-promo-after,
.merge-promo-final {
    margin-top: 20px;
}

@media (max-width: 900px) {
    .merge-workspace {
        grid-template-columns: 1fr;
    }

    .merge-main {
        border-right: 0;
        border-bottom: 1px solid var(--border);
    }

    .merge-how-grid {
        grid-template-columns: 1fr;
    }

    .merge-primary {
        margin-top: 10px;
    }
}

@media (max-width: 620px) {
    .merge-heading {
        align-items: flex-start;
    }

    .merge-title-icon {
        width: 54px;
        height: 54px;
        flex-basis: 54px;
    }

    .merge-dropzone {
        min-height: 290px;
        padding: 28px 16px;
    }

    .merge-main,
    .merge-sidebar {
        padding: 16px;
    }

    .merge-files-header {
        align-items: stretch;
        flex-direction: column;
    }

    .merge-add-more {
        width: 100%;
    }

    .merge-file-card {
        grid-template-columns: auto minmax(0,1fr) auto;
    }

    .merge-file-index {
        display: none;
    }
}
