/* ═══════════════════════════════════════════
   Platform Agent Execution Utility
   Production-ready agent chat execution component styles
   @version 1.0.0
═══════════════════════════════════════════ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════
   DESIGN TOKENS
═══════════════════════════════════════════ */
.platform-agent-execution {
    --bg: #f0f4f8;
    --bg2: #e8edf5;
    --bg-dark: #1e1e1e;
    --surface: #ffffff;
    --surface2: #f7f9fc;
    --surface3: #edf1f7;
    --border: #dde3ee;
    --border2: #c8d2e4;
    --accent: var(--theme-color, #255fa6);
    --accent-soft: rgba(37, 95, 166, 0.1);
    --accent-glow: rgba(37, 95, 166, 0.25);
    --accent2: #4a90e2;
    --accent3: #0d9488;
    --warn: #f59e0b;
    --text: #1a2332;
    --text-mid: #4a5872;
    --text-muted: #8a97ae;
    --text-light: #c0cad8;
    --shadow-sm: 0 2px 8px rgba(30, 60, 100, 0.07);
    --shadow: 0 4px 20px rgba(30, 60, 100, 0.10);
    --shadow-lg: 0 12px 48px rgba(30, 60, 100, 0.16);
    --radius: 0;
    --radius-sm: 0;
    --radius-xs: 0;
    --font: "Open Sans", sans-serif;
    --mono: "Open Sans", sans-serif;
    --transition: all .25s cubic-bezier(.4, 0, .2, 1);
    --sb-width: 5px;
    --sb-thumb: #b0bdd0;
    --sb-thumb-hover: #8a97ae;
    --sb-track: transparent;
    --sb-radius: 99px;

    position: relative;
    z-index: 1;
    height: 100%;
    display: flex;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
}

/* Animated mesh background */
.platform-agent-execution::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 700px 500px at 15% 30%, rgba(46, 134, 222, 0.07) 0%, transparent 70%),
        radial-gradient(ellipse 600px 400px at 85% 70%, rgba(56, 189, 248, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 400px 300px at 50% 10%, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
    animation: bgShift 12s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes bgShift {
    0% {
        opacity: .8;
        transform: scale(1) translateY(0);
    }

    50% {
        opacity: 1;
        transform: scale(1.03) translateY(-8px);
    }

    100% {
        opacity: .9;
        transform: scale(1.01) translateY(4px);
    }
}

.platform-agent-execution * {
    box-sizing: border-box;
}

/* SCREEN TRANSITIONS */
.platform-agent-execution .screen {
    position: absolute;
    inset: 0;
    display: flex;
    transition: opacity .38s cubic-bezier(.4, 0, .2, 1), transform .38s cubic-bezier(.4, 0, .2, 1);
}

.platform-agent-execution .screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.platform-agent-execution .screen.slide-out-left {
    transform: translateX(-48px);
}

.platform-agent-execution .screen.slide-out-right {
    transform: translateX(48px);
}

.platform-agent-execution .screen.slide-in-right {
    transform: translateX(0);
}

/* AGENTS SCREEN */
.platform-agent-execution .agents-page {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
    animation: panelFadeUp .5s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes panelFadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-agent-execution .agents-topbar {
    padding: 24px 36px;
    background: linear-gradient(160deg, #fff 60%, var(--surface2));
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.platform-agent-execution .agents-title {
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -.6px;
    color: var(--text);
}

.platform-agent-execution .agents-count {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 3px;
}

.platform-agent-execution .search-wrap {
    position: relative;
    width: 320px;
    flex-shrink: 0;
    align-self: center;
}

.platform-agent-execution .search-wrap svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

.platform-agent-execution .search-input {
    width: 100%;
    padding: 11px 14px 11px 40px;
    background: var(--surface3);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.platform-agent-execution .search-input::placeholder {
    color: var(--text-light);
}

.platform-agent-execution .search-input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.platform-agent-execution .agents-grid-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    contain: layout style;
}

.platform-agent-execution .agents-grid {
    padding: 28px 36px 36px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    align-content: start;
}

.platform-agent-execution .agents-empty {
    grid-column: 1/-1;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding: 60px 20px;
}

/* Empty state for chat/session areas - centered */
.platform-agent-execution .chat-empty-state,
.platform-agent-execution .session-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    padding: 40px 20px;
    gap: 4px;
}

.platform-agent-execution .chat-empty-state {
    flex: 1;
    align-self: stretch;
    min-height: 0;
    height: 100%;
}

.platform-agent-execution .session-empty-state {
    min-height: 200px;
}

.platform-agent-execution .agents-empty-icon {
    font-size: 48px;
    margin-bottom: 8px;
    line-height: 1;
    opacity: 0.8;
}

.platform-agent-execution .chat-empty-state .agents-empty-icon,
.platform-agent-execution .session-empty-state .agents-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    font-size: 28px;
    margin-bottom: 16px;
    opacity: 1;
}

.platform-agent-execution .chat-empty-state>div:last-child,
.platform-agent-execution .session-empty-state>div:last-child {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.platform-agent-execution .agent-card {
    padding: 20px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    animation: cardStagger .45s cubic-bezier(.4, 0, .2, 1) both;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: transform;
    backface-visibility: hidden;
}

.platform-agent-execution .agent-card:nth-child(1) {
    animation-delay: .05s;
}

.platform-agent-execution .agent-card:nth-child(2) {
    animation-delay: .12s;
}

.platform-agent-execution .agent-card:nth-child(3) {
    animation-delay: .19s;
}

.platform-agent-execution .agent-card:nth-child(4) {
    animation-delay: .26s;
}

@keyframes cardStagger {
    from {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

.platform-agent-execution .agent-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), var(--accent-soft) 0%, transparent 70%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.platform-agent-execution .agent-card:hover {
    border-color: var(--accent);
    transform: translate3d(0, -3px, 0);
    box-shadow: var(--shadow), 0 0 0 1px var(--accent-glow);
    background: #fff;
}

.platform-agent-execution .agent-card:hover::after {
    opacity: 1;
}

.platform-agent-execution .agent-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.platform-agent-execution .agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.platform-agent-execution .agent-meta {
    flex: 1;
    width: calc(100% - 62px);
}

.platform-agent-execution .agent-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.2px;
    margin-bottom: 2px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-x: hidden;
}

.platform-agent-execution .agent-app-name {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text-muted);
    margin-top: 2px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow-x: hidden;
}

.platform-agent-execution .agent-desc {
    font-size: 13px;
    color: var(--text-mid);
    line-height: 1.65;
    /* margin-bottom: 14px; */
    flex: 1;
    /* Limit to 3 lines with ellipsis */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-agent-execution .agent-type-badge {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: .5px;
}

.platform-agent-execution .agent-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.platform-agent-execution .agent-open-btn {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 0;
    transition: opacity .2s;
}

.platform-agent-execution .agent-card:hover .agent-open-btn {
    opacity: 1;
}

/* SESSION SCREEN */
.platform-agent-execution .session-layout {
    flex: 1;
    display: flex;
    background: var(--surface);
    overflow: hidden;
    animation: sessionSlideIn .4s cubic-bezier(.4, 0, .2, 1) both;
}

@keyframes sessionSlideIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.platform-agent-execution .left-panel {
    width: 75%;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow: hidden;
}

.platform-agent-execution .lp-header {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(160deg, #fff, var(--surface2));
    flex-shrink: 0;
}

.platform-agent-execution .lp-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.platform-agent-execution .lp-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.platform-agent-execution .lp-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: var(--text-mid);
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-xs);
    padding: 0;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    outline: none;
}

.platform-agent-execution .lp-action-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.platform-agent-execution .lp-action-btn span {
    display: none;
}

/* List Sessions button - show text */
.platform-agent-execution .lp-action-btn-with-text {
    width: auto;
    padding: 0 12px;
    gap: 6px;
}

.platform-agent-execution .lp-action-btn-with-text span {
    display: inline;
    font-size: 13px;
    font-weight: 500;
}

.platform-agent-execution .lp-action-btn:hover {
    background: #fff;
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.platform-agent-execution .lp-action-btn-primary {
    /* background: linear-gradient(135deg, var(--accent), var(--accent2)); */
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 3px 12px rgba(46, 134, 222, 0.35);
}

.platform-agent-execution .lp-action-btn-primary:hover {
    /* background: linear-gradient(135deg, var(--accent), var(--accent2)); */
    background-color: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px rgba(46, 134, 222, 0.45);
}

.platform-agent-execution .lp-action-btn:active {
    transform: translateY(0);
}


.platform-agent-execution .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font);
    letter-spacing: .5px;
    color: var(--accent);
    cursor: pointer;
    background: var(--accent-soft);
    padding: 5px 12px;
    border-radius: var(--radius-xs);
    border: none;
    transition: var(--transition);
    margin-bottom: 10px;
}

.platform-agent-execution .back-btn:hover {
    background: rgba(46, 134, 222, .18);
    transform: translateX(-2px);
}

.platform-agent-execution .back-btn svg {
    width: 13px;
    height: 13px;
}

.platform-agent-execution .lp-agent-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.platform-agent-execution .lp-avatar {
    width: 38px;
    height: 38px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    flex-shrink: 0;
}

.platform-agent-execution .lp-agent-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.3px;
}

.platform-agent-execution .lp-agent-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

.platform-agent-execution .lp-content {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.platform-agent-execution .session-tiles-wrap {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 4px 16px 20px;
    overflow-y: auto;
    transition: opacity .22s ease, transform .22s ease;
}

.platform-agent-execution .session-tiles-wrap.panel-hidden {
    opacity: 0;
    transform: translateX(-18px);
    pointer-events: none;
}

.platform-agent-execution .session-tiles-wrap>.mCustomScrollBox>.mCSB_container {
    width: calc(100% - 10px);
    padding-right: 8px;
}

.platform-agent-execution .session-section-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--text-muted);
    font-family: var(--mono);
    padding: 4px 2px;
    margin-bottom: 2px;
}

