.v4-bni-dashboard {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.v4-bni-dashboard-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--v4-line);
    border-radius: 16px;
    background: var(--v4-surface);
    box-shadow: var(--v4-shadow-sm);
}

.v4-bni-dashboard-focus {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(220px, .6fr);
    grid-template-areas: "heading total" "actions total";
    column-gap: 24px;
    align-items: center;
    padding: 16px 24px;
    border-color: var(--v4-nav);
    background: var(--v4-nav);
}

.v4-bni-dashboard-card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.v4-bni-dashboard-icon {
    display: inline-grid;
    flex: 0 0 36px;
    height: 36px;
    place-items: center;
    border-radius: 10px;
    color: var(--v4-brand);
    background: var(--v4-brand-soft);
}

.v4-bni-dashboard-card h2 {
    margin: 0;
    color: var(--v4-ink);
    font-size: 1rem;
    font-weight: 700;
}

.v4-bni-dashboard-focus .v4-bni-dashboard-card-heading {
    grid-area: heading;
}

.v4-bni-dashboard-focus .v4-bni-dashboard-icon {
    color: var(--v4-brand-on-dark);
    background: rgba(213, 229, 242, .12);
}

.bni-v4 .v4-bni-dashboard-focus h2 {
    color: white;
    font-size: clamp(1.15rem, 2vw, 1.7rem);
}

.v4-bni-dashboard-total {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 8px;
    margin: 0;
    color: var(--v4-muted);
}

.v4-bni-dashboard-total strong {
    color: var(--v4-brand);
    font-size: 2rem;
    line-height: 1.1;
    letter-spacing: -.035em;
    font-variant-numeric: tabular-nums;
}

.v4-bni-dashboard-focus .v4-bni-dashboard-total {
    grid-area: total;
    align-content: center;
    height: 100%;
    padding-inline-start: 24px;
    border-inline-start: 1px solid rgba(255, 255, 255, .22);
    color: var(--v4-brand-on-dark);
}

.v4-bni-dashboard-focus .v4-bni-dashboard-total strong {
    color: var(--v4-brand-on-dark);
    font-size: 2.75rem;
}

.v4-bni-dashboard-total[data-state="error"] strong {
    color: inherit;
    font-size: inherit;
    letter-spacing: normal;
}

.v4-bni-dashboard-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--v4-line);
}

.bni-v4 .v4-bni-dashboard-action {
    display: inline-flex;
    min-height: 44px;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 0;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--v4-brand);
    font-size: .92rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.bni-v4 .v4-bni-dashboard-action:hover {
    color: var(--v4-brand-strong);
    text-decoration: underline;
}

.bni-v4 .v4-bni-dashboard-action.is-add {
    padding-inline: 10px;
    border-color: var(--v4-line);
    background: var(--v4-paper);
    color: var(--v4-ink);
}

.v4-bni-dashboard-focus .v4-bni-dashboard-actions {
    grid-area: actions;
    justify-content: flex-start;
    padding: 0;
    border: 0;
}

.bni-v4 .v4-bni-dashboard-focus .v4-bni-dashboard-action {
    padding-inline: 12px;
}

.bni-v4 .v4-bni-dashboard-focus .is-primary {
    background: var(--v4-brand-on-dark);
    color: var(--v4-nav);
}

.bni-v4 .v4-bni-dashboard-focus .is-add {
    border-color: rgba(255, 255, 255, .42);
    background: transparent;
    color: white;
}

.bni-v4 .v4-bni-dashboard-focus .v4-bni-dashboard-action:focus-visible {
    outline-color: var(--v4-brand-on-dark);
}

.v4-bni-dashboard-action svg {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.v4-bni-dashboard-retry {
    grid-column: 1 / -1;
    justify-self: start;
    min-height: 44px;
    padding: 0;
    border: 0;
    color: var(--v4-brand);
    background: transparent;
    font-weight: 600;
    text-decoration: underline;
}

@media (max-width: 799px) {
    .v4-bni-dashboard {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }

    .v4-bni-dashboard-card {
        display: grid;
        grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
        grid-template-areas: "heading total" "actions actions";
        align-items: center;
        gap: 8px;
        padding: 12px;
    }

    .v4-bni-dashboard-card-heading { grid-area: heading; }

    .v4-bni-dashboard-total,
    .v4-bni-dashboard-focus .v4-bni-dashboard-total {
        grid-area: total;
        justify-content: flex-end;
        gap: 0 6px;
        height: auto;
        padding: 0;
        border: 0;
        text-align: end;
    }

    .v4-bni-dashboard-total strong { font-size: 1.55rem; }
    .v4-bni-dashboard-focus .v4-bni-dashboard-total strong { font-size: 1.8rem; }
    .v4-bni-dashboard-total span { font-size: .83rem; }
    .v4-bni-dashboard-total[data-state="error"] strong { font-size: .9rem; }
    .v4-bni-dashboard-actions { grid-area: actions; }
}

@media (max-width: 359px) {
    .v4-bni-dashboard-focus .v4-bni-dashboard-icon { display: none; }
}
