@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&family=Fira+Code:wght@400;500;600&display=swap');

/* ==========================================================================
   UGO AI — COMMERCIAL STANDALONE WEB APPLICATION STYLES (ugos.ai)
   ========================================================================== */

:root {
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-title: 'Space Grotesk', sans-serif;
  --font-code: 'Fira Code', monospace;

  /* Color Palette - Dark Enterprise Theme */
  --bg-dark-base: #0B0E14;
  --bg-dark-sidebar: #0F141C;
  --bg-dark-card: #161D2A;
  --bg-dark-input: #1C2536;
  --bg-dark-hover: #222C3E;

  --accent-orange: #FF6B00;
  --accent-orange-glow: rgba(255, 107, 0, 0.35);
  --accent-cyan: #00F0FF;
  --accent-purple: #A855F7;
  --accent-green: #10B981;
  --accent-gold: #F59E0B;

  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-tertiary: #6B7280;

  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(255, 107, 0, 0.5);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.6);
  --shadow-orange: 0 0 25px rgba(255, 107, 0, 0.25);
}

/* Light Theme Variables */
body.theme-light {
  --bg-dark-base: #F8FAFC;
  --bg-dark-sidebar: #F1F5F9;
  --bg-dark-card: #FFFFFF;
  --bg-dark-input: #E2E8F0;
  --bg-dark-hover: #E2E8F0;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-tertiary: #94A3B8;

  --border-light: rgba(0, 0, 0, 0.08);
  --border-focus: rgba(255, 107, 0, 0.6);
}

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-sans);
  background-color: var(--bg-dark-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* APP FULLSCREEN CONTAINER */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR STYLES */
.sidebar {
  width: 280px;
  height: 100%;
  background-color: var(--bg-dark-sidebar);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s ease, margin-left 0.3s ease;
  z-index: 100;
}

.sidebar.collapsed {
  margin-left: -280px;
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-orange), #FF8F00);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  font-size: 1.2rem;
  box-shadow: var(--shadow-orange);
}

.brand-main {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.15rem;

  display: block;
}

.brand-ai {
  color: var(--accent-orange);
}

.brand-by {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  display: block;
}

/* New Chat Button */
.sidebar-action {
  padding: 16px 20px 12px;
}

.btn-new-chat {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-orange), #E65100);
  color: #FFF;
  border: none;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(255, 107, 0, 0.3);
  transition: all 0.2s ease;
}

.btn-new-chat:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.45);
}

/* Search Input */
.sidebar-search {
  padding: 0 20px 12px;
  position: relative;
}

.sidebar-search input {
  width: 100%;
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 36px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}

.sidebar-search input:focus {
  border-color: var(--border-focus);
}

.search-icon {
  position: absolute;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font-size: 0.8rem;
}

/* Chat History Stream */
.sidebar-chats-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
}

.chat-group-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding: 8px 8px 4px;
  letter-spacing: 0.5px;
}

.chats-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.chat-item-btn:hover {
  background: var(--bg-dark-hover);
  color: var(--text-primary);
}

.chat-item-btn.active {
  background: rgba(255, 107, 0, 0.12);
  color: var(--accent-orange);
  font-weight: 600;
}

.chat-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.chat-item-actions {
  display: opacity;
  opacity: 0;
  transition: opacity 0.2s;
}

.chat-item-btn:hover .chat-item-actions {
  opacity: 1;
}

.chat-action-icon {
  color: var(--text-tertiary);
  font-size: 0.75rem;
  padding: 4px;
}

.chat-action-icon:hover {
  color: var(--accent-orange);
}

