/* ============================================================================
   Cloud Botty AI — Full-Bleed IDE Workspace (Designs A, B, C) & Studio Motion
   ============================================================================ */

/* ── Botty CTA button ("botty-main" + BottyLure 5.5s greeting animation) ── */
.bz-botty-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid rgba(88, 166, 255, 0.55);
    background: rgba(62, 139, 255, 0.12);
    color: var(--bz-text, #e6edf3);
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    overflow: hidden;
    transition: background 140ms ease, border-color 140ms ease, transform 120ms ease;
    user-select: none;
}
.bz-botty-cta:hover {
    background: rgba(62, 139, 255, 0.24);
    border-color: rgba(88, 166, 255, 0.85);
}
.bz-botty-cta:active {
    background: rgba(62, 139, 255, 0.32);
}
.app-theme-light .bz-botty-cta {
    color: #1f5fa8;
    background: rgba(31, 95, 168, 0.08);
    border-color: rgba(31, 95, 168, 0.42);
}
.app-theme-light .bz-botty-cta:hover {
    background: rgba(31, 95, 168, 0.16);
}
.bz-botty-cta-icon {
    width: 19px;
    height: 19px;
    fill: currentColor;
    transform-origin: 50% 90%;
    flex-shrink: 0;
}
.bz-botty-cta.lure .bz-botty-cta-icon,
.bz-botty-cta:hover .bz-botty-cta-icon {
    animation: bz-botty-hop-wave 0.7s ease-in-out 1;
}
.bz-botty-cta-sheen {
    position: absolute;
    top: -10%;
    left: -40px;
    width: 24px;
    height: 120%;
    background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.43), rgba(255,255,255,0));
    transform: skewX(-20deg);
    pointer-events: none;
    opacity: 0;
}
.bz-botty-cta.lure .bz-botty-cta-sheen,
.bz-botty-cta:hover .bz-botty-cta-sheen {
    animation: bz-botty-sheen 0.8s ease-in-out 0.25s 1;
}
.bz-botty-cta-sparkle {
    position: absolute;
    top: 1px;
    right: 3px;
    font-size: 11px;
    line-height: 1;
    color: #ffd87a;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.6);
}
.bz-botty-cta.lure .bz-botty-cta-sparkle,
.bz-botty-cta:hover .bz-botty-cta-sparkle {
    animation: bz-botty-sparkle 0.8s ease-in-out 0.55s 1;
}

@keyframes bz-botty-hop-wave {
    0%   { transform: translateY(0) rotate(0deg); }
    22%  { transform: translateY(-3.5px) rotate(12deg); }
    45%  { transform: translateY(0) rotate(-10deg); }
    68%  { transform: translateY(-3px) rotate(7deg); }
    100% { transform: translateY(0) rotate(0deg); }
}
@keyframes bz-botty-sheen {
    0%   { left: -40px; opacity: 0; }
    20%  { opacity: 1; }
    100% { left: calc(100% + 40px); opacity: 0; }
}
@keyframes bz-botty-sparkle {
    0%   { opacity: 0; transform: scale(0.6); }
    50%  { opacity: 1; transform: scale(1.25); }
    100% { opacity: 0; transform: scale(0.7); }
}

/* ── Sidebar Botty AI nav item: standard styling, icon-only hop-wave ── */
.app-shell .app-drawer .bz-botty-nav > .mud-nav-link .mud-nav-link-icon {
    transform-origin: 50% 90%;
}
.app-shell .app-drawer .bz-botty-nav.lure > .mud-nav-link .mud-nav-link-icon,
.app-shell .app-drawer .bz-botty-nav > .mud-nav-link:hover .mud-nav-link-icon {
    animation: bz-botty-nav-hop-wave 0.75s ease-in-out 1;
}

@keyframes bz-botty-nav-hop-wave {
    0%   { transform: translateY(0) rotate(0deg); }
    22%  { transform: translateY(-2px) rotate(7deg); }
    45%  { transform: translateY(0) rotate(-5deg); }
    68%  { transform: translateY(-1.5px) rotate(4deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

@media (prefers-reduced-motion: reduce) {
    .bz-botty-cta.lure .bz-botty-cta-icon,
    .bz-botty-cta:hover .bz-botty-cta-icon,
    .bz-botty-cta.lure .bz-botty-cta-sheen,
    .bz-botty-cta:hover .bz-botty-cta-sheen,
    .bz-botty-cta.lure .bz-botty-cta-sparkle,
    .bz-botty-cta:hover .bz-botty-cta-sparkle,
    .app-shell .app-drawer .bz-botty-nav.lure > .mud-nav-link .mud-nav-link-icon,
    .app-shell .app-drawer .bz-botty-nav > .mud-nav-link:hover .mud-nav-link-icon {
        animation: none;
    }
}

/* ── Full-bleed breakout ONLY when /botty is active (zero dead side gutters!) ── */
.app-main-content:has(.bz-botty-shell) {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
}
@media (max-width: 600px) {
    .app-main-content:has(.bz-botty-shell) {
        padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)) !important;
    }
}
.app-page-content:has(.bz-botty-shell) {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* ── Custom thin scrollbars inside Cloud Botty ── */
.bz-botty-shell *::-webkit-scrollbar { width: 6px; height: 6px; }
.bz-botty-shell *::-webkit-scrollbar-track { background: transparent; }
.bz-botty-shell *::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.22); border-radius: 999px; }
.bz-botty-shell *::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.38); }
.app-theme-light .bz-botty-shell *::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.18); }

/* ── Root Full-Bleed IDE Shell ── */
.bz-botty-shell {
    flex: 1;
    display: flex;
    position: relative;
    min-height: 0;
    min-width: 0;
    background: #0d1117;
    color: #e6edf3;
    overflow: hidden;
    cursor: default;
}
.bz-botty-shell .bz-studio-titlebar,
.bz-botty-shell .bz-studio-toolbar,
.bz-botty-shell .bz-studio-tabstrip,
.bz-botty-shell .bz-studio-panel-head,
.bz-botty-shell .bz-v-splitter,
.bz-botty-shell .bz-h-splitter {
    user-select: none;
}
.bz-botty-shell input[type="text"],
.bz-botty-shell input[type="number"],
.bz-botty-shell input:not([type]),
.bz-botty-shell textarea {
    cursor: text;
    user-select: text;
}
.bz-botty-shell select,
.bz-botty-shell input[type="checkbox"],
.bz-botty-shell input[type="radio"],
.bz-botty-shell input[type="range"] {
    cursor: pointer;
}
.app-theme-light .bz-botty-shell {
    background: #f6f8fa;
    color: #1f2328;
}

