.cmm-deals {
    color: #172033;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 24px 0;
}

.cmm-deals * {
    box-sizing: border-box;
}

.cmm-deals__loader {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #d8e0ec;
    border-radius: 8px;
    color: #172033;
    display: flex;
    font-size: 16px;
    font-weight: 800;
    gap: 12px;
    justify-content: center;
    min-height: 320px;
    width: 100%;
}

.cmm-deals__spinner {
    animation: cmm-deals-spin 0.8s linear infinite;
    border: 3px solid #d8e6ff;
    border-top-color: #0b63f6;
    border-radius: 999px;
    display: inline-block;
    height: 28px;
    width: 28px;
}

.cmm-deals.is-ready .cmm-deals__loader {
    display: none;
}

.cmm-deals.is-ready .cmm-deals__content {
    display: block !important;
}

@keyframes cmm-deals-spin {
    to {
        transform: rotate(360deg);
    }
}

.cmm-deals__header {
    align-items: flex-end;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.cmm-deals__header h2 {
    font-size: 28px;
    line-height: 1.15;
    margin: 0;
}

.cmm-deals__controls {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.cmm-deals__search,
.cmm-deals__sort {
    display: grid;
    gap: 6px;
}

.cmm-deals__search {
    min-width: min(340px, 100%);
}

.cmm-deals__sort {
    min-width: 150px;
}

.cmm-deals__search span,
.cmm-deals__sort span {
    color: #4c5870;
    font-size: 13px;
    font-weight: 700;
}

.cmm-deals__search input,
.cmm-deals__sort select {
    border: 1px solid #cfd6e3;
    border-radius: 6px;
    color: #172033;
    font: inherit;
    min-height: 42px;
    padding: 9px 12px;
}

.cmm-deals__tabs {
    background: #eef2f7;
    border: 1px solid #d8deea;
    border-radius: 8px;
    display: inline-flex;
    padding: 3px;
}

.cmm-deals__tabs button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #35425a;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
    padding: 9px 13px;
}

.cmm-deals__tabs button.is-active {
    background: #172033;
    color: #fff;
}

.cmm-deals__count {
    color: #5d687c;
    font-size: 14px;
    margin: 0 0 14px;
}

.cmm-deals__panel {
    display: none;
}

.cmm-deals__panel.is-active {
    display: block;
}

.cmm-deal-grid {
    display: grid;
    gap: 24px;
    grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
}

.cmm-deal-card {
    background: #fff;
    border: 1px solid #d8e0ec;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(10, 24, 48, 0.09);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.cmm-deals img {
    max-width: 100%;
}

.cmm-deal-card[hidden],
.cmm-deals-table tr[hidden] {
    display: none;
}

.cmm-tombstone {
    background: #fff;
    color: #061638;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 368px;
}

.cmm-tombstone__header {
    align-items: center;
    background: linear-gradient(90deg, #061b49 0%, #082760 100%);
    color: #fff;
    display: flex;
    font-size: 16px;
    font-weight: 700;
    justify-content: flex-start;
    min-height: 50px;
    padding: 0 20px;
}

.cmm-tombstone__date {
    display: inline-block;
    padding-left: 32px;
    position: relative;
}

.cmm-tombstone__date::before {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='8' y='12' width='48' height='44' rx='6'/%3E%3Cpath d='M20 6v14M44 6v14M8 26h48'/%3E%3C/g%3E%3Cg fill='%23ffffff'%3E%3Crect x='18' y='34' width='7' height='5' rx='1'/%3E%3Crect x='29' y='34' width='7' height='5' rx='1'/%3E%3Crect x='40' y='34' width='7' height='5' rx='1'/%3E%3Crect x='18' y='44' width='7' height='5' rx='1'/%3E%3Crect x='29' y='44' width='7' height='5' rx='1'/%3E%3Crect x='40' y='44' width='7' height='5' rx='1'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    content: "";
    display: block;
    height: 22px;
    left: 0;
    position: absolute;
    top: -1px;
    width: 22px;
}

.cmm-tombstone__date::after {
    content: none;
}

.cmm-tombstone__body {
    display: grid;
    gap: 14px;
    grid-template-rows: auto auto auto minmax(38px, auto);
    padding: 20px 24px 18px;
}

.cmm-tombstone__party {
    align-items: center;
    display: grid;
    gap: 20px;
    grid-template-columns: 64px 1fr;
    min-height: 66px;
}

.cmm-tombstone__logo {
    align-items: center;
    background: #fff;
    border: 1px solid #dfe6f2;
    border-radius: 8px;
    display: flex;
    flex: 0 0 64px;
    height: 64px;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 64px;
}

.cmm-deals .cmm-tombstone__logo img,
.cmm-tombstone__logo img {
    display: block;
    height: auto !important;
    max-height: 48px;
    max-width: 52px !important;
    object-fit: contain;
    opacity: 0;
    position: absolute;
    transform: translateZ(0);
    visibility: hidden;
    width: auto !important;
    transition: opacity 0.15s ease;
}

.cmm-tombstone__logo.cmm-logo-loaded img {
    opacity: 1;
    visibility: visible;
}

.cmm-tombstone__logo.cmm-logo-loaded span {
    opacity: 0;
}

.cmm-tombstone__logo span {
    color: #061638;
    display: block;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.1;
    max-width: 56px;
    overflow: hidden;
    text-align: center;
}

.cmm-tombstone__name {
    color: #061638;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
}

.cmm-tombstone__phrase {
    align-items: center;
    color: #061638;
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr auto 1fr;
    margin: 0 10px;
}

.cmm-tombstone__phrase span {
    background: #8ea0bf;
    height: 1px;
}

.cmm-tombstone__phrase em {
    font-size: 18px;
    font-style: italic;
    white-space: nowrap;
}

.cmm-tombstone__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 36px;
    place-content: flex-start;
    padding-top: 4px;
}

.cmm-tombstone__chips span {
    border: 1px solid #2f61d3;
    border-radius: 6px;
    color: #0d4fd1;
    font-size: 12px;
    font-weight: 700;
    height: 32px;
    line-height: 1.1;
    max-width: 128px;
    overflow: hidden;
    padding: 8px 11px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cmm-tombstone__chips span:nth-child(2) {
    border-color: #2c8a5f;
    color: #176942;
}

.cmm-tombstone__chips span:nth-child(3) {
    border-color: #9b6a1a;
    color: #7d4d02;
}

.cmm-deal-card__actions {
    align-items: center;
    background: #f1f4f8;
    border-top: 1px solid #e1e6ef;
    display: flex;
    gap: 10px;
    padding: 12px 14px;
}

.cmm-deal-card__actions a,
.cmm-deal-card__details {
    align-items: center;
    appearance: none;
    background: #fff;
    border: 1px solid #cfd6e3;
    border-radius: 6px;
    color: #172033;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    text-decoration: none;
}

.cmm-deal-card__details {
    background: #0b63f6;
    border-color: #0b63f6;
    color: #fff;
    flex: 1 1 auto;
    max-width: 190px;
}

.cmm-deal-card__actions a:hover,
.cmm-deal-card__details:hover {
    background: #061b49;
    border-color: #061b49;
    color: #fff;
}

.cmm-modal-open {
    overflow: hidden;
}

.cmm-deal-modal[hidden] {
    display: none;
}

.cmm-deal-modal {
    bottom: 0;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 99999;
}

.cmm-deal-modal__backdrop {
    background: rgba(10, 16, 28, 0.56);
    bottom: 0;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

.cmm-deal-modal__dialog {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(10, 16, 28, 0.34);
    color: #172033;
    left: 50%;
    max-height: min(760px, calc(100vh - 40px));
    max-width: min(760px, calc(100vw - 28px));
    overflow: auto;
    padding: 26px;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
}

.cmm-deal-modal__close {
    align-items: center;
    background: #172033;
    border: 0;
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    font-size: 28px;
    height: 38px;
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: 18px;
    top: 18px;
    width: 38px;
}

.cmm-deal-modal__eyebrow {
    color: #5d687c;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
    margin: 0 48px 8px 0;
    text-transform: uppercase;
}

.cmm-deal-modal h3 {
    font-size: 28px;
    line-height: 1.15;
    margin: 0 48px 18px 0;
}

.cmm-deal-modal h4 {
    font-size: 15px;
    margin: 20px 0 6px;
    text-transform: uppercase;
}

.cmm-deal-modal p {
    color: #334158;
    line-height: 1.5;
    margin: 0 0 12px;
}

.cmm-detail-list {
    display: grid;
    gap: 8px;
    margin: 0 0 18px;
}

.cmm-detail-row {
    border-bottom: 1px solid #e4e8f0;
    display: grid;
    gap: 10px;
    grid-template-columns: 160px 1fr;
    padding-bottom: 8px;
}

.cmm-detail-row dt {
    color: #5d687c;
    font-weight: 800;
}

.cmm-detail-row dd {
    margin: 0;
}

.cmm-deal-modal__links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.cmm-deal-modal__links a {
    border: 1px solid #cfd6e3;
    border-radius: 6px;
    color: #172033;
    font-weight: 800;
    padding: 8px 10px;
    text-decoration: none;
}

.cmm-table-wrap {
    border: 1px solid #dce2ed;
    border-radius: 8px;
    overflow-x: auto;
}

.cmm-deals-table {
    border-collapse: collapse;
    font-size: 14px;
    min-width: 1100px;
    width: 100%;
}

.cmm-deals-table th,
.cmm-deals-table td {
    border-bottom: 1px solid #e5e9f1;
    padding: 10px 12px;
    text-align: left;
    vertical-align: top;
}

.cmm-deals-table th {
    background: #f3f6fa;
    color: #253148;
    font-weight: 800;
    white-space: nowrap;
}

.cmm-deals-table th:first-child,
.cmm-deals-table td:first-child {
    min-width: 112px;
    white-space: nowrap;
}

.cmm-deals-table tbody tr:nth-child(even) {
    background: #fafbfd;
}

.cmm-deals-table td {
    color: #26344d;
}

.cmm-deals-table a {
    color: #1b55a8;
    font-weight: 800;
}

.cmm-deals__empty,
.cmm-deals-error {
    background: #fff7e6;
    border: 1px solid #ffd98d;
    border-radius: 8px;
    color: #6f4a00;
    padding: 14px;
}

.cmm-deals__pagination {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-top: 22px;
}

.cmm-deals__pagination:empty {
    display: none;
}

.cmm-deals__pagination button {
    appearance: none;
    background: #fff;
    border: 1px solid #cfd8e6;
    border-radius: 6px;
    color: #172033;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    min-height: 38px;
    min-width: 38px;
    padding: 8px 12px;
}

.cmm-deals__pagination button.is-active {
    background: #061638;
    border-color: #061638;
    color: #fff;
}

.cmm-deals__pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

@media (max-width: 760px) {
    .cmm-deals__header {
        align-items: stretch;
        display: grid;
    }

    .cmm-deals__controls {
        justify-content: stretch;
    }

    .cmm-deals__search {
        width: 100%;
    }

    .cmm-deals__sort {
        width: 100%;
    }

    .cmm-deals__tabs {
        width: 100%;
    }

    .cmm-deals__tabs button {
        flex: 1;
    }

    .cmm-detail-row {
        grid-template-columns: 1fr;
    }
}
