/* Domain comparisons keep native table semantics, sorting and column preferences. */
.bm-metrics .bm-heading { position: relative; }

.bm-metrics .bm-heading [data-abbr]::before { content: attr(data-abbr); }
.bm-metrics .bm-heading .bm-full {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.bm-metrics .ba-th-urut, .bm-metrics .s-sort { position: relative; gap: 0; }
.bm-metrics .ba-th-urut > i, .bm-metrics .s-sort-ic {
    position: absolute;
    right: 100%;
    margin-right: 1px;
    opacity: 0;
    pointer-events: none;
}
.bm-metrics th:is(:hover, :focus-within, [aria-sort=ascending], [aria-sort=descending]) :is(.ba-th-urut > i, .s-sort-ic),
.bm-metrics .ba-th-urut.aktif > i { opacity: 1; }

/* Center the value itself under its abbreviation, including when a score is missing. */
body table.bm-metrics th:has(.bm-heading),
body table.bm-metrics td:is(.c, .center),
body table.bm-metrics td:has(.ds-val, .s-bmr, .s-plain, .ck-metric, .bmr-cell) {
    text-align: center;
    font-variant-numeric: tabular-nums;
}
body table.bm-metrics .bm-heading { display: inline-block; }
body table.bm-metrics :is(.ck-metric, .s-metric, .bmr-cell, .s-bmr) {
    display: inline-flex;
    width: auto;
    min-width: 0;
    justify-content: center;
    align-items: baseline;
    gap: 2px;
}
body table.bm-metrics :is(.ds-val, .bmr-score) { min-width: 0; width: auto; text-align: center; }
body table.bm-metrics :is(.ck-bar, .s-bar) { display: none; }

/* Equal side space keeps the score centered while its dot sits on the left. */
body table.bm-metrics :is(.ck-metric, .s-metric):has(> :is(.ck-dot, .s-dot)) {
    position: relative;
    padding-inline: 9px;
}
body table.bm-metrics :is(.ck-dot, .s-dot) {
    display: block;
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
}
body table.bm-metrics :is(.bmr-cell, .s-bmr) { align-items: center; gap: 5px; }
body table.bm-metrics :is(.bmr-stars, .s-stars) {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    flex: none;
}
/* Reuse the rating's full, half and empty star states even when offline. */
body table.bm-metrics :is(.bmr-stars, .s-stars) > i {
    --star-on: var(--gold-solid, var(--s-mark, #c79836));
    --star-empty: var(--star-off, var(--s-star-off, #888785));
    display: block;
    width: 10px;
    height: 10px;
    background: var(--star-on);
    clip-path: polygon(50% 0, 62% 34%, 99% 35%, 70% 58%, 80% 95%, 50% 74%, 20% 95%, 30% 58%, 1% 35%, 38% 34%);
}
body table.bm-metrics :is(.bmr-stars, .s-stars) > .far { background: var(--star-empty); }
body table.bm-metrics :is(.bmr-stars, .s-stars) > .fa-star-half-stroke {
    background: linear-gradient(to right, var(--star-on) 50%, var(--star-empty) 50%);
}
body table.bm-metrics :is(.bmr-stars, .s-stars) > i::before { content: none; }

@media (min-width: 1024px) {
    :is(.ba-tw, .fc-table-wrap, .s-metric-table):has(> .bm-metrics) {
        container-type: inline-size;
        min-width: 0;
    }
    body table.bm-metrics:not([data-tiruan]) {
        width: 100%;
        min-width: 0;
        table-layout: auto;
    }
    body table.bm-metrics col { width: auto; }
    body .bm-metrics:is(.wide, .fc-table, [data-sortable]) :is(th, td) {
        padding-inline: clamp(8px, 1cqw, 15px);
        white-space: nowrap;
        vertical-align: middle;
        font-variant-numeric: tabular-nums;
    }
    body .bm-metrics td:has(> :is(.ck-dom, .ds-dom-wrap)) { width: 24%; }
    body .bm-metrics :is(.ck-dom, .ds-dom-wrap) {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        width: 0;
        min-width: 100%;
        max-width: none;
    }
    .bm-metrics :is(.ck-dom-nm, .ds-dom-name) {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bm-metrics :is(.ck-dom, .ds-dom-wrap) > :not(.ck-dom-nm, .ds-dom-name) { flex-shrink: 0; }

    @container (max-width: 950px) {
        body .bm-metrics:is(.wide, .fc-table, [data-sortable]) :is(th, td) { padding-inline: 8px; }
        body .bm-metrics :is(.ck-dom-fav, .ds-favicon) { display: none; }
    }
}
/* Reserve an icon rail on smaller laptops. Hover or keyboard focus expands the menu. */
@media (min-width: 1001px) and (max-width: 1320px) {
    body.studio-dashboard:has(main table.bm-metrics) { --sidebar-w: 56px; --ds-main-pad: 16px; }
    .studio-dashboard:has(main table.bm-metrics) .ba-side {
        width: 56px;
        overflow-x: hidden;
        white-space: nowrap;
    }
    .studio-dashboard:has(main table.bm-metrics) .ba-side:is(:hover, :focus-within) { width: 236px; z-index: 68; }
    .studio-dashboard:has(main table.bm-metrics) .ba-side:not(:hover, :focus-within) :is(.nm, .ba-nav-label, .ds-workspace-label, .ds-tools-chevron) { visibility: hidden; }
    .studio-dashboard:has(main table.bm-metrics) .ba-side:not(:hover, :focus-within) .ba-link { width: 40px; overflow: hidden; }
}
@media (max-width: 1023px) {
    .bm-metrics .ba-th-urut > i, .bm-metrics .s-sort-ic { opacity: .45; }
    :is(.ba-tw, .fc-table-wrap, .s-metric-table):has(> .bm-metrics) { overflow-x: auto; }
    body table.bm-metrics:not([data-tiruan]) { min-width: 56rem; }
}

.bm-actions-trigger { letter-spacing: .06em; }
.bm-row-actions {
    margin: auto;
    padding: 12px;
    width: min(260px, 88vw);
    max-height: 80vh;
    color: var(--text-main);
    background: var(--bg-raise, #252526);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 12px 36px #0004;
}
.bm-row-actions:popover-open { display: grid; gap: 4px; }
.bm-row-actions strong { padding: 4px 7px 8px; overflow-wrap: anywhere; white-space: normal; }
.bm-row-actions .ck-detail-btn {
    width: 100%; height: auto; min-height: 36px;
    justify-content: flex-start; padding: 6px 9px; gap: 9px;
}
.bm-row-actions .ck-detail-btn::after { content: attr(data-src); }
@media (min-width: 1024px) {
    body.studio-dashboard .ba-main table.bm-metrics.wide :is(th, td) { padding-inline: clamp(8px, 1cqw, 15px); }
    @container (max-width: 1250px) {
        body.studio-dashboard .ba-main :is(#baMktTable, #tabelSaya, #tabelKatalog) :is(th, td) { padding-inline: 6px; }
        :is(#baMktTable, #tabelSaya, #tabelKatalog) .ba-badge { padding-inline: 4px; letter-spacing: 0; }
        :is(#baMktTable, #tabelSaya, #tabelKatalog) .mkt-kontak { padding-inline: 2px; gap: 3px; }
        #baMktTable .ba-badge i { display: none; }
    }
}
@media (min-width: 1024px) and (max-width: 1150px) {
    .s-workspace:has(.bm-metrics) { grid-template-columns: minmax(0, 1fr); }
    .s-workspace:has(.bm-metrics) .s-workspace-side {
        flex-direction: row; align-items: center; padding: 8px 16px;
        border-right: 0; border-bottom: 1px solid var(--s-line);
    }
    .s-workspace:has(.bm-metrics) .s-workspace-tabs { display: flex; gap: 8px; }
    .s-workspace:has(.bm-metrics) .s-workspace-note { display: none; }
}
@media (min-width: 1024px) {
    @container (max-width: 1150px) {
        #baMktTable .ck-metric:has(> .ck-dot) { padding-inline: 4px; }
        #baMktTable .ck-dot { left: -5px; }
        #baMktTable :is(.ck-dom-fav, .mkt-kontak i) { display: none; }
        body.studio-dashboard .ba-main #baMktTable :is(th, td) { padding-inline: 4px; }
        body.studio-dashboard .ba-main #baMktTable :is(th:has(.bm-heading), td:has(.ck-metric, .bmr-cell), td[data-sort-value]) { padding-inline: 8px; }
    }
}

.page-cek-dapa-gratis .ck-analysis-results {
    grid-column: 1 / -1;
    min-width: 0;
    scroll-margin-top: 5rem;
}
@media (min-width: 761px) {
    .page-cek-dapa-gratis .ck-intake > .ck-brief { grid-area: 1 / 2; }
}
@media (max-width: 760px) {
    .page-cek-dapa-gratis .ck-intake { grid-template-columns: minmax(0, 1fr); }
}
