  :root {
    --bg: #1A1A1A;
    --bg-2: #242424;
    --bg-sidebar: #141414;
    --surface: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.2);
    --text: #FFFFFF;
    --muted: #A0A0A0;
    --accent: #2776F5;
    --accent-hover: #1A5BCA;
    --grad: linear-gradient(135deg, #2776F5 0%, #1A5BCA 100%);
    --glow: 0 8px 30px rgba(39, 118, 245, 0.3);
    --sidebar-width: 260px;
  }
  
  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body {
    background: var(--bg); color: var(--text); font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased; height: 100%; overflow: hidden;
  }
  button, select, input, textarea { font-family: inherit; color: inherit; background: none; border: none; }
  button { cursor: pointer; outline: none; -webkit-tap-highlight-color: transparent; }

  /* HARDWARE ACCELERATED TEXT-REVEAL INTRO SPLASH SCREEN */
  .splash-screen {
    position: fixed; inset: 0; background: var(--bg-sidebar); z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    transition: opacity 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .splash-logo { font-size: 42px; font-weight: 800; letter-spacing: -0.03em; display: flex; }
  .splash-letter {
    display: inline-block; opacity: 0; transform: translateX(-30px);
    animation: revealLetter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes revealLetter {
    to { opacity: 1; transform: translateX(0); }
  }

  /* AUTHENTICATION OVERLAY SCREEN */
  .auth-overlay {
    position: fixed; inset: 0; background: var(--bg); z-index: 2000;
    display: none; flex-direction: column; align-items: center; justify-content: center;
    transition: opacity 0.4s ease; opacity: 0;
  }
  .auth-card {
    background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 20px;
    padding: 40px; text-align: center; max-width: 420px; width: 90%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  }
  .auth-logo { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
  .serif { font-family: 'Instrument Serif', serif; font-weight: 400; font-style: italic; color: var(--accent); }
  .auth-subtitle { color: var(--muted); font-size: 14px; margin-bottom: 24px; line-height: 1.5; }
  
  /* MANDATORY AGREE GATE CHECKBOX */
  .legal-checkbox-container {
    display: flex; align-items: flex-start; text-align: left; gap: 10px;
    background: rgba(0,0,0,0.15); border: 1px solid var(--border);
    padding: 14px; border-radius: 10px; margin-bottom: 24px; font-size: 13px; color: #E0E0E0; line-height: 1.4;
  }
  .legal-checkbox-container input { margin-top: 2px; transform: scale(1.1); cursor: pointer; }
  .legal-checkbox-container a { color: var(--accent); text-decoration: underline; }

  .google-sign-in-btn {
    width: 100%; padding: 14px; background: #ffffff; color: #1a1a1a; font-weight: 600;
    border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 12px;
    transition: all 0.2s; font-size: 15px;
  }
  .google-sign-in-btn:hover:not(:disabled) { background: #e6e6e6; transform: translateY(-1px); }
  .google-sign-in-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

  /* APPLICATION WINDOW FRAME */
  .app-layout { display: flex; width: 100vw; height: 100vh; position: relative; }

  /* SIDEBAR OVERLAY FOR MOBILE */
  .sidebar-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px); z-index: 90; opacity: 0; transition: opacity 0.3s ease;
  }
  .sidebar-overlay.show { display: block; opacity: 1; }

  /* SIDEBAR GRID */
  .sidebar {
    width: var(--sidebar-width); background: var(--bg-sidebar); border-right: 1px solid var(--border);
    display: flex; flex-direction: column; height: 100%; flex-shrink: 0; z-index: 100;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0; transform: translateX(-20px);
  }
  body.workspace-loaded .sidebar { opacity: 1; transform: translateX(0); }
  .sidebar-header { padding: 24px 20px 18px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
  .sidebar-logo-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; background: rgba(255,255,255,0.03);
    border: 1px solid var(--border); border-radius: 14px; padding: 14px; color: #FFFFFF;
    transition: all 0.3s ease;
  }
  .sidebar-logo-btn:hover { background: rgba(255,255,255,0.06); }
  .sidebar-logo-btn img { width: 34px; height: 34px; border-radius: 10px; }
  .sidebar-logo-btn strong { display: block; font-size: 14px; }
  .sidebar-logo-btn small { display: block; color: var(--muted); font-size: 11px; }
  .sidebar-search-wrap {
    display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--border);
    border-radius: 999px; padding: 10px 14px; color: var(--muted);
  }
  .sidebar-search-wrap svg { flex-shrink: 0; }
  .sidebar-search-wrap input {
    width: 100%; border: none; outline: none; background: transparent; color: var(--text);
    font-size: 13px; padding: 6px 0;
  }
  .sidebar-nav-actions {
    display: grid;
    gap: 10px;
  }
  .sidebar-nav-item {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: rgba(255,255,255,0.03); border: 1px solid transparent; border-radius: 12px;
    color: #E8E8E8; font-size: 13px; font-weight: 600; transition: all 0.2s ease;
  }
  .sidebar-nav-item:hover {
    background: rgba(255,255,255,0.06); border-color: var(--border);
  }
  .chat-history-title {
    padding: 16px 20px 0; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.15em;
  }
  .sidebar-footer {
    padding: 18px 20px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px;
    color: var(--muted);
  }
  .sidebar-footer span:first-child { font-weight: 700; color: #fff; }
  .new-chat-btn {
    width: 100%; padding: 12px; background: var(--surface); border: 1px solid var(--border);
    border-radius: 10px; font-size: 14px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .new-chat-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
  .chat-history-list { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 6px; }
  .history-item {
    width: 100%; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; text-align: left;
    display: flex; align-items: center; justify-content: space-between; color: #E0E0E0; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .history-item:hover, .history-item.active { background: var(--surface); color: #FFFFFF; }
  .history-item.active { font-weight: 600; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--border); }
  .history-item-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
  .delete-history-btn { color: var(--muted); padding: 2px; font-size: 16px; line-height: 1; background: none; border: none; }
  .delete-history-btn:hover { color: #ff7a7a; }

  /* MAIN WORKSPACE */
  .main-stage { flex: 1; display: flex; flex-direction: column; height: 100%; position: relative; background: var(--bg); min-width: 0; }
  .workspace-surface {
    display: flex;
    height: calc(100vh - 72px);
    overflow: hidden;
  }
  .workspace-main-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
      linear-gradient(180deg, rgba(39, 118, 245, 0.02), transparent 12%),
      var(--bg);
  }
  .workspace-side-panel {
    width: 320px;
    background: linear-gradient(180deg, #0f1117, #0a0b0f);
    border-left: 1px solid var(--border);
    display: none;
    flex-direction: column;
    padding: 12px;
    gap: 12px;
  }
  .workspace-side-panel.open { display: flex; }
  .workspace-side-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 6px 12px;
  }
  .workspace-side-header h3 { margin: 0; font-size: 16px; }
  .workspace-kicker {
    margin: 0;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .14em;
  }
  .workspace-side-header button {
    background: transparent;
    border: 0;
    color: var(--muted);
    font-size: 18px;
    cursor: pointer;
  }
  .workspace-panel-block {
    background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 12px;
  }
  .workspace-panel-title {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 10px;
  }
  .branch-list, .file-list-card, .memory-preview {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .workspace-branch-item {
    width: 100%;
    text-align: left;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 12px;
    color: var(--text);
    cursor: pointer;
  }
  .workspace-branch-item span { color: var(--accent); }
  .branch-list div, .file-list-card div {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 12px;
  }
  nav {
    height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px;
    background: rgba(26, 26, 26, 0.65); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); z-index: 50; flex-shrink: 0;
  }
  .logo { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 18px; }
  
  /* ACTION CONTAINER CONTROLS */
  .nav-controls { display: flex; align-items: center; gap: 8px; }
  .logo-btn { display: inline-flex; align-items: center; gap: 10px; border: none; background: transparent; color: inherit; cursor: pointer; font-weight: 700; font-size: 16px; }
  .logo-btn img { width: 30px; height: 30px; border-radius: 10px; }
  .chat-search-bar { width: 100%; }
  .chat-search-bar input {
    width: 100%; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-2);
    color: var(--text); padding: 14px 18px; font-size: 14px; outline: none; transition: border-color 0.2s ease;
  }
  .chat-search-bar input:focus { border-color: var(--accent); }
  .pill-btn {
    background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
    padding: 6px 16px; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .pill-btn:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }

  .nav-logo-btn {
    width: 44px; height: 44px; border: none; border-radius: 14px;
    background: rgba(255,255,255,0.05); display: grid; place-items: center;
    padding: 8px; transition: background 0.2s ease;
  }
  .nav-logo-btn:hover { background: rgba(255,255,255,0.1); }
  .nav-logo-btn img { width: 26px; height: 26px; object-fit: contain; }

  .mobile-menu-btn { display: none; padding: 8px 12px; }

  /* MESSAGES ENGINE */
  .messages-viewport { flex: 1; overflow-y: auto; padding: 40px 24px; display: flex; flex-direction: column; gap: 32px; z-index: 10; }
  .welcome-hero { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; margin: auto 0; }
  .welcome-hero h1 { font-size: 40px; font-weight: 700; margin-bottom: 12px; letter-spacing: -0.02em; }
  .welcome-hero p { color: var(--muted); font-size: 15px; max-width: 440px; line-height: 1.6; }

  /* BUBBLES DESIGN GRID WITH NEW ANIMATIONS */
  .message-row { 
    display: flex; gap: 16px; width: 100%; 
    opacity: 0; transform: translateY(15px);
    animation: messageFadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .message-row:hover { background: rgba(255, 255, 255, 0.02); }
  @keyframes messageFadeIn { to { opacity: 1; transform: translateY(0); } }

  .avatar { width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; font-size: 14px; text-transform: uppercase; }
  .message-row.user .avatar { background: var(--border-strong); color: #fff; }
  .message-row.ai .avatar { background: var(--grad); color: #fff; box-shadow: var(--glow); }
  .message-content { flex: 1; padding-top: 6px; color: #E0E0E0; position: relative; min-width: 0; word-wrap: break-word; }
  
  /* MARKDOWN STYLING CONFIGS */
  .message-content p { margin-bottom: 12px; line-height: 1.6; font-size: 15px; }
  .message-content p:last-child { margin-bottom: 0; }
  .message-content pre { background: #121212; border: 1px solid var(--border); padding: 16px; border-radius: 10px; margin: 12px 0; overflow-x: auto; position: relative; max-width: 100%; }
  .message-content code { font-family: monospace; font-size: 14px; white-space: pre-wrap; word-break: break-all; }
  .message-content pre code { white-space: pre; word-break: normal; }

  /* WEB PREVIEW ACTION LAYERS */
  .sandbox-trigger-btn {
    display: inline-flex; align-items: center; gap: 6px; background: rgba(39, 118, 245, 0.15);
    border: 1px solid var(--accent); color: #FFFFFF; font-size: 12px; font-weight: 600;
    padding: 6px 12px; border-radius: 6px; margin-top: 8px; transition: background 0.2s;
  }
  .sandbox-trigger-btn:hover { background: rgba(39, 118, 245, 0.3); }

  /* RATING & REGEN FEEDBACK COMPONENT */
  .feedback-row { display: flex; gap: 8px; margin-top: 14px; align-items: center; flex-wrap: wrap; }
  .feedback-btn { padding: 4px 8px; border-radius: 4px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,0.02); border: 1px solid var(--border); transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
  .feedback-btn:hover { color: #fff; background: var(--surface); }
  .feedback-btn.active-like { color: #42b883; border-color: #42b883; }
  .feedback-btn.active-dislike { color: #ff7a7a; border-color: #ff7a7a; }
  .regen-btn { color: var(--accent); border-color: rgba(39, 118, 245, 0.3); background: rgba(39, 118, 245, 0.05); }
  .regen-btn:hover { background: rgba(39, 118, 245, 0.15); color: #fff; }

  /* INPUT WRAPPER BLOCK & LAUNCH DOCK */
  .input-panel { padding: 0 24px 24px; background: linear-gradient(180deg, transparent, var(--bg) 30%); z-index: 10; flex-shrink: 0; }
  .prompt-wrap { background: var(--bg-2); border: 1px solid var(--border-strong); border-radius: 16px; padding: 12px; }
  .prompt-inner { background: var(--bg); border-radius: 10px; padding: 12px 16px; display: flex; flex-direction: column; gap: 14px; border: 1px solid var(--border); }
  .prompt-inner textarea { width: 100%; background: none; border: none; color: var(--text); font-size: 16px; resize: none; outline: none; min-height: 44px; line-height: 1.5; }
  .prompt-tools { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .prompt-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .tool-btn {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    color: var(--muted);
  }
  .tool-btn:hover {
    background: rgba(39, 118, 245, 0.08);
    color: var(--text);
    border-color: var(--accent);
  }
  .send-btn { width: 40px; height: 40px; border-radius: 8px; background: var(--accent); display: grid; place-items: center; color: #fff; transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1); flex-shrink: 0; }
  .send-btn:hover:not(:disabled) { transform: scale(1.05); background: var(--accent-hover); }
  .send-btn:disabled { background: var(--surface); color: var(--muted); cursor: not-allowed; }

  /* FILE PREVIEW SYSTEM */
  .file-preview-tray { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
  .preview-chip { display: flex; align-items: center; gap: 6px; background: var(--bg-2); border: 1px solid var(--border-strong); padding: 6px 12px; border-radius: 8px; font-size: 12px; }
  .remove-chip { color: var(--muted); font-weight: bold; margin-left: 4px; }

  /* LEGAL DISCLAIMER FOOTER TEXT */
  .legal-footer-disclaimer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; padding: 0 10px; }
  .legal-footer-disclaimer a { color: var(--accent); text-decoration: underline; }

  /* DRAWER FLYOUT COMPONENT FOR DROPDOWNS & PROFILE CONTROL */
  .settings-panel {
    position: fixed; top: 0; right: 0; bottom: 0; width: 340px; background: var(--bg-sidebar);
    border-left: 1px solid var(--border); z-index: 1500; padding: 32px 24px;
    transform: translateX(100%); transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex; flex-direction: column; gap: 20px; box-shadow: -10px 0 40px rgba(0,0,0,0.5);
    overflow-y: auto; max-width: 100vw;
  }
  .settings-panel.open { transform: translateX(0); }
  .settings-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
  .settings-group { display: flex; flex-direction: column; gap: 8px; }
  .settings-group label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
  .settings-input, .settings-select {
    width: 100%; background: var(--bg-2); border: 1px solid var(--border-strong);
    padding: 10px 12px; border-radius: 8px; font-size: 14px; color: var(--text); outline: none;
  }
  .settings-select option { background: var(--bg-2); padding: 8px; font-size: 13px; }
  .settings-action-btn {
    width: 100%; padding: 12px; border-radius: 8px; font-weight: 600; font-size: 14px; text-align: center; transition: all 0.2s;
  }
  .btn-primary { background: var(--accent); color: #fff; }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-danger { background: rgba(255,122,122,0.1); border: 1px solid rgba(255,122,122,0.3); color: #ff7a7a; margin-top: 10px;}
  .btn-danger:hover { background: rgba(255,122,122,0.2); }
  
  /* WEB INTERACTIVE CODE PREVIEW MODAL OVERLAY */
  .sandbox-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(8px);
    z-index: 4000; display: none; align-items: center; justify-content: center; padding: 20px;
  }
  .sandbox-frame-box {
    width: 100%; height: 100%; background: #ffffff; border-radius: 16px;
    display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 30px 70px rgba(0,0,0,0.6);
  }
  .sandbox-nav {
    background: #1e1e1e; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; color: #fff;
  }
  .sandbox-iframe { width: 100%; flex: 1; border: none; background: #ffffff; }

  .streaming-cursor::after { content: '█'; font-size: 13px; color: var(--accent); margin-left: 4px; animation: blink 0.7s infinite alternate; }
  @keyframes blink { from { opacity: 0; } to { opacity: 1; } }

  /* RESPONSIVE MEDIA QUERIES FOR MOBILE/TABLET */
  @media (max-width: 768px) {
    .sidebar {
      position: fixed;
      left: 0; top: 0; bottom: 0;
      transform: translateX(-100%);
    }
    .sidebar.open {
      transform: translateX(0);
    }
    .sidebar-header { padding-top: 20px; }
    nav { padding: 0 16px; height: 60px; }
    .logo { font-size: 16px; }
    .nav-controls { gap: 6px; }
    .mobile-menu-btn { display: flex; }
    .nav-settings-text { display: none; }
    .pill-btn { padding: 6px 12px; }
    
    .messages-viewport { padding: 20px 16px; gap: 24px; }
    .message-row { gap: 12px; }
    .avatar { width: 30px; height: 30px; font-size: 12px; }
    .welcome-hero h1 { font-size: 28px; }
    .welcome-hero p { font-size: 14px; }
    
    .input-panel { padding: 0 16px 16px; }
    .prompt-wrap { border-radius: 12px; padding: 8px; }
    .prompt-inner { padding: 10px; gap: 10px; }
    .prompt-inner textarea { font-size: 15px; }
    
    .settings-panel { width: 100%; }
    .auth-card { padding: 30px 20px; }
    
    .sandbox-modal { padding: 0; }
    .sandbox-frame-box { border-radius: 0; }
    .sandbox-nav { padding: 12px 16px; font-size: 12px; }
  }

  /* Chat workflow enhancements */
  .memory-insight-row {
    display: flex;
    align-items: center;
    padding: 0 24px 8px;
  }
  .memory-insight-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(39, 118, 245, 0.08);
    border: 1px solid rgba(39, 118, 245, 0.18);
    color: #d9e6ff;
    font-size: 12px;
    font-weight: 600;
    animation: memoryPulse 2.4s ease-in-out infinite;
  }
  .thinking-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #c9c9c9;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
  }
  .thinking-status::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.5);
    animation: thinkingPulse 1.4s infinite ease-in-out;
  }
  .skill-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    padding: 0 24px;
  }
  .skill-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: #111;
    color: #c9c9c9;
    border: 1px solid #232323;
    transition: transform 0.2s ease, background 0.2s ease;
  }
  .skill-chip.active {
    background: #f5f5f5;
    color: #0f0f0f;
    border-color: #f5f5f5;
    transform: translateY(-1px);
  }
  .skill-chip.active::after {
    content: '•';
    color: #2776F5;
    animation: memoryPulse 1.6s infinite;
  }
  .skill-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 12000;
  }
  .skill-modal-card {
    width: min(520px, 92vw);
    background: #121212;
    border: 1px solid #2b2b2b;
    border-radius: 16px;
    padding: 18px;
    color: #fff;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  }
  .skill-modal-card h3 {
    margin: 0 0 8px;
    font-size: 18px;
  }
  .skill-modal-card p {
    margin: 0 0 14px;
    color: #999;
    font-size: 13px;
    line-height: 1.5;
  }
  .skill-option-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }
  .skill-option {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px;
    background: #0d0d0d;
    border: 1px solid #262626;
    border-radius: 10px;
    cursor: pointer;
  }
  .skill-option input { margin-top: 2px; }
  .skill-option strong { display: block; font-size: 12px; }
  .skill-option span { color: #9c9c9c; font-size: 11px; }
  .skill-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }
  .skill-modal-actions button {
    border: 1px solid #333;
    background: #181818;
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
  }
  .skill-modal-actions button.primary {
    background: #fff;
    color: #000;
  }
  .feedback-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.75); display: flex; align-items: center;
    justify-content: center; z-index: 10000; opacity: 0; transition: opacity 0.3s ease;
  }
  .feedback-modal-card {
    background: #161616; color: #fff; padding: 26px; border-radius: 12px;
    width: 90%; max-width: 440px; box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    border: 1px solid #282828; font-family: 'Inter', sans-serif;
  }
  .feedback-modal-card h3 { margin-top: 0; font-size: 19px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
  .feedback-modal-card p { color: #999; font-size: 13px; margin: 8px 0 18px 0; line-height: 1.5; }
  .feedback-modal-card textarea {
    width: 100%; background: #0a0a0a; border: 1px solid #2a2a2a; border-radius: 8px;
    color: #fff; padding: 12px; box-sizing: border-box; resize: none; font-family: inherit; margin-bottom: 16px; font-size: 14px;
  }
  .feedback-modal-card textarea:focus { outline: none; border-color: #555; }
  .feedback-submit-btn {
    background: #fff; color: #000; border: none; padding: 11px 20px;
    border-radius: 6px; font-weight: 600; cursor: pointer; width: 100%; transition: background 0.2s; font-size: 13px;
  }
  .feedback-submit-btn:hover { background: #e5e5e5; }
  .thinking-loader {
    display: inline-flex;
    gap: 6px;
    padding: 14px 18px;
    background: #141414;
    border: 1px solid #222;
    border-radius: 12px;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 4px;
    animation: fadeInLoader 0.3s ease-out forwards;
  }
  .thinking-dot {
    width: 6px;
    height: 6px;
    background-color: #888;
    border-radius: 50%;
    animation: thinkingPulse 1.4s infinite ease-in-out both;
  }
  .thinking-dot:nth-child(1) { animation-delay: -0.32s; }
  .thinking-dot:nth-child(2) { animation-delay: -0.16s; }
  @keyframes thinkingPulse {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.3; }
    40% { transform: scale(1.1); opacity: 1; background-color: #fff; }
  }
  @keyframes fadeInLoader {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
  }
  @keyframes memoryPulse {
    0%, 100% { opacity: 0.78; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-1px); }
  }
  pre {
    position: relative;
    padding-bottom: 42px !important;
  }
  .download-code-btn {
    position: absolute;
    bottom: 10px;
    right: 12px;
    background: #1f1f1f;
    border: 1px solid #333;
    color: #eaeaea;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
  }
  .download-code-btn:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    transform: translateY(-1px);
  }
  .download-code-btn:active {
    transform: translateY(0);
  }

  :root {
  --surface-0: #1A1A1A;
  --surface-1: #242424;
  --surface-2: #2E2E2E;
  --surface-3: #383838;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #FFFFFF;
  --muted: #A0A0A0;
  --accent: #2776F5;
  --accent-hover: #1A5BCA;
  --accent-soft: rgba(39, 118, 245, 0.12);
  --success: #32d583;
  --danger: #ff7a7a;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
body {
  background:
    radial-gradient(circle at top, rgba(39, 118, 245, 0.08), transparent 16%),
    var(--surface-0);
}

.main-stage {
  background: transparent;
}

nav {
  background: rgba(9, 9, 12, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.workspace-surface {
  display: flex;
  height: calc(100vh - 58px);
  overflow: hidden;
}

.workspace-main-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(39, 118, 245, 0.02), transparent 12%),
    var(--surface-0);
}

.workspace-side-panel {
  width: 320px;
  background: linear-gradient(180deg, #0f1117, #0a0b0f);
  border-left: 1px solid var(--border);
  display: none;
  flex-direction: column;
  padding: 12px;
  gap: 12px;
}

.workspace-side-panel.open {
  display: flex;
}

.workspace-side-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 6px 12px;
}

.workspace-side-header h3 {
  margin: 0;
  font-size: 16px;
}

.workspace-kicker {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .14em;
}

.workspace-side-header button {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.workspace-panel-block {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
}

.workspace-panel-title {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin-bottom: 10px;
}

.branch-list, .file-list-card, .memory-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-branch-item {
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.workspace-branch-item span {
  color: var(--accent);
}

.branch-list div, .file-list-card div {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.messages-viewport {
  padding: 18px 18px 12px;
}

.message-row {
  padding: 12px 0;
  gap: 12px;
  transition: background .18s ease;
}

.message-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.message-content {
  background: transparent;
  border-radius: 16px;
  padding: 0;
}

.message-row.user .message-content {
  background: linear-gradient(180deg, rgba(39, 118, 245, 0.08), rgba(39, 118, 245, 0.04));
  border: 1px solid var(--border);
  padding: 14px 16px;
}

.message-row.ai .message-content {
  padding: 0 0 0 2px;
}

.message-actions {
  display: flex;
  gap: 6px;
  opacity: 0;
  transition: opacity .15s ease;
  margin-top: 8px;
}

.message-row:hover .message-actions {
  opacity: 1;
}

.message-actions button {
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 9px;
  font-size: 11px;
  cursor: pointer;
  transition: all .15s ease;
}

.message-actions button:hover {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.input-panel {
  padding: 12px 18px 18px;
}

.prompt-wrap {
  max-width: 980px;
  margin: 0 auto;
}

.prompt-inner {
  background: linear-gradient(180deg, rgba(18, 21, 27, 0.98), rgba(9, 11, 17, 0.98));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: 18px;
}

.prompt-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
}

.file-preview-tray {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 10px;
}

.preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
}

.preview-chip .remove-chip {
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.preview-chip .remove-chip:hover {
  color: var(--text);
}

.tool-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
}

.tool-btn:hover {
  background: var(--accent-soft);
  color: var(--text);
  border-color: var(--accent);
}

.voice-active {
  background: rgba(255, 122, 122, 0.12) !important;
  color: #fff !important;
  border-color: var(--danger) !important;
}

.code-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 8px;
}

.code-toolbar button {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
}

.message-content pre {
  background: #10151d;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.message-content pre code {
  display: block;
  min-width: fit-content;
  font-size: 13px;
}

@media (max-width: 980px) {
  .workspace-side-panel {
    position: fixed;
    right: 0;
    top: 58px;
    bottom: 0;
    z-index: 90;
    width: min(92vw, 360px);
  }
}

  