/* Component: Theme-compatibility adjustments; loaded last in the shared chain. Rules are plugin-scoped (.cbah-*). */
/* Final 1.8.1 typography/layout refinements. */
.cbah-home-snapshot.cbah-snapshot-page,
.cbah-home-snapshot.cbah-snapshot-home {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) !important;
}




.cbah-home-snapshot .cbah-snap-label,
.cbah-home-snapshot .cbah-snap-market-title {
    font-family: var(--cbah-body-font, "Josefin Sans", sans-serif) !important;}





.cbah-snap-metric-label {
    font-family: var(--cbah-body-font, "Josefin Sans", sans-serif) !important;}

.cbah-snap-metric-value {
    font-family: var(--cbah-body-font, "Josefin Sans", sans-serif) !important;}

.cbah-snap-metrics-count-1 .cbah-snap-metrics-row,
.cbah-snap-metrics-count-2 .cbah-snap-metrics-row,
.cbah-snap-metrics-count-3 .cbah-snap-metrics-row {
    grid-template-columns: none !important;
}

/* Keep market mover values comfortably inside the table on narrower admin widths. */
.cbah-dashboard-wrap .cbah-market-movers-table th:first-child,
.cbah-dashboard-wrap .cbah-market-movers-table td:first-child {
    width: 38% !important;
    padding-right: 10px !important;
}

.cbah-dashboard-wrap .cbah-market-movers-table th.cbah-table-price,
.cbah-dashboard-wrap .cbah-market-movers-table td.cbah-table-price-value {
    width: 27% !important;
    min-width: 72px !important;
    padding-left: 8px !important;
    padding-right: 8px !important;
    font-size: 0.74rem !important;
}

.cbah-dashboard-wrap .cbah-market-movers-table th.cbah-table-value,
.cbah-dashboard-wrap .cbah-market-movers-table td.cbah-table-value {
    width: 35% !important;
    min-width: 88px !important;
    padding-left: 8px !important;
    padding-right: 16px !important;
}

@media (max-width: 900px) {
    .cbah-home-snapshot.cbah-snapshot-page,
    .cbah-home-snapshot.cbah-snapshot-home {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
    .cbah-home-snapshot .cbah-snap-item {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }
    .cbah-snap-metrics-grid {
        column-gap: 0 !important;
    }
}

@media (max-width: 600px) {
        .cbah-snap-metrics-grid {
        column-gap: 0 !important;
    }
}


/* 1.8.1 final correction pass: snapshot metrics, ticker full-bleed behavior,
 * macro tab visibility and market-mover spacing. All selectors are plugin-scoped. */
.cbah-home-snapshot.cbah-snapshot-page,
.cbah-home-snapshot.cbah-snapshot-home {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.20fr) !important;
}

.cbah-home-snapshot .cbah-snap-label,
.cbah-home-snapshot .cbah-snap-market-title {
    font-family: var(--cbah-body-font, "Josefin Sans", sans-serif) !important;
    font-size: 0.80rem !important;
    line-height: 1.2 !important;
    font-weight: 600 !important;
    letter-spacing: 0.55px !important;
}

.cbah-home-snapshot .cbah-snap-value {
    font-family: var(--cbah-body-font, "Josefin Sans", sans-serif) !important;
    font-size: 1.02rem !important;
    line-height: 1.25 !important;
}


.cbah-snap-market-title {
    display: block !important;
    width: 100% !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: nowrap !important;
}

.cbah-snap-metrics-row {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 7px !important;
    white-space: nowrap !important;
}

.cbah-snap-metric-label,
.cbah-snap-metric-value {
    flex: 0 1 auto !important;font-family: var(--cbah-body-font, "Josefin Sans", sans-serif) !important;
}

.cbah-snap-metric-label {    line-height: 1.2 !important;
    font-weight: 600 !important;}

.cbah-snap-metric-value {    line-height: 1.2 !important;
    font-weight: 700 !important;
}

.cbah-snap-metric-separator {
    flex: 0 0 auto !important;
    font-family: var(--cbah-body-font, "Josefin Sans", sans-serif) !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    opacity: 0.65 !important;
}

