@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ==========================================================================
   1. BASE STYLES & CONTAINER (CLS PROTECTED)
   ========================================================================== */
.ctp-wrapper {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0px;
    color: #1e293b;
    box-sizing: border-box;
    
    /* RESERVES EXACT DESKTOP HEIGHT (TITLE + 2-COL TABLE) */
    min-height: 724px; 
    contain: layout style;
}

.ctp-wrapper *, 
.ctp-wrapper *::before, 
.ctp-wrapper *::after {
    box-sizing: border-box;
}

.ctp-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
    line-height: 1.3;
    border-left: 4px solid #2563eb;
    padding-left: 12px;
    min-height: 31px; /* Reserves vertical height before text renders */
}

.ctp-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    min-height: 648px;
}

.ctp-table {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    height: fit-content;
    min-height: 648px; /* Prevents container collapse prior to JS injection */
}

.ctp-head {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    min-height: 46px;
}

.ctp-head span {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Explicit image width and height to enforce 0 CLS during asset load */
.ctp-head span img {
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    display: inline-block;
    flex-shrink: 0;
    width: 24px;
    height: 18px;
    aspect-ratio: 24 / 18;
}

.ctp-head span:last-child {
    justify-content: flex-end;
    text-align: right;
}

.ctp-row {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    transition: background 0.15s ease;
    gap: 12px;
    min-height: 46px; /* Holds row size while API values compute */
}

.ctp-row:last-child {
    border-bottom: none;
}

.ctp-amt-link {
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    line-height: 1.4;
    display: inline-block;
    transition: color 0.15s ease;
    word-break: break-word;
}

.ctp-amt-link:hover {
    text-decoration: underline;
}

.ctp-unit {
    display: inline-block;
}

.ctp-val {
    text-align: right;
    font-weight: 600;
    font-size: 0.95rem;
    color: #0f172a;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* ==========================================================================
   🔵 LEFT TABLE COLOR PALETTE (PROFESSIONAL BLUE)
   ========================================================================== */
.leftTable {
    position: relative;
}
.ctp-grid .ctp-table:first-child .ctp-head {
    background: #f0f7ff;
    color: #1e3a8a;
}
.ctp-grid .ctp-table:first-child .ctp-row:hover {
    background: #f4f9ff;
}
.ctp-grid .ctp-table:first-child .ctp-amt-link {
    color: #2563eb;
}
.ctp-grid .ctp-table:first-child .ctp-amt-link:hover {
    color: #1d4ed8;
}

/* ==========================================================================
   🟢 RIGHT TABLE COLOR PALETTE (ELEGANT EMERALD/TEAL)
   ========================================================================== */
.rightTable {
    position: relative;
}
.ctp-grid .ctp-table:last-child .ctp-head {
    background: #f0fdf4;
    color: #064e3b;
    border-bottom: 1px solid #dcfce7;
}
.ctp-grid .ctp-table:last-child {
    border-style: solid;
    border-width: 1px;
    border-color: #e2e8f0;
}
.ctp-grid .ctp-table:last-child .ctp-row:hover {
    background: #f4fdf7;
}
.ctp-grid .ctp-table:last-child .ctp-amt-link {
    color: #0d9488;
}
.ctp-grid .ctp-table:last-child .ctp-amt-link:hover {
    color: #0f766e;
}

/* ==========================================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
    .ctp-wrapper { 
        margin: 1.5rem auto; 
        min-height: 700px;
    }
    .ctp-grid { gap: 16px; }
    .ctp-title { font-size: 1.35rem; margin-bottom: 1.25rem; }
    .ctp-row { padding: 11px 14px; min-height: 44px; }
}

@media (max-width: 768px) {
    .ctp-wrapper { 
        /* STACKED 1-COL TABLE RESERVED MIN-HEIGHT */
        min-height: 1370px; 
    }
    .ctp-grid { 
        grid-template-columns: 1fr; 
        gap: 24px; 
        min-height: 1296px;
    }
    .ctp-title { font-size: 1.25rem; padding-left: 10px; }
    .ctp-table { border-radius: 10px; }
}

@media (max-width: 480px) {
    .ctp-wrapper { 
        padding: 0px; 
        margin: 1rem auto; 
        
        /* SMALL MOBILE STACKED RESERVED MIN-HEIGHT */
        min-height: 1060px; 
    }
    .ctp-grid { gap: 20px; }
    .ctp-title { font-size: 1.15rem; margin-bottom: 1rem; }
    .ctp-head { padding: 12px 14px; font-size: 0.85rem; min-height: 38px; }
    .ctp-row { padding: 10px 14px; grid-template-columns: 1.1fr 0.9fr; gap: 8px; min-height: 35px; }
    .ctp-amt-link { font-size: 0.88rem; }
    .ctp-val { font-size: 0.9rem; }
    .ctp-head span img { 
        width: 20px; 
        height: 15px; 
        aspect-ratio: 20 / 15;
    }
}