.platform-agent-execution .session-tiles-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 16px;
    overflow: visible;
}

.platform-agent-execution .session-tile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    background: var(--surface2);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    animation: tileIn .35s cubic-bezier(.4, 0, .2, 1) both;
    position: relative;
    z-index: 1;
}

.platform-agent-execution .session-tile:hover {
    z-index: 10;
}

.platform-agent-execution .session-tile.menu-open {
    z-index: 100;
}

.platform-agent-execution .session-tile:nth-child(2) {
    animation-delay: .06s;
}

.platform-agent-execution .session-tile:nth-child(3) {
    animation-delay: .12s;
}

.platform-agent-execution .session-tile:nth-child(4) {
    animation-delay: .18s;
}

@keyframes tileIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.platform-agent-execution .session-tile:hover {
    border-color: var(--accent);
    background: #fff;
    transform: translateX(4px);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--accent-glow);
}

.platform-agent-execution .session-tile-renaming {
    pointer-events: none;
    opacity: 0.7;
    cursor: default;
}

.platform-agent-execution .session-tile-renaming .session-title {
    pointer-events: auto;
}

.platform-agent-execution .session-avatar {
    width: 38px;
    height: 38px;
    border-radius: 0;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .5px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    will-change: background, color, border-color, box-shadow;
    transition:
        background .28s cubic-bezier(.4, 0, .2, 1),
        color .28s cubic-bezier(.4, 0, .2, 1),
        border-color .28s cubic-bezier(.4, 0, .2, 1),
        box-shadow .28s cubic-bezier(.4, 0, .2, 1);
}

.platform-agent-execution .session-tile:hover .session-avatar,
.platform-agent-execution .session-tile:focus .session-avatar,
.platform-agent-execution .session-tile:active .session-avatar {
    background: var(--sess-gradient) !important;
    color: #fff !important;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.platform-agent-execution .session-info {
    flex: 1;
    min-width: 0;
}

.platform-agent-execution .session-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.platform-agent-execution .session-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.platform-agent-execution .session-options {
    flex-shrink: 0;
    position: relative;
}

.platform-agent-execution .session-options-btn {
    width: 28px;
    height: 28px;
    border-radius: 0;
    border: none;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: background .18s ease, color .18s ease;
}

.platform-agent-execution .session-options-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
}

.platform-agent-execution .session-options-btn svg {
    width: 15px;
    height: 15px;
}

.platform-agent-execution .session-options-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 140px;
    z-index: 9999;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(.97);
    pointer-events: none;
    transition: opacity .18s cubic-bezier(.4, 0, .2, 1), transform .18s cubic-bezier(.4, 0, .2, 1);
}

.platform-agent-execution .session-options-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.platform-agent-execution .session-option-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    cursor: pointer;
    transition: background .12s ease, color .12s ease;
    user-select: none;
}

.platform-agent-execution .session-option-item:hover {
    background: var(--surface3);
    color: var(--text);
}

.platform-agent-execution .session-option-item svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: var(--text-muted);
}

.platform-agent-execution .session-title-editing {
    outline: none;
    background: var(--surface3);
    border-radius: 4px;
    padding: 1px 6px;
    margin: -1px -6px;
    box-shadow: 0 0 0 2px var(--accent);
    cursor: text;
}

.platform-agent-execution .chat-messages-wrap {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: opacity .22s ease, transform .22s ease;
    /* Prevent browser auto-scroll anchor from fighting our manual scroll control */
    overflow-anchor: none;
    /* Own compositor layer — streaming appends won't trigger ancestor repaints */
    will-change: scroll-position;
    /* Disable smooth scrolling - we control scroll position manually */
    scroll-behavior: auto !important;
}

/* Prevent user scroll interaction and hide scroll visuals during panel width transitions.
   Uses opacity instead of visibility to allow mCustomScrollbar calculations.
   Programmatic scrolling (streaming, auto-scroll) still works. */
.platform-agent-execution .chat-messages-wrap.scroll-locked {
    pointer-events: none;
}

/* Hide scroll content visually during transition without blocking calculations */
.platform-agent-execution .chat-messages-wrap.scroll-locked .mCustomScrollBox {
    opacity: 0;
    transition: none;
    /* Instant hide/show, no fade */
}

/* Hide scrollbar tools as well */
.platform-agent-execution .chat-messages-wrap.scroll-locked .mCSB_scrollTools {
    opacity: 0;
    transition: none;
}

/* Loading overlay — sits over the message area with a solid background
   so messages can render behind it invisibly.  Removed by JS once the
   scroll position is set to the latest message. */
.platform-agent-execution .messages-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface);
}

/* Hide scrollbar movement during loading to avoid visible top-to-bottom jump */
.platform-agent-execution .chat-messages-wrap.messages-loading {
    pointer-events: none;
}

.platform-agent-execution .chat-messages-wrap.messages-loading .mCSB_scrollTools {
    opacity: 0;
    transition: none;
}

.platform-agent-execution .chat-messages-wrap.messages-loading .mCSB_scrollTools {
    opacity: 0 !important;
}

.platform-agent-execution .chat-messages-wrap.messages-loading .mCSB_scrollTools {
    opacity: 0;
}

.platform-agent-execution .chat-messages-wrap>.mCustomScrollBox>.mCSB_container {
    width: calc(100% - 10px);
    padding-right: 8px;
}

.platform-agent-execution .chat-messages-wrap.panel-hidden {
    opacity: 0;
    transform: translateX(18px);
    pointer-events: none;
}

.platform-agent-execution .message {
    display: flex;
    flex-direction: column;
    margin: 15px 0;
    animation: msgIn .3s cubic-bezier(.4, 0, .2, 1) both;
    /* Prevent each message from triggering global layout recalcs */
    contain: layout style;
}

@keyframes msgIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ══════════════════════════════════════════════════════════════
   CUSTOM SCROLLBAR STYLING (Native CSS)
   Matches the dark-thin theme from mCustomScrollbar
   ══════════════════════════════════════════════════════════════ */

/* Scrollable containers in agent-execution */
.platform-agent-execution .custom-scroll {
    overflow-y: auto;
    overflow-x: hidden;
}

/* Webkit browsers (Chrome, Safari, Edge) - Exact match for mCustomScrollbar dark-thin theme */
.platform-agent-execution .custom-scroll::-webkit-scrollbar {
    width: 2px;
    /* Exact match to dark-thin theme */
}

.platform-agent-execution .custom-scroll::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    /* Exact match to dark-thin draggerRail */
    border-radius: 0;
}

.platform-agent-execution .custom-scroll::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.75);
    /* Exact match to dark-thin dragger_bar */
    border-radius: 0;
    min-height: 30px;
    transition: background 0.15s ease;
}

.platform-agent-execution .custom-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.85);
    /* Exact match to dark-thin hover state */
}

.platform-agent-execution .custom-scroll::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.9);
    /* Exact match to dark-thin active/drag state */
}

/* Firefox - Exact match to dark-thin theme */
.platform-agent-execution .custom-scroll {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.75) rgba(0, 0, 0, 0.15);
}

.platform-agent-execution .message.message-user {
    align-items: flex-end;
}

.platform-agent-execution .message.message-assistant {
    align-items: flex-start;
}

/* Event messages - matching assistant-loader pattern */
.platform-agent-execution .message-event,
.platform-agent-execution .message-error {
    flex-direction: row;
    gap: 12px;
    margin: 10px 0;
}

/* Standalone error message bubble - matching assistant-loader pattern */
.platform-agent-execution .message-avatar-error {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.platform-agent-execution .message-content-error {
    color: #6b7280;
    flex: 1;
    padding: 0 !important;
    font-size: 13px !important;
    box-shadow: none !important;
}

.platform-agent-execution .message-event .message-content {
    color: #8894c1;
    font-size: 11px;
    font-style: italic;
    padding: 0px 8px;
    box-shadow: none;
}

/* Error event messages - styled like assistant messages for consistency */
.platform-agent-execution .message-event-error .message-content {
    background: #f9fafb;
    color: var(--text);
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.65;
    word-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-style: normal;
}

.platform-agent-execution .message-wrapper {
    max-width: 80%;
    width: fit-content;
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    position: relative;
}

/* Full width for bot messages with structured content - like GPT/Claude */
.platform-agent-execution .message.message-assistant .message-wrapper {
    width: auto;
}

/* msg-content now direct child of msg-wrapper (matching assistant-loader) */
.platform-agent-execution .message-content {
    width: fit-content;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.65;
    border-radius: 14px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Bot content - full width, subtle background (matching assistant) */
.platform-agent-execution .message-content-assistant {
    background: #f9fafb;
    color: var(--text);
    width: 100%;
}

.platform-agent-execution .message-content-assistant br {
    display: none;
}

/* User content - styled bubble */
.platform-agent-execution .message-content-user {
    background: linear-gradient(135deg, #255fa6, #1d6dba);
    color: #fff;
    border-radius: 14px 14px 2px 14px;
    box-shadow: 0 4px 16px rgba(46, 134, 222, 0.3);
    align-self: flex-end;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.platform-agent-execution .message-content-user:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(46, 134, 222, 0.4);
}

/* Keep legacy msg-bubble support for backwards compatibility */
.platform-agent-execution .msg-bubble {
    width: fit-content;
    padding: 0;
    background: transparent;
    border: none;
}

.platform-agent-execution .message-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
}

/* Action Buttons for Decision-Based Responses */
.platform-agent-execution .msg-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0 16px 0;
    padding: 0;
}

.platform-agent-execution .msg-action-buttons.disabled {
    pointer-events: none;
}

.platform-agent-execution .action-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font);
    min-width: 80px;
    text-align: center;
}

.platform-agent-execution .action-btn:hover:not(:disabled) {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 95, 166, 0.2);
}