.cbah-snapshot-home .cbah-snap-metric-separator {
    color: rgba(255,255,255,0.75) !important;
}

.cbah-snapshot-page .cbah-snap-metric-separator {
    color: #64748b !important;
}

/* Full-width ticker: the component escapes a narrower content column while
 * remaining completely scoped to its own shortcode output. */
.cbah-price-ticker.cbah-ticker-full-bleed {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
}

.cbah-price-ticker.cbah-ticker-full-bleed .cbah-ticker-wrapper {
    text-align: left !important;
}

.cbah-price-ticker .cbah-ticker-group-secondary {
    display: flex !important;
}

.cbah-price-ticker.cbah-ticker-js .cbah-ticker-track {
    animation: none !important;
}

/* Macro inner tabs: active state controls both underline and pane. */
.cbah-macro-tabs .cbah-mac-tab.active {
    color: #0f172a !important;
    border-bottom-color: #3b82f6 !important;
}

.cbah-macro-tabs .cbah-mac-tab[aria-selected="true"] {
    color: #0f172a !important;
    border-bottom-color: #3b82f6 !important;
}

.cbah-macro-tabs .cbah-mac-tab[aria-selected="false"] {
    color: #64748b !important;
    border-bottom-color: transparent !important;
}

.cbah-mac-pane.active {
    display: block !important;
}

.cbah-mac-pane:not(.active) {
    display: none !important;
}

.cbah-market-symbol-title {
    margin: 0 0 4px !important;
    color: #0f172a !important;
    font-size: 18px !important;
    line-height: 1.25 !important;
}

.cbah-active-symbol {
    margin: 0 !important;
    color: #64748b !important;
    font-size: 13px !important;
}

@media (max-width: 1100px) {
    .cbah-home-snapshot .cbah-snap-market-title,
    .cbah-home-snapshot .cbah-snap-label {
        font-size: 0.74rem !important;
    }

    
    
    .cbah-snap-metrics-grid {
        column-gap: 0 !important;
    }
}