/* Nav Modules */
.sidebar-nav-modules {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-module-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.nav-module-btn:hover, .nav-module-btn.active {
  background: var(--bg-dark-hover);
  color: var(--accent-orange);
}

/* User Profile Footer */
.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  background: rgba(0, 0, 0, 0.2);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-orange);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.user-details {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-badge {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  display: block;
}

/* MAIN WORKSPACE */
.main-workspace {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  background-color: var(--bg-dark-base);
}

/* WORKSPACE HEADER */
.workspace-header {
  height: 60px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  z-index: 50;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn-ghost {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.icon-btn-ghost:hover {
  background: var(--bg-dark-hover);
  color: var(--text-primary);
}

/* Model Selector Dropdown */
.model-selector-wrapper {
  position: relative;
}

.model-select-btn {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.model-select-btn:hover {
  border-color: var(--border-focus);
}

.model-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 200;
}

.model-selector-wrapper.open .model-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.model-option {
  width: 100%;
  background: none;
  border: none;
  padding: 12px;
  border-radius: var(--radius-md);
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.model-option:hover, .model-option.active {
  background: var(--bg-dark-hover);
}

.model-opt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.model-opt-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.model-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: rgba(255, 107, 0, 0.15);
  color: var(--accent-orange);
  font-weight: 600;
}

.model-badge.pro {
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
}

.model-opt-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: block;
}

/* Language Selector */
.lang-selector-wrapper {
  position: relative;
}

.icon-btn-text {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 6px;
  min-width: 150px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 200;
}

.lang-selector-wrapper.open .lang-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-opt {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 10px;
  text-align: left;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
}

.lang-opt:hover, .lang-opt.active {
  background: var(--bg-dark-hover);
  color: var(--accent-orange);
}

.btn-usso {
  background: linear-gradient(135deg, var(--accent-orange), #D84315);
  color: #FFF;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(255, 107, 0, 0.25);
}

/* WORKSPACE VIEWS */
.workspace-view {
  display: none;
  flex: 1;
  height: calc(100% - 60px);
  overflow: hidden;
  position: relative;
}

.workspace-view.active {
  display: flex;
  flex-direction: column;
}

/* VIEW 1: CHAT CANVAS & WELCOME CARDS */
.chat-welcome-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
}

.chat-welcome-container.hidden {
  display: none;
}

.welcome-hero {
  text-align: center;
  margin-bottom: 40px;
}

.welcome-orb {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-orange) 0%, rgba(255, 107, 0, 0.4) 70%, transparent 100%);
  box-shadow: 0 0 40px var(--accent-orange);
  color: #FFF;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  animation: floatOrb 4s ease-in-out infinite;
}

@keyframes floatOrb {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

.welcome-title {
  font-family: var(--font-title);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.welcome-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

.prompt-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  width: 100%;
}

.prompt-card {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.25s ease;
}

.prompt-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.icon-orange { background: rgba(255, 107, 0, 0.15); color: var(--accent-orange); }
.icon-purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); }
.icon-cyan { background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); }
.icon-green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }

.card-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.card-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* CHAT THREAD MESSAGES AREA */
.chat-thread-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.chat-thread-container.hidden {
  display: none;
}

.messages-stream {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 20px;
}

.message-row {
  display: flex;
  gap: 16px;
  width: 100%;
}

.msg-user-row {
  justify-content: flex-end;
}

.msg-avatar-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  flex-shrink: 0;
  font-size: 0.95rem;
}

.msg-ugo-row .msg-avatar-badge {
  background: var(--accent-orange);
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.4);
}

.msg-user-row .msg-avatar-badge {
  background: var(--accent-cyan);
  order: 2;
}

.msg-user-row .msg-body {
  align-items: flex-end;
}

.msg-user-row .msg-footer-bar {
  justify-content: flex-end;
}

.msg-body {
  max-width: 82%;
  display: flex;
  flex-direction: column;
}

.msg-bubble {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  font-size: 0.98rem;
  color: var(--text-primary);
  line-height: 1.6;
}

.msg-user-row .msg-bubble {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.25);
  border-top-right-radius: 4px;
}

.msg-ugo-row .msg-bubble {
  border-top-left-radius: 4px;
}

/* Rich Markdown Code Blocks */
.msg-bubble pre {
  background: #080A0E;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px;
  margin: 12px 0;
  overflow-x: auto;
  font-family: var(--font-code);
  font-size: 0.88rem;
  position: relative;
}

