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

:root {
  --page-bg: #f4f4f5;
  --panel-bg: #ffffff;
  --sidebar-bg: #f9fafb;
  --border: #e4e4e7;
  --border-light: rgba(9, 9, 11, 0.04);
  
  --text-primary: #09090b;
  --text-secondary: #4f4f5f;
  --text-muted: #8c8c9e;
  
  --accent-blue: #2563eb;
  --accent-blue-hover: #1d4ed8;
  --accent-blue-light: rgba(37, 99, 235, 0.06);
  
  --accent-green: #10b981;
  --accent-green-light: rgba(16, 185, 129, 0.08);
  
  --accent-amber: #f59e0b;
  --accent-amber-light: rgba(245, 158, 11, 0.08);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-2xl: 24px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-floating: 0 12px 32px -4px rgba(9, 9, 11, 0.06), 0 4px 12px -2px rgba(9, 9, 11, 0.03);

  --left-rail-width: 320px;
  --right-rail-width: 380px;
  --splitter-width: 1px;
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #e4e4e7;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: #cbd5e1;
}

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

html, body {
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--page-bg);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, textarea, input {
  font-family: inherit;
  outline: none;
}

/* App Shell Layout */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background-color: var(--page-bg);
}

/* TOP HEADER BAR (Resembling macOS native client) */
.window-header {
  height: 48px;
  background-color: var(--panel-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  user-select: none;
  flex-shrink: 0;
  z-index: 100;
}

.window-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

.window-controls .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.window-controls .dot.close { background-color: #ff5f56; }
.window-controls .dot.minimize { background-color: #ffbd2e; }
.window-controls .dot.expand { background-color: #27c93f; }

.window-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
}

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

.terminal-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-secondary);
  background-color: var(--page-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.terminal-status span {
  color: var(--accent-blue);
  font-weight: bold;
}

.pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
  color: var(--text-secondary);
}

.pill.neutral {
  background-color: var(--page-bg);
}

.pill.model-mode {
  color: var(--accent-blue);
  background-color: var(--accent-blue-light);
  border-color: rgba(37, 99, 235, 0.15);
  font-family: 'JetBrains Mono', monospace;
}

/* MAIN WORKSPACE 3-COLUMN LAYOUT */
.workspace {
  display: grid;
  grid-template-columns:
    var(--left-rail-width)
    var(--splitter-width)
    minmax(0, 1fr)
    var(--splitter-width)
    var(--right-rail-width);
  flex: 1;
  height: 100vh !important; /* Occupy full viewport height */
  min-height: 0;             /* Prevent flex container auto-expansion */
  overflow: hidden;
  position: relative;
  background-color: var(--panel-bg);
}

/* Left & Right Rails */
.left-rail, .right-rail {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--sidebar-bg);
  position: relative;
  transition: width 0.2s ease;
}

.left-rail {
  border-right: 1px solid var(--border);
}

.right-rail {
  border-left: 1px solid var(--border);
  background-color: var(--panel-bg);
}

/* COLUMN 1: LEFT RAIL ELEMENTS */
.brand-container {
  height: 48px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-sizing: border-box;
}

.brand-wordmark {
  height: 18px;
  width: auto;
}

.brand-subtext {
  display: none;
}

.rail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Left sidebar navigation group */
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--accent-blue-light);
  color: var(--accent-blue);
  font-weight: 600;
}

.nav-icon {
  font-size: 16px;
}

/* Modern Panel Structure */
.panel {
  display: flex;
  flex-direction: column;
}

.panel-header-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.panel-title-icon {
  font-size: 14px;
}

.panel-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Digital Office Scene Box */
.office-scene-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background-color: #f1f5f9;
  box-shadow: var(--shadow-sm);
}

.office-bg {
  width: 100%;
  height: auto;
  display: block;
  image-rendering: pixelated;
}

/* Workstations */
.workstation {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 5;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.workstation-avatar-wrap {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  transition: all 0.2s ease;
}

.workstation-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.workstation:hover:not(.locked) {
  z-index: 10;
  transform: translate(-50%, -50%) scale(1.12);
}

.workstation:hover:not(.locked) .workstation-avatar-wrap {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
  animation: workstation-float 1.8s ease-in-out infinite;
}

@keyframes workstation-float {
  0% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

/* Active workstation highlight */
.workstation.active {
  z-index: 8;
}

.workstation.active .workstation-avatar-wrap {
  border-color: var(--accent-green);
  outline: 2.5px solid var(--accent-green);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.5);
  animation: workstation-float 1.8s ease-in-out infinite;
}

/* Beacon Ping Ring */
.workstation-ping {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 9px;
  height: 9px;
  background: var(--accent-green);
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  z-index: 12;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.workstation-ping::after {
  content: '';
  position: absolute;
  top: -1.5px;
  left: -1.5px;
  width: 9px;
  height: 9px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: workstation-ping-anim 1.5s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes workstation-ping-anim {
  75%, 100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* Locked workstation */
.workstation.locked {
  cursor: not-allowed;
  opacity: 0.6;
}

.workstation.locked .workstation-avatar-wrap {
  background-color: #e4e4e7;
  border: 1.5px dashed #cbd5e1;
  box-shadow: none;
}

.workstation.locked .locked-icon {
  font-size: 12px;
  color: #94a3b8;
  user-select: none;
}

/* Tooltip overlay */
.workstation-tooltip {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  background: rgba(9, 9, 11, 0.95);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all 0.15s ease-in-out;
  box-shadow: var(--shadow-md);
  z-index: 20;
}

.workstation:hover .workstation-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-8px);
}

/* NPC Characters & Sprite styling */
.npc-character {
  position: absolute;
  width: 20px;
  height: 26px;
  pointer-events: none;
  z-index: 10;
  transition: left 4s linear, top 4s linear;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.npc-sprite {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background-color: #ffffff;
  border: 1px solid var(--border);
  object-fit: cover;
  image-rendering: pixelated;
  z-index: 2;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.1));
  animation: npc-idle 1.5s ease-in-out infinite alternate;
  transition: transform 0.2s ease;
}

.npc-character.walking .npc-sprite {
  animation: npc-walk 0.5s ease-in-out infinite;
}

.npc-shadow {
  width: 10px;
  height: 3px;
  background: rgba(9, 9, 11, 0.1);
  border-radius: 50%;
  margin-top: 1px;
  z-index: 1;
}

/* Speech bubble for random NPC quotes */
.npc-bubble {
  position: absolute;
  bottom: 28px;
  background: #ffffff;
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 9px;
  font-weight: 500;
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px) scale(0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 20;
}

.npc-bubble.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.npc-bubble::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 4px 4px 0;
  border-style: solid;
  border-color: #ffffff transparent;
  display: block;
  width: 0;
}

@keyframes npc-idle {
  0% { transform: translateY(0); }
  100% { transform: translateY(-1.5px); }
}

@keyframes npc-walk {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-2px) rotate(-4deg); }
  75% { transform: translateY(-2px) rotate(4deg); }
}