@media (max-width: 900px) {
    .cbah-home-snapshot.cbah-snapshot-page,
    .cbah-home-snapshot.cbah-snapshot-home {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    }

@media (max-width: 600px) {
    
    .cbah-snap-metrics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .cbah-snap-metric-label,
    .cbah-snap-metric-value,
    .cbah-snap-metric-separator {
        white-space: nowrap !important;
    }

    .cbah-price-ticker.cbah-ticker-full-bleed {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}


/* --------------------------------------------------------------------------
 * 1.8.1 UI correction pass — snapshot spacing, centering and report actions.
 * Layout/visual-only overrides; no data, shortcode or interaction behavior
 * is changed.
 * -------------------------------------------------------------------------- */

/* Keep the complete four-column snapshot visually grouped and centered. */
.cbah-home-snapshot.cbah-snapshot-page,
.cbah-home-snapshot.cbah-snapshot-home {
    width: 100% !important;
    max-width: 1180px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    justify-self: center !important;
    column-gap: 0 !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.12fr) !important;
}

/* Reduce the visual distance between the four snapshot sections. */
.cbah-home-snapshot.cbah-snapshot-page .cbah-snap-item,
.cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item {
    padding-left: 6px !important;
    padding-right: 6px !important;
}

.cbah-home-snapshot.cbah-snapshot-page .cbah-snap-item:first-child,
.cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:first-child {
    padding-left: 0 !important;
}

.cbah-home-snapshot.cbah-snapshot-page .cbah-snap-item:last-child,
.cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:last-child {
    padding-right: 0 !important;
}

/* Keep only one divider immediately before Market Turnover & Size. */
.cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:last-child {
    border-left: 0 !important;
}


.cbah-home-snapshot.cbah-snapshot-page .cbah-snap-item:last-child,
.cbah-home-snapshot.cbah-snapshot-page .cbah-snap-item:nth-child(3) {
    border-left: 0 !important;
    border-right: 0 !important;
}

.cbah-snap-market-metrics {border-left: 0 !important;
}

/* Top Gainer and Top Loser snapshot values: slightly more compact. */
.cbah-home-snapshot .cbah-snap-item:nth-child(2) .cbah-snap-value,
.cbah-home-snapshot .cbah-snap-item:nth-child(3) .cbah-snap-value {
    font-size: 0.94rem !important;
    line-height: 1.22 !important;
}

/* View/Download report actions use the same compact typography and stay on one line. */
.cbah-reports-preview .cbah-btn-view,
.cbah-reports-preview .cbah-btn-download,
.cbah-reports-preview .cbah-btn-large {
    font-size: 12px !important;
    line-height: 1.2 !important;
    white-space: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    box-sizing: border-box !important;
}

.cbah-reports-preview .cbah-btn-view {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px 18px !important;
}

.cbah-reports-preview .cbah-btn-download,
.cbah-reports-preview .cbah-btn-large {
    padding: 10px 18px !important;
}

@media (max-width: 1100px) {
    .cbah-home-snapshot .cbah-snap-item:nth-child(2) .cbah-snap-value,
    .cbah-home-snapshot .cbah-snap-item:nth-child(3) .cbah-snap-value {
        font-size: 0.90rem !important;
    }
}

@media (max-width: 900px) {
    .cbah-home-snapshot.cbah-snapshot-page,
    .cbah-home-snapshot.cbah-snapshot-home {
        max-width: calc(100% - 16px) !important;
    }

    }


/* --------------------------------------------------------------------------
 * 1.8.1 UI correction pass 2 — market snapshot divider/metric alignment and
 * admin ticker settings separation. Visual/layout only; no data or behavior
 * is changed.
 * -------------------------------------------------------------------------- */

/* Give the fourth snapshot section enough room for all three market metrics. */
.cbah-home-snapshot.cbah-snapshot-page,
.cbah-home-snapshot.cbah-snapshot-home {
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(250px, 1.35fr) !important;
}

/* The divider before Market Turnover & Size is a single, consistent rule. */
.cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:nth-child(3) {
    border-right: 1.5px solid rgba(255,255,255,0.62) !important;
}

.cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:last-child,
.cbah-home-snapshot.cbah-snapshot-page .cbah-snap-item:last-child {
    border-left: 0 !important;
}

/* Market metrics use three equal cells so labels and values cannot collide. */
.cbah-snap-market-metrics {
    min-width: 0 !important;
    padding-left: 8px !important;
    padding-right: 0 !important;
    gap: 5px !important;
}

.cbah-snap-metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    width: 100% !important;
    min-width: 0 !important;
    align-items: start !important;
    column-gap: 0 !important;
}

.cbah-snap-metric-cell {
    min-width: 0 !important;
    width: auto !important;
    padding: 0 8px 0 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
}

.cbah-snap-metric-cell + .cbah-snap-metric-cell {
    padding-left: 12px !important;
}

.cbah-snap-metric-cell + .cbah-snap-metric-cell::before {
    content: "|" !important;
    left: 0 !important;
    top: 0 !important;
    line-height: 1.2 !important;
    color: #94a3b8 !important;
}

.cbah-snapshot-home .cbah-snap-metric-cell + .cbah-snap-metric-cell::before {
    color: rgba(255,255,255,0.72) !important;
}

.cbah-snap-metric-label,
.cbah-snap-metric-value {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: clip !important;
    box-sizing: border-box !important;
}

.cbah-snap-metric-label {
    font-size: 0.68rem !important;
    letter-spacing: 0.4px !important;
}

.cbah-snap-metric-value {
    font-size: 0.74rem !important;
    letter-spacing: 0 !important;
}

@media (max-width: 1100px) {
    .cbah-home-snapshot.cbah-snapshot-page,
    .cbah-home-snapshot.cbah-snapshot-home {
        grid-template-columns: minmax(0, 0.92fr) minmax(0, 0.92fr) minmax(0, 0.92fr) minmax(240px, 1.30fr) !important;
    }

    .cbah-snap-metric-label {
        font-size: 0.64rem !important;
    }

    .cbah-snap-metric-value {
        font-size: 0.70rem !important;
    }
}

