/* ═══════════════════════════════════════════════════════
   CREATIVE YADLEY — ANTIGRAVITY IDE THEME & WORKBENCH
   Dark VS Code / Antigravity Aesthetic:
   Canvas: #181818 / #1e1e1e / #252526 / #2d2d2d
   Activity Bar: #141414
   Accent: #AFE139 (Creative Yadley Lime)
   Full-Rounded Buttons: 9999px
   White Client Tree Icons: #FFFFFF
   Typography: Bebas Neue (Headers), Nunito Sans (UI), JetBrains Mono (Code/Tabs)
   ═══════════════════════════════════════════════════════ */

:root {
    --ide-bg-app: #121316;
    --ide-bg-sidebar: #17181e;
    --ide-bg-editor: #121316;
    --ide-bg-activity: #0e0f12;
    --ide-bg-titlebar: #0e0f12;
    --ide-bg-panel: #1a1b22;
    --ide-bg-input: #1f2129;
    --ide-bg-hover: rgba(255, 255, 255, 0.08);
    --ide-bg-active: #242732;
    --ide-bg-tab-active: #121316;
    --ide-bg-tab-inactive: #0e0f12;

    --ide-border: #272a36;
    --ide-border-subtle: rgba(255, 255, 255, 0.09);

    --color-accent: #A3E635; /* Creative Yadley Vivid Lime */
    --color-accent-hover: #BEF264;
    --color-accent-muted: rgba(163, 230, 53, 0.16);
    --color-ide-blue: #0ea5e9;

    --color-text-primary: #e2e8f0; /* Crisp slate-200 */
    --color-text-bright: #ffffff;
    --color-text-muted: #94a3b8; /* Slate-400 */
    --color-text-dim: #64748b;

    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-full: 9999px; /* Creative Yadley Standard Full-Rounded */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body.vscode-theme {
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--ide-bg-app);
    color: var(--color-text-primary);
    height: 100vh;
    height: 100dvh;
    min-height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 13px;
}

/* Typography */
.font-display,
[class*="font-display"],
h1.font-display, h2.font-display, h3.font-display, h4.font-display, button.font-display, span.font-display {
    font-family: 'Bebas Neue', system-ui, sans-serif !important;
    font-weight: 400 !important;
    letter-spacing: 0.06em;
}

.mono-font {
    font-family: 'JetBrains Mono', monospace;
}

.hidden {
    display: none !important;
}

/* Scrollbars */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
}

/* ═══════════════════════════════════════════════════════
   PIN AUTH OVERLAY
   ═══════════════════════════════════════════════════════ */
.pin-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.94);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pin-card {
    background: var(--ide-bg-sidebar);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
}

.ide-logo-badge {
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pin-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.pin-card h2 {
    font-size: 26px;
    color: var(--color-text-bright);
    margin-bottom: 6px;
}

.pin-subtitle {
    color: var(--color-text-muted);
    font-size: 13px;
    margin-bottom: 24px;
}

.pin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pin-form input {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full);
    padding: 12px 18px;
    font-size: 20px;
    text-align: center;
    letter-spacing: 0.3em;
    color: var(--color-text-bright);
    outline: none;
}
.pin-form input:focus {
    border-color: var(--color-accent);
}

.pin-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════
   IDE WORKBENCH ROOT
   ═══════════════════════════════════════════════════════ */
.ide-workbench {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════
   TOP TITLEBAR
   ═══════════════════════════════════════════════════════ */
.ide-titlebar {
    height: 44px;
    background: var(--ide-bg-titlebar);
    border-bottom: 1px solid var(--ide-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    user-select: none;
    flex-shrink: 0;
    z-index: 100;
}

.titlebar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}

.app-brand-badge {
    display: flex;
    align-items: center;
    cursor: pointer;
    flex-shrink: 0;
}
.titlebar-logo-img {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.ide-app-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--color-text-bright);
    letter-spacing: 0.03em;
    white-space: nowrap !important;
    flex-shrink: 0;
}

.titlebar-menu {
    display: flex;
    gap: 10px;
    margin-left: 8px;
}
.titlebar-menu span {
    font-size: 12px;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-full);
    transition: all 0.1s ease;
}
.titlebar-menu span:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}

.menu-item-with-badge {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}
.menu-badge {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    line-height: 1.2;
}
.menu-badge.badge-warning {
    background: #f59e0b;
    color: #0d0d0d;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.titlebar-center {
    flex: 1;
    max-width: 480px;
    margin: 0 16px;
}

.command-palette-input {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 8px;
    cursor: text;
}
.command-palette-input:focus-within {
    border-color: var(--color-accent);
}
.cmd-icon {
    width: 14px;
    height: 14px;
    color: var(--color-text-muted);
}
.command-palette-input input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-bright);
    font-size: 12px;
    flex: 1;
}
.cmd-kbd {
    font-size: 10px;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: var(--radius-full);
}

.titlebar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: auto;
}

.layout-controls {
    display: flex;
    gap: 4px;
    padding-right: 8px;
    border-right: 1px solid var(--ide-border);
    flex-shrink: 0;
}
.titlebar-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.titlebar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.15);
}
.titlebar-btn.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.22);
}
.titlebar-btn.muted {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}
.titlebar-btn svg {
    width: 14px;
    height: 14px;
}

/* Operator Profile Switcher & Dropdown */
.operator-profile-wrap {
    position: relative;
    flex-shrink: 0;
}
.operator-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full);
    padding: 3px 8px 3px 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--color-text-bright);
    max-width: 140px;
    flex-shrink: 0;
}
.operator-profile-btn:hover {
    background: var(--ide-bg-hover);
    border-color: rgba(255, 255, 255, 0.2);
}
.staff-avatar-slot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    background: #2a2d3d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.staff-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.staff-avatar-initials {
    font-size: 9px;
    font-weight: 700;
    color: var(--color-text-bright);
    font-family: 'JetBrains Mono', monospace;
}
.operator-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}
.operator-caret {
    width: 12px;
    height: 12px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.operator-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 270px;
    background: #181a20;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
    padding: 8px 0;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}
.dropdown-section-title {
    padding: 6px 14px 4px 14px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--color-text-dim);
    letter-spacing: 0.5px;
}
.operator-dropdown-list {
    display: flex;
    flex-direction: column;
    max-height: 220px;
    overflow-y: auto;
}
.operator-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: background 0.12s ease;
}
.operator-dropdown-item:hover {
    background: var(--ide-bg-hover);
    color: #ffffff;
}
.operator-dropdown-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.operator-item-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: #2a2d3d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    flex-shrink: 0;
}
.operator-item-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.operator-item-name {
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.operator-item-role {
    font-size: 10px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.operator-item-check {
    color: var(--color-accent);
    font-size: 14px;
    font-weight: bold;
}
.operator-dropdown-divider {
    height: 1px;
    background: var(--ide-border);
    margin: 6px 0;
}
.dropdown-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.12s ease;
    text-align: left;
    width: 100%;
}
.dropdown-action-btn:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}
.dropdown-action-btn svg {
    width: 14px;
    height: 14px;
}

