/* -------------------------------------------------------------
   AMANI BRAND DESIGN SYSTEM & CODEX / ANTIGRAVITY STYLING
   Primary Dark Blue: #0D4B8A
   Secondary Light Blue: #26B9F3
   Background Soft Blue: #F4F9FD
   Text Dark: #1A2B49 / #333333
   Text Muted: #8A9AA8
   Border Radius: 12px - 16px
-------------------------------------------------------------- */

:root {
  --primary: #0D4B8A;
  --primary-hover: #093766;
  --primary-light: rgba(13, 75, 138, 0.08);
  --secondary: #26B9F3;
  --secondary-hover: #15a4db;
  --secondary-glow: rgba(38, 185, 243, 0.25);
  --bg-app: #F4F9FD;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-subtle: #EBF3FA;
  --text-main: #1A2B49;
  --text-dark: #333333;
  --text-muted: #8A9AA8;
  --border-light: #E2EEF8;
  --border-focus: #26B9F3;
  --accent-green: #10B981;
  --accent-amber: #F59E0B;
  --accent-rose: #EF4444;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(13, 75, 138, 0.04);
  --shadow-md: 0 4px 14px rgba(13, 75, 138, 0.06);
  --shadow-lg: 0 10px 30px rgba(13, 75, 138, 0.1);
  --shadow-codex: 0 8px 32px rgba(13, 75, 138, 0.12);

  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-code: 'JetBrains Mono', monospace;
}

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

html, body {
  height: 100%;
  width: 100%;
  font-family: var(--font-ui);
  background-color: var(--bg-app);
  color: var(--text-main);
  overflow: hidden;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  -webkit-font-smoothing: antialiased;
}

/* Base App Shell */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background: radial-gradient(circle at 80% -20%, rgba(38, 185, 243, 0.08) 0%, transparent 60%),
              radial-gradient(circle at 10% 120%, rgba(13, 75, 138, 0.06) 0%, transparent 50%),
              var(--bg-app);
}

/* Topbar */
.topbar {
  height: 64px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 20;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.brand-logo {
  height: 28px;
  object-fit: contain;
}

.brand-divider {
  color: var(--border-light);
  font-size: 18px;
  font-weight: 300;
}

.studio-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: -0.2px;
}

.agent-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--secondary);
  box-shadow: 0 0 8px var(--secondary);
  animation: pulse-glow 2s infinite ease-in-out;
}

