:root {
    --bg-primary: #050508;
    --bg-secondary: #0c0c12;
    --bg-tertiary: #14141c;
    --bg-card: #181822;
    --bg-glass: rgba(255, 255, 255, 0.025);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(255, 255, 255, 0.12);
    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-tertiary: #c4b5fd;
    --accent-cyan: #22d3ee;
    --accent-green: #10b981;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-glow: rgba(139, 92, 246, 0.3);
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --font-display: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', 'Cascadia Mono', 'Segoe UI Mono', Consolas, 'Liberation Mono', monospace;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 60px rgba(139, 92, 246, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-display);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.bg-effects {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-effects::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12) 0%, transparent 70%);
    filter: blur(60px);
}

.bg-effects::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    bottom: -100px;
    right: -100px;
    background: radial-gradient(circle, rgba(34, 211, 238, 0.08) 0%, transparent 70%);
    filter: blur(50px);
}

.app {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav {
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(9, 11, 16, 0.88);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.nav-logo-art {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.nav-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-tabs {
    display: flex;
    gap: 8px;
    margin-left: 24px;
}

.nav-tab {
    padding: 10px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-tab:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-tab.active {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-secondary);
    border-color: rgba(139, 92, 246, 0.3);
}

.main {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.section.active {
    display: block;
}

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

.lobby-header {
    text-align: center;
    margin-bottom: 40px;
}

.lobby-header h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
    background: linear-gradient(135deg, var(--text-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lobby-header p {
    color: var(--text-secondary);
    font-size: 16px;
}

.robot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.robot-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.robot-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.robot-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-primary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 40px rgba(139, 92, 246, 0.1);
}

.robot-card:hover::before {
    opacity: 1;
}

.robot-avatar {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.robot-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.robot-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
}

.robot-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.robot-status.online {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.robot-status.offline {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.robot-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.chat-container {
    display: none;
    height: calc(100vh - 180px);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    overflow: hidden;
    flex-direction: column;
}

.chat-container.active {
    display: flex;
}

.chat-shell {
    position: relative;
    display: grid;
    grid-template-columns: 296px minmax(0, 1fr);
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.chat-session-sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(15, 23, 42, 0.9));
    border-right: 1px solid rgba(148, 163, 184, 0.14);
    min-height: 0;
}

.chat-session-sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.chat-session-sidebar-eyebrow {
    color: rgba(125, 211, 252, 0.72);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-session-sidebar-header h3 {
    margin: 4px 0 0;
    color: #f8fbff;
    font-size: 18px;
    font-weight: 700;
}

.chat-session-sidebar-actions {
    display: flex;
    gap: 8px;
}

.chat-session-action-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(59, 130, 246, 0.18);
    color: #eff6ff;
    border-radius: 12px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
}

.chat-session-action-btn:hover {
    border-color: rgba(125, 211, 252, 0.38);
    background: rgba(59, 130, 246, 0.24);
}

.chat-session-action-btn.secondary {
    background: rgba(15, 23, 42, 0.42);
    border-color: rgba(148, 163, 184, 0.18);
    color: rgba(226, 232, 240, 0.92);
}

.chat-session-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-session-list::-webkit-scrollbar {
    width: 8px;
}

.chat-session-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 999px;
}

.chat-session-list-card {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 16px;
    padding: 12px 12px 11px;
    background: rgba(15, 23, 42, 0.52);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chat-session-list-card:hover {
    border-color: rgba(125, 211, 252, 0.28);
    background: rgba(15, 23, 42, 0.68);
    transform: translateY(-1px);
}

.chat-session-list-card.is-active {
    border-color: rgba(96, 165, 250, 0.4);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 34%),
        rgba(15, 23, 42, 0.78);
    box-shadow: inset 0 0 0 1px rgba(96, 165, 250, 0.12);
}

.chat-session-list-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.chat-session-list-card-title {
    color: #f8fbff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    word-break: break-word;
}

.chat-session-list-card-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.chat-session-list-card-badge.active {
    background: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}

.chat-session-list-card-badge.archived {
    background: rgba(51, 65, 85, 0.36);
    color: rgba(226, 232, 240, 0.72);
}

.chat-session-list-card-meta {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: rgba(191, 219, 254, 0.72);
    font-size: 11px;
}

.chat-session-list-card-subtitle {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.72);
    font-size: 12px;
    line-height: 1.5;
}

.chat-session-list-empty {
    margin: auto 0;
    padding: 18px 14px;
    border-radius: 16px;
    border: 1px dashed rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.4);
    color: rgba(226, 232, 240, 0.78);
    text-align: center;
    line-height: 1.6;
}

.chat-session-list-empty strong {
    display: block;
    color: #f8fbff;
    font-size: 14px;
    margin-bottom: 4px;
}

.chat-session-backdrop {
    display: none;
}

.chat-main-panel {
    flex: 1;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-session-toggle-btn {
    display: none;
}

.chat-header {
    min-height: 62px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-tertiary);
    flex-shrink: 0;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    padding-top: 0;
}

.chat-header-avatar {
    position: relative;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    overflow: hidden;
}

.chat-header-avatar::before {
    content: '';
    position: absolute;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
}

.chat-header-avatar::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0);
    box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
    pointer-events: none;
}

.chat-header-avatar.is-thinking::after {
    animation: robotThinkingPulse 2.2s ease-in-out infinite;
}

.chat-header-avatar.is-thinking .avatar-art-header {
    animation: robotThinkingFloat 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    transform-origin: 50% 60%;
}

.chat-header-avatar.is-planning::after {
    animation: robotPlanningPulse 1.9s ease-in-out infinite;
}

.chat-header-avatar.is-planning::before {
    content: '✓';
    top: 7px;
    right: 8px;
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.95), rgba(13, 148, 136, 0.92));
    color: rgba(6, 18, 22, 0.95);
    font-size: 10px;
    font-weight: 900;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
    opacity: 1;
    animation: robotPlanningBadge 1.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
}

.chat-header-avatar.is-planning .avatar-art-header {
    animation: robotPlanningTilt 1.9s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
    transform-origin: 50% 62%;
}

.chat-header-avatar.is-tooling::after {
    animation: robotToolPulse 1.2s ease-in-out infinite;
}

.chat-header-avatar.is-tooling::before {
    content: '✦';
    top: 7px;
    right: 8px;
    font-size: 12px;
    color: rgba(253, 224, 71, 0.98);
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.55);
    opacity: 0.95;
    animation: robotToolSpark 1.2s ease-in-out infinite;
}

.chat-header-avatar.is-tooling .avatar-art-header {
    animation: robotToolBounce 1.2s ease-in-out infinite;
    transform-origin: 50% 58%;
}