@media (max-width: 900px) {
    .cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:nth-child(3) {
        border-right: 0 !important;
    }

    .cbah-home-snapshot.cbah-snapshot-page,
    .cbah-home-snapshot.cbah-snapshot-home {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .cbah-snap-market-metrics {
        grid-column: 1 / -1 !important;
        padding-left: 0 !important;
    }

    .cbah-snap-metric-value {
        font-size: 0.74rem !important;
    }
}

@media (max-width: 600px) {
    .cbah-home-snapshot.cbah-snapshot-page,
    .cbah-home-snapshot.cbah-snapshot-home {
        grid-template-columns: 1fr !important;
    }

    .cbah-snap-market-metrics {
        grid-column: auto !important;
    }

    .cbah-snap-metric-label {
        font-size: 0.62rem !important;
    }

    .cbah-snap-metric-value {
        font-size: 0.70rem !important;
    }
}


/* --------------------------------------------------------------------------
 * 1.8.2 homepage snapshot spacing correction.
 * Visual/layout only. The four market-summary sections remain centralized
 * while occupying a tighter, fixed visual group on desktop.
 * -------------------------------------------------------------------------- */
@media (min-width: 901px) {
    .cbah-home-snapshot.cbah-snapshot-home {
        width: min(920px, calc(100% - 32px)) !important;
        max-width: 920px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        grid-template-columns: minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(0, 0.95fr) minmax(300px, 1.25fr) !important;
        column-gap: 0 !important;
    }

    .cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }

    .cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:first-child {
        padding-left: 0 !important;
    }

    .cbah-home-snapshot.cbah-snapshot-home .cbah-snap-item:last-child {
        padding-right: 0 !important;
    }

    .cbah-home-snapshot.cbah-snapshot-home .cbah-snap-market-metrics {
        padding-left: 6px !important;
    }
}


/* Pagination for list tabs */
.cbah-pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; padding: 12px 14px; border-top: 1px solid #e5e7eb; background: #fff; position: sticky; bottom: 0; }
.cbah-pager.is-loading { opacity: .55; pointer-events: none; }
.cbah-pager-btn { min-width: 34px; padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 4px; background: #fff; color: #111827; font: inherit; font-size: 13px; cursor: pointer; }
.cbah-pager-btn:hover:not(:disabled):not(.is-current) { background: #f3f4f6; }
/* Current page: unmistakable and theme-proof. It uses the palette colour from Settings, bold text and an
   accent underline (so it is not conveyed by colour alone) and ignores hover. aria-current mirrors it. */
.cbah-app-wrapper .cbah-pager-btn.is-current,
.cbah-app-wrapper .cbah-pager-btn[aria-current="page"] {
	background: var(--cbah-primary, #1e293b) !important;
	border-color: var(--cbah-primary, #1e293b) !important;
	color: #fff !important;
	font-weight: 700;
	box-shadow: inset 0 -3px 0 var(--cbah-accent, #3b82f6);
	cursor: default;
}
.cbah-pager-btn:disabled { opacity: .4; cursor: not-allowed; }
.cbah-pager-gap { padding: 0 2px; color: #6b7280; }
.cbah-pager-info { flex-basis: 100%; text-align: center; font-size: 12px; color: #6b7280; }

/* Shared Research Hub palette. Defaults exactly match the existing frontend colours. */
.cbah-app-wrapper .cbah-btn-download,
.cbah-app-wrapper .cbah-btn-large { background: var(--cbah-primary, #1e293b) !important; }
.cbah-app-wrapper .cbah-btn-download:hover,
.cbah-app-wrapper .cbah-btn-large:hover { filter: brightness(.88); }
.cbah-app-wrapper .cbah-nav-item.active { border-left-color: var(--cbah-accent, #3b82f6); }
.cbah-app-wrapper :is(a, button, input, select):focus-visible { outline: 2px solid var(--cbah-accent, #3b82f6); outline-offset: 2px; }

/* Research Hub controls: square corners by default; configurable in Settings. */
.cbah-app-wrapper button,
.cbah-app-wrapper .cbah-btn-view,
.cbah-app-wrapper .cbah-btn-large,
.cbah-app-wrapper .cbah-btn-download,
.cbah-app-wrapper .cbah-pager-btn,
.cbah-home-snapshot button,
.cbah-price-ticker button {
    border-radius: var(--cbah-button-radius, 0px) !important;
}