/* Agent Switcher list keys */
.agent-tabs.vertical-tabs {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tab {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}

.tab:hover:not(.active) {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
}

.tab.active {
  color: var(--text-primary);
  background-color: rgba(9, 9, 11, 0.05);
  border-color: var(--border);
  font-weight: 600;
}

.tab-slot {
  margin-left: auto;
  color: var(--text-muted);
  background-color: rgba(9, 9, 11, 0.06);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: normal;
}

/* Sidebar Projects list */
.stack-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stack-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  font-weight: 500;
  cursor: default;
}

.stack-item:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* Fast Onboarding Guide Card */
.onboarding-orient-card {
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.orientation-steps {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.step-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: bold;
  color: var(--accent-blue);
  background-color: var(--accent-blue-light);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-text {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 10px;
}

/* Left & Right demo progress trackers */
.demo-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.demo-progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  padding: 6px 10px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-weight: 500;
}

.demo-progress-item span {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--accent-blue);
}

.demo-progress-item.done {
  background-color: rgba(9, 9, 11, 0.02);
  color: var(--text-muted);
  border-style: dashed;
}

.demo-progress-item.done span {
  color: var(--text-muted);
}

.demo-progress-item em {
  font-family: 'JetBrains Mono', monospace;
  font-style: normal;
  font-size: 10px;
  font-weight: bold;
}

/* Sidebar Footer & Profile */
.left-rail-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background-color: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--text-primary);
  color: var(--panel-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
  flex-shrink: 0;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rail-toggle-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.rail-toggle-icon-btn:hover {
  background-color: rgba(9, 9, 11, 0.06);
  color: var(--text-primary);
}

/* Splitters for Drag and Resize */
.rail-splitter {
  position: relative;
  width: 1px;
  background-color: var(--border);
  cursor: col-resize;
  z-index: 50;
  align-self: stretch;
  user-select: none;
  transition: background 0.15s ease;
}

.rail-splitter:hover,
body.is-resizing .rail-splitter {
  background-color: var(--accent-blue);
}

.rail-splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -4px;
  right: -4px;
  cursor: col-resize;
}

.chat-splitter {
  position: relative;
  height: 6px;
  background-color: transparent;
  cursor: row-resize;
  z-index: 50;
  margin-top: -3px;
  margin-bottom: -3px;
  flex-shrink: 0;
  width: 100%;
}

.chat-splitter::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  height: 1px;
  background-color: var(--border);
  opacity: 0.8;
  transition: all 0.15s ease;
}

.chat-splitter:hover::after {
  background-color: var(--text-muted);
  height: 2px;
  top: 2px;
}

/* COLUMN 2: CENTER STAGE WORKSPACE */
.center-stage {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--panel-bg);
}

.chat-workbench {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Chat Header actions */
.chat-header {
  height: 48px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  background-color: var(--panel-bg);
}

.chat-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
}

.title-chevron {
  font-size: 9px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

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

.header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
  color: var(--text-secondary);
}

.header-action-btn:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.header-action-btn.primary {
  background-color: var(--text-primary);
  color: var(--panel-bg);
  border-color: var(--text-primary);
}

.header-action-btn.primary:hover {
  background-color: #27272a;
}

.vertical-divider {
  width: 1px;
  height: 14px;
  background-color: var(--border);
  margin: 0 4px;
}

.terminal-inline-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* Chat History message list */
.chat-history {
  flex: 1;
  padding: 28px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background-color: var(--panel-bg);
  scroll-behavior: smooth;
}

/* Welcome Hero Card */
.hero-card {
  width: 100%;
  max-width: 640px;
  margin: 20px auto 40px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero-avatar-wrap {
  margin-bottom: 16px;
}

.hero-agent-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  image-rendering: pixelated;
}

.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--accent-blue);
  background-color: var(--accent-blue-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 600;
  letter-spacing: 0.04em;
  display: inline-block;
  margin-bottom: 8px;
}

.hero-card h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.hero-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-actions button {
  padding: 6px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.hero-actions button:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

/* Chat bubble aesthetics */
.bubble.agent {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.agent-avatar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.agent-mini-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  image-rendering: pixelated;
}

.agent-name-header {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.agent-message-content {
  padding-left: 36px;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.65;
}

.agent-message-content p {
  margin-bottom: 8px;
}

.agent-message-content p:last-child {
  margin-bottom: 0;
}

.agent-message-content ul,
.agent-message-content ol {
  margin: 8px 0;
  padding-left: 20px;
}

.agent-message-content li {
  margin-bottom: 4px;
}

.bubble.user {
  align-self: flex-end;
  max-width: 70%;
  background-color: #ecfdf5;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #064e3b;
  border: 1px solid #a7f3d0;
}

/* Dynamic Tasks flow cards */
.run-card {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding-left: 36px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.run-head {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-blue);
}

.run-step {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.run-step::before {
  content: "→";
  color: var(--text-muted);
}

/* DOUBLE-ROUNDED PILL CHAT INPUT (Bottom compose box) */
.chat-compose-wrap {
  padding: 0 24px 24px;
  background-color: var(--panel-bg);
  flex-shrink: 0;
}

.chat-compose {
  margin: 0 auto;
  width: 100%;
  max-width: 640px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 12px 16px 10px;
  background-color: var(--panel-bg);
  box-shadow: var(--shadow-floating);
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease-in-out;
}

.chat-compose:focus-within {
  border-color: rgba(9, 9, 11, 0.2);
  box-shadow: 0 16px 36px -4px rgba(9, 9, 11, 0.08), 0 4px 16px -2px rgba(9, 9, 11, 0.04);
}

.chat-compose textarea {
  min-height: 40px;
  height: 40px;
  resize: vertical;
  max-height: 350px;
  border: none;
  outline: none;
  font-size: 13px;
  line-height: 1.5;
  background: transparent;
  color: var(--text-primary);
}

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

.compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(9, 9, 11, 0.03);
  padding-top: 8px;
}

.compose-left-actions, .compose-right-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compose-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.compose-btn:hover {
  background-color: rgba(9, 9, 11, 0.05);
  color: var(--text-primary);
}

/* Badge selector pill inside compose footer */
.compose-btn.badge-btn {
  width: auto;
  height: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 8px;
  font-size: 10px;
  font-weight: 600;
  gap: 4px;
  background-color: var(--sidebar-bg);
  color: var(--text-secondary);
}

.compose-btn.badge-btn:hover {
  background-color: rgba(9, 9, 11, 0.06);
  border-color: #cbd5e1;
}

.badge-icon {
  font-size: 10px;
}

.badge-chevron {
  font-size: 8px;
  color: var(--text-muted);
}

/* Token Speed Indicator badge */
.compose-token-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: var(--accent-blue-light);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.indicator-lightning {
  font-size: 9px;
  color: var(--accent-blue);
}

.indicator-text {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent-blue);
}

.compose-voice-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.compose-voice-btn:hover {
  background-color: rgba(9, 9, 11, 0.05);
  color: var(--text-primary);
}

/* Dark Circular Send Button with Upward Arrow */
.send-circle-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--text-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.send-circle-btn svg {
  stroke: #ffffff;
  transition: stroke 0.2s ease;
}

.send-circle-btn:hover:not(:disabled) {
  background-color: #27272a;
  transform: scale(1.06);
}

.send-circle-btn:disabled {
  background-color: var(--border);
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.send-circle-btn:disabled svg {
  stroke: var(--text-muted);
}

/* COLUMN 3: RIGHT RAIL WORKSPACE */
.right-rail-header {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  background-color: var(--panel-bg);
  flex-shrink: 0;
}

.right-rail-tabs {
  display: flex;
  gap: 16px;
  height: 100%;
}

.right-rail-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  height: 100%;
  padding: 0 2px;
  transition: color 0.15s;
}

.right-rail-tab.active {
  color: var(--text-primary);
}

.right-rail-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--text-primary);
}