.btn-action-new {
    background: var(--color-accent);
    color: #080808;
    border: none;
    padding: 6px 16px;
    height: 30px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    font-size: 14px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-action-new:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}
.btn-action-new svg {
    width: 14px;
    height: 14px;
}

/* ═══════════════════════════════════════════════════════
   MAIN 3-COLUMN CONTAINER
   ═══════════════════════════════════════════════════════ */
.ide-main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* 1. ACTIVITY BAR */
.ide-activity-bar {
    width: 48px;
    background: var(--ide-bg-activity);
    border-right: 1px solid var(--ide-border);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    flex-shrink: 0;
    z-index: 40;
}

.activity-top {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    align-items: center;
}

.activity-btn {
    background: transparent;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.15s ease;
}
.activity-btn svg {
    width: 20px;
    height: 20px;
}
.activity-btn:hover {
    color: var(--color-text-bright);
    background: var(--ide-bg-hover);
}
.activity-btn.active {
    color: var(--color-text-bright);
    background: var(--ide-bg-active);
}
.activity-btn.active::before {
    content: '';
    position: absolute;
    left: -5px;
    top: 8px;
    bottom: 8px;
    width: 3px;
    background: var(--color-accent);
    border-radius: 0 3px 3px 0;
}

.whmcs-live-indicator {
    padding: 8px;
    cursor: pointer;
    border-radius: var(--radius-full);
}
.whmcs-live-indicator:hover {
    background: var(--ide-bg-hover);
}
.live-dot {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
}

/* 2. PRIMARY SIDEBAR (EXPLORER: CLIENTS) */
.ide-sidebar {
    width: 280px;
    min-width: 220px;
    max-width: 360px;
    background: var(--ide-bg-sidebar);
    border-right: 1px solid var(--ide-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.2s ease, transform 0.2s ease;
    z-index: 30;
}
.ide-sidebar.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-right: none;
    overflow: hidden;
}

.sidebar-header-bar {
    height: 38px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ide-border-subtle);
}
.sidebar-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text-bright);
    letter-spacing: 0.05em;
}
.sidebar-tools {
    display: flex;
    align-items: center;
    gap: 6px;
}
.sidebar-count {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--ide-bg-active);
    color: var(--color-text-bright);
    padding: 2px 8px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
}
.sidebar-icon-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    cursor: pointer;
    border-radius: var(--radius-full);
}

.sidebar-filter-section {
    padding: 10px 12px;
    border-bottom: 1px solid var(--ide-border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-search-box {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    height: 28px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 6px;
}
.sidebar-search-box svg {
    width: 13px;
    height: 13px;
    color: var(--color-text-muted);
}
.sidebar-search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-bright);
    font-size: 11px;
    flex: 1;
}

.filter-pills-row {
    display: flex;
    gap: 6px;
}
.filter-pill {
    flex: 1;
    background: transparent;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    color: var(--color-text-muted);
    font-size: 11px;
    padding: 4px 0;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
}
.filter-pill:hover {
    color: var(--color-text-bright);
    border-color: rgba(255, 255, 255, 0.2);
}
.filter-pill.active {
    background: var(--ide-bg-active);
    color: var(--color-text-bright);
    border-color: rgba(255, 255, 255, 0.3);
}

.clients-tree-view {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0;
}

/* Client Tree Item */
.client-tree-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    gap: 8px;
    border-left: 2px solid transparent;
    transition: background 0.1s ease;
}
.client-tree-item:hover {
    background: var(--ide-bg-hover);
}
.client-tree-item.active {
    background: var(--ide-bg-active);
    border-left-color: var(--color-accent);
}

.tree-chevron {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-dim);
    transition: transform 0.15s ease, color 0.15s ease;
    display: inline-block;
    width: 10px;
    text-align: center;
    line-height: 1;
    flex-shrink: 0;
}
.client-tree-item.expanded .tree-chevron,
.tree-chevron.expanded {
    transform: rotate(90deg);
    color: var(--color-accent);
}

/* WHITE CLIENT TREE ICON (User Request) */
.client-tree-icon {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    background: #2b2b2b;
    color: #ffffff !important; /* STRICTLY WHITE */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.client-tree-content {
    flex: 1;
    min-width: 0;
}
.client-tree-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-bright);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.client-tree-sub {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}
.client-tree-badge {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--color-accent);
    color: #080808;
    padding: 2px 6px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    font-weight: bold;
    flex-shrink: 0;
}

/* Explorer Client Tickets Subtree */
.client-tickets-sublist {
    margin-left: 24px;
    padding: 2px 0 6px 12px;
    border-left: 1px dashed rgba(255, 255, 255, 0.15);
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ticket-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 11px;
    color: var(--color-text-muted);
    transition: all 0.12s ease;
}
.ticket-sub-item:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}
.ticket-sub-item.active {
    background: var(--ide-bg-active);
    color: var(--color-accent);
    font-weight: 700;
}
.ticket-sub-icon {
    font-size: 11px;
    flex-shrink: 0;
}
.ticket-sub-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ticket-sub-subject {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ticket-sub-meta {
    font-size: 10px;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 6px;
}
.sub-status-tag {
    font-size: 9px;
    padding: 2px 6px;
    border-radius: var(--radius-full);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.sub-status-tag.customer-reply,
.sub-status-tag.customer_reply {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.2);
}
.sub-status-tag.open {
    background: rgba(251, 191, 36, 0.18);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.35);
}
.sub-status-tag.in-progress,
.sub-status-tag.in_progress,
.sub-status-tag.on-hold {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.35);
}
.sub-status-tag.answered {
    background: rgba(175, 225, 57, 0.15);
    color: var(--color-accent);
    border: 1px solid rgba(175, 225, 57, 0.3);
}
.sub-status-tag.closed {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-dim);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ticket-sub-item.is-unanswered {
    border-left: 2px solid #f59e0b !important;
}

/* ═══════════════════════════════════════════════════════
   3. CENTER CONSOLE (TICKET WORKSPACE & EDITOR)
   ═══════════════════════════════════════════════════════ */
.ide-editor-area {
    flex: 1;
    background: var(--ide-bg-editor);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* Tabs Bar */
.editor-tabs-bar {
    height: 38px;
    background: var(--ide-bg-tab-inactive);
    border-bottom: 1px solid var(--ide-border);
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.editor-tabs-scroll-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    position: relative;
}

.editor-tabs-list {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: stretch;
    scroll-behavior: smooth;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.editor-tabs-list::-webkit-scrollbar {
    display: none;
    height: 0;
    width: 0;
}

.editor-tab {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    background: var(--ide-bg-tab-inactive);
    border-right: 1px solid var(--ide-border);
    color: var(--color-text-muted);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    user-select: none;
    border-top: 2px solid transparent;
    flex-shrink: 0;
    white-space: nowrap;
    max-width: 260px;
    box-sizing: border-box;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.editor-tab:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}
.editor-tab.active {
    background: var(--ide-bg-tab-active);
    color: var(--color-text-bright);
    border-top-color: var(--color-accent);
}
.tab-icon {
    font-size: 13px;
    flex-shrink: 0;
}
.tab-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 180px;
}
.tab-badge {
    font-size: 10px;
    background: rgba(175, 225, 57, 0.15);
    color: var(--color-accent);
    padding: 2px 6px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(175, 225, 57, 0.3);
    flex-shrink: 0;
    white-space: nowrap;
}
.tab-close {
    font-size: 14px;
    opacity: 0.6;
    margin-left: 4px;
    padding: 2px 4px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    transition: all 0.12s ease;
    line-height: 1;
}
.tab-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
    color: #ff5555;
}

