.balance-quota {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.timer-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.balance-quota-status {
    color: #86909c;
    font-size: 13px;
    line-height: 1.5;
}

.balance-quota-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
    outline: none;
}

.balance-quota-title {
    flex-shrink: 0;
    color: #86909c;
    font-size: 13px;
    white-space: nowrap;
}

.balance-summary-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #f2f3f5;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.balance-quota-trigger:hover .balance-summary-chip,
.balance-quota-trigger:focus .balance-summary-chip,
.balance-quota-trigger:focus-within .balance-summary-chip {
    background: #e5e6eb;
}

.balance-summary-text {
    color: #1d2129;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.balance-summary-caret {
    color: #86909c;
    font-size: 10px;
    line-height: 1;
    transition: transform 0.2s ease;
}

.balance-quota-trigger:hover .balance-summary-caret,
.balance-quota-trigger:focus .balance-summary-caret,
.balance-quota-trigger:focus-within .balance-summary-caret {
    transform: rotate(180deg);
}

.balance-detail-popover {
    position: absolute;
    z-index: 30;
    bottom: calc(100% + 12px);
    left: 50%;
    min-width: 220px;
    padding: 10px 12px;
    border: 1px solid #e5e6eb;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(29, 33, 41, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, 4px);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
    pointer-events: none;
}

.balance-detail-popover::before {
    position: absolute;
    right: 0;
    bottom: -13px;
    left: 0;
    height: 13px;
    content: "";
}

.balance-detail-popover::after {
    position: absolute;
    bottom: -7px;
    left: 50%;
    width: 12px;
    height: 12px;
    border-right: 1px solid #e5e6eb;
    border-bottom: 1px solid #e5e6eb;
    background: #fff;
    content: "";
    transform: translateX(-50%) rotate(45deg);
}

.balance-quota-trigger:hover .balance-detail-popover,
.balance-quota-trigger:focus .balance-detail-popover,
.balance-quota-trigger:focus-within .balance-detail-popover {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.balance-detail-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    padding: 5px 2px;
}

.balance-detail-label {
    color: #86909c;
    font-size: 13px;
    white-space: nowrap;
}

.balance-detail-value {
    color: #1d2129;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.balance-quota.is-low .balance-quota-title,
.balance-quota.is-low .balance-summary-text,
.balance-quota.is-low .balance-detail-value {
    color: #d46b08;
}

.balance-quota.is-low .balance-summary-chip {
    border-color: #ffd591;
    background: #fff7e6;
}

@media (max-width: 768px) {
    .balance-quota {
        flex-wrap: wrap;
    }

    .balance-detail-popover {
        left: 0;
        transform: translate(0, 4px);
    }

    .balance-quota-trigger:hover .balance-detail-popover,
    .balance-quota-trigger:focus .balance-detail-popover,
    .balance-quota-trigger:focus-within .balance-detail-popover {
        transform: translate(0, 0);
    }

    .balance-detail-popover::after {
        left: 32px;
    }
}