.msg-bubble code {
  font-family: var(--font-code);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.88rem;
}

.msg-bubble pre code {
  background: none;
  padding: 0;
}

.code-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  margin: -14px -14px 10px -14px;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-code);
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.copy-code-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.copy-code-btn:hover {
  color: var(--accent-orange);
}

.msg-footer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.msg-action-btn {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.8rem;
}

.msg-action-btn:hover {
  color: var(--accent-orange);
}

/* TYPING BAR */
.typing-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 8px;
  width: 100%;
}

.typing-bar.hidden { display: none; }

.typing-dots .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-orange);
  animation: typingGlow 1.4s infinite ease-in-out;
}

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

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

.typing-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* FLOATING BOTTOM INPUT DOCK */
.input-dock-wrapper {
  padding: 12px 24px 20px;
  max-width: 860px;
  margin: 0 auto;
  width: 100%;
}

.input-dock {
  background: var(--bg-dark-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 8px 12px 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.2s ease;
}

.input-dock:focus-within {
  border-color: var(--border-focus);
}

.input-dock textarea {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.98rem;
  resize: none;
  max-height: 140px;
  min-height: 24px;
  line-height: 1.4;
}

.dock-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all 0.2s ease;
}

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

.dock-btn.send-btn {
  background: var(--accent-orange);
  color: #FFF;
  box-shadow: 0 0 12px rgba(255, 107, 0, 0.4);
}

.dock-btn.send-btn:hover {
  transform: scale(1.05);
}

.input-disclaimer {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 8px;
}

/* OTHER MODULE VIEWS */
.view-header {
  padding: 32px 32px 16px;
  border-bottom: 1px solid var(--border-light);
}

.view-header h2 { font-family: var(--font-title); font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; }
.view-header p { color: var(--text-secondary); font-size: 0.95rem; }