.platform-agent-execution .action-btn:active:not(:disabled) {
    transform: translateY(0);
}

.platform-agent-execution .action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--surface3);
}

.platform-agent-execution .action-btn.selected {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

.platform-agent-execution .actions-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.platform-agent-execution .actions-right {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.platform-agent-execution .message-time {
    font-size: 10px;
    color: var(--text-light);
}

/* Base action button style - matching assistant-loader */
.platform-agent-execution .message-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
}

/* Show action buttons on message-wrapper hover (matching assistant-loader) */
.platform-agent-execution .message-wrapper:hover .message-action-btn {
    opacity: 1;
}

/* Keep regenerate button hidden when explicitly set */
.platform-agent-execution .regenerate-btn[style*="display: none"] {
    opacity: 0 !important;
    pointer-events: none;
}

.platform-agent-execution .message-action-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    transform: scale(1.1);
}

.platform-agent-execution .message-action-btn.copied {
    opacity: 1;
    color: var(--accent3);
    background: rgba(16, 185, 129, .08);
    transform: scale(1.15);
}

.platform-agent-execution .message-action-btn svg {
    width: 14px;
    height: 14px;
    transition: transform 0.2s ease;
}

/* Regenerate button - specific styling */
.platform-agent-execution .regenerate-btn {
    transition: all 0.3s ease;
}

.platform-agent-execution .regenerate-btn:hover {
    background: var(--accent-soft);
    color: var(--accent);
    transform: rotate(180deg) scale(1.1);
}

.platform-agent-execution .typing-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-agent-execution .typing-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.platform-agent-execution .typing-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    animation: typingBounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px var(--accent-glow);
}

.platform-agent-execution .typing-dot:nth-child(2) {
    animation-delay: .2s;
}

.platform-agent-execution .typing-dot:nth-child(3) {
    animation-delay: .4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0) scale(1);
        opacity: .6;
    }

    30% {
        transform: translateY(-8px) scale(1.1);
        opacity: 1;
    }
}

.platform-agent-execution .typing-label {
    font-size: 11px;
    color: var(--text-muted);
    animation: labelPulse 2s ease-in-out infinite;
}

@keyframes labelPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Thinking indicator – shown while waiting for agent response */
.platform-agent-execution .thinking-indicator {
    opacity: 1;
    transition: opacity 0.15s ease;
}

.platform-agent-execution .thinking-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}

.platform-agent-execution .thinking-content .typing-dots {
    gap: 5px;
}

.platform-agent-execution .thinking-content .typing-dot {
    width: 6px;
    height: 6px;
}

.platform-agent-execution .thinking-text {
    font-size: 13px;
    color: var(--text-muted);
    animation: labelPulse 2s ease-in-out infinite;
}

/* Inline status indicator - appears dynamically during streaming */
.platform-agent-execution .inline-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(var(--accent-rgb), 0.08);
    border-radius: 12px;
    margin: 4px 0;
    animation: statusFadeIn 0.2s ease-out;
}

.platform-agent-execution .inline-status-indicator .typing-dot {
    width: 6px;
    height: 6px;
}

.platform-agent-execution .inline-status-indicator .status-label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

@keyframes statusFadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.platform-agent-execution .chatbox-outer-wrap {
    padding: 12px 16px 14px;
    flex-shrink: 0;
}

.platform-agent-execution .chatbox-outer {
    border: 1.5px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    background: var(--surface2);
    transition: border-color .2s, box-shadow .2s;
    position: relative;
}

.platform-agent-execution .chatbox-outer:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}

/* Animated border during execution — Copilot-style traveling light trail */
/* .platform-agent-execution .chatbox-outer.streaming-active {
    border-color: transparent;
    box-shadow: 0 0 0 3px var(--accent-soft);
} */

.platform-agent-execution .chatbox-outer.streaming-active::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    pointer-events: none;
    z-index: -1;
    background: conic-gradient(
        from var(--streaming-angle-exec, 0deg),
        transparent 0deg,
        transparent 300deg,
        var(--accent, #255fa6) 330deg,
        #60a5fa 345deg,
        var(--accent, #255fa6) 360deg
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    padding: 2px;
    animation: streaming-rotate-exec 2.5s linear infinite;
}

@property --streaming-angle-exec {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes streaming-rotate-exec {
    0%   { --streaming-angle-exec: 0deg; }
    100% { --streaming-angle-exec: 360deg; }
}

.platform-agent-execution .chat-textarea {
    width: 100%;
    padding: 13px 14px;
    background: transparent;
    border: none;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    resize: none;
    outline: none;
    min-height: 72px;
    max-height: 140px;
    line-height: 1.6;
}

.platform-agent-execution .chat-textarea::placeholder {
    color: var(--text-light);
}

.platform-agent-execution .chat-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    border-top: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.6);
}

.platform-agent-execution .toolbar-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.platform-agent-execution .toolbar-tag {
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    font-size: 10px;
    font-weight: 600;
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: .5px;
    cursor: default;
}

.platform-agent-execution .tag-model {
    background: var(--accent-soft);
    color: var(--accent);
}

.platform-agent-execution .tag-tool {
    background: rgba(16, 185, 129, .1);
    color: #059669;
}

.platform-agent-execution .tag-agent {
    background: rgba(139, 92, 246, .1);
    color: #7c3aed;
}

.platform-agent-execution .tag-extra {
    background: rgba(100, 116, 139, .1);
    color: #475569;
}

.platform-agent-execution .send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 92px;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    /* background: linear-gradient(135deg, var(--accent), var(--accent2)); */
    background-color: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 3px 12px rgba(46, 134, 222, 0.35);
}

.platform-agent-execution .send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(46, 134, 222, 0.45);
}

.platform-agent-execution .send-btn:active {
    transform: translateY(0);
}

.platform-agent-execution .send-btn:disabled,
.platform-agent-execution .send-btn.sending {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Stop state — visually identical to Send, only label/icon differ */
.platform-agent-execution .send-btn.stop-state {
    opacity: 1;
    cursor: pointer;
    pointer-events: auto;
}

/* Unified icon sizing for both Send and Stop states */
.platform-agent-execution .send-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: middle;
}

/* Spinning arc on stop icon — only the arc rotates, square stays fixed */
.platform-agent-execution .send-btn svg.stop-icon .stop-arc {
    transform-origin: center;
    animation: statusSpinnerRotate 1s linear infinite;
}

/* Smooth content swap: fade in on state change */
.platform-agent-execution .send-btn>span,
.platform-agent-execution .send-btn>svg {
    animation: btnContentFadeIn 0.2s ease-out;
}

@keyframes btnContentFadeIn {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.platform-agent-execution .chat-textarea:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    /* background: var(--surface3); */
}

/* ═══════════════════════════════════════════
   CLEAN, SIMPLE & ATTRACTIVE CONTENT STYLES
   Modern, readable styling with proper spacing
═══════════════════════════════════════════ */

/* Bot message content - matching assistant layout */
.platform-agent-execution .message.message-assistant .message-content {
    display: block;
    width: 100%;
    max-width: 100%;
    color: var(--text);
}