.editor-tab-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    background: var(--ide-bg-tab-inactive);
    border-left: 1px solid var(--ide-border);
    flex-shrink: 0;
    z-index: 5;
}

.tab-nav-group {
    display: flex;
    align-items: center;
    gap: 2px;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full);
    padding: 2px;
    background: rgba(0, 0, 0, 0.25);
}

.tab-nav-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.tab-nav-btn:hover:not(:disabled):not(.nav-inactive) {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}
.tab-nav-btn:disabled,
.tab-nav-btn.nav-inactive {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}
.tab-nav-btn svg {
    width: 12px;
    height: 12px;
}

.tab-action-btn {
    background: transparent;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    color: var(--color-text-muted);
    font-size: 11px;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.tab-action-btn:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
    border-color: rgba(255, 255, 255, 0.2);
}
.tab-action-btn svg {
    width: 12px;
    height: 12px;
}

/* Breadcrumbs Bar & Ticket Switcher */
.editor-breadcrumbs {
    height: 32px;
    background: var(--ide-bg-editor);
    border-bottom: 1px solid var(--ide-border-subtle);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 6px;
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-text-muted);
    flex-shrink: 0;
    position: relative;
    z-index: 50;
}
.crumb-root {
    color: var(--color-accent);
}
.crumb-sep {
    color: var(--color-text-dim);
}
.crumb-client {
    color: var(--color-text-bright);
    cursor: pointer;
}
.crumb-client:hover {
    color: var(--color-accent);
}

.ticket-switcher-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}
.ticket-switcher-btn {
    background: var(--ide-bg-active);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full);
    color: var(--color-text-bright);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    padding: 3px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    max-width: 240px;
}
.ticket-switcher-btn:hover {
    border-color: var(--color-accent);
    background: rgba(175, 225, 57, 0.12);
}
.ticket-switcher-btn span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.switcher-arrow-icon {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.ticket-switcher-wrap.open .switcher-arrow-icon {
    transform: rotate(180deg);
}
.ticket-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 280px;
    max-width: 380px;
    max-height: 280px;
    overflow-y: auto;
    background: #1f1f1f;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
    z-index: 500;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.switcher-menu-item {
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    transition: background 0.1s ease;
    text-align: left;
    background: transparent;
    border: none;
    color: var(--color-text-primary);
    font-family: 'Nunito Sans', sans-serif;
    width: 100%;
}
.switcher-menu-item:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}
.switcher-menu-item.active {
    background: rgba(175, 225, 57, 0.12);
    color: var(--color-accent);
    font-weight: 700;
}
.switcher-ticket-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.switcher-ticket-subject {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.switcher-ticket-date {
    font-size: 10px;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.breadcrumbs-status-wrap {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}
.crumb-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    background: var(--ide-bg-active);
    color: var(--color-text-bright);
}
.domain-badges {
    display: flex;
    gap: 4px;
}
.domain-chip {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ide-border);
    padding: 2px 8px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    color: var(--color-text-muted);
}