/* LIVE VISION MODULE */
.live-workspace-container {
  flex: 1;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.live-viewport-box {
  flex: 1;
  background: #000;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.live-placeholder-screen { text-align: center; color: var(--text-secondary); }
.camera-icon-glow { font-size: 3.5rem; color: var(--accent-cyan); margin-bottom: 16px; }

.hud-scanner-line {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  box-shadow: 0 0 15px var(--accent-cyan);
  animation: scan 3s ease-in-out infinite;
}

@keyframes scan { 0% { top: 0; } 50% { top: 98%; } 100% { top: 0; } }

.hud-box { position: absolute; border: 2px solid var(--accent-cyan); border-radius: 6px; background: rgba(0, 240, 255, 0.1); }
.box-a { top: 20%; left: 25%; width: 160px; height: 120px; }
.box-b { top: 50%; left: 60%; width: 110px; height: 110px; border-color: var(--accent-orange); }

.hud-box-tag { position: absolute; top: -24px; left: 0; background: var(--bg-dark-base); color: #FFF; font-family: var(--font-code); font-size: 0.7rem; padding: 2px 6px; border-radius: 4px; }

.hud-status-chip {
  position: absolute; bottom: 16px; left: 16px;
  background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(8px);
  padding: 6px 14px; border-radius: var(--radius-full);
  font-family: var(--font-code); font-size: 0.75rem; color: var(--accent-cyan);
}

.live-actions-bar { display: flex; justify-content: center; gap: 16px; }

/* MEMORY & TROPHIES MODULE */
.memory-workspace-grid {
  flex: 1; padding: 24px 32px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  overflow-y: auto;
}

.memory-card-panel {
  background: var(--bg-dark-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-lg); padding: 24px;
}

.memory-card-panel h3 { font-size: 1.1rem; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; }

.memory-items-container { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.memory-item-row { display: flex; align-items: center; justify-content: space-between; padding: 12px; background: var(--bg-dark-input); border-radius: var(--radius-md); }

.memory-add-form { display: flex; gap: 10px; }
.memory-add-form input { flex: 1; background: var(--bg-dark-input); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 10px 14px; color: var(--text-primary); }

.trophies-container { display: flex; flex-direction: column; gap: 14px; }
.trophy-item { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: var(--radius-md); background: var(--bg-dark-input); border: 1px solid var(--border-light); }
.trophy-item.unlocked { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.08); }
.trophy-item.locked { opacity: 0.5; }

.trophy-icon { font-size: 1.5rem; color: var(--accent-gold); }
.trophy-name { font-weight: 700; font-size: 0.9rem; }
.trophy-desc { font-size: 0.78rem; color: var(--text-secondary); }

/* NOTES MODULE */
.notes-workspace-container { flex: 1; padding: 24px 32px; overflow-y: auto; }
.create-note-box { display: flex; flex-direction: column; gap: 12px; background: var(--bg-dark-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 28px; }
.create-note-box input, .create-note-box textarea { background: var(--bg-dark-input); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 12px; color: var(--text-primary); font-family: var(--font-sans); }

.notes-grid-display { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.note-item-card { background: var(--bg-dark-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 18px; }

/* SETTINGS MODULE */
.settings-workspace-list { flex: 1; padding: 24px 32px; max-width: 760px; display: flex; flex-direction: column; gap: 20px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; background: var(--bg-dark-card); border: 1px solid var(--border-light); border-radius: var(--radius-lg); padding: 20px; }
.setting-title { font-weight: 700; font-size: 0.95rem; }
.setting-subtitle { font-size: 0.8rem; color: var(--text-secondary); }

.select-field, .input-field { background: var(--bg-dark-input); border: 1px solid var(--border-light); color: var(--text-primary); padding: 8px 14px; border-radius: var(--radius-md); outline: none; }

/* MODALS */
.modal-backdrop { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0,0,0,0.8); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; z-index: 5000; }
.modal-backdrop.hidden { display: none; }
.modal-box { background: var(--bg-dark-card); border: 1px solid var(--border-light); border-radius: var(--radius-xl); width: 100%; max-width: 440px; padding: 28px; box-shadow: var(--shadow-lg); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-title-text { font-family: var(--font-title); font-size: 1.2rem; font-weight: 700; }
.input-group { margin-top: 14px; }
.input-group label { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
.input-group input { width: 100%; background: var(--bg-dark-input); border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 10px 14px; color: var(--text-primary); }
.modal-foot { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* EXPORT DROPDOWN MENU */
.export-selector-wrapper { position: relative; }
.export-dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--bg-dark-card); border: 1px solid var(--border-light);
  border-radius: var(--radius-md); padding: 6px; min-width: 200px;
  box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden;
  transform: translateY(-8px); transition: all 0.2s ease; z-index: 200;
}
.export-selector-wrapper.open .export-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.export-opt {
  width: 100%; background: none; border: none; color: var(--text-secondary);
  padding: 8px 12px; text-align: left; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.85rem; display: flex; align-items: center; gap: 8px;
}
.export-opt:hover { background: var(--bg-dark-hover); color: var(--text-primary); }

/* CLOUD SYNC BADGES */
.badge-status-offline { color: var(--text-tertiary); font-weight: 600; }
.badge-status-online { color: var(--accent-green); font-weight: 600; }

/* LIVE VOICE INTERACTIVE FULLSCREEN SCREEN */
.live-voice-screen {
  position: relative; width: 100%; height: 100%;
  background: radial-gradient(circle at center, #111827 0%, #05070A 100%);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 40px 24px; box-sizing: border-box; overflow: hidden;
}
.live-voice-close-btn {
  position: absolute; top: 24px; right: 24px;
  background: rgba(255,255,255,0.08); border: none; color: #FFF;
  width: 44px; height: 44px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
}
.live-voice-status-bar { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; color: var(--accent-cyan); font-weight: 500; }
.live-status-dot.pulse {
  width: 10px; height: 10px; border-radius: 50%; background: var(--accent-cyan);
  box-shadow: 0 0 12px var(--accent-cyan); animation: pulseDot 1.5s infinite ease-in-out;
}
@keyframes pulseDot { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.3); } }

.visualizer-container {
  position: relative; width: 320px; height: 320px;
  display: flex; align-items: center; justify-content: center;
}
#live-audio-canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; }
.visualizer-center-orb {
  width: 120px; height: 120px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple));
  display: flex; align-items: center; justify-content: center; color: #FFF;
  font-size: 2.5rem; box-shadow: 0 0 50px var(--accent-orange-glow);
  z-index: 10; transition: transform 0.1s ease;
}

.live-transcript-box {
  width: 100%; max-width: 600px; max-height: 120px; overflow-y: auto;
  text-align: center; font-size: 1.05rem; color: var(--text-primary);
  line-height: 1.5; background: rgba(255,255,255,0.03); padding: 16px;
  border-radius: var(--radius-lg); border: 1px solid var(--border-light);
}
.live-transcript-box .placeholder { color: var(--text-tertiary); font-size: 0.9rem; }

.live-controls-bar { display: flex; align-items: center; gap: 24px; }
.live-ctrl-btn {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--bg-dark-card); border: 1px solid var(--border-light);
  color: var(--text-primary); font-size: 1.3rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s ease;
}
.live-ctrl-btn.active { background: rgba(0, 240, 255, 0.15); border-color: var(--accent-cyan); color: var(--accent-cyan); }
.live-ctrl-btn.end-call { background: #EF4444; border: none; color: #FFF; box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }

/* MEDIA LIGHTBOX */
.lightbox-content {
  position: relative; max-width: 90vw; max-height: 85vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
#lightbox-img-element { max-width: 100%; max-height: 75vh; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); object-fit: contain; }
.lightbox-close-btn {
  position: absolute; top: -40px; right: 0; background: none; border: none;
  color: #FFF; font-size: 1.5rem; cursor: pointer;
}
.lightbox-toolbar { margin-top: 16px; display: flex; gap: 12px; }

/* MCP MODAL & SWITCHES */
.modal-box.modal-lg { max-width: 600px; }
.mcp-tools-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.mcp-tool-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px; background: var(--bg-dark-input); border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
}
.mcp-tool-info { display: flex; flex-direction: column; gap: 2px; }
.mcp-tool-name { font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; gap: 8px; }
.mcp-tool-desc { font-size: 0.78rem; color: var(--text-secondary); }

/* TOGGLE SWITCH STYLES */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #374151; transition: .3s; border-radius: 24px;
}
.slider:before {
  position: absolute; content: ""; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background-color: white; transition: .3s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent-orange); }
input:checked + .slider:before { transform: translateX(20px); }

/* SIDEBAR BACKDROP OVERLAY FOR MOBILE */
.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* RESPONSIVE DESIGN */
.mobile-only { display: none; }

@media (max-width: 768px) {
  .mobile-only { display: flex !important; }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1000;
    transform: translateX(-100%);
    margin-left: 0;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.5);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }

  /* WORKSPACE HEADER MOBILE */
  .workspace-header {
    height: 56px;
    padding: 0 10px;
    flex-shrink: 0;
  }

  .header-left, .header-right {
    gap: 6px;
  }

  .model-select-btn {
    padding: 5px 10px;
    font-size: 0.8rem;
    max-width: 145px;
  }

  #selected-model-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 80px;
  }

  .model-dropdown-menu {
    width: 280px;
    left: 0;
  }

  #header-usso-text {
    display: none !important;
  }

  .btn-usso {
    padding: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    justify-content: center;
    font-size: 0.95rem;
    box-shadow: none;
  }

  .icon-btn-text {
    padding: 5px 8px;
    font-size: 0.78rem;
  }

  .icon-btn-ghost {
    width: 34px;
    height: 34px;
  }

  /* WELCOME SCREEN MOBILE */
  .chat-welcome-container {
    padding: 16px 12px;
  }

  .welcome-hero {
    margin-bottom: 24px;
  }

  .welcome-orb {
    width: 56px;
    height: 56px;
    font-size: 1.6rem;
    margin-bottom: 12px;
  }

  .welcome-title {
    font-size: 1.45rem;
  }

  .welcome-subtitle {
    font-size: 0.88rem;
  }

  .prompt-cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .prompt-card {
    padding: 14px;
  }

  /* CHAT THREAD & MESSAGES MOBILE */
  .chat-thread-container {
    padding: 10px 8px 80px;
  }

  .messages-stream {
    gap: 14px;
  }

  .message-row {
    gap: 8px;
  }

  .msg-avatar-badge {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .msg-body {
    max-width: 88%;
  }

  .msg-bubble {
    padding: 10px 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    border-radius: 14px;
  }

  .msg-user-row .msg-bubble {
    border-top-right-radius: 4px;
  }

  .msg-ugo-row .msg-bubble {
    border-top-left-radius: 4px;
  }

  .msg-footer-bar {
    font-size: 0.7rem;
    margin-top: 3px;
  }

  .msg-bubble pre {
    padding: 10px;
    font-size: 0.78rem;
    margin: 8px 0;
    max-width: 100%;
    overflow-x: auto;
  }

  .code-header-bar {
    padding: 4px 8px;
    margin: -10px -10px 8px -10px;
    font-size: 0.7rem;
  }

  /* INPUT DOCK MOBILE */
  .input-dock-wrapper {
    padding: 6px 8px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  .input-dock {
    padding: 6px 8px;
    gap: 6px;
    border-radius: 20px;
  }

  .dock-btn {
    width: 32px;
    height: 32px;
    font-size: 0.9rem;
    flex-shrink: 0;
  }

  .dock-btn.send-btn {
    width: 34px;
    height: 34px;
  }

  .input-dock textarea {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
    padding: 2px 2px;
    max-height: 100px;
  }

  .input-disclaimer {
    font-size: 0.68rem;
    line-height: 1.25;
    margin-top: 4px;
    padding: 0 4px;
  }

  .typing-bar {
    padding: 0 12px 6px;
  }

  /* SUB-MODULE VIEWS MOBILE */
  .view-header {
    padding: 16px 14px 12px;
  }

  .view-header h2 {
    font-size: 1.25rem;
  }

  .view-header p {
    font-size: 0.85rem;
  }

  .live-workspace-container {
    padding: 12px;
    gap: 12px;
  }

  .live-actions-bar {
    flex-direction: column;
    gap: 10px;
  }

  .live-actions-bar .btn {
    width: 100%;
  }

  .memory-workspace-grid {
    grid-template-columns: 1fr;
    padding: 12px;
    gap: 14px;
  }

  .memory-card-panel {
    padding: 16px;
  }

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

  .memory-add-form .btn {
    width: 100%;
  }

  .notes-workspace-container {
    padding: 12px;
  }

  .create-note-box {
    padding: 14px;
    margin-bottom: 16px;
  }

  .notes-grid-display {
    grid-template-columns: 1fr;
  }

  .settings-workspace-list {
    padding: 12px;
    gap: 12px;
  }

  .setting-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
  }

  .setting-row .select-field,
  .setting-row .input-field,
  .setting-row .btn {
    width: 100%;
  }

  .modal-box {
    width: 92%;
    padding: 20px;
    margin: 0 16px;
  }
}

/* ULTRA-SMALL DEVICES (<= 420px) */
@media (max-width: 420px) {
  .workspace-header {
    padding: 0 6px;
  }

  .header-left, .header-right {
    gap: 4px;
  }

  .model-select-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
    max-width: 120px;
  }

  #selected-model-name {
    max-width: 65px;
  }

  .msg-body {
    max-width: 92%;
  }

  .input-dock {
    gap: 4px;
    padding: 4px 6px;
  }

  .dock-btn {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
}