.badge-codex {
  background: linear-gradient(135deg, var(--primary), #1b62ad);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

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

.status-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dark);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.status-pill.error .status-dot {
  background-color: var(--accent-rose);
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.pill-icon {
  width: 14px;
  height: 14px;
  color: var(--primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Model Selector */
.model-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.model-picker:hover, .model-picker:focus-within {
  border-color: var(--secondary);
  background-color: #fff;
  box-shadow: 0 0 0 3px var(--secondary-glow);
}

.model-icon {
  width: 15px;
  height: 15px;
  color: var(--primary);
}

.model-picker select {
  border: none;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
}

.token-mini-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-md);
}

.token-mini-badge svg {
  width: 14px;
  height: 14px;
  color: var(--secondary);
}

/* Buttons */
.icon-btn, .icon-btn-subtle {
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  padding: 8px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.icon-btn:hover, .icon-btn-subtle:hover {
  background-color: var(--bg-subtle);
  color: var(--primary);
}

.icon-btn.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.icon-btn-xs {
  background: transparent;
  border: none;
  padding: 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
}
.icon-btn-xs:hover {
  background: var(--bg-subtle);
  color: var(--primary);
}

.btn-primary-sm {
  background: linear-gradient(135deg, var(--secondary), #0e9cd2);
  color: white;
  border: none;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(38, 185, 243, 0.3);
  transition: all 0.2s ease;
}

.btn-primary-sm:hover {
  background: linear-gradient(135deg, #22ace3, #0988ba);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(38, 185, 243, 0.4);
}

/* Workspace Layout */
.workspace-body {
  display: flex;
  flex: 1;
  height: calc(100vh - 64px);
  overflow: hidden;
  position: relative;
}

/* Left Sidebar */
.sidebar {
  width: 280px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s ease;
  z-index: 15;
}

.sidebar-section {
  padding: 18px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-header-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
}

.new-session-btn {
  background: var(--primary-light);
  border: 1px solid rgba(13, 75, 138, 0.12);
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.new-session-btn:hover {
  background: var(--primary);
  color: #fff;
}

.chat-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-dark);
}

.history-item:hover {
  background-color: var(--bg-subtle);
}

.history-item.active {
  background-color: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.history-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.history-content {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.history-title {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-time {
  font-size: 10px;
  color: var(--text-muted);
}

.badge-count {
  background-color: var(--bg-subtle);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.skills-mini-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  max-height: calc(100vh - 430px);
}

.skill-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background-color: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-size: 12px;
  transition: all 0.15s ease;
}

.skill-badge-row:hover {
  border-color: var(--secondary);
  background-color: #fff;
}

.skill-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.skill-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--secondary);
}

.skill-name-label {
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.skill-tools-count {
  font-size: 10px;
  color: var(--text-muted);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--border-light);
  background: #FAFCFE;
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar svg {
  width: 18px;
  height: 18px;
}

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

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.user-phone {
  font-size: 11px;
  color: var(--text-muted);
}

/* Center Chat Stage */
.chat-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background-color: transparent;
  overflow: hidden;
}

/* Welcome Hero */
.welcome-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  max-width: 760px;
  margin: 0 auto;
}

.hero-logo-box {
  width: 72px;
  height: 72px;
  background: white;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 1px solid var(--border-light);
}

.hero-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.hero-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.hero-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 32px;
}

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

.starter-chip {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  text-align: left;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.starter-chip svg {
  width: 18px;
  height: 18px;
  color: var(--secondary);
  flex-shrink: 0;
}

.starter-chip:hover {
  transform: translateY(-2px);
  border-color: var(--secondary);
  box-shadow: 0 6px 18px rgba(13, 75, 138, 0.08);
}

/* Messages Area */
.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message-row {
  display: flex;
  gap: 14px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.message-row.assistant .message-avatar {
  background: white;
  border: 1px solid var(--border-light);
}

.message-row.assistant .message-avatar img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.message-row.user .message-avatar {
  background: linear-gradient(135deg, var(--primary), #1e5fa0);
  color: white;
}

.message-bubble {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.65;
  box-shadow: var(--shadow-sm);
  max-width: calc(100% - 60px);
  word-break: break-word;
}

.message-row.user .message-bubble {
  background: linear-gradient(135deg, var(--primary), #0c437a);
  color: white;
  border: none;
  border-top-right-radius: var(--radius-sm);
}

.message-row.assistant .message-bubble {
  border-top-left-radius: var(--radius-sm);
}

/* Collapsible Reasoning & Trajectory in Message */
.thought-box {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
  font-size: 12px;
}

.thought-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(13, 75, 138, 0.04);
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
  user-select: none;
}

.thought-header:hover {
  background: rgba(13, 75, 138, 0.08);
}

.thought-body {
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  color: var(--text-muted);
  font-family: var(--font-code);
  font-size: 11px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

/* Artifact Card within Message */
.message-artifact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  border: 1px solid rgba(38, 185, 243, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  margin-top: 12px;
  gap: 12px;
}

.artifact-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.artifact-file-icon {
  width: 24px;
  height: 24px;
  color: var(--primary);
}

.artifact-info-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.artifact-info-sub {
  font-size: 11px;
  color: var(--text-muted);
}

/* Markdown styling inside bubbles */
.message-bubble h1, .message-bubble h2, .message-bubble h3 {
  color: var(--primary);
  margin-top: 14px;
  margin-bottom: 8px;
  font-weight: 700;
}
.message-row.user .message-bubble h1,
.message-row.user .message-bubble h2,
.message-row.user .message-bubble h3 {
  color: #fff;
}

.message-bubble p {
  margin-bottom: 10px;
}
.message-bubble p:last-child {
  margin-bottom: 0;
}

.message-bubble ul, .message-bubble ol {
  padding-left: 20px;
  margin-bottom: 10px;
}

.message-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 13px;
}

.message-bubble th {
  background-color: var(--primary);
  color: white;
  padding: 8px 12px;
  text-align: left;
  border: 1px solid rgba(0,0,0,0.05);
}

.message-bubble td {
  padding: 8px 12px;
  border: 1px solid var(--border-light);
}

.message-bubble tr:nth-child(even) td {
  background-color: #FAFCFE;
}

.message-bubble code:not(pre code) {
  font-family: var(--font-code);
  background-color: var(--bg-subtle);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
}

.message-bubble pre {
  background-color: #1a2332;
  border-radius: var(--radius-md);
  padding: 14px;
  overflow-x: auto;
  margin: 12px 0;
}

.message-bubble pre code {
  font-family: var(--font-code);
  color: #e6edf3;
  font-size: 12px;
}

/* Live Reasoning Indicator */
.reasoning-indicator {
  position: absolute;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--secondary);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 20px var(--secondary-glow);
  z-index: 10;
  animation: float-bar 3s infinite ease-in-out;
}

.spin-icon {
  width: 16px;
  height: 16px;
  color: var(--secondary);
  animation: spin 2s linear infinite;
}

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

/* Composer Container */
.composer-container {
  padding: 16px 24px 20px;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tool-tag {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tool-tag svg {
  width: 13px;
  height: 13px;
  color: var(--secondary);
}

.tool-tag:hover {
  border-color: var(--secondary);
  background-color: var(--primary-light);
  color: var(--primary);
}

.composer-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-codex);
  padding: 12px 16px;
  transition: all 0.2s ease;
}

.composer-card:focus-within {
  border-color: var(--secondary);
  box-shadow: 0 8px 32px var(--secondary-glow);
}

.attachment-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  padding: 4px 10px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
}

.attachment-preview button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
}

.composer-input-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

#promptInput {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-main);
  background: transparent;
  resize: none;
  max-height: 160px;
  min-height: 24px;
}

#promptInput::placeholder {
  color: var(--text-muted);
}

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