/* Conversation Feed */
.editor-feed-container {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Empty State */
.empty-state-ide {
    margin: auto;
    text-align: center;
    max-width: 480px;
    padding: 40px 20px;
}
.empty-logo-img {
    height: 64px;
    width: auto;
    margin-bottom: 18px;
    opacity: 0.9;
}
.empty-state-ide h2 {
    font-size: 32px;
    color: var(--color-text-bright);
    margin-bottom: 8px;
}
.empty-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}
.quick-start-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* Message Bubble (Fixed flex-shrink & rich aesthetics) */
.ticket-message-card {
    background: var(--ide-bg-panel);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    flex-shrink: 0;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.ticket-message-card.client-msg {
    border-left: 4px solid #38bdf8;
}
.ticket-message-card.staff-msg {
    border-left: 4px solid var(--color-accent);
}

.msg-header {
    background: rgba(0, 0, 0, 0.35);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ide-border-subtle);
    flex-shrink: 0;
}
.msg-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.msg-avatar {
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    background: var(--ide-bg-active);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    border: 1px solid rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}
.msg-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-bright);
}
.msg-role-tag {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
}
.msg-role-tag.client {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.25);
}
.msg-role-tag.staff {
    background: var(--color-accent-muted);
    color: var(--color-accent);
    border: 1px solid rgba(175, 225, 57, 0.25);
}
.msg-date {
    font-size: 11px;
    color: var(--color-text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.msg-body {
    padding: 16px 18px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--color-text-primary);
    word-break: break-word;
    flex-shrink: 0;
}
.msg-body p {
    margin-bottom: 12px;
}
.msg-body p:last-child {
    margin-bottom: 0;
}
.msg-body strong {
    color: var(--color-text-bright);
    font-weight: 700;
}
.msg-body em {
    color: #e0e0e0;
    font-style: italic;
}
.msg-body ul, .msg-body ol {
    padding-left: 22px;
    margin: 10px 0;
}
.msg-body li {
    margin-bottom: 6px;
}
.msg-body .code-block {
    background: #141414;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #e6e6e6;
    border: 1px solid var(--ide-border-subtle);
    margin: 10px 0;
    overflow-x: auto;
}
.msg-body .inline-code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--color-accent);
}
.msg-body .msg-h2 {
    color: var(--color-text-bright);
    margin: 14px 0 8px;
    font-size: 16px;
    font-weight: 700;
}
.msg-body .msg-h3 {
    color: var(--color-text-bright);
    margin: 12px 0 6px;
    font-size: 14px;
    font-weight: 700;
}
.msg-body .msg-h4 {
    color: var(--color-text-bright);
    margin: 10px 0 4px;
    font-size: 13px;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════
   BOTTOM PANEL / TERMINAL COMPOSER
   ═══════════════════════════════════════════════════════ */
.ide-bottom-panel {
    border-top: 1px solid var(--ide-border);
    background: var(--ide-bg-panel);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    max-height: 380px;
    transition: max-height 0.2s ease;
}
.ide-bottom-panel.collapsed {
    max-height: 34px !important;
    overflow: hidden;
}

.panel-header-tabs {
    height: 34px;
    background: #141414;
    border-bottom: 1px solid var(--ide-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    flex-shrink: 0;
}
.panel-tabs-left {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-wrap: nowrap;
}
.panel-tab {
    background: transparent;
    border: none;
    color: var(--color-text-bright);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.tab-terminal-icon {
    color: var(--color-accent);
}
.ticket-status-pill {
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    background: var(--ide-bg-active);
    color: var(--color-text-muted);
    padding: 3px 8px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    line-height: 1.2;
    border: 1px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ticket-status-pill.ticket-link-btn {
    cursor: pointer;
    text-decoration: none;
}
.ticket-status-pill.ticket-link-btn:hover {
    background: var(--ide-bg-hover);
    color: var(--color-accent);
    border-color: rgba(175, 225, 57, 0.4);
}
.pill-ext-icon {
    width: 10px;
    height: 10px;
    margin-left: 4px;
    opacity: 0.7;
}

.panel-tabs-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.preset-select-dropdown {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    color: var(--color-text-bright);
    font-size: 11px;
    padding: 3px 10px;
    outline: none;
    cursor: pointer;
}
.panel-toggle-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    border-radius: var(--radius-full);
}
.panel-toggle-btn svg {
    width: 14px;
    height: 14px;
}

.panel-content-body {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ═══════════════════════════════════════════════════════
   WYSIWYG RICH TEXT EDITOR STYLES
   ═══════════════════════════════════════════════════════ */
.wysiwyg-container {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color 0.15s ease;
}
.wysiwyg-container:focus-within {
    border-color: var(--color-accent);
}

.wysiwyg-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
    padding: 6px 10px;
    background: #111216;
    border-bottom: 1px solid var(--ide-border);
    user-select: none;
}

.wysiwyg-btn-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.wysiwyg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.12s ease;
}
.wysiwyg-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.wysiwyg-btn:active,
.wysiwyg-btn.active {
    background: rgba(163, 230, 53, 0.18);
    color: var(--color-accent);
    border-color: rgba(163, 230, 53, 0.3);
}
.wysiwyg-btn svg {
    width: 14px;
    height: 14px;
}
.wysiwyg-text-icon {
    font-family: 'JetBrains Mono', 'Bebas Neue', monospace;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.wysiwyg-divider {
    width: 1px;
    height: 18px;
    background: var(--ide-border);
    margin: 0 4px;
}

.wysiwyg-spacer {
    flex: 1;
}

.wysiwyg-editor-surface {
    min-height: 105px;
    max-height: 260px;
    overflow-y: auto;
    padding: 12px 14px;
    background: var(--ide-bg-input);
    color: var(--color-text-bright);
    font-family: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    line-height: 1.6;
    outline: none;
    word-break: break-word;
}
.wysiwyg-editor-surface:empty::before {
    content: attr(data-placeholder);
    color: var(--color-text-dim);
    pointer-events: none;
    display: block;
}

/* Rich Content Formatting inside WYSIWYG */
.wysiwyg-editor-surface h1,
.wysiwyg-editor-surface h2,
.wysiwyg-editor-surface h3 {
    font-family: 'Nunito Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 10px 0 6px;
    line-height: 1.3;
}
.wysiwyg-editor-surface p {
    margin: 0 0 8px;
}
.wysiwyg-editor-surface strong,
.wysiwyg-editor-surface b {
    font-weight: 700;
    color: #ffffff;
}
.wysiwyg-editor-surface em,
.wysiwyg-editor-surface i {
    font-style: italic;
    color: #f1f5f9;
}
.wysiwyg-editor-surface u {
    text-decoration: underline;
}
.wysiwyg-editor-surface ul,
.wysiwyg-editor-surface ol {
    margin: 0 0 8px;
    padding-left: 22px;
}
.wysiwyg-editor-surface li {
    margin-bottom: 3px;
}
.wysiwyg-editor-surface blockquote {
    border-left: 3px solid var(--color-accent);
    padding: 6px 12px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 4px 4px 0;
    color: #e2e8f0;
}
.wysiwyg-editor-surface a {
    color: var(--color-accent);
    text-decoration: underline;
}
.wysiwyg-editor-surface hr {
    border: none;
    border-top: 1px solid var(--ide-border);
    margin: 12px 0;
}

.wysiwyg-raw-textarea {
    width: 100%;
    min-height: 105px;
    max-height: 260px;
    background: var(--ide-bg-input);
    border: none;
    padding: 12px 14px;
    color: #cbd5e1;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    outline: none;
    resize: vertical;
}

.modal-wysiwyg .wysiwyg-editor-surface,
.modal-wysiwyg .wysiwyg-raw-textarea {
    min-height: 140px;
    max-height: 280px;
}

.mini-wysiwyg .wysiwyg-editor-surface,
.mini-wysiwyg .wysiwyg-raw-textarea {
    min-height: 85px;
    max-height: 160px;
    font-size: 12px;
}

.composer-editor-wrapper textarea {
    width: 100%;
    height: 100px;
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    padding: 12px;
    color: var(--color-text-bright);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    line-height: 1.5;
    outline: none;
    resize: vertical;
}

.panel-footer-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.footer-select-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--color-text-muted);
}
.footer-select-group select {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    color: var(--color-text-bright);
    font-size: 11px;
    padding: 5px 12px;
    outline: none;
}

.panel-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ═══════════════════════════════════════════════════════
   4. SECONDARY SIDEBAR: ANTIGRAVITY AGENT COPILOT (RIGHT PANE)
   ═══════════════════════════════════════════════════════ */
.ide-agent-panel {
    width: 300px;
    min-width: 260px;
    max-width: 340px;
    background: var(--ide-bg-sidebar);
    border-left: 1px solid var(--ide-border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow: hidden;
    transition: width 0.2s ease, transform 0.2s ease;
    z-index: 30;
}
.ide-agent-panel.collapsed {
    width: 0 !important;
    min-width: 0 !important;
    border-left: none;
    overflow: hidden;
}

.agent-panel-header {
    height: 38px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--ide-border-subtle);
    background: #181818;
}
.agent-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    color: var(--color-text-bright);
    letter-spacing: 0.05em;
}
.agent-spark-icon svg {
    width: 16px;
    height: 16px;
    color: var(--color-accent);
}
.agent-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-tool-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 16px;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.1s ease;
}
.agent-tool-btn:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}
.agent-tool-btn svg {
    width: 14px;
    height: 14px;
}