@keyframes robotThinkingFloat {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    18% {
        transform: translateY(-1px) rotate(-6deg) scale(1.02);
    }
    34% {
        transform: translateY(-2px) rotate(-2deg) scale(1.045);
    }
    56% {
        transform: translateY(0) rotate(5deg) scale(1.015);
    }
    74% {
        transform: translateY(-1px) rotate(2deg) scale(1.03);
    }
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

@keyframes robotThinkingPulse {
    0% {
        border-color: rgba(125, 211, 252, 0.16);
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.12);
        opacity: 0.75;
    }
    50% {
        border-color: rgba(196, 181, 253, 0.5);
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0.08);
        opacity: 1;
    }
    100% {
        border-color: rgba(125, 211, 252, 0.18);
        box-shadow: 0 0 0 0 rgba(96, 165, 250, 0);
        opacity: 0.72;
    }
}

@keyframes robotPlanningTilt {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
    20% {
        transform: translateY(-2px) rotate(-5deg) scale(1.03);
    }
    38% {
        transform: translateY(0) rotate(3deg) scale(1.055);
    }
    58% {
        transform: translateY(-1px) rotate(-2deg) scale(1.035);
    }
    78% {
        transform: translateY(0) rotate(4deg) scale(1.025);
    }
    100% {
        transform: translateY(0) rotate(0deg) scale(1);
    }
}

@keyframes robotPlanningPulse {
    0% {
        border-color: rgba(125, 211, 252, 0.15);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.06);
    }
    50% {
        border-color: rgba(52, 211, 153, 0.44);
        box-shadow: 0 0 0 9px rgba(16, 185, 129, 0.09);
    }
    100% {
        border-color: rgba(125, 211, 252, 0.16);
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@keyframes robotPlanningBadge {
    0% {
        transform: scale(0.92) translateY(1px);
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.22);
    }
    45% {
        transform: scale(1.08) translateY(-1px);
        box-shadow: 0 0 16px rgba(16, 185, 129, 0.38);
    }
    100% {
        transform: scale(0.95) translateY(0);
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.22);
    }
}

@keyframes robotToolBounce {
    0% {
        transform: translateY(0) scale(1);
    }
    20% {
        transform: translateY(-2px) scale(1.03);
    }
    40% {
        transform: translateY(0) scale(1.01);
    }
    60% {
        transform: translateY(-1px) scale(1.04);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes robotToolSpark {
    0% {
        transform: scale(0.78) rotate(-8deg);
        opacity: 0.72;
    }
    50% {
        transform: scale(1.06) rotate(8deg);
        opacity: 1;
    }
    100% {
        transform: scale(0.82) rotate(-6deg);
        opacity: 0.76;
    }
}

@keyframes robotToolPulse {
    0% {
        border-color: rgba(251, 191, 36, 0.18);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.1);
    }
    50% {
        border-color: rgba(251, 191, 36, 0.42);
        box-shadow: 0 0 0 10px rgba(249, 115, 22, 0.08);
    }
    100% {
        border-color: rgba(251, 191, 36, 0.18);
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

.chat-header-info h2 {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.1;
    min-width: 0;
}

.chat-status-line {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.44);
    color: rgba(226, 232, 240, 0.88);
    font-size: 11px;
    line-height: 1.25;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.chat-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    flex-shrink: 0;
    background: currentColor;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.03);
}

.chat-status-text {
    min-width: 0;
    font-weight: 600;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-status-line[data-state="connecting"],
.chat-status-line[data-state="loading_history"],
.chat-status-line[data-state="starting_sandbox"],
.chat-status-line[data-state="reconnecting"] {
    border-color: rgba(96, 165, 250, 0.18);
    background: rgba(15, 23, 42, 0.54);
}

.chat-status-line[data-state="connecting"] {
    color: #bfdbfe;
}

.chat-status-line[data-state="loading_history"] {
    color: #93c5fd;
}

.chat-status-line[data-state="busy"] {
    color: #fcd34d;
    border-color: rgba(251, 191, 36, 0.2);
    background: rgba(56, 32, 7, 0.34);
}

.chat-status-line[data-state="starting_sandbox"] {
    color: #fcd34d;
}

.chat-status-line[data-state="reconnecting"] {
    color: #fbbf24;
}

.chat-status-line[data-state="idle"] {
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.16);
    background: rgba(6, 31, 26, 0.4);
}

.chat-status-line[data-state="restoring"] {
    color: #86efac;
    border-color: rgba(52, 211, 153, 0.18);
    background: rgba(6, 31, 26, 0.42);
}

.chat-status-line[data-state="connected"] {
    color: #86efac;
    border-color: rgba(16, 185, 129, 0.16);
    background: rgba(6, 31, 26, 0.4);
}

.chat-status-line[data-state="disconnected"] {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.16);
    background: rgba(39, 10, 10, 0.42);
}

.chat-status-line[data-state="connecting"] .chat-status-indicator,
.chat-status-line[data-state="loading_history"] .chat-status-indicator,
.chat-status-line[data-state="starting_sandbox"] .chat-status-indicator,
.chat-status-line[data-state="reconnecting"] .chat-status-indicator {
    width: 10px;
    height: 10px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    background: transparent;
    box-shadow: none;
    animation: chatStatusSpin 0.9s linear infinite;
}

.chat-status-line[data-state="restoring"] .chat-status-indicator,
.chat-status-line[data-state="busy"] .chat-status-indicator,
.chat-status-line[data-state="idle"] .chat-status-indicator,
.chat-status-line[data-state="connected"] .chat-status-indicator {
    background: currentColor;
    box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.03), 0 0 18px rgba(16, 185, 129, 0.18);
}

.chat-status-line[data-state="disconnected"] .chat-status-indicator {
    background: currentColor;
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.08);
}

@keyframes chatStatusSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.chat-header-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.workspace-link-btn {
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.35);
    background: linear-gradient(135deg, rgba(8, 47, 73, 0.82), rgba(15, 23, 42, 0.88));
    color: #e0f2fe;
    padding: 0 10px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.workspace-link-btn:hover {
    border-color: rgba(56, 189, 248, 0.6);
    transform: translateY(-1px);
    color: #f0f9ff;
}

.desktop-link-btn {
    border-color: rgba(250, 204, 21, 0.38);
    background: linear-gradient(135deg, rgba(69, 26, 3, 0.86), rgba(23, 23, 23, 0.9));
    color: #fef3c7;
}

.desktop-link-btn:hover {
    border-color: rgba(250, 204, 21, 0.68);
    color: #fffbeb;
}

.desktop-link-btn.inactive {
    border-color: rgba(148, 163, 184, 0.3);
    color: rgba(226, 232, 240, 0.72);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.8));
}

.desktop-link-btn.inactive:hover {
    border-color: rgba(148, 163, 184, 0.45);
    color: rgba(248, 250, 252, 0.88);
}

.workspace-link-btn[hidden] {
    display: none !important;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: var(--border-active);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 3px;
}

.message {
    display: flex;
    gap: 8px;
    max-width: 90%;
    animation: messageIn 0.3s ease;
}

@keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    overflow: hidden;
}

.message.bot .message-avatar {
    background: rgba(9, 11, 16, 0.88);
}

.message.user .message-avatar {
    background: rgba(9, 11, 16, 0.88);
}