/* User message content - keep in bubble */
.platform-agent-execution .message.message-user .message-content {
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Simple paragraph text */
.platform-agent-execution .msg-text,
.platform-agent-execution .message-content p {
    margin: 0;
    line-height: inherit;
    color: inherit;
    font-size: inherit;
}

/* Headers - bold text with slight spacing */
.platform-agent-execution .msg-header {
    margin: 12px 0 6px 0;
    line-height: 1.6;
    color: var(--text);
    font-size: 15px;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Lists - clean bullet/numbered lists */
.platform-agent-execution .msg-list {
    margin: 8px 0 12px 0;
    padding-left: 24px;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .msg-list-item {
    padding: 3px 0;
    line-height: 1.6;
    color: var(--text);
    font-size: 15px;
    margin: 2px 0;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Nested lists under numbered items */
.platform-agent-execution .msg-list-nested {
    margin: 6px 0 6px 0;
    padding-left: 20px;
    list-style-type: disc;
}

/* Section divider - subtle separator */
.platform-agent-execution .section-divider {
    height: 20px;
}

/* All SVG icons in message content always visible */
.platform-agent-execution .message-content svg {
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

/* Section labels - clean emoji-based headers */
.platform-agent-execution .section-label {
    display: block;
    margin: 16px 0 8px 0;
    padding: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    opacity: 1 !important;
    visibility: visible !important;
}

/* Section wrappers for multi-line content */
.platform-agent-execution .plan-section,
.platform-agent-execution .exec-section {
    margin: 0 0 12px 0;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Plan list - clean numbered list */
.platform-agent-execution .plan-list {
    margin: 8px 0 12px 0;
    padding-left: 24px;
    list-style: none;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .plan-item {
    position: relative;
    padding: 3px 0;
    line-height: 1.6;
    color: var(--text);
    font-size: 15px;
    margin: 2px 0;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .plan-item::before {
    content: '•';
    position: absolute;
    left: -16px;
    color: var(--text);
    font-weight: normal;
}

/* Tool box - clean plain text with icon */
.platform-agent-execution .tool-box {
    margin: 12px 0;
    padding: 0;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .tool-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    font-family: 'JetBrains Mono', monospace;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .tool-arg {
    padding: 2px 0 2px 16px;
    font-size: 13px;
    color: var(--text);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1.6;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .tool-detail {
    padding: 2px 0;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Final Answer - Plain text with icon */
.platform-agent-execution .final-answer-box {
    margin: 16px 0;
    padding: 0;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .final-answer-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .final-icon {
    width: 18px;
    height: 18px;
    color: #10b981;
    flex-shrink: 0;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

.platform-agent-execution .final-label {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .final-answer-content {
    font-size: 15px;
    color: var(--text);
    line-height: 1.7;
    padding-left: 26px;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .final-answer-content strong {
    color: var(--text);
    font-weight: 600;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Error box - plain text with icon */
.platform-agent-execution .error-box {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 12px 0;
    padding: 0;
    color: var(--text);
    font-weight: 400;
    opacity: 1 !important;
    visibility: visible !important;
}

.platform-agent-execution .error-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #dc3545;
    margin-top: 2px;
    opacity: 1 !important;
    visibility: visible !important;
    display: inline-block !important;
}

.platform-agent-execution .error-content {
    flex: 1;
    line-height: 1.7;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Code blocks - wrapped variant (used by parseStructuredContent / chat timeline) */
.platform-agent-execution .code-block-wrapper {
    margin: 12px 0;
    border-radius: 10px;
    overflow: hidden;
    background: #1e1e1e;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.platform-agent-execution .code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 38px;
}

.platform-agent-execution .code-lang {
    font-size: 10px;
    font-weight: 600;
    color: #858585;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
}

/* Copy button inside .code-block-wrapper header (text variant) */
.platform-agent-execution .code-block-header .code-copy-btn {
    position: static;
    width: auto;
    height: auto;
    padding: 3px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    opacity: 1;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.platform-agent-execution .code-block-header .code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
}

.platform-agent-execution .code-block-header .code-copy-btn.copied {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border-color: rgba(16, 185, 129, 0.35);
}

.platform-agent-execution .code-block {
    margin: 0;
    padding: 14px 16px;
    background: #1e1e1e;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.65;
    color: #d4d4d4;
    /* Thin scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.platform-agent-execution .code-block::-webkit-scrollbar {
    height: 6px;
}

.platform-agent-execution .code-block::-webkit-scrollbar-track {
    background: transparent;
}

.platform-agent-execution .code-block::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.platform-agent-execution .code-block::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.platform-agent-execution .code-block code {
    font-family: inherit;
    background: none;
    padding: 0;
    color: inherit;
    display: block;
    white-space: pre;
    word-wrap: normal;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ═══════════════════════════════════════════
   CREATIVE STREAMING RESPONSE UI
   Inspired by Claude, GPT, and modern AI chats
   
   Features:
   ✨ Animated gradient backgrounds with flowing colors
   ✨ Shimmer/shine effects sweeping across messages
   ✨ Pulsing glow rings around streaming bubbles
   ✨ Animated wave progress indicator
   ✨ Orbiting particles around status icons
   ✨ Retro-futuristic scan line effect
   ✨ Enhanced cursor with particle glow
   ✨ Floating bubble animation (GPT-inspired)
   ✨ Breathing status text
   ✨ Completion sparkle celebration effect
   ✨ Smooth scale & transform transitions
   ✨ State-based color schemes (planning/streaming/completing)
   ✨ Structured card-based response rendering
═══════════════════════════════════════════ */

/* STREAMING STATUS INDICATOR - Typing-dots style like Agent thinking */
.platform-agent-execution .stream-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0;
    margin-bottom: 8px;
}

.platform-agent-execution .status-icon {
    display: flex;
    gap: 6px;
    align-items: center;
}

.platform-agent-execution .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    animation: typingBounce 1.4s infinite ease-in-out;
    box-shadow: 0 0 8px var(--accent-glow);
}

.platform-agent-execution .status-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.platform-agent-execution .status-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {

    0%,
    60%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.6;
    }

    30% {
        transform: translateY(-8px) scale(1.1);
        opacity: 1;
    }
}

/* State-specific dot colors */
.platform-agent-execution .stream-status.planning .status-dot {
    background: linear-gradient(135deg, #f59e0b, #fb923c);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
}

.platform-agent-execution .stream-status.streaming .status-dot {
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    box-shadow: 0 0 8px var(--accent-glow);
}

.platform-agent-execution .stream-status.completing .status-dot {
    background: linear-gradient(135deg, #10b981, #14b8a6);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.platform-agent-execution .status-text {
    font-size: 11px;
    color: var(--text-muted);
    animation: labelPulse 2s ease-in-out infinite;
}

@keyframes labelPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* STREAMING TEXT CONTAINER - Simple inline text during streaming */
.platform-agent-execution .streaming-text {
    display: inline;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    /* Prevent browser scroll-anchor from locking to this growing element */
    overflow-anchor: none;
}

/* STREAMING CURSOR - Matches assistant-loader exactly */
.platform-agent-execution .cursor {
    display: inline;
    color: var(--accent);
    margin-left: 2px;
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    49% {
        opacity: 1;
    }

    50%,
    100% {
        opacity: 0;
    }
}

/* MARKDOWN STYLES */
.platform-agent-execution .message-content h1,
.platform-agent-execution .message-content h2,
.platform-agent-execution .message-content h3 {
    margin: 16px 0 10px;
    font-weight: 700;
    letter-spacing: -.5px;
    line-height: 1.3;
    color: var(--text);
}

.platform-agent-execution .message-content h1 {
    font-size: 24px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 8px;
}

.platform-agent-execution .message-content h2 {
    font-size: 20px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
}

.platform-agent-execution .message-content h3 {
    font-size: 17px;
}

.platform-agent-execution .message-content h1:first-child,
.platform-agent-execution .message-content h2:first-child,
.platform-agent-execution .message-content h3:first-child {
    margin-top: 0;
}

.platform-agent-execution .message-content strong {
    font-weight: 700;
    color: var(--text);
}

.platform-agent-execution .message-content em {
    font-style: italic;
    color: var(--text-mid);
}

.platform-agent-execution .message-content ul,
.platform-agent-execution .message-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.platform-agent-execution .message-content li {
    margin: 6px 0;
    line-height: 1.6;
}

.platform-agent-execution .message-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid var(--accent-soft);
    transition: border-color 0.2s ease, color 0.2s ease;
}

.platform-agent-execution .message-content a:hover {
    color: var(--accent2);
    border-bottom-color: var(--accent2);
}

.platform-agent-execution .message-content code.inline-code,
.platform-agent-execution .message-content code {
    font-family: var(--mono);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 5px;
    border-radius: 3px;
    color: var(--text);
    font-weight: 400;
}

/* Code inside pre blocks should not have padding/background */
.platform-agent-execution .message-content pre code {
    background: transparent !important;
    padding: 0 !important;
    border-radius: 0 !important;
    color: inherit !important;
}

.platform-agent-execution .message.message-user .message-content code.inline-code,
.platform-agent-execution .message.message-user .message-content code {
    background: rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.95);
}

/* ── CODE BLOCKS (message content — renderMarkdown output) ───────────────── */

/* Non-scrolling outer wrapper — button and label are positioned here */
.platform-agent-execution .message-content .code-block-outer {
    position: relative;
    margin: 14px 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    /* Header strip: 38px frosted tint + 1px separator, then dark body */
    background:
        linear-gradient(to bottom,
            rgba(255, 255, 255, 0.07) 37px,
            rgba(255, 255, 255, 0.07) 38px,
            transparent                38px
        ),
        linear-gradient(to bottom,
            rgba(255, 255, 255, 0.04) 38px,
            transparent                38px
        ),
        #1e1e1e;
}

/* ECharts container — either a ```echarts fenced code block once rendered,
   or the agent's own <div id="..."> chart target once we've parsed and
   initialized it. */
.platform-agent-execution .message-content .echarts-container {
    width: 100%;
    height: 360px;
    min-height: 360px;
    margin: 14px 0;
    border-radius: 10px;
    background: #fff;
}

/* Loading placeholder shown while a chart is still streaming in, in place
   of the raw <div>/<script> markup until it fully arrives and is parsed. */
.platform-agent-execution .message-content .echarts-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 120px;
    margin: 14px 0;
    padding: 0 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.platform-agent-execution .message-content .echarts-spinner {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-top-color: rgba(255, 255, 255, 0.75);
    animation: echarts-spin 0.8s linear infinite;
}

.platform-agent-execution .message-content .echarts-loading-text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.6);
}

@keyframes echarts-spin {
    to { transform: rotate(360deg); }
}

/* The pre itself — only scrolling code, no header padding needed */
.platform-agent-execution .message-content pre.code-block {
    margin: 0 !important;
    border: none;
    border-radius: 0;
    padding: 52px 16px 16px !important; /* Top padding makes room for header */
    overflow-x: auto;
    background: transparent !important;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.platform-agent-execution .message-content pre.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.65;
    color: #d4d4d4;
    display: block;
    white-space: pre;
    word-wrap: normal;
}

/* Language label — top-left of the outer wrapper (never scrolls) */
.platform-agent-execution .message-content .code-block-outer > .code-lang-label {
    position: absolute;
    top: 10px;
    left: 14px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6b7280;
    pointer-events: none;
    z-index: 3;
    line-height: 18px;
}

/* Copy button — top-right of the outer wrapper (never scrolls) */
.platform-agent-execution .message-content .code-block-outer > .code-copy-btn {
    position: absolute;
    top: 5px;
    right: 8px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    opacity: 0;
    z-index: 3;
}

.platform-agent-execution .message-content .code-block-outer:hover > .code-copy-btn {
    opacity: 1;
}

.platform-agent-execution .message-content .code-block-outer > .code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #e5e7eb;
}

.platform-agent-execution .message-content .code-block-outer > .code-copy-btn.copied {
    background: rgba(16, 185, 129, 0.18);
    color: #10b981;
    opacity: 1;
}

.platform-agent-execution .message-content .code-block-outer > .code-copy-btn svg {
    width: 14px;
    height: 14px;
}

/* Custom scrollbar for message-content code blocks */
.platform-agent-execution .message-content pre.code-block::-webkit-scrollbar {
    height: 6px;
}

.platform-agent-execution .message-content pre.code-block::-webkit-scrollbar-track {
    background: transparent;
}

.platform-agent-execution .message-content pre.code-block::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.platform-agent-execution .message-content pre.code-block::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.35);
}

.platform-agent-execution .right-panel {
    width: 25%;
    display: flex;
    flex-direction: column;
    padding: 22px;
    gap: 16px;
    background: var(--surface2);
    overflow: hidden;
}

.platform-agent-execution .rp-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.platform-agent-execution .rp-icon {
    width: 30px;
    height: 30px;
    border-radius: 0;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-agent-execution .rp-icon svg {
    width: 16px;
    height: 16px;
}

.platform-agent-execution .right-panel>div[id^="rp-variables-"] {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

.platform-agent-execution .right-panel>div[id^="rp-variables-"]:not(.mCustomScrollbar) {
    padding: 4px 8px 4px 0;
}

.platform-agent-execution .right-panel>div[id^="rp-variables-"]>.mCustomScrollBox>.mCSB_container {
    padding: 4px 8px 4px 0;
}

.platform-agent-execution .form-group {
    display: flex;
    flex-direction: column;
}

.platform-agent-execution .form-group-inline {
    flex-direction: row;
    align-items: center;
}

.platform-agent-execution .form-group-inline .form-input {
    width: auto;
    margin-right: 8px;
}

.platform-agent-execution .form-group-inline .form-label {
    margin-bottom: 0;
    cursor: pointer;
}

.platform-agent-execution .form-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.5px;
    /* text-transform: uppercase; */
    color: var(--text-muted);
}

.platform-agent-execution .form-input,
.platform-agent-execution .form-textarea {
    padding: 9px 12px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: var(--transition);
    width: 100%;
}

.platform-agent-execution .form-input:focus,
.platform-agent-execution .form-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
    background: #fff;
}

.platform-agent-execution .form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.platform-agent-execution .form-input::placeholder,
.platform-agent-execution .form-textarea::placeholder {
    color: var(--text-light);
}

/* RESPONSIVE */
@media (max-width: 1400px) {
    .platform-agent-execution .session-layout {
        flex-direction: column;
    }

    .platform-agent-execution .left-panel {
        width: 100%;
        max-height: 60vh;
        min-height: 400px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    .platform-agent-execution .right-panel {
        width: 100%;
        max-height: 40vh;
        min-height: 280px;
    }
}

@media (max-width: 1024px) {
    .platform-agent-execution .agents-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 14px;
        padding: 24px 28px;
    }

    .platform-agent-execution .message-wrapper {
        max-width: 90%;
    }

    .platform-agent-execution .message.message-assistant .message-wrapper {
        max-width: 98%;
    }

    .platform-agent-execution .message-content {
        max-width: 100%;
    }

    .platform-agent-execution .response-card {
        border-radius: 12px;
    }

    .platform-agent-execution .left-panel {
        max-height: 65vh;
    }

    .platform-agent-execution .right-panel {
        max-height: 35vh;
    }
}

@media (max-width: 768px) {
    .platform-agent-execution .agents-topbar {
        padding: 16px 20px;
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
    }

    .platform-agent-execution .agents-title {
        font-size: 26px;
    }

    .platform-agent-execution .agents-grid {
        grid-template-columns: 1fr;
        padding: 20px;
        gap: 12px;
    }

    .platform-agent-execution .search-wrap {
        width: 100%;
    }

    .platform-agent-execution .lp-header {
        padding: 14px 16px 12px;
    }

    .platform-agent-execution .lp-agent-row {
        gap: 10px;
    }

    .platform-agent-execution .lp-avatar {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

    .platform-agent-execution .lp-agent-name {
        font-size: 16px;
    }

    .platform-agent-execution .lp-agent-sub {
        font-size: 11px;
    }

    .platform-agent-execution .session-tiles-wrap,
    .platform-agent-execution .chat-messages-wrap {
        padding: 12px 4px 12px 16px;
    }

    .platform-agent-execution .chatbox-outer-wrap {
        padding: 10px 12px 12px;
    }

    .platform-agent-execution .chat-textarea {
        min-height: 60px;
        max-height: 120px;
        font-size: 13px;
        padding: 11px 12px;
    }

    .platform-agent-execution .toolbar-tags {
        gap: 4px;
        flex-wrap: wrap;
    }

    .platform-agent-execution .toolbar-tag {
        font-size: 9px;
        padding: 2px 6px;
    }

    .platform-agent-execution .send-btn {
        padding: 8px 14px;
        font-size: 12px;
        gap: 5px;
    }

    .platform-agent-execution .send-btn svg {
        width: 14px;
        height: 14px;
    }

    .platform-agent-execution .message-wrapper {
        max-width: 95%;
    }

    .platform-agent-execution .message.message-assistant .message-wrapper {
        max-width: 100%;
    }

    .platform-agent-execution .msg-bubble {
        font-size: 13px;
        padding: 9px 12px;
    }

    .platform-agent-execution .response-card {
        border-radius: 10px;
    }

    .platform-agent-execution .card-header {
        padding: 10px 14px;
        font-size: 12px;
    }

    .platform-agent-execution .card-content {
        padding: 12px 14px;
        font-size: 12px;
    }

    .platform-agent-execution .plan-step {
        padding: 7px 10px;
        font-size: 11px;
    }

    .platform-agent-execution .response-intro,
    .platform-agent-execution .response-text {
        font-size: 13px;
    }

    .platform-agent-execution .right-panel {
        padding: 16px;
        gap: 12px;
    }

    .platform-agent-execution .form-input,
    .platform-agent-execution .form-textarea {
        font-size: 12px;
        padding: 8px 10px;
    }

    .platform-agent-execution .form-textarea {
        min-height: 70px;
    }

    .platform-agent-execution .session-tile {
        padding: 11px 12px;
        gap: 10px;
    }

    .platform-agent-execution .session-avatar {
        width: 34px;
        height: 34px;
        font-size: 11px;
    }

    .platform-agent-execution .session-title {
        font-size: 12px;
    }

    .platform-agent-execution .session-meta {
        font-size: 10px;
    }

    .platform-agent-execution .left-panel {
        max-height: 70vh;
        min-height: 350px;
    }

    .platform-agent-execution .right-panel {
        max-height: 30vh;
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    .platform-agent-execution .agents-topbar {
        padding: 14px 16px;
    }

    .platform-agent-execution .agents-title {
        font-size: 22px;
    }

    .platform-agent-execution .agents-grid {
        padding: 16px;
    }

    .platform-agent-execution .agent-card {
        padding: 16px;
    }

    .platform-agent-execution .agent-avatar {
        width: 42px;
        height: 42px;
        font-size: 13px;
    }

    .platform-agent-execution .agent-name {
        font-size: 14px;
    }

    .platform-agent-execution .agent-desc {
        font-size: 12px;
    }

    .platform-agent-execution .lp-header {
        padding: 12px 14px 10px;
    }

    .platform-agent-execution .lp-agent-name {
        font-size: 15px;
    }

    .platform-agent-execution .session-tiles-wrap,
    .platform-agent-execution .chat-messages-wrap {
        padding: 10px 4px 10px 14px;
    }

    .platform-agent-execution .chatbox-outer-wrap {
        padding: 8px 10px 10px;
    }

    .platform-agent-execution .chat-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px 10px;
    }

    .platform-agent-execution .send-btn {
        width: 100%;
        justify-content: center;
    }

    .platform-agent-execution .message-wrapper {
        max-width: 100%;
    }

    .platform-agent-execution .message.message-assistant .message-wrapper {
        max-width: 100%;
    }

    .platform-agent-execution .msg-bubble {
        font-size: 12px;
        padding: 8px 11px;
    }

    .platform-agent-execution .response-card {
        border-radius: 8px;
    }

    .platform-agent-execution .card-header {
        padding: 9px 12px;
        font-size: 11px;
        gap: 8px;
    }

    .platform-agent-execution .card-header svg {
        width: 14px;
        height: 14px;
    }

    .platform-agent-execution .card-content {
        padding: 10px 12px;
        font-size: 11px;
    }

    .platform-agent-execution .plan-step {
        padding: 6px 9px;
        font-size: 10px;
        margin: 5px 0;
    }

    .platform-agent-execution .response-intro,
    .platform-agent-execution .response-text {
        font-size: 12px;
    }

    .platform-agent-execution .final-card .card-content {
        font-size: 12px;
    }

    .platform-agent-execution .message-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .platform-agent-execution .copy-btn {
        opacity: 1;
    }

    .platform-agent-execution .right-panel {
        padding: 14px;
    }

    .platform-agent-execution .rp-title {
        font-size: 14px;
    }

    .platform-agent-execution .rp-icon {
        width: 26px;
        height: 26px;
    }

    .platform-agent-execution .rp-icon svg {
        width: 14px;
        height: 14px;
    }

    .platform-agent-execution .form-label {
        font-size: 10px;
    }

    .platform-agent-execution .back-btn {
        font-size: 11px;
        padding: 4px 10px;
    }

    .platform-agent-execution .back-btn svg {
        width: 11px;
        height: 11px;
    }
}

/* ═══════════════════════════════════════════
   STATUS STREAMING CONTAINER
   Vertical stepper UI that auto-collapses when tokens arrive
═══════════════════════════════════════════ */

/* Status Stream Animation - Live streaming status with "Agent thinking..." style */
.platform-agent-execution .status-stream-animation {
    margin: 0 0 12px 0;
    padding: 10px 16px 10px 0;
    /* background: rgba(37, 95, 166, 0.04); */
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: statusStreamFadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.2s ease-out;
}

.platform-agent-execution .status-stream-animation.hidden {
    display: none;
}

@keyframes statusStreamFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.platform-agent-execution .status-stream-animation-dots {
    display: flex;
    align-items: center;
    gap: 3px;
}

.platform-agent-execution .status-stream-animation-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: statusStreamDotBounce 1.4s infinite ease-in-out;
}

.platform-agent-execution .status-stream-animation-dot:nth-child(1) {
    animation-delay: 0s;
}

.platform-agent-execution .status-stream-animation-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.platform-agent-execution .status-stream-animation-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes statusStreamDotBounce {

    0%,
    60%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    30% {
        transform: scale(1.2);
        opacity: 1;
    }
}

.platform-agent-execution .status-stream-animation-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-mid);
    letter-spacing: -0.1px;
    animation: statusStreamTextPulse 2s ease-in-out infinite;
}

@keyframes statusStreamTextPulse {

    0%,
    100% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }
}

/* Status Animation Wrapper - Temporary animated status before moving to container */
.platform-agent-execution .status-animation-wrapper {
    margin: 6px 0;
    animation: statusAnimationSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: opacity 0.2s ease-out;
}

@keyframes statusAnimationSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.platform-agent-execution .status-animation-indicator {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: rgba(37, 95, 166, 0.04);
    border: none;
    border-radius: 16px;
    box-shadow: none;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.8;
    }

    50% {
        opacity: 1;
    }
}

.platform-agent-execution .status-animation-spinner {
    width: 14px;
    height: 14px;
    border: 1.5px solid rgba(37, 95, 166, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: statusSpinnerRotate 0.8s linear infinite;
}

@keyframes statusSpinnerRotate {
    to {
        transform: rotate(360deg);
    }
}

.platform-agent-execution .status-animation-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-mid);
    letter-spacing: -0.1px;
    transition: opacity 0.15s ease-in-out;
}

/* Status container - rendered inside msg-wrapper along with msg-bubbles */
.platform-agent-execution .status-stream-container {
    margin: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: statusContainerSlideIn 0.3s ease-out;
    overflow: hidden;
}

.platform-agent-execution .status-stream-container.hidden {
    display: none;
}

@keyframes statusContainerSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header - Click to toggle expand/collapse */
.platform-agent-execution .status-stream-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 8px 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: none;
}

.platform-agent-execution .status-stream-container.expanded .status-stream-header {
    border-bottom: none;
}

.platform-agent-execution .status-stream-header:hover {
    background: transparent;
}

.platform-agent-execution .status-toggle-arrow {
    font-size: 12px;
    font-weight: bold;
    color: var(--text-muted);
    transition: transform 0.2s ease;
    line-height: 1;
    width: 14px;
    text-align: center;
    opacity: 0.7;
}

.platform-agent-execution .status-stream-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Body - Contains vertical stepper */
.platform-agent-execution .status-stream-body {
    padding: 4px 0 8px 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 600px;
    overflow: hidden;
}

.platform-agent-execution .status-stream-container.collapsed .status-stream-body {
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}

.platform-agent-execution .status-stepper {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Status Step Item */
.platform-agent-execution .status-step {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    animation: statusStepSlideIn 0.3s ease-out;
}

@keyframes statusStepSlideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Icon Container */
.platform-agent-execution .status-step-icon {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    color: var(--accent);
    transition: all 0.3s ease;
}

.platform-agent-execution .status-step-icon svg {
    width: 11px;
    height: 11px;
    stroke-width: 2.5;
}

/* Vertical Connector Line */
.platform-agent-execution .status-step-connector {
    position: absolute;
    left: 9.5px;
    top: 20px;
    width: 1.5px;
    height: calc(100% - 8px);
    background: var(--border);
    z-index: 1;
    opacity: 0.4;
}

.platform-agent-execution .status-step:last-child .status-step-connector {
    display: none;
}

/* Content */
.platform-agent-execution .status-step-content {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 20px;
}

.platform-agent-execution .status-step-text {
    flex: 1;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-mid);
    font-weight: 400;
}

/* Status Type Specific Icon Colors - Enhanced specificity */
.platform-agent-execution .status-step[data-status="start"] .status-step-icon {
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    background: rgba(37, 95, 166, 0.06) !important;
}

.platform-agent-execution .status-step[data-status="planning"] .status-step-icon {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.06) !important;
}

.platform-agent-execution .status-step[data-status="execution"] .status-step-icon {
    border-color: #0d9488 !important;
    color: #0d9488 !important;
    background: rgba(13, 148, 136, 0.06) !important;
}

.platform-agent-execution .status-step[data-status="think"] .status-step-icon {
    border-color: #8b5cf6 !important;
    color: #8b5cf6 !important;
    background: rgba(139, 92, 246, 0.06) !important;
}

.platform-agent-execution .status-step[data-status="tool"] .status-step-icon {
    border-color: #0284c7 !important;
    color: #0284c7 !important;
    background: rgba(2, 132, 199, 0.06) !important;
}

.platform-agent-execution .status-step[data-status="complete"] .status-step-icon,
.platform-agent-execution .status-step[data-status="event_complete"] .status-step-icon {
    border-color: #10b981 !important;
    color: #10b981 !important;
    background: rgba(16, 185, 129, 0.06) !important;
}

.platform-agent-execution .status-step[data-status="error"] .status-step-icon {
    border-color: #dc3545 !important;
    color: #dc3545 !important;
    background: rgba(239, 68, 68, 0.06) !important;
}

/* ================= URL AND FILE LINKS ================= */
.platform-agent-execution .msg-url-link {
    color: #0284c7;
    text-decoration: underline;
    cursor: pointer;
    word-break: break-all;
    transition: color 0.2s ease;
}

.platform-agent-execution .msg-url-link:hover {
    color: #0369a1;
    text-decoration: none;
}

.platform-agent-execution .msg-file-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #059669;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 6px;
    background: rgba(5, 150, 105, 0.08);
    transition: all 0.2s ease;
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.platform-agent-execution .msg-file-link:hover {
    background: rgba(5, 150, 105, 0.15);
    border-color: rgba(5, 150, 105, 0.3);
    transform: translateY(-1px);
}

.platform-agent-execution .msg-file-link svg {
    flex-shrink: 0;
}

/* ================= RIGHT PANEL - PREVIEW & TABS ================= */
.platform-agent-execution .rp-header {
    display: flex;
    gap: 0;
    padding: 0;
    border-bottom: 2px solid var(--border);
    flex-shrink: 0;
}

.platform-agent-execution .rp-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.02em;
    position: relative;
    background: transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    user-select: none;
}

.platform-agent-execution .rp-tab::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary, #3b82f6);
    transform: scaleX(0);
    transition: transform 0.2s ease;
}