/* Rules Monitor Strip */
.agent-rules-strip {
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 12px;
    border-bottom: 1px solid var(--ide-border-subtle);
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rule-chip {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: var(--color-text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 8px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
}
.rule-dot {
    color: var(--color-accent);
    font-weight: bold;
}
.rule-dot.error {
    color: #ef4444;
}

/* Agent Chat Stream */
.agent-chat-stream {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.agent-welcome-card {
    background: var(--ide-bg-active);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: left;
}
.agent-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(175, 225, 57, 0.12);
    border: 1px solid rgba(175, 225, 57, 0.3);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    padding: 3px 10px;
    font-size: 10px;
    color: var(--color-accent);
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}
.agent-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
}
.agent-welcome-card h3 {
    font-size: 18px;
    color: var(--color-text-bright);
    margin-bottom: 4px;
}
.agent-welcome-card p {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}
.agent-example-chips {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.example-chip {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    padding: 6px 12px;
    color: var(--color-text-primary);
    font-size: 11px;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}
.example-chip:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
    border-color: var(--color-accent);
}

/* Chat Message Bubbles */
.chat-msg-user {
    align-self: flex-end;
    background: #004b87;
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 8px 14px;
    font-size: 12px;
    max-width: 90%;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg-agent {
    align-self: flex-start;
    background: var(--ide-bg-active);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    padding: 14px;
    font-size: 12px;
    max-width: 100%;
    width: 100%;
    line-height: 1.5;
    word-break: break-word;
}
.chat-msg-agent pre {
    background: #141414;
    padding: 10px;
    border-radius: var(--radius-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    margin: 8px 0;
    border: 1px solid var(--ide-border-subtle);
    color: #e6e6e6;
}

.agent-msg-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--ide-border-subtle);
}
.agent-msg-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-accent);
    display: flex;
    align-items: center;
    gap: 6px;
}
.agent-msg-tools {
    display: flex;
    align-items: center;
    gap: 4px;
}
.btn-chat-tool {
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}
.btn-chat-tool:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
    border-color: var(--ide-border-subtle);
}
.btn-chat-tool svg {
    width: 13px;
    height: 13px;
}
.btn-chat-tool.btn-clear-msg:hover {
    color: #f87171;
    border-color: rgba(248, 113, 113, 0.3);
}
.btn-chat-tool.btn-regenerate-msg:hover {
    color: var(--color-accent);
    border-color: var(--color-accent-muted);
}

.agent-msg-rendered {
    color: var(--color-text-primary);
    font-size: 12px;
    line-height: 1.6;
    margin: 6px 0 10px 0;
}
.agent-msg-rendered .msg-h2,
.agent-msg-rendered .msg-h3,
.agent-msg-rendered .msg-h4 {
    color: var(--color-text-bright);
    margin: 12px 0 4px 0;
    font-weight: 700;
}
.agent-msg-rendered .msg-h3 {
    font-size: 13px;
    border-bottom: 1px solid var(--ide-border-subtle);
    padding-bottom: 3px;
}
.agent-msg-rendered .msg-h4 {
    font-size: 12px;
    color: var(--color-accent);
}
.agent-msg-rendered ul,
.agent-msg-rendered ol {
    margin: 6px 0;
    padding-left: 18px;
}
.agent-msg-rendered li {
    margin-bottom: 4px;
}
.agent-msg-rendered strong {
    color: var(--color-text-bright);
    font-weight: 700;
}
.agent-msg-rendered .msg-hr {
    border: none;
    border-top: 1px solid var(--ide-border-subtle);
    margin: 12px 0;
}
.agent-msg-rendered p {
    margin-bottom: 8px;
}
.agent-msg-rendered p:last-child {
    margin-bottom: 0;
}
.agent-actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}
.btn-agent-action {
    background: var(--color-accent);
    color: #080808;
    border: none;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    font-size: 11px;
    font-weight: bold;
    padding: 5px 12px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.btn-agent-action.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--ide-border);
}
.btn-agent-action:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   INTERACTIVE MARKDOWN DOCUMENT & REVIEW WORKSPACE
   ═══════════════════════════════════════════════════════ */
.doc-workspace-container {
    padding: 16px 20px;
    max-width: 920px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.doc-header-card {
    background: var(--ide-bg-panel);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    padding: 18px 22px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.doc-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}
.doc-title-icon {
    font-size: 20px;
}
.doc-title-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-text-bright);
    letter-spacing: -0.01em;
}

.doc-actions-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 11px;
}
.doc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full);
    padding: 3px 10px;
    color: var(--color-text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}
.doc-chip strong {
    color: var(--color-text-bright);
}
.doc-chip.accent {
    background: var(--color-accent-muted);
    border-color: rgba(163, 230, 53, 0.35);
    color: var(--color-accent);
}

.doc-body-card {
    background: var(--ide-bg-panel);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.doc-section-block {
    position: relative;
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin: -4px -12px;
    transition: background 0.15s ease, border-color 0.15s ease;
    border: 1px solid transparent;
}
.doc-section-block:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(255, 255, 255, 0.08);
}
.doc-section-block.has-comments {
    border-left: 3px solid var(--color-accent);
    background: rgba(163, 230, 53, 0.03);
}

.doc-section-trigger {
    opacity: 0;
    position: absolute;
    right: 8px;
    top: 6px;
    background: var(--ide-bg-active);
    border: 1px solid var(--ide-border);
    color: var(--color-text-muted);
    font-size: 11px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    z-index: 10;
}
.doc-section-block:hover .doc-section-trigger,
.doc-section-block:focus-within .doc-section-trigger,
.doc-section-trigger:focus-visible,
.doc-section-trigger.active {
    opacity: 1;
}
.doc-section-trigger:hover {
    background: var(--color-accent);
    color: #000000;
    border-color: var(--color-accent);
    font-weight: bold;
}

.doc-comments-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px dashed var(--ide-border-subtle);
}

.doc-comment-card {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: all 0.15s ease;
}
.doc-comment-card.resolved {
    opacity: 0.65;
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.05);
}

.doc-comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.doc-comment-user {
    display: flex;
    align-items: center;
    gap: 8px;
}
.doc-comment-avatar {
    width: 22px;
    height: 22px;
    border-radius: var(--radius-full);
    background: var(--color-accent);
    color: #000;
    font-weight: 700;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'JetBrains Mono', monospace;
}
.doc-comment-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-bright);
}
.doc-comment-date {
    font-size: 10px;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
}

.doc-comment-text {
    font-size: 12px;
    color: var(--color-text-primary);
    line-height: 1.5;
    white-space: pre-wrap;
    padding-left: 30px;
}

.doc-comment-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 2px;
}
.doc-comment-action-btn {
    background: transparent;
    border: 1px solid var(--ide-border);
    color: var(--color-text-muted);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.1s ease;
}
.doc-comment-action-btn:hover {
    background: var(--ide-bg-hover);
    color: var(--color-text-bright);
}
.doc-comment-action-btn.btn-resolve:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
}
.doc-comment-action-btn.btn-delete:hover {
    color: #f87171;
    border-color: #f87171;
}

.doc-composer-inline {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}
.doc-composer-textarea {
    background: var(--ide-bg-panel);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-sm);
    color: var(--color-text-bright);
    font-family: inherit;
    font-size: 12px;
    padding: 8px 10px;
    resize: vertical;
    min-height: 64px;
    outline: none;
}
.doc-composer-textarea:focus {
    border-color: var(--color-accent);
}
.doc-composer-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.editor-tab .tab-badge {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: var(--radius-full);
    background: var(--ide-bg-active);
    color: var(--color-accent);
    font-family: 'JetBrains Mono', monospace;
}
.editor-tab.active .tab-badge {
    background: var(--color-accent);
    color: #000000;
    font-weight: 700;
}

