/* =========================
   CLOAK
========================= */
[x-cloak] {
    display: none !important;
}

/* =========================
   OVERLAY — CALM + SCROLL FRIENDLY
========================= */
.tr-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;

    /* critical: allow viewport scroll if needed */
    overflow-y: auto;
}

/* =========================
   SHELL — CONTENT-LED HEIGHT
========================= */
.tr-modal-shell {
    width: 100%;
    max-width: 980px;

    background: #fff;
    border-radius: 14px;

    display: flex;
    flex-direction: column;

    /* do NOT trap height */
    max-height: calc(100vh - 40px);

    /* only inner body scrolls */
    overflow: hidden;

    box-shadow:
        0 8px 30px rgba(0,0,0,0.06),
        0 2px 10px rgba(0,0,0,0.04);
}

/* =========================
   HEADER — QUIET HIERARCHY
========================= */
.tr-modal-header {
    padding: 18px 26px;
    display: flex;
    justify-content: space-between;
    align-items: center;

    border-bottom: 1px solid #f3f3f3;
}

.tr-modal-title {
    font-size: 15.5px;
    font-weight: 500;
    color: #1a1a1a;
    letter-spacing: -0.1px;
}

.tr-modal-sub {
    font-size: 12.5px;
    color: #9a9a9a;
    margin-top: 2px;
}

.tr-modal-close {
    border: none;
    background: none;
    font-size: 18px;
    color: #9a9a9a;
    cursor: pointer;
}

.tr-modal-close:hover {
    color: #555;
}

/* =========================
   CONTENT — FLEX SAFE
========================= */
.tr-modal-content {
    display: flex;
    flex: 1;

    /* REQUIRED for vertical scrolling */
    min-height: 0;
}

/* =========================
   TABS — RESTRAINED
========================= */
.tr-modal-tabs {
    width: 176px;
    padding: 18px 14px;

    background: #fafafa;
    border-right: 1px solid #f1f1f1;

    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tr-modal-tabs button {
    border: none;
    background: transparent;

    padding: 8px 10px;
    font-size: 12.5px;
    color: #7a7a7a;
    text-align: left;

    cursor: pointer;
    border-radius: 6px;
    transition: color 0.2s ease, background 0.2s ease;
}

.tr-modal-tabs button.active {
    color: #0a66c2;
    background: rgba(10, 102, 194, 0.06);
    font-weight: 500;
}

.tr-modal-tabs button .nav-icon {
    opacity: 0.75;
}

.tr-modal-tabs button.active .nav-icon {
    opacity: 1;
    stroke: #0a66c2;
}

/* =========================
   BODY — SINGLE SCROLL SOURCE
========================= */
.tr-modal-body {
    flex: 1;
    padding: 26px 28px;

    overflow-y: auto;
    overscroll-behavior: contain;

    /* REQUIRED */
    min-height: 0;

    scrollbar-width: thin;
    scrollbar-color: #e6e6e6 transparent;
}

.tr-modal-body::-webkit-scrollbar {
    width: 6px;
}
.tr-modal-body::-webkit-scrollbar-thumb {
    background: #e6e6e6;
    border-radius: 6px;
}

/* =========================
   GRID — BREATHABLE
========================= */
.tr-ts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 22px;
}

/* =========================
   CARD — NO NOISE
========================= */
.tr-ts-item {
    cursor: pointer;
}

.tr-ts-img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: contain;

    background: #fbfbfb;
    border-radius: 6px;

    border: 1px solid #eeeeee;
}

.tr-ts-item:hover .tr-ts-img {
    border-color: #dddddd;
}

.tr-ts-item.active .tr-ts-img {
    border-color: #0a66c2;
    box-shadow: 0 0 0 1px #0a66c2 inset;
}

/* =========================
   MOBILE — FULL CONTENT, NO TRAPS
========================= */
@media (max-width: 768px) {

    .tr-modal-overlay {
        padding: 0;
    }

    .tr-modal-shell {
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .tr-modal-content {
        flex-direction: column;
    }

    .tr-modal-tabs {
        width: 100%;
        flex-direction: row;
        padding: 10px 12px;

        border-right: none;
        border-bottom: 1px solid #f1f1f1;

        overflow-x: auto;
    }

    .tr-modal-tabs button {
        white-space: nowrap;
    }

    .tr-modal-body {
        padding: 22px 18px;
    }
}


.nav-icon { width: 22px; height: 22px; stroke: #444; stroke-width: 1.8; fill: none; transition: 0.25s ease; }


/* ========================= SKELETON ========================= */ .tr-ts-skeleton-card { border-radius: 10px; }
.tr-ts-skeleton-img { width: 100%; aspect-ratio: 4 / 5; border-radius: 6px; background: linear-gradient( 110deg, #f2f2f2 25%, #ececec 37%, #f2f2f2 63% ); background-size: 200% 100%; animation: skeleton-drift 1.8s ease-in-out infinite; }
.tr-ts-skeleton-card { border-radius: 10px; } .tr-ts-skeleton-img { width: 100%; aspect-ratio: 4 / 5; border-radius: 6px; background: linear-gradient( 110deg, #f2f2f2 25%, #ececec 37%, #f2f2f2 63% ); background-size: 200% 100%; animation: skeleton-drift 1.8s ease-in-out infinite; }
@keyframes skeleton-drift { 0% { background-position: 200% 0; opacity: 0.85; } 50% { opacity: 1; } 100% { background-position: -200% 0; opacity: 0.85; } } .tr-ts-skeleton-card { animation: skeleton-float 3.5s ease-in-out infinite; } @keyframes skeleton-float { 0% { transform: translateY(0); } 50% { transform: translateY(-2px); } 100% { transform: translateY(0); } } @media (max-width: 768px) { .tr-ts-grid.skeleton { grid-template-columns: repeat(4, 1fr); gap: 14px; } .tr-ts-skeleton-img { aspect-ratio: 4 / 5; } }