/* ── Real-Time Design Switcher Pill (A / B / C) ── */
.bz-design-switcher {
    display: inline-flex;
    align-items: center;
    padding: 2px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.09);
    gap: 2px;
}
.app-theme-light .bz-design-switcher {
    background: rgba(15, 23, 42, 0.05);
    border-color: rgba(15, 23, 42, 0.1);
}
.bz-design-pill {
    border: none;
    background: transparent;
    color: #9aa4b2;
    font-size: 11.5px;
    font-weight: 500;
    padding: 4px 9px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
    white-space: nowrap;
}
.bz-design-pill:hover {
    color: #e6edf3;
    background: rgba(255, 255, 255, 0.06);
}
.bz-design-pill.active {
    background: rgba(88, 166, 255, 0.2);
    color: #e6edf3;
    font-weight: 600;
}
.app-theme-light .bz-design-pill { color: #57606a; }
.app-theme-light .bz-design-pill:hover { color: #1f2328; background: rgba(0,0,0,0.05); }
.app-theme-light .bz-design-pill.active { background: #ffffff; color: #1f5fa8; box-shadow: 0 1px 2px rgba(0,0,0,0.08); }

/* ── Design C: Ultra-Clean Borderless Collapsible Chat Rail ── */
.bz-botty-rail {
    flex: 0 0 228px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: #0b0f14;
    overflow: hidden;
    transition: flex-basis 160ms ease;
}
.bz-botty-rail.collapsed {
    flex: 0 0 46px;
}
.app-theme-light .bz-botty-rail {
    background: #ffffff;
    border-right-color: #d8dee4;
}
.bz-botty-rail-head {
    height: 46px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 12.5px;
    font-weight: 600;
}
.bz-botty-rail.collapsed .bz-botty-rail-head {
    justify-content: center;
    padding: 0;
}
.app-theme-light .bz-botty-rail-head { border-bottom-color: #e5e9ef; }

.bz-rail-new-btn {
    width: calc(100% - 16px);
    margin: 8px;
    height: 32px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 120ms ease;
}
.bz-rail-new-btn:hover { background: rgba(255, 255, 255, 0.09); }
.app-theme-light .bz-rail-new-btn { border-color: #d0d7de; background: #f6f8fa; }
.app-theme-light .bz-rail-new-btn:hover { background: #eaeef2; }

.bz-rail-inner {
    flex: 1;
    min-height: 0;
    width: 228px;
    min-width: 228px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bz-rail-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 8px 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.bz-rail-row {
    display: flex;
    align-items: flex-start;
    gap: 2px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
    transition: background 140ms ease, border-color 140ms ease;
}
.bz-rail-row:hover {
    background: rgba(255, 255, 255, 0.055);
    border-color: rgba(255, 255, 255, 0.11);
}
.bz-rail-row.active {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.22);
}
.bz-rail-row.is-new-draft {
    background: rgba(88, 166, 255, 0.06);
    border: 1px dashed rgba(88, 166, 255, 0.35);
}
.app-theme-light .bz-rail-row.is-new-draft {
    background: rgba(31, 95, 168, 0.05);
    border: 1px dashed rgba(31, 95, 168, 0.38);
}
.bz-rail-title.is-placeholder {
    opacity: 0.65;
    font-style: italic;
    font-weight: 500;
}
.bz-rail-row.saving,
.bz-title-click.saving {
    position: relative;
    overflow: hidden;
    opacity: 0.78;
    animation: bz-rename-pulse 900ms ease-in-out infinite;
}
.bz-rail-row.saving::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, transparent 0%, rgba(88, 166, 255, 0.16) 50%, transparent 100%);
    animation: bz-shimmer-slide 1.1s linear infinite;
}
@keyframes bz-rename-pulse {
    0%, 100% { opacity: 0.72; }
    50%      { opacity: 1; }
}
/* Soft directional outcome tint (flatter & softer than raised Workflow action cards, no left border bracket) */
.bz-rail-row.outcome-done {
    background: linear-gradient(90deg, rgba(63, 185, 80, 0.13) 0%, rgba(63, 185, 80, 0.03) 75%, rgba(63, 185, 80, 0.01) 100%);
    border-color: rgba(74, 222, 128, 0.16);
}
.bz-rail-row.outcome-done:hover {
    background: linear-gradient(90deg, rgba(63, 185, 80, 0.19) 0%, rgba(63, 185, 80, 0.06) 80%, rgba(63, 185, 80, 0.02) 100%);
    border-color: rgba(74, 222, 128, 0.28);
}
.bz-rail-row.outcome-done.active {
    background: linear-gradient(90deg, rgba(63, 185, 80, 0.25) 0%, rgba(63, 185, 80, 0.10) 100%);
    border-color: rgba(74, 222, 128, 0.44);
}

.bz-rail-row.outcome-attention {
    background: linear-gradient(90deg, rgba(227, 179, 65, 0.13) 0%, rgba(227, 179, 65, 0.03) 75%, rgba(227, 179, 65, 0.01) 100%);
    border-color: rgba(227, 179, 65, 0.18);
}
.bz-rail-row.outcome-attention:hover {
    background: linear-gradient(90deg, rgba(227, 179, 65, 0.19) 0%, rgba(227, 179, 65, 0.06) 80%, rgba(227, 179, 65, 0.02) 100%);
    border-color: rgba(227, 179, 65, 0.30);
}
.bz-rail-row.outcome-attention.active {
    background: linear-gradient(90deg, rgba(227, 179, 65, 0.24) 0%, rgba(227, 179, 65, 0.10) 100%);
    border-color: rgba(227, 179, 65, 0.46);
}

.bz-rail-row.outcome-failure {
    background: linear-gradient(90deg, rgba(248, 81, 73, 0.13) 0%, rgba(248, 81, 73, 0.03) 75%, rgba(248, 81, 73, 0.01) 100%);
    border-color: rgba(248, 81, 73, 0.18);
}
.bz-rail-row.outcome-failure:hover {
    background: linear-gradient(90deg, rgba(248, 81, 73, 0.19) 0%, rgba(248, 81, 73, 0.06) 80%, rgba(248, 81, 73, 0.02) 100%);
    border-color: rgba(248, 81, 73, 0.30);
}
.bz-rail-row.outcome-failure.active {
    background: linear-gradient(90deg, rgba(248, 81, 73, 0.24) 0%, rgba(248, 81, 73, 0.10) 100%);
    border-color: rgba(255, 123, 123, 0.46);
}

.bz-rail-row.outcome-working {
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.15) 0%, rgba(88, 166, 255, 0.04) 75%, rgba(88, 166, 255, 0.01) 100%);
    border-color: rgba(88, 166, 255, 0.24);
}
.bz-rail-row.outcome-working.active {
    background: linear-gradient(90deg, rgba(88, 166, 255, 0.24) 0%, rgba(88, 166, 255, 0.10) 100%);
    border-color: rgba(88, 166, 255, 0.48);
}

.app-theme-light .bz-rail-row {
    background: #fafbfc;
    border-color: #e6ebf1;
}
.app-theme-light .bz-rail-row:hover { background: #f3f5f8; border-color: #d0d7de; }
.app-theme-light .bz-rail-row.active { background: #e6f0fc; border-color: #9ec0e6; }
.app-theme-light .bz-rail-row.outcome-done {
    background: linear-gradient(90deg, rgba(30, 123, 64, 0.09) 0%, rgba(30, 123, 64, 0.02) 80%, #ffffff 100%);
    border-color: #c6e6d0;
}
.app-theme-light .bz-rail-row.outcome-done.active {
    background: linear-gradient(90deg, rgba(30, 123, 64, 0.16) 0%, rgba(30, 123, 64, 0.06) 100%);
    border-color: #7cc997;
}
.app-theme-light .bz-rail-row.outcome-attention {
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.09) 0%, rgba(180, 83, 9, 0.02) 80%, #ffffff 100%);
    border-color: #edd8a4;
}
.app-theme-light .bz-rail-row.outcome-attention.active {
    background: linear-gradient(90deg, rgba(180, 83, 9, 0.16) 0%, rgba(180, 83, 9, 0.06) 100%);
    border-color: #d9a944;
}
.app-theme-light .bz-rail-row.outcome-failure {
    background: linear-gradient(90deg, rgba(201, 42, 42, 0.09) 0%, rgba(201, 42, 42, 0.02) 80%, #ffffff 100%);
    border-color: #efc4c4;
}
.app-theme-light .bz-rail-row.outcome-failure.active {
    background: linear-gradient(90deg, rgba(201, 42, 42, 0.16) 0%, rgba(201, 42, 42, 0.06) 100%);
    border-color: #df8d8d;
}
.app-theme-light .bz-rail-row.outcome-working {
    background: linear-gradient(90deg, rgba(31, 95, 168, 0.10) 0%, rgba(31, 95, 168, 0.02) 80%, #ffffff 100%);
    border-color: #bdd6f2;
}
.app-theme-light .bz-rail-row.outcome-working.active {
    background: linear-gradient(90deg, rgba(31, 95, 168, 0.18) 0%, rgba(31, 95, 168, 0.07) 100%);
    border-color: #79aee6;
}

.bz-rail-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding: 8px 6px 8px 9px;
    border: none;
    background: transparent;
    color: #c9d1d9;
    font-size: 12.5px;
    text-align: left;
    cursor: pointer;
}
.bz-rail-row.active .bz-rail-item { color: #ffffff; }
.app-theme-light .bz-rail-item { color: #24292f; }
.app-theme-light .bz-rail-row.active .bz-rail-item { color: #0f172a; }
.app-theme-light .bz-rail-row.active .bz-rail-sub { opacity: 0.78; }
.bz-rail-title {
    font-size: 12.6px;
    font-weight: 600;
    line-height: 1.32;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.bz-rail-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    opacity: 0.65;
}
.bz-rail-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #6e7681;
}
.bz-rail-dot.outcome-done { background: #6fcf97; }
.bz-rail-dot.outcome-attention { background: #e3b341; }
.bz-rail-dot.outcome-failure { background: #ff7b7b; }
.bz-rail-dot.outcome-working { background: #58a6ff; box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.22); }
.bz-rail-menu-wrap {
    padding: 4px 2px 0 0;
    opacity: 0.55;
    flex-shrink: 0;
}
.bz-rail-row:hover .bz-rail-menu-wrap,
.bz-rail-row.active .bz-rail-menu-wrap { opacity: 1; }
.bz-rail-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 6px;
    flex-shrink: 0;
}
.app-theme-light .bz-rail-footer { border-top-color: #e5e9ef; }
.bz-rail-archive-btn {
    width: 100%;
    height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #9aa4b2;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: background 110ms ease, color 110ms ease;
}
.bz-rail-archive-btn:hover { background: rgba(255, 255, 255, 0.06); color: #e6edf3; }
.bz-rail-archive-btn.active { background: rgba(88, 166, 255, 0.14); color: #8cc2ff; border-color: rgba(88, 166, 255, 0.3); }
.app-theme-light .bz-rail-archive-btn { color: #57606a; }
.app-theme-light .bz-rail-archive-btn:hover { background: #f3f5f8; color: #1f2328; }

/* Clickable inline-rename title */
.bz-title-click {
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: text;
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: background 110ms ease, border-color 110ms ease;
}
.bz-title-click:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.14);
}
.app-theme-light .bz-title-click:hover { background: rgba(0,0,0,0.04); border-color: #cdd7e3; }
.bz-title-input {
    height: 26px;
    min-width: 160px;
    max-width: 320px;
    padding: 0 8px;
    border-radius: 4px;
    border: 1px solid #58a6ff;
    background: #14181f;
    color: #ffffff;
    font-size: 12.5px;
    font-weight: 600;
    outline: none;
}
.app-theme-light .bz-title-input { background: #ffffff; color: #1f2328; border-color: #1f5fa8; }

/* ── Design B: Slide-Over History Drawer ── */
.bz-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 25;
}
.bz-history-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    background: #121720;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.45);
    z-index: 30;
    display: flex;
    flex-direction: column;
}
.app-theme-light .bz-history-drawer {
    background: #ffffff;
    border-right-color: #d0d7de;
}
.bz-drawer-head {
    height: 46px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
}
.app-theme-light .bz-drawer-head { border-bottom-color: #e5e9ef; }

/* ── Design A: Top Session Switcher Dropdown ── */
.bz-session-picker-wrap {
    position: relative;
    min-width: 0;
    flex: 1;
}
.bz-session-picker-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}
.bz-session-picker-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.08);
}
.app-theme-light .bz-session-picker-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}
.bz-session-picker-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.bz-session-popover {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    width: 330px;
    max-width: calc(100vw - 32px);
    max-height: 420px;
    background: #161d27;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
    z-index: 35;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.app-theme-light .bz-session-popover {
    background: #ffffff;
    border-color: #d0d7de;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}
.bz-session-popover-head {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11.5px;
    font-weight: 600;
    color: #9aa4b2;
}
.app-theme-light .bz-session-popover-head { border-bottom-color: #e5e9ef; color: #57606a; }
.bz-session-popover-list {
    overflow-y: auto;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bz-session-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 7px;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 110ms ease;
}
.bz-session-row:hover { background: rgba(255, 255, 255, 0.06); }
.bz-session-row.active { background: rgba(88, 166, 255, 0.16); }
.app-theme-light .bz-session-row:hover { background: #f3f5f8; }
.app-theme-light .bz-session-row.active { background: #e3eefb; }
.bz-session-row-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bz-session-row-title {
    font-size: 12.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bz-session-row-meta {
    font-size: 11px;
    opacity: 0.65;
}

/* ── Main Edge-to-Edge Split Workspace ── */
.bz-botty-workspace {
    flex: 1;
    display: flex;
    min-width: 0;
    min-height: 0;
}

/* ── Left Pane: Clean Borderless Chat Column ── */
.bz-botty-panel {
    flex: 0 0 42%;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #0f141b;
}
.design-b .bz-botty-panel,
.design-c .bz-botty-panel {
    flex: 0 0 38%;
}
.app-theme-light .bz-botty-panel {
    background: #ffffff;
}
.bz-chat-topbar {
    height: 46px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}
.app-theme-light .bz-chat-topbar {
    border-bottom-color: #e5e9ef;
}
.bz-ghost-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 120ms ease;
}
.bz-ghost-btn:hover { background: rgba(255, 255, 255, 0.09); }
.app-theme-light .bz-ghost-btn { border-color: #d0d7de; background: #f6f8fa; }
.app-theme-light .bz-ghost-btn:hover { background: #eaeef2; }

.bz-botty-activity-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.bz-botty-activity {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 13.3px;
    line-height: 1.52;
}

/* ── Hairline Resizable Splitters ── */
.bz-v-splitter {
    flex: 0 0 1px;
    width: 1px;
    position: relative;
    cursor: col-resize;
    background: rgba(255, 255, 255, 0.08);
    user-select: none;
    touch-action: none;
    z-index: 5;
}
.bz-v-splitter::before {
    content: "";
    position: absolute;
    inset: 0 -4px;
}
.bz-v-splitter:hover { background: #58a6ff; }
.app-theme-light .bz-v-splitter { background: #d8dee4; }
.app-theme-light .bz-v-splitter:hover { background: #1f5fa8; }

.bz-h-splitter {
    flex: 0 0 6px;
    cursor: row-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f141b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    user-select: none;
    touch-action: none;
}
.bz-h-splitter::after {
    content: "";
    width: 36px;
    height: 2px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    transition: background 120ms ease;
}
.bz-h-splitter:hover::after { background: #58a6ff; }
.app-theme-light .bz-h-splitter { background: #f6f8fa; border-color: #d8dee4; }
.app-theme-light .bz-h-splitter::after { background: rgba(15, 23, 42, 0.2); }

/* ── Refined Conversational Messages (less boxy, cleaner hierarchy) ── */
.bz-card {
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 10px 13px;
    animation: bz-card-in 150ms ease-out;
}
@keyframes bz-card-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bz-card-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
}
.bz-card-time {
    font-size: 11px;
    font-weight: 400;
    opacity: 0.55;
}
.bz-card-body {
    white-space: pre-wrap;
    word-break: break-word;
}

.bz-card-user {
    align-self: flex-end;
    max-width: 88%;
    background: rgba(56, 139, 253, 0.16);
    border-color: rgba(88, 166, 255, 0.28);
    border-radius: 14px 14px 4px 14px;
    color: #eef5ff;
}
.bz-card-user .bz-card-head { color: #8cc2ff; }
.app-theme-light .bz-card-user { background: #e6f0fc; border-color: #b8d3f5; color: #1c2430; }
.app-theme-light .bz-card-user .bz-card-head { color: #1f5fa8; }

.bz-card-reply {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.06);
    color: #dce3ec;
}
.bz-card-reply .bz-card-head { color: #e6edf3; }
.app-theme-light .bz-card-reply { background: #f6f8fa; border-color: #e5e9ef; color: #24292f; }
.app-theme-light .bz-card-reply .bz-card-head { color: #1f2328; }

.bz-card-attention {
    background: rgba(210, 153, 34, 0.1);
    border-color: rgba(210, 153, 34, 0.35);
    color: #f3e2b6;
}
.bz-card-attention .bz-card-head { color: #f2c45a; }
.app-theme-light .bz-card-attention { background: #fff8e6; border-color: #ebcb7a; color: #5c4200; }
.app-theme-light .bz-card-attention .bz-card-head { color: #7a5300; }

.bz-card-failure {
    background: rgba(248, 81, 73, 0.1);
    border-color: rgba(248, 81, 73, 0.35);
    color: #ffd4d4;
}
.bz-card-failure .bz-card-head { color: #ff9c9c; }
.app-theme-light .bz-card-failure { background: #fce8e8; border-color: #edb1b1; color: #6e1c1c; }
.app-theme-light .bz-card-failure .bz-card-head { color: #8d2020; }

.bz-card-done {
    background: rgba(46, 160, 67, 0.1);
    border-color: rgba(63, 185, 80, 0.32);
    color: #d8f5e3;
}
.bz-card-done .bz-card-head { color: #7ee2a0; }
.app-theme-light .bz-card-done { background: #e8f8ee; border-color: #a9d9b8; color: #144424; }
.app-theme-light .bz-card-done .bz-card-head { color: #14552c; }

/* Collapsible Step Groups */
.bz-step-group { padding: 0 2px; }
.bz-step-fold-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.03);
    color: #9aa4b2;
    font-size: 11.8px;
    padding: 3px 9px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.bz-step-fold-btn:hover { background: rgba(255, 255, 255, 0.08); color: #e6edf3; }
.app-theme-light .bz-step-fold-btn { border-color: #d8dee4; background: #f6f8fa; color: #57606a; }
.app-theme-light .bz-step-fold-btn:hover { background: #eaeef2; color: #1f2328; }
.bz-step-line {
    font-size: 12px;
    color: #9aa4b2;
    padding: 2px 10px;
    display: flex;
    gap: 6px;
    align-items: baseline;
}
.app-theme-light .bz-step-line { color: #57606a; }
.bz-step-ok { color: #3fb950; font-weight: 700; }
.app-theme-light .bz-step-ok { color: #1e7b40; }
.bz-step-retry { color: #e3b341; font-weight: 700; }

/* Typing Bubble & Shimmer */
.bz-typing-wrap { display: flex; justify-content: center; padding: 6px 0 2px; }
.bz-typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.app-theme-light .bz-typing-bubble {
    background: #eef2f6;
    border-color: #d0d7de;
}
.bz-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8cc2ff;
    opacity: 0.4;
    animation: bz-typing-pulse 1200ms infinite ease-in-out;
}
.app-theme-light .bz-typing-dot { background: #1f5fa8; }
.bz-typing-dot:nth-child(2) { animation-delay: 200ms; }
.bz-typing-dot:nth-child(3) { animation-delay: 400ms; }
@keyframes bz-typing-pulse {
    0%, 100% { opacity: 0.4; transform: scale(0.92); }
    45%      { opacity: 1.0; transform: scale(1.12); }
}
.bz-shimmer-strip { height: 3px; position: relative; overflow: hidden; background: rgba(88, 166, 255, 0.12); }
.bz-shimmer-bar {
    position: absolute; top: 0; bottom: 0; width: 34%;
    background: linear-gradient(90deg, rgba(88,166,255,0), #58a6ff, rgba(88,166,255,0));
    animation: bz-shimmer-slide 1.736s linear infinite;
}
@keyframes bz-shimmer-slide { from { left: -35%; } to { left: 105%; } }

/* Budget Pause Bar */
.bz-budget-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 10px 14px; background: rgba(210, 153, 34, 0.12); border-top: 1px solid rgba(210, 153, 34, 0.35);
    color: #f3e2b6; font-size: 12.5px;
}
.bz-budget-btn-primary {
    border: none; border-radius: 6px; padding: 5px 12px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; background: #d99b26; color: #17140b;
}
.bz-budget-btn-secondary {
    border: 1px solid #6b5418; border-radius: 6px; padding: 5px 10px; font-size: 12.5px; font-weight: 600;
    cursor: pointer; background: #3b321c; color: #f3e2b6;
}
.app-theme-light .bz-budget-bar {
    background: #fef9e7;
    border-top-color: #e6c672;
    color: #5c3d00;
}
.app-theme-light .bz-budget-btn-primary {
    background: #d97706;
    color: #ffffff;
}
.app-theme-light .bz-budget-btn-secondary {
    background: #ffffff;
    border-color: #d4b059;
    color: #784c00;
}

/* ── Modern Floating Composer (with Desktop Studio-identical square icons) ── */
.bz-composer-dock {
    padding: 10px 14px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    background: #0f141b;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.app-theme-light .bz-composer-dock {
    background: #ffffff;
    border-top-color: #e5e9ef;
}
.bz-composer-card {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: #161c26;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 140ms ease;
}
.bz-composer-card:focus-within { border-color: rgba(88, 166, 255, 0.6); }
.app-theme-light .bz-composer-card { background: #f6f8fa; border-color: #d0d7de; }
.app-theme-light .bz-composer-card:focus-within { border-color: #1f5fa8; background: #ffffff; }

.bz-composer-input {
    width: 100%;
    min-height: 76px;
    max-height: 190px;
    padding: 2px 4px;
    border: none;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: 13.3px;
    line-height: 1.48;
    resize: vertical;
    outline: none;
    transition: min-height 240ms ease, height 240ms ease, opacity 200ms ease;
}
.bz-composer-input.compact {
    min-height: 30px;
    height: 30px;
    opacity: 0.6;
    resize: none;
    overflow: hidden;
}
.bz-composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.app-theme-light .bz-composer-toolbar { border-top-color: #e5e9ef; }
.bz-botty-usage {
    font-size: 11px;
    opacity: 0.65;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2px;
    font-variant-numeric: tabular-nums;
}
.bz-studio-sq {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}
.bz-studio-sq:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.16); }
.app-theme-light .bz-studio-sq { border-color: #d0d7de; background: #ffffff; }
.app-theme-light .bz-studio-sq:hover { background: #eaeef2; }

/* Send / Stop button matching the exact 28px height of the square cog & new chat buttons */
.bz-send-btn, .bz-stop-btn {
    height: 28px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: background 120ms ease, opacity 120ms ease;
    white-space: nowrap;
}
.bz-send-btn { background: #2f81f7; color: #ffffff; }
.bz-send-btn:hover:not(:disabled) { background: #3b8bfd; }
.bz-send-btn:disabled { opacity: 0.4; cursor: default; }
.bz-stop-btn { background: #da3633; color: #ffffff; }
.bz-stop-btn:hover:not(:disabled) { background: #f85149; }

/* Clean rounded Agent Options card */
.bz-options-card {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #1a2029;
    padding: 11px 13px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 12.2px;
}
.app-theme-light .bz-options-card {
    background: #f6f8fa;
    border-color: #d0d7de;
}
.bz-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.bz-stepper {
    display: inline-flex;
    align-items: center;
    height: 30px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: #12161d;
    overflow: hidden;
}
.app-theme-light .bz-stepper { background: #ffffff; border-color: #cbd4df; }
.bz-stepper-btn {
    width: 28px;
    height: 100%;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bz-stepper-btn:hover { background: rgba(255, 255, 255, 0.08); }
.app-theme-light .bz-stepper-btn:hover { background: #f0f3f7; }
.bz-stepper-input {
    width: 54px;
    height: 100%;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: inherit;
    text-align: center;
    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    outline: none;
    -moz-appearance: textfield;
}
.bz-stepper-input::-webkit-inner-spin-button,
.bz-stepper-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bz-quick-pill {
    height: 28px;
    padding: 0 9px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 11.8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 110ms ease, border-color 110ms ease;
}
.bz-quick-pill:hover { background: rgba(88, 166, 255, 0.16); border-color: rgba(88, 166, 255, 0.45); }
.app-theme-light .bz-quick-pill { background: #ffffff; border-color: #cbd4df; }
.app-theme-light .bz-quick-pill:hover { background: #e6f0fc; border-color: #8cb8eb; }
.bz-options-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 11.5px;
    color: #9aa4b2;
}
.app-theme-light .bz-options-foot { border-top-color: #e2e8f0; color: #57606a; }
.bz-options-link {
    color: #58a6ff;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.bz-options-link:hover { text-decoration: underline; }

/* Save Bot Rename Modal & Run Details Popup */
.bz-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 1200;
}
.bz-modal-card {
    width: 100%;
    max-width: 440px;
    border-radius: 12px;
    border: 1px solid #343b46;
    background: #1d222a;
    color: #e6edf3;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.bz-modal-card.run-popup {
    max-width: 960px;
    max-height: 88vh;
    padding: 0;
    overflow: hidden;
}
.app-theme-light .bz-modal-card {
    background: #ffffff;
    border-color: #cbd4df;
    color: #1f2328;
}
.bz-run-popup-head {
    height: 44px;
    padding: 0 16px;
    border-bottom: 1px solid #2e343e;
    background: #22272e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.app-theme-light .bz-run-popup-head { background: #f3f6f9; border-bottom-color: #d8dee4; }
.bz-run-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}
.bz-modal-input {
    width: 100%;
    height: 36px;
    padding: 0 11px;
    border-radius: 7px;
    border: 1px solid #3c4554;
    background: #14181f;
    color: #ffffff;
    font-size: 13.5px;
    outline: none;
}
.bz-modal-input:focus { border-color: #58a6ff; }
.app-theme-light .bz-modal-input { background: #ffffff; color: #1f2328; border-color: #cbd4df; }

/* ── Right Pane: Unified Browser Stage + Workflow Actions ── */
.bz-botty-stage {
    flex: 1;
    min-width: 340px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #0b0f15;
    overflow: hidden;
}
.app-theme-light .bz-botty-stage {
    background: #f0f3f7;
}
.bz-stage-topbar {
    height: 46px;
    padding: 0 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f141b;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
.app-theme-light .bz-stage-topbar {
    background: #ffffff;
    border-bottom-color: #e5e9ef;
}
.bz-stage-title {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.bz-draft-pill {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(210, 153, 34, 0.16);
    color: #f2c45a;
    border: 1px solid rgba(210, 153, 34, 0.35);
    flex-shrink: 0;
}
.app-theme-light .bz-draft-pill { background: #fff4d6; color: #7a5300; border-color: #ebcb7a; }

/* Browser Canvas Backdrop (subtle dot-grid — zero black letterbox void!) */
.bz-botty-live-pane {
    flex: 1;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background-color: #0b0f15;
    background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
    background-size: 18px 18px;
    overflow: hidden;
}
.design-a .bz-botty-live-pane,
.design-b .bz-botty-live-pane.split-mode,
.design-c .bz-botty-live-pane.split-mode {
    flex: 0 0 56%;
}
.app-theme-light .bz-botty-live-pane {
    background-color: #eef2f6;
    background-image: radial-gradient(rgba(15, 23, 42, 0.09) 1px, transparent 1px);
}

/* Framed Minimal Browser Chrome */
.bz-browser-frame {
    width: 100%;
    height: 100%;
    max-width: 1120px;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #141922;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.app-theme-light .bz-browser-frame {
    background: #ffffff;
    border-color: #d0d7de;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}
.bz-browser-bar {
    height: 32px;
    padding: 0 12px;
    background: #1a202b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11.5px;
    flex-shrink: 0;
}
.app-theme-light .bz-browser-bar {
    background: #f6f8fa;
    border-bottom-color: #e5e9ef;
}
.bz-browser-dots {
    display: flex;
    align-items: center;
    gap: 5px;
}
.bz-browser-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
}
.app-theme-light .bz-browser-dots span { background: rgba(15, 23, 42, 0.16); }
.bz-browser-url {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
    padding: 2px 10px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: #9aa4b2;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.app-theme-light .bz-browser-url {
    background: #ffffff;
    border-color: #d8dee4;
    color: #57606a;
}
.bz-browser-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: #3fb950;
    white-space: nowrap;
}
.bz-browser-status.live { color: #f85149; }
.bz-browser-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background 110ms ease, border-color 110ms ease;
}
.bz-browser-status-btn.live {
    color: #f85149;
}
.bz-browser-status-btn.live:hover {
    background: rgba(248, 81, 73, 0.14);
    border-color: rgba(248, 81, 73, 0.35);
}
.bz-browser-status-btn.paused {
    color: #e3b341;
    background: rgba(227, 179, 65, 0.12);
    border-color: rgba(227, 179, 65, 0.32);
}
.bz-browser-status-btn.paused:hover {
    background: rgba(227, 179, 65, 0.22);
}
.app-theme-light .bz-browser-status-btn.paused {
    color: #9a6700;
    background: #fdf6e3;
    border-color: #e3c278;
}
.bz-browser-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}
.bz-botty-live-viewport {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0d1117;
    overflow: hidden;
    position: relative;
}
.app-theme-light .bz-botty-live-viewport { background: #f6f8fa; }
.bz-botty-live-viewport img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.bz-botty-live-viewport.actual-size {
    display: block;
    overflow: auto;
}
.bz-botty-live-viewport.actual-size img {
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    object-fit: none;
    display: block;
}
.bz-live-zoom-toggle {
    display: inline-flex;
    align-items: center;
    padding: 1px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
    gap: 1px;
}
.app-theme-light .bz-live-zoom-toggle {
    background: #e2e8f0;
    border-color: #cbd5e1;
}
.bz-live-zoom-btn {
    border: none;
    background: transparent;
    color: #9aa4b2;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 7px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 110ms ease, color 110ms ease;
}
.bz-live-zoom-btn:hover { color: #e6edf3; }
.bz-live-zoom-btn.active {
    background: #2b3f56;
    color: #e6f0fa;
}
.app-theme-light .bz-live-zoom-btn { color: #57606a; }
.app-theme-light .bz-live-zoom-btn:hover { color: #1f2328; }
.app-theme-light .bz-live-zoom-btn.active {
    background: #ffffff;
    color: #1f5fa8;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

/* ── Read-Only Visual Workflow Actions Panel ── */
.bz-botty-workflow-pane {
    flex: 1;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    background: #0f141b;
    overflow: hidden;
}
.bz-botty-workflow-pane.full-pane {
    flex: 1;
    min-height: 0;
}
.app-theme-light .bz-botty-workflow-pane {
    background: #ffffff;
}
.bz-botty-workflow-head {
    height: 36px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
}
.app-theme-light .bz-botty-workflow-head { border-bottom-color: #e5e9ef; }

.bz-workflow-toggle-bar {
    width: 100%;
    height: 38px;
    padding: 0 14px;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: #0f141b;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}
.bz-workflow-toggle-bar:hover { background: rgba(255, 255, 255, 0.03); }
.app-theme-light .bz-workflow-toggle-bar { background: #ffffff; border-top-color: #e5e9ef; }
.app-theme-light .bz-workflow-toggle-bar:hover { background: #f6f8fa; }

.bz-botty-workflow-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px 110px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

/* Desktop Studio-style POOF entrance animation for newly added workflow actions */
.bz-wf-poof {
    position: relative;
    animation: bz-wf-poof-in 420ms cubic-bezier(0.22, 1.25, 0.36, 1) both;
}
.bz-wf-poof::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 10px;
    pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(140, 194, 255, 0.38) 0%, rgba(88, 166, 255, 0.14) 55%, rgba(88, 166, 255, 0) 80%);
    border: 1.5px solid rgba(140, 194, 255, 0.65);
    animation: bz-wf-poof-ring 520ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes bz-wf-poof-in {
    0%   { opacity: 0; transform: translateY(10px) scale(0.88); }
    62%  { opacity: 1; transform: translateY(-1px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bz-wf-poof-ring {
    0%   { opacity: 0.95; transform: scale(0.94); }
    99%  { opacity: 0; transform: scale(1.06); }
    100% { opacity: 0; transform: scale(1); }
}

/* ── Desktop Studio-Faithful Read-Only Workflow Cards & Containers ── */
.bz-wf-container {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(110, 152, 214, 0.28);
    background: rgba(255, 255, 255, 0.02);
}
.app-theme-light .bz-wf-container {
    border-color: #c2d4ea;
    background: rgba(31, 95, 168, 0.03);
}

.bz-wf-card {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    background: #23272f;
    color: #e6edf3;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
    min-width: 0;
    transition: border-color 130ms ease, filter 130ms ease, box-shadow 130ms ease;
}
.bz-wf-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    filter: brightness(1.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.36);
}
.bz-wf-card.is-container {
    cursor: pointer;
}
.app-theme-light .bz-wf-card {
    background: #ffffff;
    border-color: #d8dee4;
    color: #1f2328;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.app-theme-light .bz-wf-card:hover {
    border-color: #9fb3c8;
    filter: brightness(0.985);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.11);
}

/* Category-tinted card backgrounds & icons matching Desktop Studio */
.bz-wf-card.kind-browser { background: #23272f; }
.bz-wf-card.kind-browser .bz-wf-icon { color: #d0d7de; }

.bz-wf-card.kind-extract { background: #1e332b; border-color: rgba(74, 222, 128, 0.16); }
.bz-wf-card.kind-extract .bz-wf-icon { color: #4ade80; }

.bz-wf-card.kind-table { background: #312c22; border-color: rgba(234, 179, 8, 0.18); }
.bz-wf-card.kind-table .bz-wf-icon { color: #f5b942; }

.bz-wf-card.kind-dict { background: #292638; border-color: rgba(167, 139, 250, 0.2); }
.bz-wf-card.kind-dict .bz-wf-icon { color: #a78bfa; }

.bz-wf-card.kind-data { background: #212c38; border-color: rgba(96, 165, 250, 0.18); }
.bz-wf-card.kind-data .bz-wf-icon { color: #60a5fa; }

.bz-wf-card.kind-flow { background: #322c23; border-color: rgba(245, 185, 66, 0.22); }
.bz-wf-card.kind-flow .bz-wf-icon { color: #f5b942; }

.bz-wf-card.kind-notify { background: #2e2533; border-color: rgba(244, 114, 182, 0.2); }
.bz-wf-card.kind-notify .bz-wf-icon { color: #f472b6; }

.bz-wf-card.kind-ai { background: #26233a; border-color: rgba(139, 92, 246, 0.25); }
.bz-wf-card.kind-ai .bz-wf-icon { color: #c084fc; }

.app-theme-light .bz-wf-card.kind-extract { background: #edf9f2; border-color: #b7e4c7; }
.app-theme-light .bz-wf-card.kind-extract .bz-wf-icon { color: #15803d; }
.app-theme-light .bz-wf-card.kind-table { background: #fdf8eb; border-color: #eed89d; }
.app-theme-light .bz-wf-card.kind-table .bz-wf-icon { color: #b45309; }
.app-theme-light .bz-wf-card.kind-dict { background: #f4f1fd; border-color: #d6c8fb; }
.app-theme-light .bz-wf-card.kind-dict .bz-wf-icon { color: #6d28d9; }
.app-theme-light .bz-wf-card.kind-data { background: #eef6ff; border-color: #c2dcfa; }
.app-theme-light .bz-wf-card.kind-data .bz-wf-icon { color: #1d4ed8; }
.app-theme-light .bz-wf-card.kind-flow { background: #fdf7ec; border-color: #eed4a2; }
.app-theme-light .bz-wf-card.kind-flow .bz-wf-icon { color: #b45309; }
.app-theme-light .bz-wf-card.kind-browser { background: #ffffff; border-color: #d8dee4; }
.app-theme-light .bz-wf-card.kind-browser .bz-wf-icon { color: #4b5563; }
.app-theme-light .bz-wf-card.kind-notify { background: #fdf2f8; border-color: #f3c6de; }
.app-theme-light .bz-wf-card.kind-notify .bz-wf-icon { color: #be185d; }
.app-theme-light .bz-wf-card.kind-ai { background: #f5f3ff; border-color: #d8cdfc; }
.app-theme-light .bz-wf-card.kind-ai .bz-wf-icon { color: #7c3aed; }

.bz-wf-chevron {
    font-size: 12px;
    opacity: 0.72;
    margin-top: 2px;
    width: 12px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
    transform: rotate(0deg);
}
.bz-wf-chevron.collapsed {
    transform: rotate(-90deg);
}
.bz-wf-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.bz-wf-icon svg {
    width: 19px;
    height: 19px;
}
.bz-wf-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.bz-wf-title-row {
    display: flex;
    align-items: baseline;
    gap: 7px;
    min-width: 0;
}
.bz-wf-prefix {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    opacity: 0.85;
}
.bz-wf-title {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bz-wf-sub {
    font-size: 11.8px;
    line-height: 1.38;
    color: rgba(230, 237, 243, 0.72);
    word-break: break-word;
}
.app-theme-light .bz-wf-sub {
    color: #57606a;
}
.bz-wf-step-count {
    opacity: 0.78;
}
.bz-wf-dot-sep {
    opacity: 0.5;
}

/* Desktop Studio token colors inside card subtitles */
.bz-tok-var { color: #60a5fa; font-weight: 500; }
.bz-tok-table { color: #f5b942; font-weight: 500; }
.bz-tok-dict { color: #c084fc; font-weight: 500; }
.bz-tok-list { color: #38bdf8; font-weight: 500; }
.bz-tok-str { color: #f2a679; }
.bz-tok-num { color: #f2a679; }
.app-theme-light .bz-tok-var { color: #1d4ed8; }
.app-theme-light .bz-tok-table { color: #b45309; }
.app-theme-light .bz-tok-dict { color: #6d28d9; }
.app-theme-light .bz-tok-list { color: #0369a1; }
.app-theme-light .bz-tok-str,
.app-theme-light .bz-tok-num { color: #9a3412; }

/* Smooth accordion expand/collapse for workflow containers */
.bz-wf-children-wrap {
    display: grid;
    grid-template-rows: 1fr;
    opacity: 1;
    transition: grid-template-rows 220ms cubic-bezier(0.22, 1, 0.36, 1),
                opacity 180ms ease;
}
.bz-wf-children-wrap.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
}
.bz-wf-children-inner {
    overflow: hidden;
    min-height: 0;
}
.bz-wf-children {
    padding-left: 14px;
    padding-top: 1px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.bz-wf-container.is-collapsed {
    gap: 0;
}
.bz-wf-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
    background: #3b82f6;
}

/* ── Studio Layout: External Chats Rail (left) + Simulated "Botty AI (Cloud version)" Window (right) ── */
.bz-botty-shell.design-d {
    padding: 0;
    background: #14181d;
    flex-direction: row;
}
.app-theme-light .bz-botty-shell.design-d {
    background: #e6ebf1;
}
.bz-studio-canvas-wrap {
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    /* Subtle Windows-11-style layered desktop wallpaper backdrop so the Studio window floats like a real desktop app */
    background:
        radial-gradient(ellipse 68% 62% at 22% 28%, rgba(76, 154, 255, 0.42) 0%, transparent 65%),
        radial-gradient(ellipse 62% 58% at 78% 72%, rgba(99, 102, 241, 0.34) 0%, transparent 64%),
        radial-gradient(ellipse 52% 48% at 72% 20%, rgba(45, 212, 191, 0.24) 0%, transparent 60%),
        linear-gradient(135deg, #1b2a44 0%, #24385c 48%, #1e2c4a 100%);
}
.app-theme-light .bz-studio-canvas-wrap {
    background:
        radial-gradient(ellipse 68% 62% at 22% 28%, rgba(147, 197, 253, 0.65) 0%, transparent 65%),
        radial-gradient(ellipse 62% 58% at 78% 72%, rgba(165, 180, 252, 0.52) 0%, transparent 64%),
        radial-gradient(ellipse 52% 48% at 72% 20%, rgba(153, 246, 228, 0.45) 0%, transparent 60%),
        linear-gradient(135deg, #dbeafe 0%, #e0e7ff 50%, #ccfbf1 100%);
}
.design-d .bz-botty-rail {
    border: none;
    border-right: 1px solid #2b313c;
    border-radius: 0;
    background: #171b21;
}
.app-theme-light .design-d .bz-botty-rail {
    background: #ffffff;
    border-right-color: #d0d7de;
}
.bz-studio-window {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: #1c2026;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62), 0 4px 16px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}
.app-theme-light .bz-studio-window {
    background: #f0f3f7;
    border-color: #c8d1dc;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.1);
}
.bz-studio-titlebar {
    height: 36px;
    padding: 0 12px;
    background: #191d23;
    border-bottom: 1px solid #2e343e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}
.app-theme-light .bz-studio-titlebar {
    background: #e9eef4;
    border-bottom-color: #d0d7de;
}
.bz-studio-win-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 600;
    color: #d5dce4;
    min-width: 0;
}
.app-theme-light .bz-studio-win-title { color: #1f2328; }
.bz-studio-win-sep { opacity: 0.35; }
.bz-studio-window-body {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    gap: 6px;
    padding: 6px;
    background: #1c2026;
    overflow: hidden;
}
.app-theme-light .bz-studio-window-body { background: #e8edf3; }

/* Desktop Studio Centered Toolbar ([ Save Bot | ▶ Run ] in a dark recessed pill, Botty AI on right) */
.bz-studio-toolbar {
    height: 46px;
    padding: 0 12px;
    background: #20252c;
    border-bottom: 1px solid #2f3640;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}
.app-theme-light .bz-studio-toolbar {
    background: #f3f6f9;
    border-bottom-color: #d4dce4;
}
.bz-tb-pill-group {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 7px;
    background: #15191e;
    border: 1px solid #323944;
}
.app-theme-light .bz-tb-pill-group {
    background: #e6ebf1;
    border-color: #cbd4df;
}
.bz-tb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 30px;
    padding: 0 14px;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    color: #dce3ec;
    font-size: 12.5px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
    white-space: nowrap;
}
.bz-tb-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.bz-tb-btn:disabled { opacity: 0.38; cursor: default; }
.bz-tb-btn.run {
    background: #24964c;
    border-color: #2eb15c;
    color: #ffffff;
    padding: 0 18px;
}
.bz-tb-btn.run:hover:not(:disabled) { background: #2aa957; }
.bz-tb-btn.save {
    color: #d6e0ec;
}
.bz-tb-btn.save:hover:not(:disabled) {
    background: #262e3a;
    border-color: #3a4556;
}
.app-theme-light .bz-tb-btn { color: #1f2328; }
.app-theme-light .bz-tb-btn:hover:not(:disabled) { background: rgba(0,0,0,0.06); }
.app-theme-light .bz-tb-btn.run { background: #1f883d; border-color: #1a7f37; color: #ffffff; }
.bz-tb-right {
    justify-self: end;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.bz-tb-botty-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 32px;
    padding: 0 12px;
    border-radius: 6px;
    border: 1px solid #3f6ca1;
    background: #1f2e40;
    color: #dceeff;
    font-size: 12.5px;
    font-weight: 600;
}
.app-theme-light .bz-tb-botty-chip {
    background: #e6f0fc;
    border-color: #9ec0e6;
    color: #1f5fa8;
}

/* Studio Panel Framing in Design D */
.design-d .bz-studio-wf-col {
    order: 1;
    flex: 0 1 22%;
    min-width: 185px;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border: 1px solid #303742;
    border-radius: 6px;
    background: #22272e;
    overflow: hidden;
}
.app-theme-light .design-d .bz-studio-wf-col { background: #ffffff; border-color: #d0d7de; }
.bz-studio-panel-head {
    height: 36px;
    padding: 0 12px;
    background: #252b33;
    border-bottom: 1px solid #303742;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 600;
    color: #e6edf3;
    flex-shrink: 0;
}
.app-theme-light .bz-studio-panel-head { background: #f3f6f9; border-bottom-color: #d8dee4; color: #1f2328; }
.bz-count-badge {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 4px;
    background: #2f3640;
    color: #9aa4b2;
}
.app-theme-light .bz-count-badge { background: #e6ebf1; color: #57606a; }

.design-d #bz-botty-wf-split,
.design-d #bz-botty-v-split {
    flex: 0 0 5px;
    width: 5px;
    background: transparent;
}
.design-d #bz-botty-wf-split:hover,
.design-d #bz-botty-v-split:hover { background: rgba(88, 166, 255, 0.35); border-radius: 3px; }
.design-d #bz-botty-wf-split { order: 2; }
.design-d .bz-botty-stage {
    order: 3;
    flex: 1 1 0;
    min-width: 240px;
    background: transparent;
    gap: 6px;
}
.design-d #bz-botty-v-split { order: 4; }
.design-d .bz-botty-live-pane {
    flex: 0 0 56%;
    padding: 0;
    background: #22272e;
    background-image: none;
    border: 1px solid #303742;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.app-theme-light .design-d .bz-botty-live-pane { background: #ffffff; border-color: #d0d7de; }

/* Flush Desktop Studio Browser Tab + Address Bar + Status Strip (no macOS 3-dots) */
.design-d .bz-browser-frame {
    max-width: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #171b20;
}
.bz-studio-tabstrip {
    height: 32px;
    padding: 4px 8px 0;
    background: #22272e;
    border-bottom: 1px solid #303742;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}
.app-theme-light .bz-studio-tabstrip { background: #eef2f6; border-bottom-color: #d0d7de; }
.bz-studio-tabs-left {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    min-width: 0;
    flex: 1;
    overflow: hidden;
}
.bz-studio-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 27px;
    padding: 0 11px;
    border-radius: 5px 5px 0 0;
    background: #2b3f56;
    border: 1px solid #3e648c;
    border-bottom: none;
    color: #e6f0fa;
    font-size: 11.5px;
    font-weight: 600;
    max-width: 300px;
    min-width: 0;
}
.bz-studio-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-theme-light .bz-studio-tab { background: #ffffff; border-color: #b8cde5; color: #1f5fa8; }
.bz-studio-more-tabs {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 21px;
    margin-bottom: 4px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(56, 139, 253, 0.14);
    border: 1px solid rgba(56, 139, 253, 0.35);
    color: #79c0ff;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: default;
}
.app-theme-light .bz-studio-more-tabs {
    background: rgba(9, 105, 218, 0.09);
    border-color: rgba(9, 105, 218, 0.28);
    color: #0969da;
}
.bz-studio-tabs-notice {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    background: rgba(56, 139, 253, 0.12);
    border-bottom: 1px solid rgba(56, 139, 253, 0.28);
    color: #a5d6ff;
    font-size: 11.5px;
    font-weight: 500;
    flex-shrink: 0;
}
.bz-studio-tabs-notice span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.app-theme-light .bz-studio-tabs-notice {
    background: #ddf4ff;
    border-bottom-color: #b6e3ff;
    color: #0969da;
}
.bz-studio-addrbar {
    height: 34px;
    padding: 4px 8px;
    background: #22272e;
    border-bottom: 1px solid #303742;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.app-theme-light .bz-studio-addrbar { background: #f6f8fa; border-bottom-color: #d8dee4; }
.bz-studio-addr-input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 25px;
    padding: 0 10px;
    border-radius: 4px;
    background: #15191e;
    border: 1px solid #323944;
    color: #c9d1d9;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    line-height: 23px;
    outline: none;
}
.bz-studio-addr-input:focus {
    border-color: rgba(88, 166, 255, 0.55);
}
.app-theme-light .bz-studio-addr-input { background: #ffffff; border-color: #d0d7de; color: #24292f; }
.bz-studio-statusbar {
    height: 24px;
    padding: 0 10px;
    background: #1e232a;
    border-top: 1px solid #2e343e;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #8b949e;
    flex-shrink: 0;
}
.app-theme-light .bz-studio-statusbar { background: #f3f6f9; border-top-color: #d8dee4; color: #57606a; }

.design-d .bz-h-splitter {
    flex: 0 0 5px;
    background: transparent;
    border: none;
}
.design-d .bz-h-splitter::after { display: none; }
.design-d .bz-h-splitter:hover { background: rgba(88, 166, 255, 0.35); border-radius: 3px; }

/* Runtime Data Panel (Desktop Studio 4-tab layout: Variables | Lists | Dictionaries | Tables) */
.design-d .bz-runtime-dock {
    border: 1px solid #303742;
    border-radius: 6px;
    background: #22272e;
}
.app-theme-light .design-d .bz-runtime-dock { background: #ffffff; border-color: #d0d7de; }
.bz-runtime-subtabs {
    padding: 6px 10px;
    background: #22272e;
    border-bottom: 1px solid #2e343e;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.app-theme-light .bz-runtime-subtabs { background: #f8fafc; border-bottom-color: #e2e8f0; }
.bz-rt-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 10px;
    border-radius: 5px;
    border: 1px solid transparent;
    background: transparent;
    color: #b0bac6;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 110ms ease, border-color 110ms ease, color 110ms ease;
}
.bz-rt-tab-btn:hover { background: rgba(255, 255, 255, 0.05); color: #e6edf3; }
.bz-rt-tab-btn.active {
    background: #29384a;
    border-color: #3e6b9e;
    color: #e6f0fa;
    font-weight: 600;
}
.app-theme-light .bz-rt-tab-btn { color: #57606a; }
.app-theme-light .bz-rt-tab-btn.active { background: #e6f0fc; border-color: #9ec0e6; color: #1f5fa8; }
.bz-rt-tab-count {
    font-size: 10.5px;
    padding: 0 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
}
.bz-var-pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    background: #1c2838;
    border: 1px solid #355275;
    color: #7eb6ff;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
}
.app-theme-light .bz-var-pill { background: #edf4fc; border-color: #b5d0f0; color: #1f5fa8; }

.design-d .bz-botty-panel {
    order: 5;
    flex: 0 1 30%;
    min-width: 260px;
    max-width: 480px;
    border: 1px solid #303742;
    border-radius: 6px;
    background: #22272e;
    overflow: hidden;
}
.app-theme-light .design-d .bz-botty-panel { background: #ffffff; border-color: #d0d7de; }
.design-d .bz-composer-dock {
    background: #1f242b;
    border-top-color: #303742;
}
.app-theme-light .design-d .bz-composer-dock { background: #f8fafc; border-top-color: #e2e8f0; }
.bz-botty-hero-head {
    height: 36px;
    padding: 0 12px;
    border-bottom: 1px solid #303742;
    background: #252b33;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-shrink: 0;
}
.app-theme-light .bz-botty-hero-head { background: #f3f6f9; border-bottom-color: #d8dee4; }
/* Expandable Runtime Data TreeView & Mini-Table */
.bz-rt-tree { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; }
.bz-rt-node { border-radius: 5px; border: 1px solid #303742; background: #1a1f26; overflow: hidden; }
.app-theme-light .bz-rt-node { background: #f8fafc; border-color: #d8dee4; }
.bz-rt-row {
    width: 100%; border: none; background: transparent; color: inherit;
    padding: 6px 10px; display: flex; align-items: center; justify-content: space-between;
    gap: 10px; font-size: 12px; text-align: left; cursor: pointer;
}
.bz-rt-row:hover { background: rgba(255, 255, 255, 0.04); }
.app-theme-light .bz-rt-row:hover { background: #eef2f6; }
.bz-rt-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.bz-rt-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 10px;
    font-size: 12px;
}
.bz-file-act-btn {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 9px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #dce3ec;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 110ms ease, border-color 110ms ease;
}
.bz-file-act-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.24); }
.bz-file-act-btn.primary {
    background: rgba(88, 166, 255, 0.18);
    border-color: rgba(88, 166, 255, 0.42);
    color: #93c5fd;
}
.bz-file-act-btn.primary:hover { background: rgba(88, 166, 255, 0.28); color: #ffffff; }
.app-theme-light .bz-file-act-btn {
    background: #ffffff;
    border-color: #d0d7de;
    color: #24292f;
}
.app-theme-light .bz-file-act-btn:hover { background: #f3f5f8; }
.app-theme-light .bz-file-act-btn.primary {
    background: #e6f0fc;
    border-color: #9ec0e6;
    color: #1f5fa8;
}
.app-theme-light .bz-file-act-btn.primary:hover { background: #d2e4fa; }
.bz-rt-name { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 600; }
.bz-rt-meta { font-size: 11px; opacity: 0.6; white-space: nowrap; }
.bz-rt-details {
    border-top: 1px solid #2e343e; padding: 6px 10px 8px 24px;
    display: flex; flex-direction: column; gap: 3px; max-height: 210px; overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11.5px;
}
.bz-rt-entry { display: flex; gap: 8px; padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.bz-rt-idx { opacity: 0.45; min-width: 26px; text-align: right; flex-shrink: 0; }
.bz-rt-table-wrap { position: relative; overflow: auto; max-height: 210px; border-top: 1px solid #2e343e; }
.bz-rt-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.bz-rt-table th, .bz-rt-table td {
    padding: 5px 10px; border-bottom: 1px solid #2b313a; border-right: 1px solid #2b313a;
    text-align: left; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bz-rt-table th:last-child, .bz-rt-table td:last-child { border-right: none; }
.bz-rt-table thead th {
    position: sticky; top: 0; z-index: 2;
    background: #1e232a; font-weight: 600; color: #b0bac6;
    border-bottom: 1px solid #38404c;
}
.bz-rt-table td.bz-rt-rownum { color: #6e7681; }
.app-theme-light .bz-rt-table thead th { background: #eef2f6; color: #24292f; border-bottom-color: #d0d7de; }
.app-theme-light .bz-rt-table th, .app-theme-light .bz-rt-table td { border-color: #d8dee4; }
.app-theme-light .bz-rt-table td.bz-rt-rownum { color: #6e7781; }

.bz-start-here-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    background: rgba(88, 166, 255, 0.18);
    color: #8cc2ff;
    border: 1px solid rgba(88, 166, 255, 0.38);
}
.app-theme-light .bz-start-here-pill {
    background: #dcebfa;
    color: #1f5fa8;
    border-color: #a9ccf0;
}

/* Interactive Botty AI Onboarding Guide & Starter Chips */
.bz-botty-guide {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid rgba(88, 166, 255, 0.24);
    background: linear-gradient(180deg, rgba(56, 139, 253, 0.1) 0%, rgba(255, 255, 255, 0.02) 100%);
}
.app-theme-light .bz-botty-guide {
    background: linear-gradient(180deg, #eef5fd 0%, #f8fafc 100%);
    border-color: #bfd7f4;
}
.bz-guide-title {
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.bz-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 7px;
    font-size: 12.2px;
    opacity: 0.88;
}
.bz-guide-step {
    display: flex;
    align-items: baseline;
    gap: 8px;
}
.bz-guide-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(88, 166, 255, 0.2);
    color: #8cc2ff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.app-theme-light .bz-guide-num { background: #dcebfa; color: #1f5fa8; }
.bz-guide-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 4px;
}
.bz-guide-chip {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: inherit;
    font-size: 11.8px;
    padding: 5px 10px;
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
    transition: background 120ms ease, border-color 120ms ease;
}
.bz-guide-chip:hover {
    background: rgba(88, 166, 255, 0.16);
    border-color: rgba(88, 166, 255, 0.45);
}
.app-theme-light .bz-guide-chip { border-color: #cdd7e3; background: #ffffff; }
.app-theme-light .bz-guide-chip:hover { background: #e6f0fc; border-color: #8cb8eb; }

/* Mobile: clean Activity-only chat experience (no desktop app chrome / side panes) */
.bz-mobile-bar { display: none; }
@media (max-width: 900px) {
    .bz-botty-shell.design-d { padding: 0 !important; background: #0f141b; }
    .bz-studio-canvas-wrap { padding: 0 !important; }
    .bz-studio-window { border-radius: 0 !important; border: none !important; box-shadow: none !important; }
    .bz-studio-titlebar,
    .bz-studio-toolbar,
    .bz-botty-rail,
    .bz-studio-wf-col,
    .bz-botty-stage,
    .bz-v-splitter,
    .bz-h-splitter { display: none !important; }
    .bz-botty-panel {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        max-width: none !important;
        width: 100% !important;
        border-left: none !important;
    }
    .bz-mobile-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        height: 44px;
        padding: 0 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        background: #0f141b;
        flex-shrink: 0;
    }
    .app-theme-light .bz-mobile-bar { background: #ffffff; border-bottom-color: #e5e9ef; }
}

/* Runtime Data bottom dock (Design D) */
.bz-runtime-dock {
    flex: 1;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    background: #0f141b;
    overflow: hidden;
}
.app-theme-light .bz-runtime-dock {
    background: #ffffff;
}
.bz-runtime-head {
    height: 36px;
    padding: 0 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}
.app-theme-light .bz-runtime-head { border-bottom-color: #e5e9ef; }
.bz-runtime-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
}
.bz-runtime-tab {
    border: none;
    background: transparent;
    color: #9aa4b2;
    font-size: 11.8px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 110ms ease, color 110ms ease;
}
.bz-runtime-tab:hover { background: rgba(255, 255, 255, 0.06); color: #e6edf3; }
.bz-runtime-tab.active { background: rgba(88, 166, 255, 0.16); color: #e6edf3; font-weight: 600; }
.app-theme-light .bz-runtime-tab { color: #57606a; }
.app-theme-light .bz-runtime-tab.active { background: #e3eefb; color: #1f5fa8; }

.bz-runtime-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    font-size: 12.2px;
}
.bz-runtime-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.bz-runtime-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
}
.app-theme-light .bz-runtime-chip {
    background: #f6f8fa;
    border-color: #d8dee4;
}
.bz-runtime-kv-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.bz-runtime-kv-key { opacity: 0.65; }
.bz-runtime-kv-val { font-weight: 500; text-align: right; }

/* ── Studio-Style Inline Bot UI Block Dock (renders when Bot has UI inputs) ── */
.bz-studio-ui-dock {
    display: flex;
    flex-direction: column;
    border: 1px solid #303742;
    border-radius: 6px;
    background: #22272e;
    overflow: hidden;
    flex-shrink: 0;
}
.app-theme-light .bz-studio-ui-dock {
    background: #ffffff;
    border-color: #d0d7de;
}
.bz-ui-dock-head {
    height: 32px;
    padding: 0 10px;
}
.bz-ui-dock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    color: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.bz-ui-dock-hint {
    font-size: 11px;
    opacity: 0.55;
    font-weight: 400;
}
.bz-ui-reset-btn {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.05);
    color: #c9d1d9;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 5px;
    cursor: pointer;
    transition: background 110ms ease, color 110ms ease;
}
.bz-ui-reset-btn:hover { background: rgba(255, 255, 255, 0.12); color: #ffffff; }
.app-theme-light .bz-ui-reset-btn { border-color: #d0d7de; background: #f6f8fa; color: #24292f; }
.app-theme-light .bz-ui-reset-btn:hover { background: #eaeef2; }
.bz-studio-ui-body {
    max-height: 210px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 12px;
    background: #1b2027;
}
.app-theme-light .bz-studio-ui-body {
    background: #f8fafc;
}
.bz-cloud-ui-surface {
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #e6edf3;
}
.bz-cloud-ui-surface .bz-row {
    gap: 10px;
}
.bz-cloud-ui-surface .bz-caption,
.bz-cloud-ui-surface label {
    color: #9aa4b2 !important;
    font-size: 11.5px !important;
    font-weight: 500 !important;
}
.bz-cloud-ui-surface input[type="text"],
.bz-cloud-ui-surface input[type="number"],
.bz-cloud-ui-surface input:not([type]),
.bz-cloud-ui-surface textarea,
.bz-cloud-ui-surface select {
    background: #15191e !important;
    border: 1px solid #323944 !important;
    color: #e6edf3 !important;
    border-radius: 6px !important;
    font-size: 12.5px !important;
    padding: 5px 9px !important;
    box-shadow: none !important;
    transition: border-color 120ms ease, background 120ms ease;
}
.bz-cloud-ui-surface input[type="text"],
.bz-cloud-ui-surface input[type="number"],
.bz-cloud-ui-surface select {
    height: 30px !important;
}
.bz-cloud-ui-surface input:focus,
.bz-cloud-ui-surface textarea:focus,
.bz-cloud-ui-surface select:focus {
    outline: none !important;
    border-color: #58a6ff !important;
    background: #12161b !important;
}
.bz-cloud-ui-surface .bz-group {
    background: #1e242c !important;
    border: 1px solid #2e3540 !important;
    border-radius: 7px !important;
    padding: 8px 10px !important;
}
.bz-cloud-ui-surface .bz-group-title {
    color: #c9d1d9 !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
}
.bz-cloud-ui-surface .bz-label {
    color: #c9d1d9 !important;
    font-size: 12px !important;
}
.bz-cloud-ui-surface .bz-ui-button {
    background: #2b323c !important;
    border: 1px solid #3c4553 !important;
    color: #9aa4b2 !important;
    border-radius: 6px !important;
    font-size: 12px !important;
    padding: 4px 10px !important;
}
.app-theme-light .bz-cloud-ui-surface { color: #1f2328; }
.app-theme-light .bz-cloud-ui-surface .bz-caption,
.app-theme-light .bz-cloud-ui-surface label { color: #57606a !important; }
.app-theme-light .bz-cloud-ui-surface input[type="text"],
.app-theme-light .bz-cloud-ui-surface input[type="number"],
.app-theme-light .bz-cloud-ui-surface input:not([type]),
.app-theme-light .bz-cloud-ui-surface textarea,
.app-theme-light .bz-cloud-ui-surface select {
    background: #ffffff !important;
    border-color: #d0d7de !important;
    color: #1f2328 !important;
}
.app-theme-light .bz-cloud-ui-surface .bz-group {
    background: #ffffff !important;
    border-color: #d8dee4 !important;
}
.app-theme-light .bz-cloud-ui-surface .bz-group-title,
.app-theme-light .bz-cloud-ui-surface .bz-label { color: #1f2328 !important; }

@media (max-width: 1440px) and (min-width: 901px) {
    .bz-studio-canvas-wrap { padding: 10px; }
    .bz-botty-rail:not(.collapsed) { flex: 0 0 188px; width: 188px; }
    .bz-rail-inner { min-width: 188px; }
    .design-d .bz-studio-wf-col { flex: 0 1 21%; min-width: 170px; }
    .design-d .bz-botty-stage { min-width: 210px; }
    .design-d .bz-botty-panel { flex: 0 1 32%; min-width: 250px; }
    .bz-studio-tab { max-width: 180px; }
}
@media (max-width: 900px) {
    .bz-botty-shell,
    .bz-botty-workspace,
    .bz-studio-canvas-wrap,
    .bz-studio-window,
    .bz-studio-window-body {
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }
    .bz-studio-window-body { padding: 0 !important; gap: 0 !important; }
    .bz-composer-dock {
        flex-shrink: 0;
        padding: 8px 10px 10px;
    }
}
