/* Layout */
.content-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5vh;
    padding: 0 5vw;
    justify-content: center;
    flex: 1;
    height: auto;
    width: 100%;
    align-items: center;
}

.slide-header {
    margin-bottom: 2vh;
    width: 100%;
    text-align: center;
}

/* Explicitly allow subtitle to take full width */
.slide-header .subtitle {
    max-width: 100%;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.badge-container {
    margin-bottom: 1.5vh;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: linear-gradient(180deg, #fff, #f9fbff);
    box-shadow: var(--shadow-sm);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
}

/* Market Frame (Nested Boxes) */
.market-frame {
    width: 100%;
    max-width: 1200px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 2vh;
    box-shadow: var(--shadow-md);
    margin-bottom: 2vh;
}

.market-box {
    border-radius: 12px;
    padding: 1.5vh 2vw;
    border: 1px solid rgba(37, 99, 235, 0.15);
}

.market-box.tam {
    background: #eff6ff;
    border-color: #dbeafe;
}

.market-box.sam {
    background: #dbeafe;
    border-color: #bfdbfe;
    margin-top: 1vh;
}

.market-box.som {
    background: #bfdbfe;
    border-color: #93c5fd;
    margin-top: 1vh;
}

.market-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1vh;
}

.market-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.9;
}

.amount {
    font-size: 20px;
    font-weight: 800;
    color: var(--accent);
}

.market-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.market-desc strong {
    color: var(--text-primary);
}

/* New Institutional Text Line */
.institutional-text-line {
    width: 100%;
    max-width: 1200px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    background: #f8fafc;
    /* Subtle background */
    padding: 1.5vh 2vw;
    border-radius: 12px;
    border: 1px solid var(--border);
}

/* Footnote */
.footnote {
    width: 100%;
    max-width: 1200px;
    font-size: 11px;
    color: var(--text-tertiary);
    text-align: center;
    padding: 1vh 0;
    opacity: 0.7;
}

/* Responsive constraints */
@media (max-height: 800px) {
    .market-box {
        padding: 1.5vh 1.5vw;
    }

    .amount {
        font-size: 20px;
    }

    .slide-header {
        margin-bottom: 2vh;
    }
}

.data-source {
    display: block;
    font-size: 10px;
    font-style: italic;
    color: var(--text-tertiary);
    margin-top: 4px;
    font-weight: 400;
}

/* Group for Side-by-Side SOMs */
.som-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5vh;
    margin-top: 1.5vh;
    width: 100%;
}

.som-group .market-box.som {
    margin-top: 0;
    /* Reset margin since gap handles spacing */
    height: 100%;
    /* Equal height */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Responsive adjustment for smaller screens */
@media (max-width: 768px),
(max-height: 700px) {
    .som-group {
        grid-template-columns: 1fr;
        gap: 1vh;
    }
}