/* Agent Input Box */
.agent-input-container {
    padding: 12px;
    background: #141414;
    border-top: 1px solid var(--ide-border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.agent-input-box {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.agent-input-box:focus-within {
    border-color: var(--color-accent);
}
.agent-input-box textarea {
    background: transparent;
    border: none;
    outline: none;
    color: var(--color-text-bright);
    font-size: 12px;
    line-height: 1.4;
    resize: none;
    font-family: 'Nunito Sans', sans-serif;
}

.agent-input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.agent-model-pill {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: var(--color-text-muted);
    font-family: 'JetBrains Mono', monospace;
}
.model-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
}
.agent-send-btn {
    background: var(--color-accent);
    color: #080808;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
}
.agent-send-btn svg {
    width: 14px;
    height: 14px;
}
.agent-send-btn:hover {
    background: var(--color-accent-hover);
    transform: translateY(-1px);
}

.agent-disclaimer {
    font-size: 10px;
    color: var(--color-text-dim);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════
   BUTTONS & MODALS (FULL ROUNDED & SIZED)
   ═══════════════════════════════════════════════════════ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 32px;
    padding: 0 16px;
    border-radius: var(--radius-full); /* FULL ROUNDED */
    border: 1px solid transparent;
    outline: none;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
    text-decoration: none;
}
.btn svg {
    width: 14px;
    height: 14px;
    max-width: 14px;
    max-height: 14px;
    flex-shrink: 0;
}
.btn-primary {
    background: var(--color-accent);
    color: #080808;
    border-color: var(--color-accent);
}
.btn-primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    transform: translateY(-1px);
}
.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-bright);
    border: 1px solid var(--ide-border);
}
.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.25);
}

.modal-overlay, .drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-card {
    background: var(--ide-bg-panel);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85);
}
.modal-header {
    background: #141414;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ide-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.modal-title-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal-header h3 {
    font-size: 20px;
    color: var(--color-text-bright);
}
.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: var(--radius-full);
}
.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-group label {
    font-size: 11px;
    color: var(--color-text-muted);
}
.form-group input, .form-group select {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-full); /* FULL ROUNDED */
    padding: 8px 14px;
    color: var(--color-text-bright);
    font-size: 12px;
    outline: none;
}
.form-group textarea {
    background: var(--ide-bg-input);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    color: var(--color-text-bright);
    font-size: 12px;
    font-family: 'JetBrains Mono', monospace;
    outline: none;
}
.form-row {
    display: flex;
    gap: 10px;
}
.flex-1 {
    flex: 1;
}
.modal-footer {
    padding: 14px 20px;
    background: #141414;
    border-top: 1px solid var(--ide-border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Drawer */
.drawer-panel {
    background: var(--ide-bg-panel);
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}
.drawer-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--ide-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-body {
    padding: 20px;
}

/* ═══════════════════════════════════════════════════════
   MOBILE RESPONSIVENESS & DOCK
   ═══════════════════════════════════════════════════════ */
.hide-desktop {
    display: none !important;
}

.ide-mobile-dock {
    display: none;
}

@media (max-width: 900px) {
    .hide-mobile {
        display: none !important;
    }
    .hide-desktop {
        display: flex !important;
    }

    .ide-activity-bar {
        display: none;
    }

    .ide-titlebar {
        height: 46px;
        padding: 0 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    .titlebar-left {
        flex-shrink: 0;
        white-space: nowrap;
        gap: 8px;
    }
    .ide-app-title {
        font-size: 13px;
        font-weight: 800;
        white-space: nowrap !important;
    }
    .titlebar-center {
        display: none !important;
    }
    .titlebar-right {
        gap: 6px;
    }
    .operator-profile-pill {
        padding: 3px 8px;
    }
    .operator-select {
        font-size: 11px;
    }
    .btn-action-new {
        width: 32px;
        height: 32px;
        padding: 0;
        border-radius: var(--radius-full);
        justify-content: center;
    }
    .btn-action-new svg {
        width: 16px;
        height: 16px;
    }

    .ide-main-container {
        flex-direction: column;
        position: relative;
    }

    .ide-sidebar {
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        width: 88% !important;
        max-width: 340px;
        box-shadow: 8px 0 24px rgba(0, 0, 0, 0.85);
        transform: translateX(-100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }
    .ide-sidebar.mobile-open {
        transform: translateX(0);
    }

    .ide-agent-panel {
        position: absolute;
        top: 0;
        bottom: 0;
        right: 0;
        width: 92% !important;
        max-width: 360px;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.85);
        transform: translateX(100%);
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
    }
    .ide-agent-panel.mobile-open {
        transform: translateX(0);
    }

    /* Mobile Bottom Dock */
    .ide-mobile-dock {
        display: flex;
        height: 56px;
        background: #141414;
        border-top: 1px solid var(--ide-border);
        align-items: center;
        justify-content: space-around;
        flex-shrink: 0;
        z-index: 100;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .mobile-dock-btn {
        background: transparent;
        border: none;
        color: var(--color-text-muted);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        font-size: 10px;
        cursor: pointer;
        padding: 6px 16px;
        border-radius: var(--radius-full);
    }
    .mobile-dock-btn svg {
        width: 18px;
        height: 18px;
    }
    .mobile-dock-btn.active {
        color: var(--color-accent);
        background: rgba(175, 225, 57, 0.1);
    }
}

/* Mobile-Specific Refinements (Phones < 640px) */
@media (max-width: 640px) {
    .hide-mobile-inline {
        display: none !important;
    }
    .hide-mobile-label {
        display: none !important;
    }

    .editor-breadcrumbs {
        padding: 4px 10px;
        height: 32px;
        white-space: nowrap;
        overflow: visible !important;
        overflow-x: visible !important;
        gap: 4px;
        font-size: 10px;
        position: relative;
        z-index: 50;
    }
    .crumb-root {
        display: none;
    }
    .editor-breadcrumbs .crumb-sep:first-of-type {
        display: none;
    }
    .domain-badges {
        display: none;
    }
    .ticket-switcher-btn {
        max-width: 150px;
        padding: 2px 8px;
        font-size: 10px;
    }
    .ticket-switcher-menu {
        position: absolute;
        top: calc(100% + 4px);
        left: 0;
        width: 85vw;
        max-width: 320px;
        z-index: 2000;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95);
    }

    .editor-feed-container {
        padding: 12px 10px;
        gap: 12px;
    }

    .panel-footer-actions {
        padding: 6px 10px;
        gap: 6px;
    }
    .footer-select-group select {
        padding: 4px 8px;
        font-size: 11px;
        max-width: 115px;
    }
    #previewReplyBtn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: var(--radius-full);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    #previewReplyBtn svg {
        width: 16px;
        height: 16px;
    }
    #sendReplyBtn {
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: var(--radius-full);
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    #sendReplyBtn svg {
        width: 16px;
        height: 16px;
    }
    .composer-editor-wrapper textarea {
        height: 80px;
    }
}

/* ═══════════════════════════════════════════════════════
   PRELOADERS & EVENT LOADING ANIMATIONS (CSS-LOADERS DOTS)
   ═══════════════════════════════════════════════════════ */

/* 1. Bouncing 3-Dot Wave Loader (.loader-dots) */
.loader-dots {
    width: 44px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(circle closest-side, var(--color-accent) 90%, transparent);
    background: 
        var(--_g) 0%   50%,
        var(--_g) 50%  50%,
        var(--_g) 100% 50%;
    background-size: calc(100% / 3) 50%;
    animation: loader-dots-anim 1s infinite linear;
    display: inline-block;
    vertical-align: middle;
}
@keyframes loader-dots-anim {
    20% { background-position: 0% 0%, 50% 50%, 100% 50%; }
    40% { background-position: 0% 100%, 50% 0%, 100% 50%; }
    60% { background-position: 0% 50%, 50% 100%, 100% 0%; }
    80% { background-position: 0% 50%, 50% 50%, 100% 100%; }
}

/* 2. Orbital Jumping / Rotating Dots Loader (.loader-orbit) */
.loader-orbit {
    width: 14px;
    aspect-ratio: 1;
    position: relative;
    animation: loader-orbit-step 1.5s infinite steps(2);
    display: inline-block;
    vertical-align: middle;
}
.loader-orbit::before,
.loader-orbit::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--color-accent);
}
.loader-orbit::before {
    box-shadow: 20px 0 var(--color-accent);
    transform: translateX(-20px);
    animation: loader-orbit-left 0.75s infinite linear alternate;
}
.loader-orbit::after {
    transform: translateX(10px) rotate(0deg) translateX(10px);
    animation: loader-orbit-right 0.75s infinite linear alternate;
}
@keyframes loader-orbit-step {
    0%, 49.9% { transform: scale(1); }
    50%, 100% { transform: scale(-1); }
}
@keyframes loader-orbit-left {
    100% { box-shadow: 40px 0 var(--color-accent); }
}
@keyframes loader-orbit-right {
    100% { transform: translateX(10px) rotate(-180deg) translateX(10px); }
}