.message-content {
    background: rgba(17, 24, 39, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 14px;
    padding: 10px 12px;
    line-height: 1.5;
    font-size: 13px;
    word-break: break-word;
    box-shadow: none;
}

.message.user .message-content {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.92), rgba(168, 85, 247, 0.88));
    border: 1px solid rgba(216, 180, 254, 0.12);
    color: white;
    padding-bottom: 8px;
}

.message.bot:not(.agent-activity) .message-content {
    background: rgba(15, 15, 23, 0.78);
    border-color: rgba(255, 255, 255, 0.06);
}

.message-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-body > * {
    margin: 0;
}

.message-body p,
.message-body ul,
.message-body ol,
.message-body pre,
.message-body blockquote,
.message-body h1,
.message-body h2,
.message-body h3,
.message-body h4 {
    margin: 0;
}

.message-body ul,
.message-body ol {
    padding-left: 18px;
}

.message-body li + li {
    margin-top: 6px;
}

.message-body blockquote {
    padding: 8px 12px;
    border-left: 3px solid rgba(34, 211, 238, 0.5);
    border-radius: 0 12px 12px 0;
    background: rgba(34, 211, 238, 0.06);
    color: var(--text-secondary);
}

.message-body pre {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(3, 7, 18, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: #dbeafe;
    overflow: auto;
}

.message-body code {
    font-family: var(--font-mono);
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.06);
}

.message-body pre code {
    padding: 0;
    background: transparent;
}

.message-rich-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.conversation-summary {
    margin-top: 2px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.42);
    overflow: hidden;
}

.conversation-summary-title {
    list-style: none;
    cursor: pointer;
    padding: 6px 8px;
    color: #9fb4d6;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.conversation-summary-title::-webkit-details-marker {
    display: none;
}

.conversation-summary-body {
    display: grid;
    gap: 6px;
    padding: 0 8px 8px;
}

.conversation-summary-item {
    display: grid;
    gap: 1px;
    font-size: 11px;
    color: #d8e6ff;
    line-height: 1.45;
}

.turn-usage-card {
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid rgba(56, 189, 248, 0.18);
    background: linear-gradient(180deg, rgba(8, 20, 35, 0.74), rgba(8, 15, 26, 0.58));
    overflow: hidden;
}

.turn-usage-summary {
    list-style: none;
    cursor: pointer;
    padding: 7px 9px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.turn-usage-summary::-webkit-details-marker {
    display: none;
}

.turn-usage-title {
    color: #7dd3fc;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.turn-usage-summary-main {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    color: #dbeafe;
    font-size: 11px;
}

.turn-usage-total {
    color: #f8fafc;
    font-weight: 700;
}

.turn-usage-billing {
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.22);
    padding: 1px 7px;
    color: #7dd3fc;
    font-size: 10px;
    text-transform: uppercase;
}

.turn-usage-summary-bits {
    color: #93c5fd;
}

.turn-usage-body {
    display: grid;
    gap: 8px;
    padding: 0 9px 9px;
}

.turn-usage-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: 6px;
}

.turn-usage-metric {
    display: grid;
    gap: 2px;
    padding: 7px 8px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.46);
}

.turn-usage-metric span {
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.turn-usage-metric strong {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 700;
}

.turn-usage-row {
    display: grid;
    gap: 5px;
}

.turn-usage-label {
    color: #94a3b8;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.turn-usage-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.turn-usage-tags span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid rgba(59, 130, 246, 0.18);
    background: rgba(15, 23, 42, 0.54);
    color: #dbeafe;
    font-size: 11px;
}

.message-attachment-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.message-attachment-preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-width: 0;
}

.message-attachment-preview-image {
    flex-direction: column;
    align-items: flex-start;
    width: 118px;
    text-decoration: none;
    color: inherit;
}

.message-attachment-preview-image img {
    display: block;
    width: 118px;
    height: 78px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(15, 23, 42, 0.5);
}

.message-attachment-preview-image span {
    font-size: 10px;
    line-height: 1.2;
    color: rgba(255, 255, 255, 0.82);
    max-width: 118px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-attachment-preview-file {
    padding: 6px 8px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(15, 23, 42, 0.34);
}

.message-attachment-preview-file-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    font-weight: 700;
}

.message-attachment-preview-file-body {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.message-attachment-preview-file-title {
    color: rgba(255, 255, 255, 0.92);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.message-attachment-preview-file-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-summary-item > span {
    color: #8ca3c7;
    font-size: 10px;
    font-weight: 600;
}

.message-block {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.message-block + .message-block {
    padding-top: 1px;
}

.job-notification-card {
    padding: 12px;
    border-radius: 14px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 32%),
        linear-gradient(180deg, rgba(8, 47, 73, 0.52), rgba(15, 23, 42, 0.78));
    gap: 10px;
}

.job-notification-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.job-notification-title {
    color: #f8fbff;
    font-size: 14px;
    font-weight: 700;
}

.job-notification-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.job-notification-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(125, 211, 252, 0.18);
    background: rgba(14, 116, 144, 0.22);
    color: #d7f5ff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.job-notification-badge.kind {
    border-color: rgba(191, 219, 254, 0.18);
    background: rgba(30, 41, 59, 0.46);
    color: #dbeafe;
}

.job-notification-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.job-notification-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 9px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.52);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.job-notification-grid span {
    color: #9cc8de;
    font-size: 10px;
    font-weight: 600;
}

.job-notification-grid strong {
    color: #f8fbff;
    font-size: 12px;
    font-weight: 600;
    word-break: break-word;
}

.job-notification-summary {
    color: #e6f4ff;
    font-size: 12px;
    line-height: 1.6;
}

.job-notification-actions {
    display: flex;
    justify-content: flex-end;
}

.job-notification-actions a {
    color: #7dd3fc;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.job-notification-actions a:hover {
    color: #d7f5ff;
}

.artifact-image-link {
    display: block;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.44);
}

.artifact-image {
    display: block;
    width: 100%;
    max-height: 300px;
    object-fit: cover;
}

.artifact-meta-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.artifact-kind {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    border: 1px solid rgba(34, 211, 238, 0.18);
    color: #b8f5ff;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.artifact-name {
    color: #eef4ff;
    font-size: 12px;
    font-weight: 600;
}

.artifact-card {
    padding: 10px 11px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background:
        radial-gradient(circle at top right, rgba(96, 165, 250, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(17, 24, 39, 0.72), rgba(15, 23, 42, 0.58));
}

.artifact-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.artifact-card-title {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.artifact-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: #9fb0c8;
    font-size: 10px;
}

.artifact-video-player {
    width: 100%;
    max-height: 300px;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.88);
}

.artifact-audio-player {
    width: 100%;
    margin: 0;
}

.artifact-file-summary {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    color: #9fb0c8;
    font-size: 11px;
}

.artifact-source,
.artifact-mime {
    display: inline-flex;
    align-items: center;
    padding: 3px 7px;
    border-radius: 999px;
    background: rgba(51, 65, 85, 0.26);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

.artifact-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.artifact-actions a {
    color: #c5d8ff;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
}

.artifact-actions a:hover {
    color: #f8fbff;
}

.message-content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 8px 0;
}