.platform-agent-execution .rp-tab:hover:not(.rp-tab-active) {
    background: rgba(0, 0, 0, 0.02);
    color: #334155;
}

.platform-agent-execution .rp-tab.rp-tab-active {
    background: transparent;
    color: var(--primary, #3b82f6);
    font-weight: 600;
    cursor: default;
}

.platform-agent-execution .rp-tab.rp-tab-active::before {
    transform: scaleX(1);
}

.platform-agent-execution .rp-tab .rp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    pointer-events: none;
}

.platform-agent-execution .rp-tab .rp-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.2;
}

.platform-agent-execution .rp-tab-label {
    line-height: 1.4;
    pointer-events: none;
}

.platform-agent-execution .rp-tab-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-left: 6px;
    transition: all 0.15s ease;
    color: currentColor;
    opacity: 0.5;
}

.platform-agent-execution .rp-tab-close:hover {
    background: rgba(0, 0, 0, 0.08);
    opacity: 1;
}

.platform-agent-execution .rp-tab.rp-tab-active .rp-tab-close {
    opacity: 0.7;
}

.platform-agent-execution .rp-tab.rp-tab-active .rp-tab-close:hover {
    background: rgba(59, 130, 246, 0.12);
    opacity: 1;
}

/* ================= INLINE ACTION BUTTONS ================= */
.platform-agent-execution .inline-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    margin: 0 2px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: baseline;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Positive Actions (Approve, Accept, Allow, etc.) */
.platform-agent-execution .inline-action-btn.btn-positive {
    background: #22c55e;
    color: #ffffff;
    border-color: #16a34a;
}