/* 3. Traveling Scanning Dots Loader (.loader-scan) */
.loader-scan {
    width: 72px;
    height: 12px;
    --_g: no-repeat radial-gradient(farthest-side, var(--color-accent) 94%, transparent);
    background:
        var(--_g) 25% 0,
        var(--_g) 75% 0;
    background-size: 12px 12px;
    position: relative;
    animation: loader-scan-outer 1s linear infinite;
    display: inline-block;
    vertical-align: middle;
}
.loader-scan::before {
    content: "";
    position: absolute;
    height: 12px;
    aspect-ratio: 1;
    border-radius: 50%;
    background: var(--color-accent);
    inset: 0;
    margin: auto;
    animation: loader-scan-inner 1s cubic-bezier(0.5, 300, 0.5, -300) infinite;
}
@keyframes loader-scan-outer {
    0%, 24%  { background-position: 25% 0, 75% 0; }
    40%      { background-position: 25% 0, 85% 0; }
    50%, 72% { background-position: 25% 0, 75% 0; }
    90%      { background-position: 15% 0, 75% 0; }
    100%     { background-position: 25% 0, 75% 0; }
}
@keyframes loader-scan-inner {
    100% { transform: translate(0.1px); }
}

/* Generic Fallback Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(175, 225, 57, 0.2);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin-wheel 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin-wheel {
    to { transform: rotate(360deg); }
}

/* Loading States & Containers */
.loading-state,
.loading-state-ide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 36px 20px;
    text-align: center;
    color: var(--color-text-muted);
}
.loading-title {
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-bright);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.loading-sub {
    font-size: 11px;
    color: var(--color-text-dim);
    font-family: 'JetBrains Mono', monospace;
}

/* Agent Thinking Card (When Copilot is thinking) */
.chat-msg-agent.agent-thinking-bubble {
    background: transparent;
    border: none;
    padding: 0;
    width: 100%;
    box-shadow: none;
}

.agent-thinking-card {
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(15, 23, 15, 0.95));
    border: 1px solid rgba(175, 225, 57, 0.28);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 16px rgba(175, 225, 57, 0.05);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    animation: thinking-card-glow 2s infinite ease-in-out;
}

@keyframes thinking-card-glow {
    0%, 100% {
        border-color: rgba(175, 225, 57, 0.25);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        border-color: rgba(175, 225, 57, 0.55);
        box-shadow: 0 4px 28px rgba(175, 225, 57, 0.15), inset 0 0 20px rgba(175, 225, 57, 0.08);
    }
}

.agent-thinking-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.thinking-agent-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(175, 225, 57, 0.12);
    border: 1px solid rgba(175, 225, 57, 0.35);
    border-radius: var(--radius-full);
    padding: 3px 9px;
    font-size: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--color-accent);
}

.agent-pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
    box-shadow: 0 0 8px var(--color-accent);
    animation: pulse-agent-dot 1.2s infinite ease-in-out;
}

@keyframes pulse-agent-dot {
    0%, 100% { transform: scale(0.85); opacity: 0.6; }
    50% { transform: scale(1.3); opacity: 1; }
}

.thinking-status-indicator {
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-text-muted);
}

.agent-thinking-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 8px 4px 4px 4px;
}

.agent-thinking-caption {
    font-size: 11px;
    color: var(--color-text-muted);
    font-style: italic;
    text-align: center;
    line-height: 1.4;
}

/* ═══════════════════════════════════════════════════════
   GEMINI ICONS & SUBTLE BADGE AESTHETICS (REDUCED GREEN)
   ═══════════════════════════════════════════════════════ */
.gemini-nav-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(14, 165, 233, 0.45));
    transition: transform 0.2s ease;
}
.activity-btn:hover .gemini-nav-icon {
    transform: scale(1.12);
}
.gemini-header-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(14, 165, 233, 0.35));
}
.gemini-inline-icon {
    width: 13px;
    height: 13px;
    object-fit: contain;
    vertical-align: middle;
}

.agent-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: var(--radius-full);
    padding: 3px 10px;
    font-size: 10px;
    color: #e2e8f0 !important;
    margin-bottom: 8px;
    font-family: 'JetBrains Mono', monospace;
}
.agent-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #38bdf8 !important; /* Sky Blue Pulse */
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.6) !important;
}

.agent-model-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    padding: 3px 8px;
    font-size: 10px;
    color: var(--color-text-muted);
    font-family: 'JetBrains Mono', monospace;
}

/* ═══════════════════════════════════════════════════════
   STAFF DIRECTORY & SIGNATURES MODAL
   ═══════════════════════════════════════════════════════ */