.message-content video {
    max-width: 100%;
    border-radius: var(--radius-sm);
}

.message-content audio {
    width: 100%;
    margin: 8px 0;
}

/* 媒体播放器容器 */
.message-content .media-player-container {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-content .media-player-item {
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.05);
}

.message-content img.chat-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    margin: 6px 0;
}

.message-content video.chat-video {
    max-width: 100%;
    border-radius: 10px;
    display: block;
}

.message-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
}

.message.user[data-delivery-state="queued"] .message-content {
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.82), rgba(126, 34, 206, 0.72));
    border-color: rgba(221, 214, 254, 0.22);
}

.message.user[data-delivery-state="sending"] .message-content {
    background: linear-gradient(135deg, rgba(67, 56, 202, 0.9), rgba(124, 58, 237, 0.82));
}

.message.user[data-delivery-state="queued"] .message-time,
.message.user[data-delivery-state="sending"] .message-time,
.message.user[data-delivery-state="sent"] .message-time {
    color: rgba(255, 255, 255, 0.92);
}

.message.user[data-delivery-state="failed"] .message-time {
    color: #fecaca;
}

.message.user .message-time {
    color: rgba(255, 255, 255, 0.82);
}

/* 任务卡片样式 */
.message.agent-activity {
    max-width: min(920px, calc(100% - 12px));
}

.agent-activity .activity-avatar {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(99, 102, 241, 0.16));
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 16px 34px rgba(0, 0, 0, 0.22);
}

.avatar-art {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.avatar-art-message {
    width: 100%;
    height: 100%;
}

.avatar-art-header {
    width: 100%;
    height: 100%;
}

.activity-avatar .avatar-art-activity {
    width: 100%;
    height: 100%;
}

.activity-card {
    position: relative;
    overflow: hidden;
    padding: 16px 16px 14px;
    background:
        radial-gradient(circle at top right, rgba(56, 189, 248, 0.08), transparent 34%),
        linear-gradient(165deg, rgba(17, 22, 34, 0.98), rgba(10, 14, 22, 0.95));
    border: 1px solid rgba(148, 163, 184, 0.14);
    width: min(760px, 100%);
    backdrop-filter: blur(16px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
}

.activity-card::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 28%);
}

.activity-card.tool {
    border-color: rgba(96, 165, 250, 0.2);
    background:
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 30%),
        linear-gradient(180deg, rgba(19, 25, 38, 0.96), rgba(14, 18, 28, 0.96));
    box-shadow: 0 12px 26px rgba(3, 8, 18, 0.28);
}

.activity-card.tool .activity-collapse-summary {
    padding: 13px 15px 12px;
}

.activity-card.tool .activity-collapse-head {
    align-items: flex-start;
}

.activity-card.tool .activity-collapse-title-row {
    gap: 8px;
    align-items: flex-start;
}

.activity-card.tool .activity-title.compact {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    color: #f3f6fc;
}

.activity-card.tool .activity-status.compact {
    padding: 3px 8px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: rgba(30, 41, 59, 0.68);
    color: #dbeafe;
    box-shadow: none;
}

.activity-card.tool .activity-collapse-meta-row {
    gap: 8px;
    margin-top: 4px;
}

.activity-card.tool .activity-subtitle,
.activity-card.tool .activity-compact-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background: rgba(30, 41, 59, 0.58);
    color: #d8e9ff;
    font-size: 10px;
}

.activity-card.tool .activity-subtitle::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #7dd3fc;
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.14);
}

.activity-card.tool .activity-compact-tag {
    max-width: min(32vw, 220px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
    color: #b9c8db;
}

.activity-card.tool .activity-compact-tag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.8);
    box-sizing: border-box;
}

.activity-card.tool .activity-collapse-preview {
    margin-top: 10px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(226, 232, 240, 0.74);
    font-size: 12px;
    line-height: 1.5;
    font-family: var(--font-display);
    opacity: 1;
}

.activity-card.tool .activity-collapse-preview::before {
    content: none;
}

.activity-card.tool .activity-collapse-indicator {
    border: 1px solid rgba(96, 165, 250, 0.18);
    background: rgba(30, 41, 59, 0.55);
    color: #bfdbfe;
}

.activity-card.tool.activity-collapse[open] .activity-collapse-indicator {
    background: rgba(37, 99, 235, 0.16);
    color: #e0f2fe;
}

.activity-human-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 8px;
    margin-top: 12px;
    margin-bottom: 12px;
}

.activity-human-option {
    border: 1px solid rgba(148, 163, 184, 0.32);
    background: rgba(30, 41, 59, 0.48);
    color: #dbeafe;
    border-radius: 10px;
    padding: 9px 11px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.activity-human-option:hover:not(:disabled) {
    border-color: rgba(96, 165, 250, 0.75);
    background: rgba(30, 64, 175, 0.3);
}

.activity-human-option:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.activity-human-option.selected {
    border-color: rgba(52, 211, 153, 0.75);
    background: rgba(5, 150, 105, 0.28);
    color: #d1fae5;
}

.activity-human-feedback {
    margin-top: 8px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(30, 64, 175, 0.16);
    color: #dbeafe;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 12px;
    font-weight: 600;
}

.activity-human-feedback.success {
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(5, 150, 105, 0.2);
    color: #d1fae5;
}

.activity-human-feedback.pending {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(161, 98, 7, 0.2);
    color: #fef3c7;
}

.activity-a2ui-shell {
    position: relative;
}

.activity-a2ui-inline {
    margin-top: 2px;
}

.activity-a2ui-shell.is-pending {
    opacity: 0.78;
}

.activity-a2ui-shell.is-pending::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.18);
    pointer-events: auto;
}

.activity-a2ui-feedback {
    margin-top: 10px;
    border: 1px solid rgba(96, 165, 250, 0.28);
    background: rgba(30, 64, 175, 0.16);
    color: #dbeafe;
    border-radius: 10px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: 600;
}

.activity-a2ui-feedback.pending {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(161, 98, 7, 0.2);
    color: #fef3c7;
}

.activity-a2ui-feedback.error {
    border-color: rgba(248, 113, 113, 0.42);
    background: rgba(127, 29, 29, 0.26);
    color: #fee2e2;
}

.activity-a2ui-feedback.success {
    border-color: rgba(52, 211, 153, 0.55);
    background: rgba(5, 150, 105, 0.2);
    color: #d1fae5;
}

.activity-card-compact-prompt .activity-header {
    margin-bottom: 8px;
}

.activity-card-compact-prompt .activity-kicker {
    color: rgba(125, 211, 252, 0.78);
}

.activity-card-compact-prompt .activity-footer-line {
    margin-top: 10px;
}

.activity-card-compact-prompt .mb-a2ui-card {
    border-radius: 16px;
    padding: 12px 14px;
}