.send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), #0d9fd9);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(38, 185, 243, 0.4);
  transition: all 0.2s ease;
}

.send-btn svg {
  width: 18px;
  height: 18px;
}

.send-btn:hover {
  background: linear-gradient(135deg, #1fb3ec, #0689bc);
  transform: scale(1.05);
}

.send-btn:disabled {
  background: #cfdbe6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-light);
  font-size: 11px;
  color: var(--text-muted);
}

.key-hint kbd {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-code);
  font-size: 10px;
}

.brand-safe-note {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Right Inspector Panel */
.inspector-panel {
  width: 340px;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease, transform 0.25s ease;
  z-index: 15;
}

.inspector-panel.collapsed {
  width: 0;
  overflow: hidden;
  border-left: none;
}

.inspector-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-light);
  background: #FAFCFE;
}

.inspector-tab {
  flex: 1;
  background: transparent;
  border: none;
  padding: 12px 6px;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.inspector-tab svg {
  width: 14px;
  height: 14px;
}

.inspector-tab.active {
  color: var(--primary);
  border-bottom-color: var(--secondary);
  background: #ffffff;
}

.inspector-tab-content {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.inspector-tab-content.active {
  display: flex;
  flex-direction: column;
}

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

.pane-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.artifacts-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.artifact-card-item {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.artifact-card-item:hover {
  border-color: var(--secondary);
  background: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.item-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.item-badge.pdf { background: #fee2e2; color: #b91c1c; }
.item-badge.excel { background: #dcfce7; color: #15803d; }
.item-badge.docx { background: #e0e7ff; color: #4338ca; }
.item-badge.html { background: #ffedd5; color: #c2410c; }
.item-badge.image { background: #f3e8ff; color: #7e22ce; }

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

.item-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 36px;
  height: 36px;
  stroke-width: 1.5;
  margin-bottom: 10px;
  color: #c7d8e8;
}

.empty-state p {
  font-size: 12px;
  line-height: 1.5;
}

/* Trajectory Log */
.trajectory-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trajectory-step {
  background: #1a2332;
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #e6edf3;
  font-family: var(--font-code);
  font-size: 11px;
}

.trajectory-step-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

.trajectory-step-args {
  color: #94a3b8;
  word-break: break-all;
  white-space: pre-wrap;
}

/* Token Stats Tab */
.token-stats-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.metric-card {
  background: linear-gradient(135deg, var(--primary), #1a5796);
  color: white;
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(13, 75, 138, 0.2);
}

.metric-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.5px;
}

.metric-value {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric-box {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-label {
  font-size: 10px;
  color: var(--text-muted);
}

.sub-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.section-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 8px;
}

.distribution-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dist-item {
  background: var(--bg-app);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dist-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(13, 75, 138, 0.4);
  backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 960px;
  height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(13, 75, 138, 0.25);
  overflow: hidden;
}

.modal-dialog-sm {
  max-width: 460px;
  height: auto;
}

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

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-body {
  flex: 1;
  overflow: hidden;
  background: var(--bg-app);
}

.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.modal-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  margin: auto;
  display: block;
}

.settings-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
}

.form-control {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-family: var(--font-ui);
  font-size: 13px;
  outline: none;
}

.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px var(--secondary-glow);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

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

@keyframes float-bar {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, -4px); }
}

/* Responsive Rules */
.mobile-only {
  display: none;
}

@media (max-width: 992px) {
  .sidebar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .mobile-only {
    display: flex;
  }
  .inspector-panel {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    box-shadow: var(--shadow-lg);
  }
  .inspector-panel.open {
    transform: translateX(0);
  }
  .prompt-starters {
    grid-template-columns: 1fr;
  }
}