.staff-modal-card {
    max-width: 820px;
    width: 94vw;
    background: #16181e;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.92);
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.staff-modal-card .modal-header {
    padding: 16px 20px;
    background: #121317;
    border-bottom: 1px solid var(--ide-border);
}

.staff-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.staff-modal-header-left .modal-header-icon {
    width: 28px;
    height: 28px;
    color: #ffffff;
    flex-shrink: 0;
}
.modal-subheading {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.staff-modal-layout {
    display: flex;
    min-height: 440px;
}

.staff-sidebar-column {
    width: 240px;
    border-right: 1px solid var(--ide-border);
    background: #101216;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.staff-members-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    max-height: 350px;
}

.staff-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
    width: 100%;
}
.staff-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}
.staff-nav-item.active {
    background: #20232d;
    border-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.staff-nav-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: #272a38;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.staff-nav-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-nav-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.staff-nav-name {
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.staff-nav-role {
    font-size: 10px;
    color: var(--color-text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-add-staff {
    width: 100%;
    padding: 8px 12px;
    font-size: 12px;
    justify-content: center;
}

.staff-editor-column {
    flex: 1;
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    background: #16181e;
}

.staff-avatar-edit-box {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #111317;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-md);
}

.staff-avatar-preview {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: #232634;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}
.staff-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.staff-avatar-initials-lg {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    font-family: 'JetBrains Mono', monospace;
}

.staff-avatar-action-btns {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.btn-upload-avatar {
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    width: fit-content;
}
.avatar-helper-text {
    font-size: 10px;
    color: var(--color-text-dim);
}

.staff-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.label-with-compliance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.compliance-badge-pill {
    font-size: 10px;
    background: rgba(163, 230, 53, 0.12);
    color: var(--color-accent);
    border: 1px solid rgba(163, 230, 53, 0.3);
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.signature-textarea {
    width: 100%;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    background: #101216;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-sm);
    color: #ffffff;
    padding: 10px;
    resize: vertical;
    line-height: 1.5;
}
.signature-textarea:focus {
    border-color: rgba(255, 255, 255, 0.25);
}

.form-field-hint {
    font-size: 10px;
    color: var(--color-text-dim);
    margin-top: 4px;
    display: block;
}

.staff-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--ide-border);
    margin-top: auto;
}
.staff-footer-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-ghost {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 11px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-full);
    transition: all 0.12s ease;
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
.text-danger {
    color: #f87171 !important;
}
.text-danger:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
}

@media (max-width: 640px) {
    .staff-modal-layout {
        flex-direction: column;
    }
    .staff-sidebar-column {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--ide-border);
    }
    .staff-form-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════
   CANNED RESPONSES & PROMPTS WIDGET
   ═══════════════════════════════════════════════════════ */
.canned-responses-widget {
    background: #14151b;
    border-bottom: 1px solid var(--ide-border-subtle);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}
.canned-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.canned-widget-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--color-text-dim);
}
.canned-widget-title svg {
    width: 12px;
    height: 12px;
    color: var(--color-accent);
}
.canned-count-badge {
    font-size: 9px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
    padding: 1px 6px;
    border-radius: var(--radius-full);
    font-family: 'JetBrains Mono', monospace;
}
.canned-widget-control {
    display: flex;
    align-items: center;
    gap: 8px;
}
.canned-dropdown-select {
    flex: 1;
    min-width: 0;
    background: #0d0e12;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-sm);
    color: #ffffff;
    font-size: 11px;
    padding: 6px 8px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}
.canned-dropdown-select:focus {
    border-color: rgba(255, 255, 255, 0.3);
}
.canned-apply-btn {
    padding: 6px 12px;
    font-size: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

/* ═══════════════════════════════════════════════════════
   TOAST NOTIFICATIONS (NON-BLOCKING)
   ═══════════════════════════════════════════════════════ */
.cy-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}
.cy-toast {
    background: #191b22;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85);
    color: #ffffff;
    padding: 10px 16px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transition: all 0.2s ease;
    max-width: 360px;
}
.cy-toast.success {
    border-left: 3px solid var(--color-accent);
}
.cy-toast.info {
    border-left: 3px solid #60a5fa;
}
.cy-toast.error {
    border-left: 3px solid #f87171;
}
.cy-toast.hide {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
}
.cy-toast-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.cy-toast-msg {
    flex: 1;
    line-height: 1.4;
}

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

/* ═══════════════════════════════════════════════════════
   RESPONSE TEMPLATES MANAGEMENT MODAL
   ═══════════════════════════════════════════════════════ */
.templates-modal-card {
    max-width: 900px;
    width: 92vw;
    background: #14161d;
    border: 1px solid var(--ide-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.6);
}

.templates-modal-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.templates-modal-header-left .modal-header-icon {
    width: 26px;
    height: 26px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.templates-modal-layout {
    display: flex;
    min-height: 480px;
    max-height: 80vh;
}

.templates-sidebar-column {
    width: 260px;
    border-right: 1px solid var(--ide-border);
    background: #101216;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.templates-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    max-height: 420px;
}

.template-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    text-align: left;
    transition: all 0.12s ease;
    width: 100%;
    font-size: 12px;
}
.template-nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}
.template-nav-item.active {
    background: rgba(163, 230, 53, 0.12);
    border-color: rgba(163, 230, 53, 0.35);
    color: var(--color-accent);
    font-weight: 600;
}
.template-nav-icon {
    font-size: 14px;
    flex-shrink: 0;
}
.template-nav-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.btn-add-template {
    width: 100%;
    padding: 8px 12px;
    font-size: 11px;
}

.templates-editor-column {
    flex: 1;
    padding: 20px 24px;
    background: #14161d;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
}

.template-form-grid {
    display: flex;
    gap: 12px;
}
.template-form-grid .flex-2 {
    flex: 2;
}
.template-form-grid .flex-1 {
    flex: 1;
}

.template-editor-group {
    display: flex;
    flex-direction: column;
}

.template-wysiwyg .wysiwyg-editor-surface,
.template-wysiwyg .wysiwyg-raw-textarea {
    min-height: 180px;
    max-height: 320px;
}

.templates-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    border-top: 1px solid var(--ide-border);
    margin-top: auto;
}
.templates-footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ═══════════════════════════════════════════════════════
   18. INSERT LINK MODAL
   ═══════════════════════════════════════════════════════ */
.link-modal-card {
    max-width: 440px;
    width: 100%;
}
.link-modal-card .modal-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ═══════════════════════════════════════════════════════
   19. ATTACHMENTS TRAY & CHIPS
   ═══════════════════════════════════════════════════════ */
.attachments-tray {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: var(--ide-bg-sidebar);
    border-top: 1px solid var(--ide-border);
    max-height: 120px;
    overflow-y: auto;
}
.attachment-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: var(--ide-bg-active);
    border: 1px solid var(--ide-border-focus);
    border-radius: var(--radius-full);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--color-text-bright);
}
.attachment-chip svg {
    width: 12px;
    height: 12px;
    color: var(--color-accent);
    flex-shrink: 0;
}
.attachment-chip-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.attachment-chip-size {
    font-size: 10px;
    color: var(--color-text-dim);
}
.attachment-chip-remove {
    background: transparent;
    border: none;
    color: var(--color-text-dim);
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0 2px;
    margin-left: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.1s ease;
}
.attachment-chip-remove:hover {
    color: #ef4444;
}