.activity-card-compact-prompt .mb-a2ui-card-title,
.activity-card-compact-prompt .mb-a2ui-card-subtitle,
.activity-card-compact-prompt .mb-a2ui-badge {
    display: none;
}

.activity-card-compact-prompt .mb-a2ui-card-body > .mb-a2ui-stack {
    --mb-a2ui-gap: 10px;
}

.activity-card-compact-prompt .mb-a2ui-text {
    color: rgba(226, 232, 240, 0.84);
}

.mb-a2ui-surface {
    display: block;
}

.mb-a2ui-card {
    border-radius: 18px;
    border: 1px solid rgba(96, 165, 250, 0.16);
    background:
        radial-gradient(circle at top right, rgba(125, 211, 252, 0.12), transparent 34%),
        linear-gradient(180deg, rgba(13, 20, 33, 0.92), rgba(9, 14, 25, 0.96));
    padding: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mb-a2ui-card-title {
    color: #f8fbff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.01em;
    margin-bottom: 4px;
}

.mb-a2ui-card-subtitle {
    color: rgba(203, 213, 225, 0.76);
    font-size: 12px;
    margin-bottom: 10px;
}

.mb-a2ui-card-body {
    display: block;
}

.mb-a2ui-stack {
    display: flex;
    gap: var(--mb-a2ui-gap, 12px);
}

.mb-a2ui-column {
    flex-direction: column;
}

.mb-a2ui-row {
    flex-direction: row;
    align-items: center;
}

.mb-a2ui-row.mb-a2ui-wrap {
    flex-wrap: wrap;
}

.mb-a2ui-text {
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.mb-a2ui-text.tone-muted {
    color: rgba(203, 213, 225, 0.72);
}

.mb-a2ui-text.tone-danger {
    color: #fecaca;
}

.mb-a2ui-badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.mb-a2ui-badge.tone-info {
    background: rgba(14, 165, 233, 0.16);
    border: 1px solid rgba(56, 189, 248, 0.28);
    color: #d8f5ff;
}

.mb-a2ui-badge.tone-success {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(52, 211, 153, 0.24);
    color: #d1fae5;
}

.mb-a2ui-badge.tone-warning {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(251, 191, 36, 0.24);
    color: #fef3c7;
}

.mb-a2ui-badge.tone-danger {
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(248, 113, 113, 0.24);
    color: #fee2e2;
}

.mb-a2ui-divider {
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.32), rgba(148, 163, 184, 0));
}

.mb-a2ui-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.mb-a2ui-field-label {
    color: rgba(226, 232, 240, 0.82);
    font-size: 12px;
    font-weight: 600;
}

.mb-a2ui-control {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(15, 23, 42, 0.68);
    color: #f8fafc;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.mb-a2ui-control::placeholder {
    color: rgba(148, 163, 184, 0.72);
}

.mb-a2ui-control:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.85);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.16);
    background: rgba(15, 23, 42, 0.88);
}

.mb-a2ui-field.is-validation-error .mb-a2ui-field-label {
    color: #fecaca;
}

.mb-a2ui-control.is-validation-error,
.mb-a2ui-field.is-validation-error .mb-a2ui-control {
    border-color: rgba(248, 113, 113, 0.9);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
    background: rgba(69, 10, 10, 0.22);
}

.mb-a2ui-control[type="password"] {
    letter-spacing: 0.08em;
}

.mb-a2ui-select {
    appearance: none;
}

.mb-a2ui-button {
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    background: rgba(30, 41, 59, 0.72);
    color: #e2e8f0;
    min-height: 42px;
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.mb-a2ui-button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.7);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.24);
}

.mb-a2ui-button:disabled {
    cursor: not-allowed;
    opacity: 0.56;
    transform: none;
    box-shadow: none;
}

.mb-a2ui-button.variant-primary {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.88), rgba(14, 165, 233, 0.82));
    border-color: rgba(125, 211, 252, 0.42);
    color: #eff6ff;
}

.mb-a2ui-button.variant-secondary {
    background: rgba(30, 41, 59, 0.76);
    color: #dbeafe;
}

.mb-a2ui-button.variant-danger {
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.88), rgba(248, 113, 113, 0.82));
    border-color: rgba(248, 113, 113, 0.34);
    color: #fff1f2;
}

.mb-a2ui-image {
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    background: rgba(15, 23, 42, 0.58);
}

.mb-a2ui-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.mb-a2ui-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mb-a2ui-list-item {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.12);
}

.activity-card.plan {
    border-color: rgba(16, 185, 129, 0.22);
}

.activity-card.thought {
    border-color: rgba(245, 158, 11, 0.12);
    background:
        radial-gradient(circle at top left, rgba(245, 158, 11, 0.035), transparent 42%),
        linear-gradient(165deg, rgba(22, 20, 17, 0.95), rgba(14, 13, 12, 0.92));
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.activity-card.thought .activity-kicker {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.12);
    color: #f7c96f;
}

.activity-card.thought .activity-status.running,
.activity-card.thought .activity-status.in_progress {
    position: relative;
    overflow: hidden;
}

.activity-card.thought .activity-status.running::after,
.activity-card.thought .activity-status.in_progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
    animation: thoughtShimmer 2.4s infinite;
}

@keyframes thoughtShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.activity-card.thought .activity-title::before {
    content: '•';
    margin-right: 8px;
    color: rgba(251, 191, 36, 0.8);
}

.activity-card.thought .activity-summary {
    padding: 10px 12px;
    border-radius: 12px;
    border-left: none;
    background: rgba(245, 158, 11, 0.07);
    color: #f4dfb3;
    font-style: normal;
}

.activity-card.thought .activity-summary::before {
    content: none;
}

.activity-card.result {
    border-color: rgba(139, 92, 246, 0.22);
}

.activity-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.activity-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.activity-kicker {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(226, 232, 240, 0.66);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.activity-collapse {
    padding: 0;
}

.activity-collapse-summary {
    list-style: none;
    display: block;
    cursor: pointer;
    padding: 13px 15px 12px;
    padding-right: 48px;
    position: relative;
}

.activity-collapse-summary::-webkit-details-marker {
    display: none;
}

.activity-collapse-summary::marker,
.activity-section-header::marker {
    content: "";
}

.activity-collapse-body {
    padding: 0 16px 14px;
}

.activity-collapse-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.activity-collapse-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-collapse-title-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
}

.activity-title.compact {
    font-size: 14px;
    line-height: 1.3;
}

.activity-collapse-title-row .activity-title.compact {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-collapse-title-row .activity-status.compact {
    flex-shrink: 0;
}

.activity-collapse-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.activity-collapse-preview {
    margin-top: 8px;
    color: rgba(226, 232, 240, 0.64);
    font-size: 11px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.activity-collapse-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    min-width: 84px;
    height: 28px;
    padding: 0 10px;
    line-height: 1;
    position: absolute;
    right: 15px;
    top: 14px;
    transform: none;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.14);
    background: rgba(15, 23, 42, 0.44);
    color: rgba(226, 232, 240, 0.78);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.activity-collapse-indicator-label {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.activity-collapse-indicator-label-open {
    display: none;
}

.activity-collapse-indicator-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 10px;
    height: 10px;
    font-size: 10px;
    line-height: 1;
    color: rgba(191, 219, 254, 0.9);
    transform: translateY(1px);
    transition: transform 0.2s ease, color 0.2s ease;
}

.activity-status.compact {
    padding: 3px 8px;
    font-size: 10px;
}

.activity-compact-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(203, 213, 225, 0.7);
    font-size: 10px;
    font-family: var(--font-mono);
}