.right-rail-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.right-rail-close:hover {
  background-color: rgba(9, 9, 11, 0.05);
  color: var(--text-primary);
}

.right-rail .rail-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--sidebar-bg);
}

.right-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px;
}

/* Side Card elements */
.right-rail .panel {
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

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

.muted {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* macOS Widget-style Git Card */
.git-status-card {
  background-color: var(--panel-bg);
}

.widget-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent-blue);
  letter-spacing: 0.04em;
}

.git-info-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.git-info-item {
  display: flex;
  align-items: center;
  font-size: 12px;
  color: var(--text-secondary);
}

.git-icon {
  font-size: 14px;
  margin-right: 8px;
  width: 16px;
  text-align: center;
}

.git-label {
  font-weight: 500;
}

.git-value {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-primary);
  font-weight: 500;
}

.git-value.success-text {
  color: var(--accent-green);
  font-weight: 600;
}

.git-value.link-style {
  color: var(--accent-blue);
  cursor: pointer;
  text-decoration: underline;
}

/* Execution logs & Output cards */
.object-card, .result-card {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--sidebar-bg);
  font-size: 12px;
}

.object-card h3, .result-card h3 {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.object-card p, .result-card p {
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 8px;
}

.object-card ul, .result-card ul {
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.object-card li, .result-card li {
  margin-bottom: 2px;
}

.result-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--accent-blue);
  background-color: var(--accent-blue-light);
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 8px;
}

.artifact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.artifact-list span {
  font-size: 11px;
  background-color: var(--panel-bg);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
}

.result-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.result-actions button {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.result-actions button:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

/* Device grid hardware widgets */
.device-panel {
  background-color: var(--panel-bg);
}

.device-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.device-cell {
  border: 1px solid var(--border);
  background-color: var(--sidebar-bg);
  border-radius: var(--radius-md);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.device-cell.wide-cell {
  grid-column: span 2;
}

.device-cell span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cell-strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.cell-strong.text-success {
  color: var(--accent-green);
}

/* Context tree files section */
.context-panel {
  background-color: var(--panel-bg);
}

.context-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.context-item {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 6px 10px;
  background-color: var(--sidebar-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-blue);
  font-weight: 500;
}

.file-tree-panel {
  background-color: var(--panel-bg);
}

.file-search-wrap {
  margin: 8px 0 12px;
}

.file-search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 12px;
  background-color: var(--sidebar-bg);
  transition: all 0.15s;
}

.file-search-input:focus {
  background-color: var(--panel-bg);
  border-color: var(--text-primary);
}

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

.file-tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}

.file-tree-item:hover {
  background-color: rgba(9, 9, 11, 0.04);
}

.file-tree-item.folder {
  font-weight: 600;
  color: var(--text-primary);
}

.file-tree-item.file {
  color: var(--text-secondary);
  margin-left: 12px;
  font-weight: 500;
}

.file-tree-item.file.pptx {
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
}

.file-icon {
  font-size: 14px;
}

.file-name {
  flex: 1;
}

.file-download-badge {
  font-size: 10px;
  color: var(--text-muted);
  padding: 1px 6px;
  background-color: var(--sidebar-bg);
  border-radius: 4px;
  font-weight: bold;
}

/* Quick action suggestions */
.quick-actions-panel {
  background-color: var(--panel-bg);
}

.quick-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.quick-actions button {
  width: 100%;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.quick-actions button:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

/* HARDWARE KEY BOOT SCREEN OVERLAY */
.boot-screen {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  background-color: rgba(244, 244, 245, 0.8);
  backdrop-filter: blur(12px);
  transition: opacity 0.3s ease;
}

.boot-screen.hidden {
  display: none;
}

.boot-card {
  width: min(480px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background-color: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-lg);
  animation: boot-rise 0.4s ease-out;
}

.boot-decor {
  width: 40px;
  height: 4px;
  background-color: var(--accent-blue);
  border-radius: var(--radius-full);
}

.boot-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: bold;
  color: var(--accent-blue);
  letter-spacing: 0.08em;
}

.boot-wordmark {
  height: 38px;
  width: auto;
  align-self: flex-start;
}

.boot-console {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--sidebar-bg);
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
}

.boot-line::before {
  content: "> ";
  color: var(--text-muted);
}

.boot-line {
  opacity: 0;
  transform: translateY(4px);
  animation: boot-line-in 0.3s ease-out forwards;
}

.boot-line:nth-child(1) { animation-delay: 0.08s; }
.boot-line:nth-child(2) { animation-delay: 0.18s; }
.boot-line:nth-child(3) { animation-delay: 0.28s; }
.boot-line:nth-child(4) { animation-delay: 0.38s; }

.boot-line.ready {
  color: var(--accent-green);
  font-weight: 600;
}

.boot-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.boot-btn {
  flex: 1;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.boot-btn.primary {
  background-color: var(--text-primary);
  color: var(--panel-bg);
}

.boot-btn.primary:hover {
  background-color: #27272a;
}

.boot-btn.secondary {
  border-color: var(--border);
  background-color: var(--panel-bg);
  color: var(--text-secondary);
}

.boot-btn.secondary:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
  border-color: #cbd5e1;
}

@keyframes boot-rise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes boot-line-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ONBOARDING MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background-color: rgba(9, 9, 11, 0.25);
  backdrop-filter: blur(8px);
  z-index: 1000;
}

.modal-backdrop.hidden {
  display: none;
}

.modal {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  background-color: var(--panel-bg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-indicator {
  width: 40px;
  height: 4px;
  background-color: var(--accent-blue);
  border-radius: var(--radius-full);
}

.modal-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: bold;
  color: var(--accent-blue);
  letter-spacing: 0.08em;
}

.modal h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.guide-list {
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.8;
  font-weight: 500;
}

.modal-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  background-color: var(--text-primary);
  color: var(--panel-bg);
  border: none;
  cursor: pointer;
  transition: background 0.15s;
  margin-top: 8px;
}

