.td-deal-media-upload-shell {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px dashed rgba(72, 78, 96, 0.22);
    border-radius: 1rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 249, 252, 0.98)),
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.08), transparent 36%);
    padding: 1.25rem;
    min-height: 100%;
}

.td-deal-media-upload-shell.is-enhanced .td-deal-media-fallback,
.td-deal-media-upload-shell.is-enhanced .td-deal-media-fallback-submit {
    display: none !important;
}

.td-deal-media-uploader {
    min-height: clamp(20rem, 48vh, 28rem);
}

.td-deal-media-uploader .uppy-Dashboard-inner {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 1rem;
    border-color: rgba(72, 78, 96, 0.18);
}

.td-deal-media-uploader .uppy-Dashboard-AddFiles {
    border-radius: 0.9rem;
}

.td-deal-media-uploader .uppy-Dashboard-innerWrap,
.td-deal-media-uploader .uppy-Dashboard-content,
.td-deal-media-uploader .uppy-Dashboard-AddFiles {
    min-height: inherit;
}

.td-deal-media-card {
    border: 1px solid rgba(72, 78, 96, 0.14);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 0.75rem 1.75rem rgba(15, 23, 42, 0.04);
}

.td-deal-media-card__preview {
    border-radius: 0.9rem;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(248, 250, 252, 1), rgba(241, 245, 249, 1));
}

.td-deal-media-card__preview img {
    display: block;
    width: 100%;
    height: auto;
}

.td-deal-media-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.td-deal-media-summary {
    --td-media-summary-accent: #715b3c;
    --td-media-summary-accent-rgb: 113, 91, 60;
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    min-height: 8.6rem;
    padding: 1.25rem 1.35rem;
    overflow: hidden;
    border: 1px solid rgba(163, 130, 79, 0.22);
    border-radius: 1rem;
    background: #fffdf9;
    box-shadow: none;
}

.td-deal-media-summary::after {
    display: none;
}

.td-deal-media-summary--visible {
    --td-media-summary-accent: #4f7b37;
    --td-media-summary-accent-rgb: 79, 123, 55;
    background: #fcfdf9;
}

.td-deal-media-summary--hidden {
    --td-media-summary-accent: #c1852a;
    --td-media-summary-accent-rgb: 193, 133, 42;
    background: #fffdf8;
}

.td-deal-media-summary__icon {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.9rem;
    height: 2.9rem;
    flex: 0 0 auto;
    border: 1px solid rgba(var(--td-media-summary-accent-rgb), 0.25);
    border-radius: 0.9rem;
    color: var(--td-media-summary-accent);
    background: rgba(var(--td-media-summary-accent-rgb), 0.09);
}

.td-deal-media-summary__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.td-deal-media-summary__label {
    color: #806e54;
    font-size: 0.71rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.td-deal-media-summary__metric {
    margin-top: 0.3rem;
    color: #2f2418;
    font-size: clamp(1.85rem, 2.2vw, 2.35rem);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1;
}

.td-deal-media-summary__hint {
    max-width: 17rem;
    margin: 0.55rem 0 0;
    color: #846f55;
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.35;
}

.td-deal-media-table-shell {
    overflow: hidden;
    border: 1px solid rgba(163, 130, 79, 0.32);
    border-radius: 1rem;
    background: #fffdf9;
    box-shadow: none;
}

.td-deal-media-table {
    width: 100%;
    min-width: 44rem;
    margin: 0 !important;
    border-collapse: separate;
    border-spacing: 0;
}

.td-deal-media-table thead th {
    padding: 0.92rem 1.45rem;
    border: 0 !important;
    color: #7c694f;
    background: #f4ead6;
    font-size: 0.69rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-transform: uppercase;
}

.td-deal-media-table thead th:first-child {
    padding-left: 1.55rem;
}

.td-deal-media-table tbody tr {
    --td-media-row-accent: #587f3d;
    background: #fffdf9;
    transition: background-color 150ms ease;
}

.td-deal-media-table tbody tr.is-hidden {
    --td-media-row-accent: #c1842b;
}

.td-deal-media-table tbody tr:hover {
    background: #fffaf1;
}

.td-deal-media-table tbody td {
    vertical-align: middle;
    padding: 1.3rem 1.45rem;
    border-top: 1px solid rgba(163, 130, 79, 0.2) !important;
    border-bottom: 0 !important;
}

.td-deal-media-table__type {
    width: 30%;
    min-width: 15.5rem;
    padding-left: 1.55rem !important;
}

.td-deal-media-table__document {
    width: 57%;
}

.td-deal-media-table__actions {
    width: 6.5rem;
    min-width: 6.5rem;
    padding-right: 1.55rem !important;
}

.td-deal-media-type-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.05rem;
    height: 3.05rem;
    flex: 0 0 auto;
    border: 1px solid rgba(113, 91, 60, 0.18);
    border-radius: 0.95rem;
    color: #69563e;
    background: #f8f1e5;
}

.td-deal-media-type-chip--image {
    color: #37736f;
    background: #eaf5f2;
}

.td-deal-media-type-chip--audio {
    color: #586b9d;
    background: #eef0fb;
}

.td-deal-media-type-chip--video {
    color: #a96c22;
    background: #fff1d6;
}

.td-deal-media-type-chip--document {
    color: #68533a;
    background: #f6efe3;
}

.td-deal-media-type-chip svg {
    width: 1.35rem;
    height: 1.35rem;
}