.activity-collapse[open] .activity-collapse-indicator {
    color: #f8fafc;
    border-color: rgba(96, 165, 250, 0.2);
    background: rgba(30, 41, 59, 0.72);
}

.activity-collapse[open] .activity-collapse-indicator-label-collapsed {
    display: none;
}

.activity-collapse[open] .activity-collapse-indicator-label-open {
    display: inline-flex;
}

.activity-collapse[open] .activity-collapse-indicator-icon {
    transform: translateY(1px) rotate(180deg);
    color: #dbeafe;
}

.activity-collapse[open] .activity-collapse-body {
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-collapse:not([open]) .activity-summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.activity-collapse:not([open]) .activity-locations {
    margin-bottom: 0;
}

.activity-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.activity-header-main {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.activity-header-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-header .activity-kicker {
    flex-shrink: 0;
    margin-top: 1px;
}

.activity-header .activity-title {
    flex: 1;
    min-width: 0;
}

.activity-header-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.activity-header .activity-subtitle {
    flex-shrink: 0;
}

.activity-header .activity-topbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    padding-top: 1px;
}

.activity-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.activity-title {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #f8fafc;
    line-height: 1.35;
}

.activity-subtitle {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.14);
    font-size: 10px;
    color: #bfdbfe;
}

.activity-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-family: var(--font-mono);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.activity-status.pending,
.activity-status.started {
    background: rgba(245, 158, 11, 0.14);
    color: #fbbf24;
}

.activity-status.running {
    background: rgba(34, 211, 238, 0.14);
    color: var(--accent-cyan);
}

.activity-status.in_progress {
    background: rgba(34, 211, 238, 0.14);
    color: var(--accent-cyan);
}

.activity-status.completed {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
}

.activity-status.failed {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

.activity-status.waiting {
    background: rgba(139, 92, 246, 0.14);
    color: var(--accent-secondary);
}

.activity-summary {
    font-size: 12px;
    line-height: 1.7;
    color: rgba(241, 245, 249, 0.86);
    max-width: 68ch;
    margin-bottom: 10px;
}

.activity-locations {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.activity-location {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    font-family: var(--font-mono);
    color: #7dd3fc;
    background: rgba(34, 211, 238, 0.07);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 999px;
    padding: 4px 8px;
    max-width: 100%;
}

.activity-location-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

.activity-section {
    margin-top: 10px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.045);
    background: rgba(255, 255, 255, 0.025);
    overflow: hidden;
}

.activity-section[open] {
    background: rgba(255, 255, 255, 0.032);
    border-color: rgba(255, 255, 255, 0.06);
}

.activity-section-header {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 11px;
    cursor: pointer;
}

.activity-section-header::-webkit-details-marker {
    display: none;
}

.activity-section-title,
.activity-section-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.activity-section-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    font-size: 12px;
}

.activity-section-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.activity-section-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 62px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: rgba(15, 23, 42, 0.34);
    color: rgba(226, 232, 240, 0.72);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    transition: transform 0.2s ease, color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.activity-section-chevron-label {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    line-height: 1;
}

.activity-section-chevron-label-open {
    display: none;
}

.activity-section-chevron-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 9px;
    height: 9px;
    font-size: 9px;
    line-height: 1;
    color: rgba(191, 219, 254, 0.82);
    transform: translateY(1px);
    transition: transform 0.2s ease, color 0.2s ease;
}

.activity-section[open] .activity-section-chevron {
    border-color: rgba(96, 165, 250, 0.16);
    background: rgba(30, 41, 59, 0.5);
    color: #f8fafc;
}

.activity-section[open] .activity-section-chevron-label-collapsed {
    display: none;
}

.activity-section[open] .activity-section-chevron-label-open {
    display: inline-flex;
}

.activity-section[open] .activity-section-chevron-icon {
    transform: translateY(1px) rotate(180deg);
    color: #dbeafe;
}

.activity-section-body {
    padding: 0 11px 11px;
}

.activity-lines,
.activity-plan-list,
.activity-diffs,
.activity-substeps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.activity-plan-tool-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-substeps {
    position: relative;
}

.activity-substeps.depth-1,
.activity-substeps.depth-2,
.activity-substeps.depth-3 {
    margin-top: 10px;
    padding-left: 14px;
    border-left: 1px solid rgba(139, 92, 246, 0.18);
}

.activity-substep-card {
    padding: 11px 11px 10px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(21, 24, 39, 0.78), rgba(11, 14, 24, 0.72));
    border: 1px solid rgba(139, 92, 246, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.activity-substep-card.completed {
    border-color: rgba(16, 185, 129, 0.18);
}

.activity-substep-card.failed {
    border-color: rgba(239, 68, 68, 0.22);
}

.activity-substep-card.waiting {
    border-color: rgba(249, 115, 22, 0.24);
}

.activity-substep-topbar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.activity-substep-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    border-radius: 999px;
    background: rgba(139, 92, 246, 0.14);
    color: var(--accent-tertiary);
    font-size: 10px;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.activity-substep-main {
    min-width: 0;
    flex: 1;
}

.activity-substep-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.activity-substep-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-substep-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
    color: var(--text-muted);
    font-size: 10px;
    font-family: var(--font-mono);
}

.activity-substep-summary {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(226, 232, 240, 0.72);
    font-size: 11px;
    line-height: 1.6;
}

.activity-substep-command {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(34, 211, 238, 0.06);
    border: 1px solid rgba(34, 211, 238, 0.1);
}

.activity-substep-command-label {
    flex-shrink: 0;
    color: var(--accent-cyan);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.activity-substep-command code {
    color: #dbeafe;
    font-size: 11px;
    line-height: 1.6;
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
}

.activity-substep-payload {
    margin-top: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

.activity-substep-payload.input {
    border-color: rgba(34, 211, 238, 0.12);
}

.activity-substep-payload.output {
    border-color: rgba(16, 185, 129, 0.12);
}

.activity-substep-payload-label {
    display: block;
    width: 100%;
    padding: 8px 10px;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.activity-substep-payload-preview {
    padding: 0 10px 8px;
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.6;
}

.activity-substep-payload-body {
    margin: 0;
    padding: 0 10px 10px;
    color: #dbeafe;
    font-size: 10px;
    line-height: 1.65;
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
}

.activity-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
}

.activity-line-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    border-radius: 999px;
    background: rgba(34, 211, 238, 0.12);
    color: var(--accent-cyan);
    font-size: 10px;
    font-family: var(--font-mono);
    flex-shrink: 0;
}

.activity-line-text {
    flex: 1;
    font-size: 11px;
    line-height: 1.55;
    color: rgba(226, 232, 240, 0.74);
}

.activity-plan-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 11px;
    color: rgba(226, 232, 240, 0.72);
    padding: 4px 2px;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.activity-plan-thought {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.08), rgba(15, 23, 42, 0.38));
    border: 1px solid rgba(34, 211, 238, 0.14);
}

