/* Behind the scenes governance drawer — demo host only (ENG-546 / W6b).
 * Never bundled into frontal/v1.js.
 * Placement: fixed right rail >= 1024px; bottom sheet < 1024px. */

.bts-peek-bar {
    position: fixed;
    top: 72px;
    right: 16px;
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #141923;
    color: #F8FAFC;
    border: 1px solid #2D3748;
    border-radius: 999px;
    padding: 8px 14px;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.22);
}

.bts-peek-bar:hover {
    background: #1E293B;
}

.bts-peek-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34D399;
    flex-shrink: 0;
}

.bts-peek-dot.running {
    background: #FBBF24;
}

.bts-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 360px;
    z-index: 35;
    background: #0F172A;
    color: #E2E8F0;
    border-left: 1px solid #1E293B;
    box-shadow: -8px 0 28px rgba(15, 23, 42, 0.24);
    display: flex;
    flex-direction: column;
    font-family: "Inter", system-ui, -apple-system, sans-serif;
}

@media (min-width: 1024px) {
    body.bts-drawer-open {
        padding-right: 360px;
        --cerebral-offset-right: 380px;
    }
}

@media (max-width: 1023px) {
    body.bts-drawer-visible {
        padding-bottom: 58px;
        --cerebral-offset-bottom: 60px;
    }

    body.bts-drawer-visible.bts-drawer-open {
        --cerebral-offset-bottom: calc(min(46vh, 380px) + 14px);
    }

    .bts-peek-bar {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 46px;
        padding: 0 16px;
        border-radius: 12px 12px 0 0;
        border-bottom: none;
        justify-content: flex-start;
    }

    .bts-drawer {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: min(46vh, 380px);
        border-left: none;
        border-top: 1px solid #334155;
        border-radius: 14px 14px 0 0;
        box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.35);
    }
}

.bts-head {
    padding: 12px 14px;
    border-bottom: 1px solid #1E293B;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #111C33;
}

.bts-head-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bts-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.bts-title {
    font-size: 14px;
    font-weight: 700;
    color: #F8FAFC;
    letter-spacing: -0.2px;
}

.bts-pill {
    font-size: 10.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 7px;
    border-radius: 999px;
}

.bts-pill-replayed {
    background: #312E81;
    color: #E0E7FF;
}

.bts-pill-probe {
    background: #78350F;
    color: #FEF3C7;
}

.bts-pill-fixture {
    background: #1E3A5F;
    color: #DBEAFE;
}

.bts-close-btn {
    background: transparent;
    border: 1px solid #334155;
    color: #CBD5E1;
    border-radius: 6px;
    padding: 4px 9px;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

.bts-close-btn:hover {
    border-color: #64748B;
    color: #fff;
}

.bts-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
}

.bts-view-toggle {
    display: inline-flex;
    background: #0F172A;
    border: 1px solid #334155;
    border-radius: 7px;
    padding: 2px;
}

.bts-view-btn {
    border: none;
    background: transparent;
    color: #94A3B8;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.bts-view-btn.active {
    background: #2D6A4F;
    color: #fff;
}

.bts-probe-btn {
    border: 1px solid #F59E0B;
    background: rgba(245, 158, 11, 0.14);
    color: #FDE68A;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    padding: 5px 10px;
    border-radius: 7px;
    cursor: pointer;
}

.bts-probe-btn:hover {
    background: rgba(245, 158, 11, 0.24);
}

.bts-probe-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bts-probe-btn:disabled:hover {
    background: rgba(245, 158, 11, 0.14);
}

.bts-fixture-banner {
    padding: 6px 14px;
    background: #172554;
    color: #BFDBFE;
    border-bottom: 1px solid #1E3A8A;
    font-size: 11px;
    font-weight: 500;
}

.bts-fixture-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: #1E293B;
    border-bottom: 1px solid #334155;
    font-size: 11.5px;
}

.bts-fixture-select {
    flex: 1;
    min-width: 0;
    background: #0F172A;
    color: #E2E8F0;
    border: 1px solid #475569;
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 11.5px;
    font-family: inherit;
}

.bts-fixture-replay {
    background: #334155;
    color: #F8FAFC;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.bts-fixture-replay:hover {
    background: #475569;
}

.bts-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px 92px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bts-turn-group {
    background: #162033;
    border: 1px solid #263248;
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bts-turn-group.is-probe {
    border-color: #B45309;
}

.bts-turn-group.is-unlinked {
    border-style: dashed;
    border-color: #475569;
}

.bts-turn-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
    color: #94A3B8;
}

.bts-turn-id {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #CBD5E1;
}

.bts-running-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    color: #FDE68A;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 7px;
    padding: 6px 9px;
}

.bts-event-card {
    background: #0F172A;
    border: 1px solid #253047;
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 12px;
}

.bts-event-card.kind-offer_blocked {
    border-left: 3px solid #EF4444;
}

.bts-event-card.kind-offer_validated {
    border-left: 3px solid #10B981;
}

.bts-event-card.kind-tool_call {
    border-left: 3px solid #38BDF8;
}

.bts-event-card.kind-offers_withheld {
    border-left: 3px solid #F59E0B;
}

.bts-event-card.kind-action_result {
    border-left: 3px solid #A78BFA;
}

.bts-event-card.kind-tap {
    border-left: 3px solid #60A5FA;
}

.bts-event-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.bts-kind-tag {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #94A3B8;
}

.bts-seq-tag {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 10.5px;
    color: #64748B;
}

.bts-event-summary {
    font-size: 12.5px;
    font-weight: 600;
    color: #F8FAFC;
    line-height: 1.35;
}

.bts-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.bts-badge {
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 5px;
    background: #1E293B;
    color: #CBD5E1;
}

.bts-badge.check-block {
    background: rgba(239, 68, 68, 0.18);
    color: #FCA5A5;
}

.bts-badge.check-pass {
    background: rgba(16, 185, 129, 0.18);
    color: #6EE7B7;
}

.bts-badge.audit {
    background: rgba(148, 163, 184, 0.15);
    color: #CBD5E1;
}

.bts-badge.browser-reported {
    background: rgba(167, 139, 250, 0.18);
    color: #DDD6FE;
}

.bts-detail-kv {
    font-size: 11.5px;
    color: #94A3B8;
    line-height: 1.45;
    word-break: break-word;
}

.bts-detail-kv code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: #E2E8F0;
}

.bts-raw-json {
    margin: 0;
    padding: 8px;
    background: #090E1A;
    border: 1px solid #1E293B;
    border-radius: 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #CBD5E1;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