.modal-btn:hover {
  background-color: #27272a;
}

/* Collapsed rail behaviors */
body.left-collapsed {
  --left-rail-width: 60px;
}

body.right-collapsed {
  --right-rail-width: 0px;
}

body.left-collapsed .left-rail {
  width: 60px;
}

body.right-collapsed .right-rail {
  width: 0px;
  border-left: none;
}

body.left-collapsed .brand-container {
  height: 48px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

body.left-collapsed .brand-wordmark {
  content: url('assets/tokenaway-mark.svg');
  width: 24px;
  height: 24px;
}

body.left-collapsed .brand-subtext {
  display: none;
}

body.left-collapsed .rail-body,
body.left-collapsed .office-space-section,
body.left-collapsed .left-rail-footer .user-profile {
  display: none !important;
}

body.left-collapsed .left-rail-footer {
  justify-content: center;
}

body.right-collapsed .right-rail-header,
body.right-collapsed .right-rail .rail-body {
  display: none !important;
}

/* Collapsible layout animation */
.workspace-live .hero-card {
  animation: workspace-rise 0.4s ease-out both;
}

.workspace-live .left-rail {
  animation: workspace-fade-in 0.4s ease-out both;
}

.workspace-live .right-rail {
  animation: workspace-fade-in 0.4s ease-out both;
}

@keyframes workspace-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes workspace-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Agent switcher visual animation pulse */
.agent-switched .chat-workbench {
  animation: agent-pulse 0.35s ease-out;
}

@keyframes agent-pulse {
  0% { opacity: 0.85; transform: scale(0.995); }
  100% { opacity: 1; transform: scale(1); }
}

/* Thinking bubble indicator */
.thinking-bubble {
  animation: fadeIn 0.2s ease;
}

.thinking-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.thinking-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.thinking-dots span {
  width: 4px;
  height: 4px;
  background-color: var(--text-muted);
  border-radius: 50%;
  opacity: 0.4;
  display: inline-block;
  animation: thinking-blink 1.4s infinite both;
}

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

@keyframes thinking-blink {
  0% { opacity: 0.4; transform: scale(1); }
  20% { opacity: 1; transform: scale(1.25); }
  100% { opacity: 0.4; transform: scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* RESPONSIVE MOBILE PANES */
.mobile-nav-tabs {
  display: none;
}

@media (max-width: 1280px) {
  :root {
    --left-rail-width: 280px;
    --right-rail-width: 320px;
  }

  .chat-header {
    padding: 0 18px;
  }

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

  .header-action-btn {
    padding: 5px 10px;
  }

  .chat-history {
    padding: 24px 20px;
  }

  .chat-compose-wrap {
    padding: 0 20px 20px;
  }

  .bubble.user {
    max-width: 82%;
  }
}

@media (max-width: 1024px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    width: 100%;
    min-height: 100dvh;
  }

  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }
  
  .window-header {
    height: 44px;
    padding: 0 16px;
  }
  
  .window-title, .window-actions {
    display: none;
  }
  
  .workspace {
    grid-template-columns: 1fr !important;
    grid-template-rows: 44px minmax(0, 1fr);
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    gap: 0;
    overflow: hidden;
  }
  
  .mobile-nav-tabs {
    display: flex;
    grid-column: 1;
    grid-row: 1;
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border);
    padding: 8px 12px;
    gap: 8px;
    z-index: 100;
    height: 44px;
    align-items: center;
    box-shadow: var(--shadow-sm);
  }
  
  .mobile-nav-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background-color: transparent;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s ease;
    white-space: nowrap;
    height: 28px;
  }
  
  .mobile-nav-tab.active {
    background-color: var(--accent-blue-light);
    color: var(--accent-blue);
    border-color: rgba(37, 99, 235, 0.12);
  }
  
  .rail-splitter {
    display: none !important;
  }
  
  .left-rail, .right-rail, .center-stage {
    display: none !important;
    grid-column: 1 !important;
    grid-row: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    align-self: stretch !important;
    flex: 1 !important;
    border: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .workspace[data-active-pane="left-rail"] .left-rail {
    display: flex !important;
    overflow: hidden !important;
  }

  .workspace[data-active-pane="left-rail"] .left-rail .rail-body {
    flex: 1 1 auto;
    height: 0;
    min-height: 0;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .workspace[data-active-pane="left-rail"] .left-rail .brand-container,
  .workspace[data-active-pane="left-rail"] .left-rail .left-rail-footer {
    flex-shrink: 0;
  }
  
  /* Select pane visibility dynamic switching */
  .workspace[data-active-pane="center-stage"] .center-stage {
    display: flex !important;
    overflow: hidden !important;
    touch-action: pan-y;
  }
  .workspace[data-active-pane="right-rail"] .right-rail {
    display: flex !important;
  }
  
  .chat-workbench {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .chat-header {
    height: 44px;
    min-height: 44px;
    padding: 6px 12px;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
  }

  .chat-title-wrap {
    min-width: 0;
    flex: 1 1 auto;
    font-size: 12px;
  }

  .chat-header-actions {
    width: auto;
    flex: 0 0 auto;
    overflow-x: visible;
    padding-bottom: 0;
    flex-wrap: nowrap;
  }

  .chat-header-actions::-webkit-scrollbar {
    display: none;
  }

  .header-action-btn,
  .terminal-inline-status,
  .vertical-divider {
    flex-shrink: 0;
  }

  .header-action-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
  }

  .header-action-btn .btn-text,
  .terminal-inline-status,
  .vertical-divider {
    display: none;
  }

  .chat-history {
    padding: 20px 16px;
    gap: 20px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  .hero-card,
  .bubble.agent,
  .run-card,
  .chat-compose {
    max-width: 100%;
  }

  .hero-card {
    margin: 8px 0 20px;
  }

  .agent-message-content,
  .run-card {
    padding-left: 0;
  }

  .bubble.user {
    max-width: min(100%, 560px);
  }
  
  .chat-compose-wrap {
    padding: 0 16px 16px;
  }

  .chat-compose textarea {
    font-size: 16px;
  }

  .compose-footer {
    flex-wrap: wrap;
    gap: 8px;
  }

  .compose-right-actions {
    margin-left: auto;
  }

  .left-rail .rail-body,
  .right-rail .rail-body {
    padding: 14px 16px;
    gap: 16px;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
  }

  .office-scene-container {
    overflow-x: auto;
  }
}

@media (max-width: 640px) {
  .window-header {
    padding: 0 12px;
  }

  .mobile-nav-tabs {
    padding: 8px 10px;
    gap: 6px;
  }

  .mobile-nav-tab {
    padding: 6px 8px;
    font-size: 10px;
  }

  .chat-header {
    padding: 10px 12px;
  }

  .chat-title-wrap {
    font-size: 13px;
  }

  .header-action-btn {
    padding: 5px 9px;
    font-size: 10px;
  }

  .chat-history {
    padding: 16px 12px;
    gap: 16px;
  }

  .hero-card h2 {
    font-size: 18px;
  }

  .hero-card p,
  .agent-message-content,
  .bubble.user {
    font-size: 12px;
  }

  .hero-actions {
    width: 100%;
  }

  .hero-actions button {
    flex: 1 1 calc(50% - 4px);
    justify-content: center;
  }

  .chat-compose-wrap {
    padding: 0 12px 12px;
  }

  .chat-compose {
    border-radius: 16px;
    padding: 10px 12px 9px;
  }

  .chat-compose textarea {
    min-height: 72px;
    height: 72px;
  }

  .compose-footer {
    align-items: flex-start;
  }

  .compose-right-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .left-rail .rail-body,
  .right-rail .rail-body {
    padding: 12px;
  }
}

/* Accordion Sidebar Panels (Accordion UI) */
details.accordion-panel {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background-color: var(--bg-card, #ffffff);
  margin-bottom: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

details.accordion-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary);
  list-style: none;
  background-color: var(--bg-card, #ffffff);
  border-radius: var(--radius-lg);
  transition: background-color 0.2s ease;
}

details.accordion-panel summary::-webkit-details-marker {
  display: none;
}

details.accordion-panel summary:hover {
  background-color: var(--bg-hover, #f3f4f6);
}

details.accordion-panel .accordion-chevron {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

details.accordion-panel[open] .accordion-chevron {
  transform: rotate(180deg);
}

details.accordion-panel[open] summary {
  border-bottom: 1px solid var(--border);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

details.accordion-panel .accordion-content {
  padding: 12px 16px;
  background-color: var(--bg-card, #ffffff);
}

/* Custom Guide and extension styling inside accordion */
.active-guide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-hover, #f3f4f6);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.active-guide-btn:hover {
  background: var(--accent-blue-light);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

.accordion-nav-group {
  gap: 6px;
}

.accordion-nav-group .nav-item {
  padding: 10px 12px;
  font-size: 12px;
  border: 1px solid transparent;
}

.accordion-nav-group .nav-item:hover {
  border-color: var(--border);
  background-color: var(--bg-hover, #f3f4f6);
}

/* Nested collapsible disclosures styling */
details.nested-details {
  margin-top: 10px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg-hover, #f9fafb);
  overflow: hidden;
  transition: all 0.2s ease;
}

details.nested-details summary.nested-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-secondary);
  background-color: var(--bg-hover, #f9fafb);
  cursor: pointer;
  user-select: none;
  border-radius: var(--radius-md);
}

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

details.nested-details summary.nested-summary:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
}

details.nested-details[open] summary.nested-summary {
  border-bottom: 1px dashed var(--border);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

details.nested-details .nested-chevron {
  margin-left: auto;
  font-size: 8px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

details.nested-details[open] .nested-chevron {
  transform: rotate(180deg);
}

details.nested-details p.onboarding-text {
  padding: 10px 12px;
  margin: 0 !important;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
  background-color: var(--bg-card, #ffffff);
}

/* Right rail accordions layout stability overrides */
/* Update Sidebar Backgrounds to macOS-style Light Gray */
:root {
  --sidebar-bg: #f4f4f5; /* Elegant macOS light gray */
}

.left-rail, .right-rail, .right-rail .rail-body, .right-rail-header {
  background-color: var(--sidebar-bg) !important;
}

/* Eliminate Bento-Box Borders, Shadows, and Margins in Sidebars */
.left-rail .panel,
.left-rail details.accordion-panel,
.right-rail .panel,
.right-rail details.accordion-panel {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

/* Accordion Summary - Flat, Borderless, Compact styling */
.left-rail details.accordion-panel summary,
.right-rail details.accordion-panel summary {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 8px 0 !important;
  color: var(--text-secondary) !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.left-rail details.accordion-panel summary:hover,
.right-rail details.accordion-panel summary:hover {
  color: var(--text-primary) !important;
  background: transparent !important;
}

.left-rail details.accordion-panel[open] summary,
.right-rail details.accordion-panel[open] summary {
  border-bottom: none !important;
}

.left-rail details.accordion-panel .accordion-content,
.right-rail details.accordion-panel .accordion-content {
  background: transparent !important;
  padding: 4px 0 16px 0 !important;
}

/* Flat & Borderless Tab Headers in Right Sidebar */
.right-rail-header {
  border-bottom: 1px solid var(--border) !important;
}

.right-rail-tab {
  border-bottom: 2px solid transparent !important;
}

.right-rail-tab.active {
  color: var(--text-primary) !important;
}

.right-rail-tab.active::after {
  display: none !important; /* Remove original absolute line indicator to make it cleaner */
}

/* Use standard clean bottom border for active tab */
.right-rail-tab.active {
  border-bottom: 2px solid var(--text-primary) !important;
}

/* + New Conversation Pill Button */
.new-conversation-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background-color: var(--panel-bg);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  margin-bottom: 8px;
}

.new-conversation-btn:hover {
  background-color: var(--page-bg);
  border-color: #cbd5e1;
  box-shadow: var(--shadow-md);
}

.new-conversation-btn .btn-plus {
  font-size: 14px;
  font-weight: 700;
}

/* Collapsible Tree Folder Group styling */
.tree-folder-group {
  display: block;
  width: 100%;
}

.tree-folder-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 0;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.tree-folder-summary::-webkit-details-marker {
  display: none;
}

.tree-arrow {
  font-size: 9px;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

details:not([open]) > summary > .tree-arrow {
  transform: rotate(-90deg);
}

.tree-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.tree-folder-content {
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Subfolders in Tree */
.tree-subfolder {
  display: block;
}

.tree-subfolder-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tree-subfolder-summary::-webkit-details-marker {
  display: none;
}

.tree-subfolder-summary:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
}

.folder-icon {
  font-size: 14px;
}

.folder-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-subfolder-content {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 1px;
}

/* Individual File Tree Item */
.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.tree-item:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
}

.tree-item.active {
  background-color: #e4e4e7;
  color: var(--text-primary);
  font-weight: 600;
}

.item-icon {
  font-size: 13px;
}

.item-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-badge {
  font-size: 10px;
  color: var(--text-muted);
  background-color: rgba(9, 9, 11, 0.05);
  padding: 1px 4px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
}

/* Footer Settings Button */
.settings-link-row {
  width: 100%;
  margin-bottom: 8px;
}

.settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: background-color 0.15s ease, color 0.15s ease;
  text-align: left;
}

.settings-btn:hover {
  background-color: rgba(9, 9, 11, 0.04);
  color: var(--text-primary);
}

.settings-icon {
  font-size: 15px;
}

/* Strip padding and borders from custom guide/extension inner elements */
.left-rail .onboarding-orient-card {
  padding: 0 !important;
}

.left-rail .accordion-content {
  padding: 4px 0 16px 0 !important;
}

/* ==========================================================================
   STRICT TYPOGRAPHY & FLAT PREMIUM OVERRIDES
   ========================================================================== */

/* 1. Global Reset: Disable bold weights, use unified clean typography */
*, *::before, *::after {
  font-weight: normal !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Microsoft YaHei", sans-serif !important;
}

/* 2. Strict 3-Tier Font Sizes (Chinese/Western characters) */

/* Tier 1: Large (13px) - Titles, main panels, headers, tabs, accordion summaries */
.window-title,
.brand-subtext,
#chatTitleName,
.panel-title,
.tree-title,
.right-rail-tab,
.modal-header h2,
.modal-kicker,
#heroTitle,
#guideTitle,
.boot-kicker,
.welcome-title,
.left-rail details.accordion-panel summary,
.right-rail details.accordion-panel summary,
.tree-folder-summary,
.settings-btn,
.panel-header-row .panel-title {
  font-size: 13px !important;
}

/* Tier 2: Medium (11px) - Default lists, file nodes, chat bubbles, buttons, inputs, dialog body */
body,
textarea,
input,
button,
.folder-name,
.item-text,
.bubble.agent,
.bubble.user,
.object-card h3,
.result-card h3,
.device-grid .device-cell strong,
.cell-strong,
.new-conversation-btn,
.tree-subfolder-summary,
.tree-item,
.chat-input,
.onboarding-text,
.step-text,
.nav-text,
.hero-body,
.panel-subtext,
.welcome-card p,
.quick-actions button,
.result-actions button,
.accordion-nav-group .nav-item {
  font-size: 11px !important;
}

/* Tier 3: Small (9px) - Badges, sub-metadata, logs, timelines, status indicators */
.terminal-status,
.terminal-inline-status,
.pill,
.item-badge,
.file-download-badge,
.muted,
.widget-kicker,
.git-info-item,
.git-value,
.device-cell span,
.boot-console,
.result-kicker,
.artifact-list span,
.user-role,
.npc-bubble,
.time,
.timeline-time,
.terminal-line,
.log-line,
.status-badge,
.demo-progress-item,
.git-label,
.step-badge {
  font-size: 9px !important;
}

/* 3. Title Graying (Elegant neutral slate-gray for important headings and tabs) */
.window-title,
.brand-subtext,
#chatTitleName,
.panel-title,
.tree-title,
.right-rail-tab,
.tree-folder-summary,
.left-rail details.accordion-panel summary,
.right-rail details.accordion-panel summary,
.widget-kicker,
.result-kicker,
.modal-header h2,
#heroTitle,
#guideTitle,
.settings-btn,
.panel-header-row .panel-title {
  color: #71717a !important; /* Premium neutral slate gray */
}

/* Active header state: slightly darker slate gray for active cues */
.right-rail-tab.active,
.tree-item.active,
.left-rail details.accordion-panel[open] summary,
.right-rail details.accordion-panel[open] summary {
  color: #3f3f46 !important;
}

/* 4. Strict Color Restriction: Only active status and progress can use colors (green/blue/amber) */
/* Reset any other excessive colorful decorations */
.quick-actions button:hover,
.result-actions button:hover {
  background-color: rgba(9, 9, 11, 0.04) !important;
  color: #09090b !important;
  border-color: #cbd5e1 !important;
}

/* Ensure only status metrics retain their vivid state colors */
.terminal-status,
.terminal-inline-status,
.text-success,
.success-text,
.cell-strong.text-success,
.device-cell .text-success,
.pill.success,
.status-indicator.active,
.demo-progress-item.done span,
.demo-progress-item em {
  /* Retain green, blue, amber */
}

/* Ensure no colorful icons remain, filter any static visual images */
img.icon, svg.icon-colorful {
  filter: grayscale(1) !important;
  opacity: 0.7 !important;
}

/* ==========================================
   PREMIUM ENTERPRISE POLISH OVERRIDES
   ========================================== */

/* 1. Strict Font Family, Size & Weight Constraints */
* {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
  font-weight: normal !important;
  font-size: 11px !important; /* All elements globally use 11px (Medium) by default */
}

/* Tier 1 (Large - 13px): Primary structural headers, group titles, active tabs */
h1, h2, h3, h4, h5, h6,
.window-title,
.panel-title,
.tree-title,
.folder-name,
.right-rail-tab,
.chat-title-wrap,
#chatTitleName,
#heroTitle,
.modal h3,
.boot-card h3,
.result-card h3,
.run-head,
.chat-header,
.boot-wordmark,
.btn-label,
.new-conversation-btn,
.panel-header-row {
  font-size: 13px !important;
}

/* Tier 3 (Small - 9px): Micro-metadata, logs, timelines, badges, roles, status */
.terminal-status,
.pill,
.item-badge,
.step-num,
.user-role,
.terminal-inline-status,
.muted,
.time-badge,
.log-time,
.status-badge,
.device-status,
.settings-btn,
.right-rail-close,
.file-download-badge,
.git-value,
.device-cell span,
.device-cell strong,
.boot-kicker,
.boot-console,
.boot-line,
.panel-subtext,
.onboarding-text,
.item-icon,
.folder-icon,
.tree-arrow,
.summary-icon,
.btn-plus,
.badge-icon,
.btn-icon,
.nav-icon,
.settings-icon,
.run-head span,
.indicator-lightning,
.indicator-text,
.run-step,
.context-item,
.file-download-badge svg,
.settings-btn svg,
.new-conversation-btn .btn-plus {
  font-size: 9px !important;
}

/* 2. Color Neutralization: Gray out all titles */
h1, h2, h3, h4, h5, h6,
.window-title,
.panel-title,
.tree-title,
.folder-name,
.right-rail-tab,
.chat-title-wrap,
#chatTitleName,
#heroTitle,
.panel-header-row,
.settings-text,
.modal-kicker,
.boot-kicker,
.run-head,
.result-kicker,
.agent-name-header,
.tree-folder-summary,
.nested-summary {
  color: #71717a !important; /* Premium neutral slate gray */
}

/* Active header state: slightly darker slate gray for active cues */
.right-rail-tab.active,
.tree-item.active,
.left-rail details.accordion-panel[open] summary,
.right-rail details.accordion-panel[open] summary {
  color: #3f3f46 !important;
}

/* 3. Icon Restrictions: All vector outline icons MUST be minimalist line gray. NO color icons! */
svg,
svg *,
.item-icon svg,
.folder-icon svg,
.panel-title-icon svg,
.btn-icon svg,
.nav-icon svg,
.settings-icon svg,
.summary-icon svg {
  color: #71717a !important;
  stroke: #71717a !important;
}

/* Ensure fill color SVGs are also styled correctly */
svg[fill="currentColor"],
svg[fill="currentColor"] *,
svg polygon {
  fill: #71717a !important;
}

/* Ensure no colorful static images are used as icons */
img.icon, svg.icon-colorful {
  filter: grayscale(1) !important;
  opacity: 0.7 !important;
}

/* 4. Left, Middle, and Right Vertical Scrollbar Styling (extremely narrow 4px, light-gray scrollbars) */
.left-rail .rail-body,
.chat-history {
  overflow-y: scroll !important;
  scrollbar-width: thin !important;
  scrollbar-color: #d4d4d8 transparent !important;
}

.right-rail .rail-body {
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: #d4d4d8 transparent !important;
}

.left-rail .rail-body::-webkit-scrollbar,
.chat-history::-webkit-scrollbar,
.right-rail .rail-body::-webkit-scrollbar {
  width: 4px !important;
  height: 4px !important;
  display: block !important;
}

.left-rail .rail-body::-webkit-scrollbar-track,
.chat-history::-webkit-scrollbar-track,
.right-rail .rail-body::-webkit-scrollbar-track {
  background: transparent !important;
}

.left-rail .rail-body::-webkit-scrollbar-thumb,
.chat-history::-webkit-scrollbar-thumb,
.right-rail .rail-body::-webkit-scrollbar-thumb {
  background-color: #d4d4d8 !important; /* Elegant light-gray scrollbar handle */
  border-radius: 2px !important;
}

.left-rail .rail-body::-webkit-scrollbar-thumb:hover,
.chat-history::-webkit-scrollbar-thumb:hover,
.right-rail .rail-body::-webkit-scrollbar-thumb:hover {
  background-color: #a1a1aa !important;
}

/* Adjust User's message bubbles to green and Assistant's to neutral gray */
.chat-message.user .message-bubble,
.bubble.user {
  background-color: #f0fdf4 !important; /* Extremely soft pastel green */
  border: 1px solid #dcfce7 !important;
  color: #166534 !important; /* Soft deep forest green text */
}

.chat-message.assistant .message-bubble,
.bubble.agent {
  background-color: #f4f4f5 !important; /* Soft neutral slate gray */
  border: 1px solid #e4e4e7 !important;
  color: #3f3f46 !important;
}

/* Elegant light gray macOS window control dots for high-end minimalist styling */
.window-controls .dot.close,
.window-controls .dot.minimize,
.window-controls .dot.expand {
  background-color: #d4d4d8 !important;
}

/* Sidebar Footer & Re-organized Status Rows */
.footer-status-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 6px 0 10px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

.status-top-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.status-pills {
  display: flex;
  gap: 6px;
}

.status-pills .pill {
  font-size: 9px !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  font-weight: normal !important;
  background-color: rgba(9, 9, 11, 0.04) !important;
  color: var(--text-secondary) !important;
  border: 1px solid var(--border) !important;
}

.status-pills .pill.model-mode {
  background-color: rgba(9, 9, 11, 0.02) !important;
}

.status-bottom-line {
  display: flex;
  align-items: center;
}

.status-bottom-line .terminal-status {
  font-size: 9px !important;
  color: var(--text-muted) !important;
  font-family: 'JetBrains Mono', monospace !important;
}

.settings-link-row {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.settings-link-row .settings-btn {
  background: transparent !important;
  border: none !important;
  color: var(--text-secondary) !important;
  font-size: 11px !important;
  cursor: pointer !important;
  padding: 6px 0 !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
  text-align: left !important;
  transition: color 0.15s ease !important;
}

.settings-link-row .settings-btn:hover {
  color: var(--text-primary) !important;
}

.footer-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* Hide footer elements when left sidebar is collapsed */
body.left-collapsed .left-rail-footer .footer-status-row,
body.left-collapsed .left-rail-footer .settings-link-row,
body.left-collapsed .left-rail-footer .user-profile {
  display: none !important;
}

/* Premium Glassmorphic Dropdown Menu */
.premium-dropdown-menu {
  position: absolute;
  z-index: 99999 !important;
  background: rgba(255, 255, 255, 0.75) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border: 1px solid rgba(228, 228, 231, 0.8) !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05) !important;
  padding: 6px !important;
  min-width: 190px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1), transform 0.15s cubic-bezier(0.16, 1, 0.3, 1) !important;
  pointer-events: none;
}

.premium-dropdown-menu.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.dropdown-item-header {
  font-size: 9px !important;
  color: #a1a1aa !important;
  padding: 4px 12px 6px 12px !important;
  font-weight: normal !important;
  border-bottom: 1px solid rgba(228, 228, 231, 0.5) !important;
  margin-bottom: 4px !important;
  pointer-events: none !important;
}

.dropdown-item {
  padding: 8px 12px !important;
  font-size: 11px !important; /* Strictly Medium (11px) */
  font-weight: normal !important; /* Strictly Normal weight */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
  color: #3f3f46 !important; /* Elegant charcoal color */
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  background: transparent !important;
  border: none !important;
  width: 100% !important;
  gap: 6px !important;
}

.dropdown-item:hover {
  background-color: rgba(9, 9, 11, 0.05) !important;
  color: var(--text-primary, #09090b) !important;
}

.dropdown-item.danger:hover {
  background-color: #fef2f2 !important;
  color: #ef4444 !important;
}

/* ==========================================
   UPDATED UX ENHANCEMENTS FOR ALIGNMENTS, 
   SKILL INTROS, AND FLEXIBLE RESIZING
   ========================================== */

/* 1. Left Sidebar First-Level Elements Left Alignment */
.left-rail .new-conversation-btn {
  justify-content: flex-start !important;
  padding-left: 16px !important;
}

.left-rail details.accordion-panel summary,
.left-rail .tree-folder-summary,
.left-rail .panel-header-row {
  justify-content: flex-start !important;
  text-align: left !important;
}

/* 2. Digital Agent "技能介绍" text - Small Gray Typography */
.hero-card p,
.hero-card .hero-body,
#heroBody {
  font-size: 9px !important;
  color: #71717a !important;
}

/* 3. Custom Chat Composer Splitter style & Composer Dragging logic */
.chat-splitter {
  height: 6px;
  background-color: transparent;
  cursor: ns-resize;
  position: relative;
  flex-shrink: 0;
  transition: background-color 0.2s ease;
  z-index: 10;
  margin-top: -3px;
  margin-bottom: -3px;
}

.chat-splitter:hover,
body.is-resizing-composer .chat-splitter {
  background-color: rgba(9, 9, 11, 0.05) !important;
}

.chat-splitter::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 2px;
  background-color: #e4e4e7;
  border-radius: 1px;
  transition: background-color 0.2s ease;
}

.chat-splitter:hover::after,
body.is-resizing-composer .chat-splitter::after {
  background-color: #a1a1aa !important;
}

body.is-resizing-composer {
  cursor: ns-resize !important;
  user-select: none !important;
}

body.is-resizing-composer * {
  pointer-events: none !important;
  cursor: ns-resize !important;
}

/* ==========================================
   NEW USER REQUESTED LAYOUT & STYLE POLISH
   ========================================== */

/* 1. Left Sidebar padding boundary & text alignments */
.left-rail-footer {
  padding: 12px 20px !important; /* Perfect 20px boundary spacing alignment */
}

/* AI智能体办公室 Resident Panel Padding Override */
.left-rail .office-space-panel {
  padding: 0 !important; /* Managed by summary and panel-content */
  background-color: var(--sidebar-bg) !important;
  border-top: 1px solid var(--border) !important;
  box-sizing: border-box !important;
  flex-shrink: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

.left-rail .new-conversation-btn {
  justify-content: flex-start !important;
  padding-left: 12px !important; /* Elegant alignment with other left sidebar icons */
}

/* First-level Sidebar Icon slots: uniform 16px width and 8px gap for absolute alignment */
.left-rail .tree-folder-summary .tree-arrow,
.left-rail details.accordion-panel summary .panel-title-icon,
.left-rail .office-space-panel .panel-header-row .panel-title-icon,
.left-rail .settings-link-row .settings-btn .settings-icon {
  width: 16px !important;
  height: 16px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  margin: 0 !important; /* Reset inline margins */
}

/* Unified gap of 8px */
.left-rail .tree-folder-summary,
.left-rail details.accordion-panel summary,
.left-rail .office-space-panel .panel-header-row,
.left-rail .settings-link-row .settings-btn {
  gap: 8px !important;
  display: flex !important;
  align-items: center !important;
}

/* Ensure settings svg inside settings-icon doesn't have inline margin-right override */
.left-rail .settings-link-row .settings-btn .settings-icon svg {
  margin-right: 0 !important;
}

/* Unified padding-left for the assistant section sub-header so its text lines up perfectly with headers at 24px */
.left-rail .office-space-panel .agent-tabs-header {
  padding-left: 24px !important;
  margin-left: 0 !important;
}

/* Force left-alignment for other text components within Left Sidebar */
.left-rail .agent-tabs.vertical-tabs,
.left-rail .tab,
.left-rail .orientation-steps,
.left-rail .step-item,
.left-rail .onboarding-text,
.left-rail .tree-subfolder-summary,
.left-rail .tree-item,
.left-rail .nested-summary {
  text-align: left !important;
  justify-content: flex-start !important;
}

/* 2. Right Sidebar collapsed state retaining narrow width & showing fold/unfold button */
body.right-collapsed {
  --right-rail-width: 48px !important; /* Keep a narrow 48px rail width */
}

body.right-collapsed .right-rail {
  width: 48px !important;
  border-left: 1px solid var(--border) !important;
}

body.right-collapsed .right-rail-tabs,
body.right-collapsed .right-rail .rail-body {
  display: none !important; /* Hide tabs and content when collapsed */
}

body.right-collapsed .right-rail-header {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important; /* Center the toggle button */
  padding: 0 !important;
  height: 48px !important;
  border-bottom: none !important;
  width: 100% !important;
}

body.right-collapsed #rightRailToggle {
  margin: 0 !important;
  padding: 0 !important;
  width: 32px !important;
  height: 32px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.right-collapsed #rightSplitter {
  pointer-events: none !important;
  opacity: 0 !important; /* Hide and disable splitter drag when collapsed */
}

/* 3. AI chat bubble rounded bubble aesthetics for Assistant/Agent messages */
.bubble.agent {
  background-color: #f4f4f5 !important; /* Soft neutral slate gray */
  border: 1px solid #e4e4e7 !important;
  border-radius: 16px 16px 16px 4px !important; /* Asymmetrical premium roundness */
  padding: 12px 16px !important;
  max-width: 75% !important;
  align-self: flex-start !important;
  box-sizing: border-box !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02) !important;
}

.bubble.agent .agent-avatar-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.bubble.agent .agent-mini-avatar {
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 1px solid var(--border) !important;
  image-rendering: pixelated !important;
}

.bubble.agent .agent-name-header {
  font-size: 11px !important; /* Tier 2 (Medium) */
  font-weight: 600 !important;
  color: var(--text-muted, #71717a) !important;
}

.bubble.agent .agent-message-content {
  padding-left: 0 !important; /* Remove legacy indent, aligned inside the bubble */
  font-size: 11px !important; /* Tier 2 (Medium) */
  color: var(--text-primary) !important;
  line-height: 1.6 !important;
  text-align: left !important;
}

/* 4. Chat header title bar single-line display & dynamic downscaling */
.chat-title-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  white-space: nowrap !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

#chatTitleName {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  flex-shrink: 1 !important;
  min-width: 0 !important;
}

/* Dynamically shrink title font-size if sidebars are wide or window is narrow */
body:not(.left-collapsed):not(.right-collapsed) .chat-title-wrap,
body:not(.left-collapsed):not(.right-collapsed) #chatTitleName {
  font-size: 11px !important; /* Scale to Medium (11px) */
}

@media (max-width: 1400px) {
  body:not(.left-collapsed):not(.right-collapsed) .chat-title-wrap,
  body:not(.left-collapsed):not(.right-collapsed) #chatTitleName {
    font-size: 9px !important; /* Scale to Small (9px) */
  }
}

@media (max-width: 1200px) {
  .chat-title-wrap,
  #chatTitleName {
    font-size: 11px !important; /* Scale to Medium (11px) */
  }
}

@media (max-width: 1000px) {
  .chat-title-wrap,
  #chatTitleName {
    font-size: 9px !important; /* Scale to Small (9px) */
  }
}

/* 5. Collapsible AI Agent Office and Vertical Row Resizer splitters */
.sidebar-row-splitter {
  position: relative;
  height: 1px;
  background-color: var(--border);
  cursor: ns-resize;
  z-index: 50;
  width: 100%;
  user-select: none;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.sidebar-row-splitter:hover,
body.is-resizing-left-row .sidebar-row-splitter {
  background-color: var(--accent-blue) !important;
}

.sidebar-row-splitter::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -4px;
  bottom: -4px;
  cursor: ns-resize;
}

/* AI智能体办公室 details accordion padding overrides */
.left-rail .office-space-panel[open] {
  height: var(--office-panel-height, 300px) !important;
}
.left-rail .office-space-panel:not([open]) {
  height: auto !important;
}

/* Make sure summary uses correct padding when closed/open */
.left-rail .office-space-panel summary.panel-header-row {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-weight: 700 !important;
  color: var(--text-primary) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  cursor: pointer !important;
  user-select: none !important;
  padding: 16px 20px !important; /* Always aligned to 20px boundaries! */
  margin-bottom: 0 !important;
  box-sizing: border-box !important;
  border: none !important;
  background: transparent !important;
}

/* When open, adjust summary and content padding to align nicely */
.left-rail .office-space-panel[open] summary.panel-header-row {
  padding: 16px 20px 12px 20px !important; /* Bottom padding slightly reduced to form a spacing gap with content */
  border-bottom: 1px solid var(--border) !important;
}

/* Panel content inside the details when open */
.left-rail .office-space-panel .panel-content {
  flex: 1 !important;
  overflow-y: auto !important;
  padding: 12px 20px 20px 20px !important; /* Rest of the content padding */
  box-sizing: border-box !important;
}