.activity-plan-thought-summary {
    font-size: 11px;
    line-height: 1.65;
    color: rgba(226, 232, 240, 0.8);
}

.activity-plan-thought-lines {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.activity-plan-thought-line {
    font-size: 10px;
    line-height: 1.6;
    color: rgba(186, 230, 253, 0.74);
}

.activity-plan-tool-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.activity-plan-tool-copy {
    min-width: 0;
    flex: 1;
}

.activity-plan-tool-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.activity-plan-tool-title {
    min-width: 0;
    flex: 1;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-primary);
}

.activity-plan-tool-status {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
}

.activity-plan-tool-status.running,
.activity-plan-tool-status.in_progress {
    color: var(--accent-cyan);
}

.activity-plan-tool-status.completed {
    color: var(--accent-green);
}

.activity-plan-tool-status.failed {
    color: #fca5a5;
}

.activity-plan-tool-status.waiting {
    color: #fdba74;
}

.activity-plan-tool-meta {
    margin-top: 4px;
    font-size: 10px;
    font-family: var(--font-mono);
    color: var(--text-muted);
}

.activity-plan-tool-summary {
    margin-top: 6px;
    font-size: 11px;
    line-height: 1.6;
    color: rgba(226, 232, 240, 0.74);
}

.plan-item-status {
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
}

.plan-item-status.in_progress {
    color: var(--accent-cyan);
}

.plan-item-status.completed {
    color: var(--accent-green);
}

.plan-item-status.failed {
    color: #fca5a5;
}

.plan-item-status.waiting {
    color: #fdba74;
}

.plan-item-text {
    flex: 1;
    line-height: 1.55;
}

.activity-terminal {
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(3, 7, 18, 0.92);
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: #dbeafe;
    font-size: 10px;
    line-height: 1.6;
    font-family: var(--font-mono);
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 220px;
    overflow: auto;
}

.activity-terminal-preview-text {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(34, 211, 238, 0.05);
    color: rgba(226, 232, 240, 0.68);
    font-size: 11px;
    line-height: 1.6;
}

.activity-terminal.full {
    max-height: 320px;
}

.activity-diff {
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.activity-diff-path {
    font-size: 11px;
    font-family: var(--font-mono);
    color: #bfdbfe;
    margin-bottom: 4px;
}

.activity-diff-meta {
    font-size: 10px;
    color: var(--text-secondary);
}

.activity-link-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.activity-link-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(96, 165, 250, 0.12);
    background: rgba(15, 23, 42, 0.28);
}

.activity-link-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.activity-link-label {
    font-size: 12px;
    font-weight: 700;
    color: #dbeafe;
}

.activity-link-url {
    font-size: 12px;
    color: #93c5fd;
    font-family: var(--font-mono);
    word-break: break-all;
}

.activity-link-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.activity-link-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(30, 41, 59, 0.38);
    color: #eff6ff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.activity-link-actions a:hover {
    border-color: rgba(96, 165, 250, 0.36);
    background: rgba(30, 64, 175, 0.24);
}

.activity-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 14px;
}

.activity-footer .message-time {
    font-size: 10px;
    color: rgba(148, 163, 184, 0.52);
}

.activity-card.thought .activity-footer-line {
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.3), transparent);
}

.activity-card.plan .activity-footer-line {
    display: none;
}

.agent-activity.thought .activity-avatar {
    animation: avatarPulse 2.6s ease-in-out infinite;
}

@keyframes avatarPulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% { 
        transform: scale(1.05);
        box-shadow: 0 0 20px 5px rgba(245, 158, 11, 0.2);
    }
}

.activity-footer-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.16), transparent);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    width: fit-content;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.thinking-dots {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
}

.thinking-dots span {
    width: 6px;
    height: 6px;
    background: #fbbf24;
    border-radius: 50%;
    animation: thinkingPulse 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes thinkingPulse {
    0%, 100% { 
        opacity: 0.3;
        transform: scale(0.8);
    }
    50% { 
        opacity: 1;
        transform: scale(1.2);
    }
}

.task-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 200;
    max-height: 50vh;
    display: flex;
    flex-direction: column;
}

.task-panel.active {
    transform: translateY(0);
}

.task-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.task-panel-header h3 {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-progress-bar {
    width: 200px;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.task-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.task-logs {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.8;
}

.task-log {
    color: var(--text-secondary);
    padding: 4px 0;
}

.task-log.success { color: var(--accent-green); }
.task-log.error { color: var(--accent-red); }
.task-log.info { color: var(--accent-cyan); }

.chat-input-area {
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 6px;
    transition: all 0.2s ease;
}

.chat-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.chat-input-wrapper.is-dragover {
    border-color: rgba(96, 165, 250, 0.75);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12), 0 0 22px rgba(14, 165, 233, 0.18);
    background: linear-gradient(180deg, rgba(8, 47, 73, 0.95), rgba(15, 23, 42, 0.98));
}

.chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    padding: 6px 10px;
    resize: none;
    min-height: 20px;
    max-height: 120px;
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-attach-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.16), rgba(15, 23, 42, 0.82));
    color: var(--accent-cyan);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    transition: all 0.2s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.chat-attach-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.45);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}

.chat-attach-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.chat-attachment-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-attachment-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 2px 4px 0;
}

.chat-attachment-panel-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
}

.chat-attachment-panel-title span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    color: var(--accent-cyan);
    font-size: 11px;
}

.chat-attachment-panel-clear {
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.55);
    color: var(--text-secondary);
    border-radius: 999px;
    height: 28px;
    padding: 0 12px;
    cursor: pointer;
    font-family: var(--font-display);
    font-size: 12px;
    transition: all 0.2s ease;
}

.chat-attachment-panel-clear:hover {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.4);
    background: rgba(30, 41, 59, 0.82);
}

.chat-attachment-panel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chat-drop-hint {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px dashed rgba(96, 165, 250, 0.5);
    background: rgba(8, 47, 73, 0.5);
    color: var(--accent-cyan);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.chat-attachment-chip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-width: min(100%, 320px);
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.92));
    box-shadow: 0 10px 24px rgba(2, 6, 23, 0.22);
}

.chat-attachment-chip.is-image {
    border-color: rgba(96, 165, 250, 0.22);
}

.chat-attachment-chip.is-file {
    border-color: rgba(34, 197, 94, 0.18);
}

.chat-attachment-chip-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    overflow: hidden;
}

.chat-attachment-chip.is-image .chat-attachment-chip-icon {
    color: var(--accent-cyan);
    background: rgba(14, 165, 233, 0.12);
}