.platform-agent-execution .inline-action-btn.btn-positive:hover:not(.disabled) {
    background: #16a34a;
    border-color: #15803d;
    box-shadow: 0 2px 5px rgba(34, 197, 94, 0.3);
}

.platform-agent-execution .inline-action-btn.btn-positive:active:not(.disabled) {
    transform: scale(0.98);
    background: #15803d;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

/* Negative Actions (Reject, Deny, Cancel, etc.) */
.platform-agent-execution .inline-action-btn.btn-negative {
    background: #dc3545;
    color: #ffffff;
    border-color: #dc2626;
}

.platform-agent-execution .inline-action-btn.btn-negative:hover:not(.disabled) {
    background: #dc2626;
    border-color: #b91c1c;
    box-shadow: 0 2px 5px rgba(239, 68, 68, 0.3);
}

.platform-agent-execution .inline-action-btn.btn-negative:active:not(.disabled) {
    transform: scale(0.98);
    background: #b91c1c;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

/* Neutral Actions (Default theme color) */
.platform-agent-execution .inline-action-btn.btn-neutral {
    background: var(--primary, #3b82f6);
    color: #ffffff;
    border-color: var(--primary-dark, #2563eb);
}

.platform-agent-execution .inline-action-btn.btn-neutral:hover:not(.disabled) {
    background: var(--primary-dark, #2563eb);
    border-color: var(--primary-darker, #1d4ed8);
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.3);
}

.platform-agent-execution .inline-action-btn.btn-neutral:active:not(.disabled) {
    transform: scale(0.98);
    background: var(--primary-darker, #1d4ed8);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) inset;
}

/* Selected State (applies to all types) */
.platform-agent-execution .inline-action-btn.selected {
    background: #10b981;
    border-color: #059669;
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Disabled State (applies to all types) */
.platform-agent-execution .inline-action-btn.disabled {
    opacity: 1;
    cursor: not-allowed;
    background: #9ca3af;
    border-color: #6b7280;
    color: #ffffff;
    box-shadow: none;
}

.platform-agent-execution .inline-action-btn.disabled.selected {
    background: #94a3b8;
    border-color: #64748b;
}

.platform-agent-execution .rp-content {
    flex: 1;
    overflow: hidden;
}

.platform-agent-execution .rp-preview-panel {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.platform-agent-execution .rp-preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}

/* ================= PANEL RESIZE ANIMATIONS ================= */
.platform-agent-execution .left-panel {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-agent-execution .left-panel.with-preview {
    width: 50% !important;
}

.platform-agent-execution .right-panel {
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.platform-agent-execution .right-panel.with-preview {
    width: 50% !important;
}

/* Right panel content areas */
.platform-agent-execution .rp-content {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.platform-agent-execution .rp-content[style*="display: none"] {
    opacity: 0;
}

/* ================= AGENTS TYPE TABS ================= */
.platform-agent-execution .agents-title-row {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.platform-agent-execution .agents-type-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    border-left: 1.5px solid var(--border2);
    padding-left: 20px;
    margin-left: 4px;
}

.platform-agent-execution .agents-type-tab {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 4px 0;
    margin: 0 14px 0 0;
    cursor: pointer;
    position: relative;
    transition: color .2s ease;
    user-select: none;
    white-space: nowrap;
}

.platform-agent-execution .agents-type-tab:last-child {
    margin-right: 0;
}

.platform-agent-execution .agents-type-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform .2s ease;
    transform-origin: left;
}

.platform-agent-execution .agents-type-tab:hover {
    color: var(--text-mid);
}

.platform-agent-execution .agents-type-tab.active {
    color: var(--accent);
    font-weight: 600;
}

.platform-agent-execution .agents-type-tab.active::after {
    transform: scaleX(1);
}

/* ========================================================================
   Enhanced Markdown Rendering Styles
   ======================================================================== */

/* Markdown Tables - Optimized for message containers with proper containment */
.platform-agent-execution .markdown-table,
.platform-agent-execution .message-content table {
    border-collapse: collapse;
    width: fit-content;
    min-width: 0;
    margin: 8px 0;
    font-size: 13px;
    background-color: white;
    border: 1px solid #e5e7eb;
    /* border-radius: 6px; */
    display: block;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.15) transparent;
}

.platform-agent-execution .markdown-table::-webkit-scrollbar,
.platform-agent-execution .message-content table::-webkit-scrollbar {
    height: 5px;
}

.platform-agent-execution .markdown-table::-webkit-scrollbar-track,
.platform-agent-execution .message-content table::-webkit-scrollbar-track {
    background: transparent;
}

.platform-agent-execution .markdown-table::-webkit-scrollbar-thumb,
.platform-agent-execution .message-content table::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

.platform-agent-execution .markdown-table::-webkit-scrollbar-thumb:hover,
.platform-agent-execution .message-content table::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.25);
}

.platform-agent-execution .markdown-table thead,
.platform-agent-execution .message-content table thead {
    /* background-color: #f9fafb; */
    background-color: #eaeaec;
}

.platform-agent-execution .markdown-table th,
.platform-agent-execution .message-content table th {
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    white-space: normal;
}

.platform-agent-execution .markdown-table th:last-child,
.platform-agent-execution .message-content table th:last-child {
    border-right: none;
}

.platform-agent-execution .markdown-table td,
.platform-agent-execution .message-content table td {
    padding: 8px 10px;
    border-bottom: 1px solid #e5e7eb;
    border-right: 1px solid #e5e7eb;
    color: #1f2937;
    white-space: normal;
}

.platform-agent-execution .markdown-table td:last-child,
.platform-agent-execution .message-content table td:last-child {
    border-right: none;
}

.platform-agent-execution .markdown-table tr:last-child td,
.platform-agent-execution .message-content table tbody tr:last-child td {
    border-bottom: none;
}

.platform-agent-execution .markdown-table tr:hover,
.platform-agent-execution .message-content table tbody tr:hover {
    background-color: #f9fafb;
}

/* Markdown Headings - Optimized for messages */
.platform-agent-execution .message-content h1,
.platform-agent-execution .message-content h2,
.platform-agent-execution .message-content h3,
.platform-agent-execution .message-content h4,
.platform-agent-execution .message-content h5,
.platform-agent-execution .message-content h6 {
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
    /* Note: margins are controlled by the reset rules below */
}

.platform-agent-execution .message-content h1 {
    font-size: 1.25em;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 4px;
}

.platform-agent-execution .message-content h2 {
    font-size: 1.15em;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 3px;
}

.platform-agent-execution .message-content h3 {
    font-size: 1.1em;
}

.platform-agent-execution .message-content h4 {
    font-size: 1.05em;
}

.platform-agent-execution .message-content h5 {
    font-size: 1em;
}

.platform-agent-execution .message-content h6 {
    font-size: 0.95em;
    color: #6b7280;
}

/* Markdown Lists - Optimized for messages */
.platform-agent-execution .message-content ul {
    list-style-type: disc;
}

.platform-agent-execution .message-content ol {
    list-style-type: decimal;
}

.platform-agent-execution .message-content li {
    margin: 5px 0;
    line-height: 1.65;
    color: #374151;
}

.platform-agent-execution .message-content li>ul,
.platform-agent-execution .message-content li>ol {
    margin: 2px 0;
}

/* Task Lists (GFM) */
.platform-agent-execution .message-content .task-list-item {
    list-style-type: none;
    margin-left: -24px;
    padding-left: 24px;
}

.platform-agent-execution .message-content .task-list-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: default;
}

/* Markdown Blockquotes - Optimized for messages */
.platform-agent-execution .message-content blockquote {
    margin: 8px 0;
    padding: 8px 12px;
    border-left: 3px solid #3b82f6;
    background-color: #eff6ff;
    color: #1e40af;
    font-style: italic;
    border-radius: 0 4px 4px 0;
}

/* Markdown Horizontal Rules */
.platform-agent-execution .message-content hr {
    margin: 12px 0;
    border: none;
    border-top: 1px solid #e5e7eb;
}

/* Markdown Images */
.platform-agent-execution .message-content .markdown-image,
.platform-agent-execution .message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Fallback: bare <pre> elements that were not processed by highlightCodeBlocks
   (e.g. SSR content or edge cases). Intentionally lower specificity so
   pre.code-block rules above always win. */
.platform-agent-execution .message-content pre:not(.code-block) {
    position: relative;
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 14px 16px;
    border-radius: 8px;
    overflow-x: auto;
    white-space: pre;
    margin: 10px 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.65;
    max-width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.platform-agent-execution .message-content .inline-code,
.platform-agent-execution .message-content code:not(.code-block code) {
    background-color: #f3f4f6;
    color: #dc2626;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Consolas', monospace;
    font-size: 0.9em;
}

/* Markdown Links */
.platform-agent-execution .message-content a {
    color: #3b82f6;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.platform-agent-execution .message-content a:hover {
    border-bottom-color: #3b82f6;
}

/* Markdown Strikethrough (GFM) */
.platform-agent-execution .message-content del {
    color: #6b7280;
    text-decoration: line-through;
}

/* Markdown Strong and Emphasis */
.platform-agent-execution .message-content strong {
    font-weight: 600;
    color: #111827;
}

.platform-agent-execution .message-content em {
    font-style: italic;
}

/* ============================================================================
   CRITICAL: Remove ALL browser default margins from marked.js generated HTML
   ============================================================================ */

/* Reset margins on ALL markdown elements (comprehensive approach) */
.platform-agent-execution .message-content p,
.platform-agent-execution .message-content h1,
.platform-agent-execution .message-content h2,
.platform-agent-execution .message-content h3,
.platform-agent-execution .message-content h4,
.platform-agent-execution .message-content h5,
.platform-agent-execution .message-content h6,
.platform-agent-execution .message-content ul,
.platform-agent-execution .message-content ol,
.platform-agent-execution .message-content blockquote,
.platform-agent-execution .message-content pre,
.platform-agent-execution .message-content table {
    margin: 0 !important;
    padding: 0 !important;
}

/* Re-apply controlled spacing only where needed */
.platform-agent-execution .message-content p+p {
    margin-top: 8px !important;
}

/* Add back essential padding for lists */
.platform-agent-execution .message-content ul,
.platform-agent-execution .message-content ol {
    padding-left: 20px !important;
    margin: 6px 0 14px !important;
}

/* Add back essential margin for headings between content */
.platform-agent-execution .message-content h1,
.platform-agent-execution .message-content h2,
.platform-agent-execution .message-content h3,
.platform-agent-execution .message-content h4,
.platform-agent-execution .message-content h5,
.platform-agent-execution .message-content h6 {
    margin: 20px 0 10px 0 !important;
    padding-bottom: 6px !important;
}

/* First heading in message should have no top margin */
.platform-agent-execution .message-content>h1:first-child,
.platform-agent-execution .message-content>h2:first-child,
.platform-agent-execution .message-content>h3:first-child,
.platform-agent-execution .message-content>h4:first-child,
.platform-agent-execution .message-content>h5:first-child,
.platform-agent-execution .message-content>h6:first-child {
    margin-top: 0 !important;
}

/* Add back essential margin for blockquotes and code blocks */
.platform-agent-execution .message-content blockquote,
.platform-agent-execution .message-content pre,
.platform-agent-execution .message-content table {
    margin: 10px 0 15px !important;
}

/* Absolute first and last child resets - catch all */
.platform-agent-execution .message-content>*:first-child {
    margin-top: 0 !important;
}

.platform-agent-execution .message-content>*:last-child {
    margin-bottom: 0 !important;
}
/* ══════════════════════════════════════════════════
   STATUS/EVENT STREAMING — collapsible timeline containers
   Ported from assistant-loader.js / assistant.css — same collapsible
   "Analyzing..."/"Executing..." timeline UI, scoped under
   .platform-agent-execution to match this widget's DOM structure.
   ══════════════════════════════════════════════════ */
/* .message-event lays its direct children out as a flex ROW (avatar + bubble alignment
   elsewhere in chat). This wrapper is the sole flex child so its own contents (series box,
   divider, Analysing/Executing indicator) stack in a COLUMN instead of side-by-side.
   The left accent border + padding + streaming background live HERE (not on the inner
   .event-series box) so the bar spans the full height of the series box, the divider,
   AND the Analysing/Executing indicator underneath it — matching platform-app-generator's
   streaming look exactly. */
.platform-agent-execution .event-series-content {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: 75%;
    min-width: 35%;
    padding: 2px 0 2px 12px;
    border-left: 2px solid transparent;
    transition: border-left-color 0.28s ease, background 0.28s ease;
}

/* Responsive min-width: on narrower screens the container grows proportionally so it
   doesn't shrink to an unreadably thin sliver. */
@media (max-width: 720px) {
    .platform-agent-execution .event-series-content {
        min-width: 50%;
    }
}

@media (max-width: 520px) {
    .platform-agent-execution .event-series-content {
        min-width: 75%;
    }
}

@media (max-width: 320px) {
    .platform-agent-execution .event-series-content {
        min-width: 100%;
    }
}

.platform-agent-execution .event-series-content.event-series-streaming {
    border-left-color: #0355A4 !important;
    background: linear-gradient(90deg, rgba(3, 85, 164, 0.03) 0%, transparent 100%) !important;
    border-radius: 2px 8px 8px 2px !important;
}

.platform-agent-execution .event-series-content.event-series-execution.event-series-streaming {
    border-left-color: #f59e0b !important;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.04) 0%, transparent 100%) !important;
}

/* Borderless inline container — no card/box, matches platform-app-generator's
   inline thinking panel (accent bar only while streaming, plain text once done). */
.platform-agent-execution .event-series {
    margin: 4px 0;
}

/* Collapsed summary header — a plain clickable row, no card chrome. Hidden until
   the series is "done"; while streaming only the item list + Analysing indicator show. */
.platform-agent-execution .event-series-header {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 2px 4px 2px 2px;
    margin-left: -2px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #6b7280;
    user-select: none;
    transition: background 0.15s ease;
}

.platform-agent-execution .event-series.done .event-series-header {
    display: flex;
    align-items: center;
}

.platform-agent-execution .event-series-header:hover {
    background: rgba(107, 114, 128, 0.08);
    color: #374151;
}

/* Chevron drawn with CSS borders (thin caret, matches the reference icon)
   instead of a filled unicode triangle glyph. */
.platform-agent-execution .event-series-header .event-series-chevron {
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-left: 5px;
    margin-bottom: 4px;
    flex-shrink: 0;
    border-right: 1.5px solid #9ca3af;
    border-bottom: 1.5px solid #9ca3af;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

/* Collapsed = chevron points down (default); expanded = rotated to point up */
.platform-agent-execution .event-series.done:not(.collapsed) .event-series-chevron {
    transform: rotate(225deg);
    margin-bottom: 0px;
}

.platform-agent-execution .event-series.done.collapsed .event-series-list {
    display: none;
}

.platform-agent-execution .event-series.done .event-series-list {
    margin-top: 3px;
    padding-left: 10px;
    border-left: 2px solid #e5e7eb;
}

.platform-agent-execution .event-series-list {
    display: flex;
    flex-direction: column;
}

/* Fixed-height streaming viewport (matches app-gen's .thinkingTimeline exactly):
   the container no longer grows unbounded as more statuses arrive — it scrolls
   internally and auto-follows the newest entry. Scrollbar hidden while live. */
.platform-agent-execution .event-series-streaming .event-series-list {
    height: 72px;
    overflow-y: auto;
    overflow-x: hidden;
    overflow-anchor: none;
    padding: 3px 8px 3px 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.platform-agent-execution .event-series-streaming .event-series-list::-webkit-scrollbar {
    display: none;
}

/* Expanded history view: capped at the same height as the streaming viewport, but as a
   max-height (not a fixed height) — a single-line history should size to its own content
   instead of always reserving the full box, matching a natural "shrink to fit, cap at
   72px, scroll beyond that" behaviour. Scrollbar hidden, matching the live view — still
   scrollable via mouse wheel/touch/keyboard, just no visible scrollbar track.
   overflow-x is explicitly hidden — without it, setting overflow-y:auto alone makes
   browsers silently force overflow-x:auto too, producing an unwanted horizontal scrollbar. */
.platform-agent-execution .event-series.done:not(.collapsed) .event-series-list {
    max-height: 74px;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 4px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.platform-agent-execution .event-series.done:not(.collapsed) .event-series-list::-webkit-scrollbar {
    display: none;
}

/* Each timeline entry: dot + text in a flex row (matches app-gen's .thinkingTimelineItem) */
.platform-agent-execution .event-series-list .event-series-item {
    font-size: 12px;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    padding: 2px 4px;
    margin: 0 -4px;
    border-radius: 5px;
    transition: background 0.18s ease;
    animation: event-series-item-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes event-series-item-in {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Colour-coded dot prefix per event category — mirrors platform-app-generator's
   classifyThinkingLine timeline dots (tool/agent/result/status). */
.platform-agent-execution .event-series-item-dot {
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    margin-top: 5.5px;
    background: #d1d5db;
    transition: background 0.2s ease;
}

.platform-agent-execution .event-series-item-dot-tool { background: #8b5cf6; }
.platform-agent-execution .event-series-item-dot-agent { background: #0284c7; }
.platform-agent-execution .event-series-item-dot-result { background: #16a34a; }
.platform-agent-execution .event-series-item-dot-status { background: #94a3b8; }

/* Non-execute (analysis) history is plain text once expanded — no dot bullets.
   Execution history keeps its colour-coded dots (matches the reference). */
.platform-agent-execution .event-series.done:not(.event-series-execution) .event-series-item-dot {
    display: none;
}

/* Muted by default (matches app-gen's .thinkingItemText) */
.platform-agent-execution .event-series-item-text {
    flex: 1;
    min-width: 0;
    color: #6b7280;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.platform-agent-execution .event-series-item-time {
    margin-left: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    white-space: nowrap;
}

/* Only the most-recently-streamed line is highlighted — subtle blue/amber tint
   plus stronger text contrast (matches app-gen's .thinkingTimelineItemActive). */
.platform-agent-execution .event-series-item-active {
    background: rgba(3, 85, 164, 0.05);
}

.platform-agent-execution .event-series-item-active .event-series-item-text {
    color: #374151;
    font-weight: 500;
}

/* The current/live line's dot breathes (shrinks/grows) while streaming,
   matching app-gen's .thinkingItemDotActive pulse. */
.platform-agent-execution .event-series-item-active .event-series-item-dot {
    animation: event-series-dot-active-pulse 1.4s ease-in-out infinite;
}

@keyframes event-series-dot-active-pulse {
    0%, 100% { opacity: 0.65; transform: scale(0.85); }
    50% { opacity: 1; transform: scale(1.25); }
}

.platform-agent-execution .event-series-execution .event-series-item-active {
    background: rgba(245, 158, 11, 0.07);
}

/* Brief collapsing transition before the summary header swaps in, mirrors the
   ~290ms exit animation in platform-app-generator's ThinkingPanel. */
.platform-agent-execution .event-series-collapsing .event-series-list {
    opacity: 0;
    transition: opacity 0.22s ease;
}

.platform-agent-execution .event-series-header .event-series-check {
    color: #0355A4;
}

/* Divider between the streamed item list and the Analysing/Executing indicator */
.platform-agent-execution .event-series-divider {
    border-top: 1px solid rgba(107, 114, 128, 0.18);
    margin: 6px 0 6px 0;
}

/* Animated "Analysing.../Executing..." indicator — sits at the BOTTOM of the
   container, below the streamed items, while streaming is in progress
   (matches app-gen's .thinkingFooterLabel + .thinkingPulseRing + .thinkingBounceDots). */
.platform-agent-execution .event-series-analysing {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 500;
    color: #0355A4;
    letter-spacing: 0.01em;
}

.platform-agent-execution .event-series-analysing-label {
    line-height: 1;
}

.platform-agent-execution .event-series-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0355A4;
    flex-shrink: 0;
    animation: event-series-pulse 1.6s ease-in-out infinite;
}

@keyframes event-series-pulse {
    0%, 100% { opacity: 0.45; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

.platform-agent-execution .event-series-bounce-dots {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: 1px;
}

.platform-agent-execution .event-series-bounce-dots .event-series-dot {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #0355A4;
    animation: event-series-dot-bounce 1.2s ease-in-out infinite;
}

.platform-agent-execution .event-series-bounce-dots .event-series-dot:nth-child(1) { animation-delay: 0s; }
.platform-agent-execution .event-series-bounce-dots .event-series-dot:nth-child(2) { animation-delay: 0.2s; }
.platform-agent-execution .event-series-bounce-dots .event-series-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes event-series-dot-bounce {
    0%, 60%, 100% { transform: translateY(0) scale(0.9); opacity: 0.4; }
    30% { transform: translateY(-3px) scale(1.1); opacity: 1; }
}

/* Execution (amber) variant — visually distinguishes tool-execute events from analysis events */
.platform-agent-execution .event-series-analysing-execution {
    color: #b45309;
}

.platform-agent-execution .event-series-analysing-execution .event-series-pulse {
    background: #f59e0b;
}

.platform-agent-execution .event-series-analysing-execution .event-series-dot {
    background: #f59e0b;
}

.platform-agent-execution .event-series-execution .event-series-header .event-series-check {
    color: #b45309;
}

/* Execution summary label: one flowing sentence ("⚡ Execution: tool completed in Xs")
   that wraps naturally at the chat width — matches platform-app-generator's single
   <span> footer label exactly (icon + text + chevron all inline). */
.platform-agent-execution .event-series-header-label {
    /* flex: 1; */
    min-width: 0;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.platform-agent-execution .event-series-execution .event-series-header {
    align-items: flex-start;
}

.platform-agent-execution .event-series-execution .event-series-header .event-series-chevron {
    margin-top: 2px;
}