.td-deal-media-type-meta__name {
    color: #34271a;
    font-size: 1rem;
    font-weight: 750;
    line-height: 1.25;
}

.td-deal-media-type-meta__size {
    margin-top: 0.2rem;
    color: #8a765b;
    font-size: 0.8rem;
    font-weight: 650;
}

.td-deal-media-form {
    display: grid;
    gap: 0.65rem;
}

.td-deal-media-name-input {
    max-width: 100%;
}

.td-deal-media-visibility {
    padding-top: 0.65rem;
    border-top: 1px solid rgba(163, 130, 79, 0.16);
}

.td-deal-media-visibility__control {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem 0.8rem;
}

.td-deal-media-visibility .form-check {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.td-deal-media-visibility .form-check-input {
    width: 2.25rem !important;
    height: 1.25rem !important;
    margin: 0 !important;
    border-color: rgba(113, 91, 60, 0.32);
    box-shadow: none !important;
}

.td-deal-media-visibility .form-check-input:checked {
    border-color: #a9762d;
    background-color: #a9762d;
}

.td-deal-media-visibility .form-check-label {
    color: #5e4b34 !important;
    font-size: 0.9rem;
    font-weight: 700 !important;
}

.td-deal-media-visibility__state {
    display: inline-flex;
    align-items: center;
    min-height: 1.7rem;
    padding: 0.2rem 0.62rem;
    border: 1px solid #b7cf9d;
    border-radius: 999px;
    color: #48732f;
    background: #f1f7e8;
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1;
}

.td-deal-media-visibility__state.is-hidden {
    border-color: #edc16c;
    color: #af701b;
    background: #fff4df;
}

.td-deal-media-title-editor {
    display: flex;
    align-items: center;
    min-height: 2.35rem;
}

.td-deal-media-title-editor.is-editing {
    align-items: stretch;
}

.td-deal-media-title-editor__edit {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
}

.td-deal-media-title-display {
    display: inline-flex;
    align-items: center;
    min-height: 2.35rem;
    padding: 0.15rem 0;
    color: #302418;
    cursor: text;
    font-size: 1.08rem;
    font-weight: 760;
    letter-spacing: -0.018em;
    line-height: 1.3;
    word-break: break-word;
}

.td-deal-media-title-display:not(.td-deal-media-title-display--static):hover,
.td-deal-media-title-display:not(.td-deal-media-title-display--static):focus-visible {
    color: #4f7b37;
    outline: 0;
}

.td-deal-media-title-input {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
}

.td-deal-media-title-save {
    flex: 0 0 auto;
    border-color: rgba(79, 123, 55, 0.3) !important;
    color: #4f7b37 !important;
    background: #f1f7e8 !important;
    white-space: nowrap;
}

.td-deal-media-title-save.is-loading {
    cursor: wait;
    opacity: 0.75;
}

.td-deal-media-actions-trigger {
    width: 2.85rem !important;
    height: 2.85rem !important;
    border: 1px solid rgba(163, 130, 79, 0.38) !important;
    border-radius: 0.85rem !important;
    color: #5d4931 !important;
    background: #fffdf9 !important;
    box-shadow: none !important;
}

.td-deal-media-actions-trigger:hover,
.td-deal-media-actions-trigger:focus-visible,
.td-deal-media-actions-trigger[aria-expanded='true'] {
    border-color: #6b893e !important;
    color: #456d2e !important;
    background: #f2f7e9 !important;
}

.td-deal-media-modal__panel {
    width: min(100% - 32px, 1120px);
}

.td-deal-media-modal__footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
}

.td-media-actions-item {
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: 0.6rem;
    color: #59462f;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.td-media-actions-item:hover,
.td-media-actions-item:focus {
    color: #456d2e;
    background: #f2f7e9;
}

.td-media-actions-menu {
    z-index: 1200 !important;
    border: 1px solid rgba(163, 130, 79, 0.28) !important;
    border-radius: 0.9rem !important;
    background: #fffdf9 !important;
    box-shadow: 0 1rem 2.25rem rgba(63, 46, 24, 0.13) !important;
}

@media (max-width: 767.98px) {
    .td-deal-media-summary-grid {
        grid-template-columns: 1fr;
    }

    .td-deal-media-summary {
        min-height: auto;
    }

    .td-deal-media-uploader {
        min-height: 18rem;
    }

    .td-deal-media-upload-shell {
        padding: 1rem;
    }

    .td-deal-media-modal__panel {
        width: calc(100% - 16px);
    }

    .td-deal-media-upload-shell {
        gap: 0.85rem;
    }

    .td-deal-media-table-shell {
        overflow: visible;
    }

    .td-deal-media-table {
        min-width: 0;
    }

    .td-deal-media-table thead {
        display: none;
    }

    .td-deal-media-table tbody tr {
        display: block;
        border: 0;
        border-bottom: 1px solid rgba(163, 130, 79, 0.2);
        margin: 0;
    }

    .td-deal-media-table tbody td {
        display: block;
        width: 100%;
        border-top: 0 !important;
        padding: 1rem 1.1rem;
    }

    .td-deal-media-table tbody td[data-td-media-cell="actions"] {
        display: flex;
        justify-content: flex-end;
        border-top: 1px solid rgba(163, 130, 79, 0.16) !important;
    }

    .td-deal-media-table__type {
        min-width: 0;
        padding-left: 1.1rem !important;
    }

    .td-deal-media-modal__footer {
        padding-top: 0.85rem;
    }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .td-deal-media-table-shell {
        overflow-x: auto;
        overflow-y: hidden;
    }
}