.chat-attachment-chip-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-attachment-chip.is-file .chat-attachment-chip-icon {
    color: var(--accent-green);
    background: rgba(34, 197, 94, 0.12);
}

.chat-attachment-chip-body {
    min-width: 0;
    flex: 1;
}

.chat-attachment-chip-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 4px;
    word-break: break-word;
}

.chat-attachment-chip-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.chat-attachment-chip-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}

.chat-attachment-chip-actions button {
    min-width: 68px;
    height: 30px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.chat-attachment-chip-actions button:hover {
    color: var(--text-primary);
    border-color: rgba(148, 163, 184, 0.36);
    background: rgba(30, 41, 59, 0.86);
}

.chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.chat-stop-btn {
    height: 40px;
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 12px;
    padding: 0 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chat-stop-btn:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: rgba(255, 99, 132, 0.6);
    background: rgba(127, 29, 29, 0.25);
}

.chat-stop-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.chat-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.memory-container {
    max-width: 900px;
    margin: 0 auto;
}

.memory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.memory-header h2 {
    font-size: 24px;
    font-weight: 600;
}

.memory-add-form {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.memory-add-form input {
    flex: 1;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.memory-add-form input:focus {
    border-color: var(--accent-primary);
}

.memory-add-form button {
    padding: 14px 24px;
    border-radius: var(--radius-md);
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-family: var(--font-display);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.memory-add-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.memory-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    position: relative;
}

.memory-card-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
}

.memory-card-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.memory-delete-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    background: transparent;
    color: var(--accent-red);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.memory-delete-btn:hover {
    background: rgba(239, 68, 68, 0.15);
}

.memory-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.memory-empty svg {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.back-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-secondary);
    font-family: var(--font-display);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.back-btn.active {
    display: flex;
}

.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-soft);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-glass);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--font-display);
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
}

.checkbox-label input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle);
}

@media (max-width: 1024px) {
    .chat-page .nav {
        display: none;
    }

    .chat-page .main {
        padding: 8px;
    }

    .chat-page .chat-container {
        height: calc(100dvh - 16px);
        border-radius: 14px;
    }

    .chat-shell {
        display: flex;
    }

    .chat-session-toggle-btn {
        display: inline-flex;
    }

    .chat-session-sidebar {
        position: absolute;
        inset: 0 auto 0 0;
        z-index: 20;
        width: min(320px, calc(100vw - 36px));
        border-right: 1px solid rgba(148, 163, 184, 0.2);
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
    }

    .chat-container.sessions-open .chat-session-sidebar {
        transform: translateX(0);
    }

    .chat-session-backdrop {
        position: absolute;
        inset: 0;
        z-index: 18;
        display: block;
        background: rgba(2, 6, 23, 0.48);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .chat-container.sessions-open .chat-session-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .chat-header {
        min-height: 60px;
        padding: 10px 14px;
    }

    .chat-messages {
        padding: 12px 14px;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .workspace-link-btn {
        display: none;
    }

    .nav {
        padding: 12px 16px;
    }

    .nav-tabs {
        display: none;
    }

    .main {
        padding: 16px;
    }

    .chat-header {
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
    }

    .chat-header-left {
        gap: 10px;
    }

    .chat-header-info {
        gap: 3px;
    }

    .chat-status-line {
        padding: 4px 9px;
        font-size: 10px;
        max-width: calc(100vw - 132px);
    }

    .chat-header-actions {
        gap: 6px;
    }

    .chat-session-sidebar {
        width: min(320px, calc(100vw - 24px));
    }

    .chat-session-sidebar-header {
        padding: 16px 14px 12px;
    }

    .chat-session-list {
        padding: 10px;
    }

    .chat-input-area {
        padding: 8px 12px 10px;
        gap: 6px;
    }

    .chat-input-wrapper {
        gap: 8px;
        padding: 5px;
        align-items: flex-end;
    }

    .message {
        max-width: 94%;
    }

    .message-content {
        padding: 9px 11px;
        font-size: 12px;
    }

    .message-avatar {
        width: 26px;
        height: 26px;
        border-radius: 7px;
    }

    .artifact-card {
        padding: 9px 10px;
        border-radius: 11px;
    }

    .chat-attach-btn {
        width: 36px;
        height: 36px;
    }

    .chat-stop-btn {
        height: 36px;
        padding: 0 10px;
    }

    .chat-send-btn {
        width: 36px;
        height: 36px;
    }

    .chat-attachment-chip {
        min-width: 100%;
        padding: 11px 12px;
    }

    .chat-attachment-panel-header {
        padding: 0 2px 0;
    }

    .chat-attachment-panel-title {
        font-size: 12px;
    }

    .chat-drop-hint {
        padding: 9px 12px;
    }

    .chat-attachment-chip-actions {
        flex-direction: row;
        gap: 6px;
    }

    .robot-grid {
        grid-template-columns: 1fr;
    }

    .message.agent-activity {
        max-width: 100%;
    }

    .activity-card {
        width: 100%;
        padding: 14px;
    }

    .activity-topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .activity-header {
        flex-direction: column;
        gap: 8px;
    }

    .activity-header-main {
        width: 100%;
        gap: 8px;
    }

    .activity-header-copy {
        gap: 5px;
    }

    .activity-header-meta {
        gap: 6px;
    }

    .activity-title {
        font-size: 15px;
    }

    .activity-summary {
        font-size: 12px;
        line-height: 1.62;
    }

    .activity-collapse-head {
        flex-direction: column;
        align-items: stretch;
    }

    .activity-collapse-summary,
    .activity-collapse-body {
        padding-left: 14px;
        padding-right: 14px;
    }

    .activity-collapse-title-row {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 6px;
    }

    .activity-collapse-main {
        gap: 5px;
    }

    .activity-title.compact {
        font-size: 13px;
    }

    .activity-collapse-preview {
        -webkit-line-clamp: 2;
        font-size: 11px;
    }

    .activity-collapse-indicator {
        top: 12px;
        right: 12px;
        min-width: 72px;
        height: 24px;
        padding: 0 8px;
        gap: 4px;
    }

    .activity-collapse-indicator-label {
        font-size: 10px;
    }

    .activity-card.tool .activity-compact-tag {
        max-width: min(56vw, 180px);
    }

    .activity-card.tool .activity-subtitle,
    .activity-card.tool .activity-compact-tag {
        font-size: 10px;
        padding: 4px 7px;
    }

    .activity-section {
        margin-top: 8px;
    }

    .activity-section-header {
        padding: 8px 10px;
    }

    .activity-section-chevron {
        min-width: 54px;
        height: 22px;
        padding: 0 7px;
        gap: 4px;
    }

    .activity-section-chevron-label {
        font-size: 9px;
    }

    .activity-section-body {
        padding: 0 10px 10px;
    }

    .memory-add-form {
        flex-direction: column;
    }
}

/* Session List Styles */
.session-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.session-info {
    flex: 1;
}

.session-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: white;
}

.session-info span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

.session-status {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.session-status.active {
    background: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.session-status.closed {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}
