/* ============================================================
   Claude PWA — Monochrome Dark
   No color. Warm whites. Deep blacks. Pure form.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* ---- Blacks ---- */
  --bg-void: #000000;
  --bg-primary: #050505;
  --bg-surface: #0f0f0f;
  --bg-elevated: #161616;
  --bg-hover: #1c1c1c;

  /* ---- Bubbles ---- */
  --bg-user: #1a1a1a;
  --bg-assistant: #0a0a0a;

  /* ---- Whites (warm) ---- */
  --text-primary: #f0ede8;
  --text-secondary: #8a8780;
  --text-tertiary: #4a4844;
  --text-on-accent: #f0ede8;

  /* ---- Accent = warm white ---- */
  --accent: #d4d0c8;
  --accent-dim: #8a8780;

  /* ---- Status ---- */
  --status-ok: #8a8780;
  --status-off: #2a2a2a;
  --status-pending: #4a4844;
  --status-running: #8a8780;
  --status-completed: #8a8780;
  --status-failed: #a08070;

  /* ---- Priority ---- */
  --priority-0: #4a4844;
  --priority-1: #a09880;
  --priority-2: #a09070;
  --priority-3: #a08070;

  /* ---- Structure ---- */
  --border: rgba(255, 255, 255, 0.06);
  --border-subtle: rgba(255, 255, 255, 0.03);
  --input-bg: #0a0a0a;
  --input-border: rgba(255, 255, 255, 0.08);

  /* ---- Glass ---- */
  --glass-bg: rgba(5, 5, 5, 0.85);
  --glass-border: rgba(255, 255, 255, 0.05);

  /* ---- Safe Areas ---- */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  --tab-bar-height: 56px;

  /* ---- Typography ---- */
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SF Mono', SFMono-Regular, ui-monospace, Menlo, monospace;

  /* ---- Radii ---- */
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 8px;
}

/* ---- Reset ---- */

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-void);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- App Layout ---- */

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 768px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-primary);
}

@media (min-width: 769px) {
  #app {
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

/* ---- Header ---- */

#header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 1px solid var(--glass-border);
  padding-top: var(--safe-top);
  flex-shrink: 0;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  position: relative;
}

.header-inner h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-off);
  transition: background 0.4s;
}

.status-dot.connected {
  background: var(--text-secondary);
}

/* ---- Tab Panels ---- */

.tab-panel {
  flex: 1;
  overflow: hidden;
  display: none;
}

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

.panel-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 20px;
}

/* ---- Toast Container ---- */

#toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 60px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 768px;
  width: calc(100% - 32px);
  pointer-events: none;
}

.toast {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.toast.removing {
  animation: toastOut 0.2s ease-in forwards;
}

.toast-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.toast.success .toast-dot { background: var(--text-secondary); }
.toast.info .toast-dot { background: var(--text-secondary); }
.toast.warning .toast-dot { background: var(--priority-2); }
.toast.error .toast-dot { background: var(--status-failed); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* ---- Messages ---- */

#messages {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.day-header {
  text-align: center;
  font-size: 11px;
  color: var(--text-tertiary);
  padding: 14px 0 8px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: var(--radius);
  word-wrap: break-word;
  overflow-wrap: break-word;
  font-size: 15px;
  line-height: 1.5;
  animation: msgIn 0.15s ease-out;
  position: relative;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.user {
  align-self: flex-end;
  background: var(--bg-user);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-bottom-right-radius: 6px;
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bg-assistant);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-bottom-left-radius: 6px;
}

.msg.error {
  align-self: flex-start;
  background: rgba(160, 128, 112, 0.06);
  border: 1px solid rgba(160, 128, 112, 0.12);
  color: #c0a090;
  border-bottom-left-radius: 6px;
}

.msg.task-result {
  align-self: flex-start;
  background: var(--bg-assistant);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--text-tertiary);
  border-bottom-left-radius: 6px;
}

.msg.task-result .task-result-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  margin-bottom: 4px;
  font-weight: 700;
}

/* ---- Markdown in messages ---- */

.msg p { margin: 0 0 8px 0; }
.msg p:last-child { margin-bottom: 0; }

.msg code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 4px;
}

.msg pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-subtle);
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  overflow-x: auto;
  margin: 8px 0;
  font-size: 13px;
}

.msg pre code { background: none; padding: 0; font-size: inherit; }

.msg ul, .msg ol { padding-left: 20px; margin: 4px 0; }
.msg li { margin: 2px 0; }
.msg strong { font-weight: 600; }

.msg a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: rgba(212, 208, 200, 0.3);
}

.msg h1, .msg h2, .msg h3 {
  margin: 12px 0 4px 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.msg h1 { font-size: 17px; }
.msg h2 { font-size: 16px; }

.msg blockquote {
  border-left: 2px solid var(--text-tertiary);
  padding-left: 12px;
  margin: 8px 0;
  color: var(--text-secondary);
}

.msg hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.msg table {
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
  width: 100%;
  overflow-x: auto;
  display: block;
}

.msg th, .msg td {
  border: 1px solid var(--border);
  padding: 5px 10px;
  text-align: left;
}

.msg th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
}

/* ---- Typing Indicator ---- */

.typing-indicator {
  display: flex;
  gap: 5px;
  padding: 0 16px 8px;
  align-items: center;
}

.typing-indicator span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-tertiary);
  animation: typingBounce 1.4s infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
  30% { transform: translateY(-4px); opacity: 0.8; }
}

/* ---- Input Bar ---- */

#input-bar {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.input-inner {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px;
}

#input {
  flex: 1;
  resize: none;
  border: 1px solid var(--input-border);
  outline: none;
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.4;
  padding: 10px 16px;
  border-radius: 24px;
  max-height: 120px;
  overflow-y: auto;
  transition: border-color 0.2s;
}

#input:focus {
  border-color: rgba(255, 255, 255, 0.15);
}

#input::placeholder { color: var(--text-tertiary); }

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, background 0.15s;
}

.btn-icon:active { background: var(--bg-hover); }
.btn-send { color: var(--accent); }
.btn-send:active { background: rgba(255, 255, 255, 0.04); }

/* ---- Tab Bar ---- */

#tab-bar {
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-top: 1px solid var(--glass-border);
  padding-bottom: var(--safe-bottom);
  flex-shrink: 0;
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 4px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  transition: color 0.2s;
}

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

.tab:active {
  opacity: 0.6;
}

.tab-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--text-secondary);
  color: var(--bg-void);
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Filter Chips ---- */

.filter-chips {
  display: flex;
  gap: 8px;
  padding-bottom: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-tertiary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
}

.chip.active {
  background: var(--text-primary);
  color: var(--bg-void);
  border-color: var(--text-primary);
}

/* ---- Task List ---- */

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

.task-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.task-item:active {
  background: var(--bg-hover);
}

.task-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}

.task-status-dot.pending { background: var(--status-pending); }
.task-status-dot.in_progress { background: var(--text-secondary); animation: pulse 2s infinite; }
.task-status-dot.completed { background: var(--text-secondary); }
.task-status-dot.cancelled { background: var(--status-failed); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.task-info {
  flex: 1;
  min-width: 0;
}

.task-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 3px;
  display: flex;
  gap: 8px;
}

.task-priority {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.task-priority.p0 { background: var(--priority-0); }
.task-priority.p1 { background: var(--priority-1); }
.task-priority.p2 { background: var(--priority-2); }
.task-priority.p3 { background: var(--priority-3); }

.task-dep-badge {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(160, 140, 100, 0.15);
  color: var(--text-tertiary);
  border: 1px solid rgba(160, 140, 100, 0.25);
}

.empty-state {
  text-align: center;
  color: var(--text-tertiary);
  padding: 56px 20px;
  font-size: 14px;
  font-weight: 500;
}

/* ---- Slide-up Panel ---- */

.slide-up {
  position: fixed;
  inset: 0;
  z-index: 150;
}

.slide-up-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.2s ease-out;
}

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

.slide-up-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 768px;
  margin: 0 auto;
  max-height: 80vh;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 8px 20px calc(20px + var(--safe-bottom));
  overflow-y: auto;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.slide-up-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-tertiary);
  margin: 0 auto 14px;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* Document Viewer */
.doc-viewer-sheet {
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.doc-viewer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.doc-viewer-header .detail-title { margin-bottom: 0; }
.doc-viewer-content {
  flex: 1;
  overflow-y: auto;
  min-height: 200px;
}
.doc-viewer-content iframe {
  width: 100%;
  min-height: 60vh;
  border: none;
  border-radius: 8px;
  background: #fff;
}
.doc-viewer-content .rendered-doc {
  padding: 16px;
  background: var(--bg-surface);
  border-radius: 8px;
  line-height: 1.6;
  font-size: 14px;
}
.doc-viewer-content .rendered-doc h1,
.doc-viewer-content .rendered-doc h2,
.doc-viewer-content .rendered-doc h3 {
  margin-top: 1em;
  margin-bottom: 0.5em;
}
.doc-viewer-content .rendered-doc pre {
  background: var(--bg-primary);
  padding: 12px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
}
.doc-viewer-content .rendered-doc code {
  font-size: 13px;
}
.doc-viewer-content .rendered-doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
.doc-viewer-content .rendered-doc th,
.doc-viewer-content .rendered-doc td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  font-size: 13px;
}

/* Agent Detail (minimap click) */
.agent-detail-section {
  margin-bottom: 14px;
}
.agent-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.agent-detail-stat {
  font-size: 13px;
  color: var(--text-secondary);
}
.budget-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.budget-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}
.agent-detail-task-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.agent-detail-task-row:hover { opacity: 0.8; }
.task-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.task-status-dot.completed { background: #80a880; }
.task-status-dot.in_progress { background: #a0a080; }
.task-status-dot.pending { background: #8a8780; }
.task-status-dot.cancelled { background: #a08070; }
/* Performance Dashboard Table */
.perf-dashboard {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.perf-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 12px;
}
.perf-table th {
  text-align: left;
  padding: 4px 6px;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
.perf-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.perf-table tr:hover td { background: rgba(255,255,255,0.02); }

.agent-detail-memory {
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-primary);
  border-radius: 6px;
  padding: 10px;
  max-height: 120px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-family: var(--font-mono);
}

.detail-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.detail-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-status.pending { background: rgba(74, 72, 68, 0.2); color: var(--status-pending); }
.detail-status.in_progress { background: rgba(138, 135, 128, 0.12); color: var(--text-secondary); }
.detail-status.completed { background: rgba(138, 135, 128, 0.12); color: var(--text-secondary); }
.detail-status.cancelled { background: rgba(160, 128, 112, 0.12); color: var(--status-failed); }

.detail-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 10px 0;
  line-height: 1.6;
}

.detail-result {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 14px;
  margin: 14px 0;
  font-size: 14px;
  line-height: 1.5;
  max-height: 40vh;
  overflow-y: auto;
}

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.detail-btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.detail-btn.primary {
  background: var(--text-primary);
  color: var(--bg-void);
}

.detail-btn.danger {
  background: rgba(160, 128, 112, 0.1);
  color: #c0a090;
}

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

.detail-executions {
  margin-top: 18px;
}

.detail-executions h3 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.execution-item {
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ---- Menu ---- */

.menu-section {
  margin-top: 16px;
}

.menu-back {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Memory List ---- */

.memory-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.memory-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.memory-content {
  flex: 1;
  font-size: 14px;
  line-height: 1.5;
}

.memory-delete {
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  transition: color 0.15s;
}

.memory-delete:active { color: var(--status-failed); }

.add-memory-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.add-memory-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.add-memory-input:focus {
  border-color: rgba(255, 255, 255, 0.15);
}

.add-memory-btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: var(--bg-void);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* ---- Call History ---- */

.call-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.call-item:active { background: var(--bg-hover); }

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

.call-direction {
  font-size: 14px;
  font-weight: 600;
}

.call-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.call-summary {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Settings ---- */

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.setting-label {
  font-size: 14px;
  font-weight: 500;
}

.setting-btn {
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.setting-btn:active { background: var(--bg-hover); }

.setting-btn.danger {
  border-color: rgba(160, 128, 112, 0.25);
  color: #c0a090;
}

/* ---- Status ---- */

.status-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.status-card-label {
  font-size: 11px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  margin-bottom: 4px;
}

.status-card-value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.job-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.job-name { font-weight: 600; }

.job-status {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.job-status.enabled { background: rgba(138, 135, 128, 0.1); color: var(--text-secondary); }
.job-status.disabled { background: rgba(74, 72, 68, 0.15); color: var(--text-tertiary); }

/* ---- Attach Menu (Bottom Sheet) ---- */

.attach-menu {
  position: fixed;
  inset: 0;
  z-index: 100;
}

.attach-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  animation: fadeIn 0.2s ease-out;
}

.attach-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 768px;
  margin: 0 auto;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 20px calc(20px + var(--safe-bottom));
  display: flex;
  gap: 12px;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.attach-option {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
  transition: background 0.15s;
}

.attach-option:active { background: var(--bg-hover); }
.attach-option svg { color: var(--text-secondary); }

/* ---- Image in message ---- */

.msg-image {
  display: block;
  max-width: 100%;
  max-height: 280px;
  border-radius: 14px;
  margin-bottom: 6px;
  cursor: pointer;
  object-fit: cover;
}

.msg.user .msg-image { border-bottom-right-radius: 4px; }

/* ---- File Preview Bar ---- */

.file-preview {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.file-preview-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  max-width: 768px;
  margin: 0 auto;
}

.preview-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
}

.preview-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.preview-dismiss:active { background: var(--bg-hover); }

/* ---- Scrollbar ---- */

#messages::-webkit-scrollbar,
.panel-scroll::-webkit-scrollbar { width: 2px; }

#messages::-webkit-scrollbar-track,
.panel-scroll::-webkit-scrollbar-track { background: transparent; }

#messages::-webkit-scrollbar-thumb,
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); border-radius: 1px; }

/* ---- iOS Add to Home Screen banner ---- */

.install-banner {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 14px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.install-banner strong { color: var(--text-primary); font-weight: 600; }

.install-banner button {
  display: block;
  margin: 8px auto 0;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
}

/* ---- Reduced Motion ---- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Agent Badge (upgraded) ---- */

.agent-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 4px;
  line-height: 1.4;
}

.agent-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Agent message left accent border */
.msg.assistant.agent-msg {
  border-left: 2px solid var(--agent-color, var(--text-tertiary));
}

/* User message "to Agent" label */
.msg-target-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 3px;
}

/* ---- Agent Switcher (Header) ---- */

.agent-switcher {
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: background 0.15s;
}

.agent-switcher:active {
  background: var(--bg-hover);
}

.agent-switcher h1 {
  margin: 0;
}

.agent-switcher-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  transition: background 0.2s;
}

/* ---- Routing Banner ---- */

.route-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-subtle);
  animation: msgIn 0.15s ease-out;
}

.route-banner .route-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Suggestion Chips ---- */

.suggestion-chips {
  display: flex;
  gap: 6px;
  padding: 6px 0 2px;
  flex-wrap: wrap;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.suggestion-chip:active {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.12);
}

.suggestion-chip .chip-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- Team Section (Menu) ---- */

.team-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.team-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.team-card:active {
  background: var(--bg-hover);
}

.team-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.team-card-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.team-card-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.team-card-role {
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: auto;
}

.team-card-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.team-card-stat {
  display: flex;
  align-items: center;
  gap: 4px;
}

.team-card-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  margin-top: 8px;
}

.toggle-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  border: none;
  background: var(--bg-hover);
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}

.toggle-switch.on {
  background: var(--text-secondary);
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--text-primary);
  transition: transform 0.2s;
}

.toggle-switch.on::after {
  transform: translateX(18px);
}

.team-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.team-card-actions button {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.team-card-actions button:active {
  background: var(--bg-hover);
}

/* ---- View Full Result Button ---- */

.view-full-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 12px;
  font-size: 12px;
  font-family: var(--font);
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent-dim);
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.view-full-btn:active { opacity: 0.7; }

/* ---- Dashboard ---- */

.dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-greeting {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text-primary);
  padding: 4px 0;
}

.dashboard-stats {
  display: flex;
  gap: 10px;
}

.stat-card {
  flex: 1;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
}

.quick-actions {
  display: flex;
  gap: 10px;
}

.quick-action-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.quick-action-btn:active {
  background: var(--bg-hover);
}

.quick-action-btn svg {
  color: var(--text-secondary);
}

/* ---- Briefing Card ---- */

.briefing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.briefing-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.briefing-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.briefing-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s;
}

.briefing-toggle.collapsed {
  transform: rotate(-90deg);
}

.briefing-body {
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-height: 200px;
  overflow-y: auto;
}

.briefing-body.collapsed {
  display: none;
}

/* ---- Team Strip (Dashboard) ---- */

.team-strip-section,
.recent-activity-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
}

.team-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}

.team-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}

.team-pill:active {
  background: var(--bg-hover);
}

.team-pill .pill-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.team-pill.disabled {
  opacity: 0.4;
}

/* ---- Recent Activity (Dashboard) ---- */

.recent-activity {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.activity-item:active {
  background: var(--bg-hover);
}

.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 6px;
}

.activity-content {
  flex: 1;
  min-width: 0;
}

.activity-text {
  font-size: 14px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

/* ---- Agent Strip (Input Bar) ---- */

.agent-strip {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.agent-strip:empty {
  display: none;
}

.agent-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s;
  flex-shrink: 0;
}

.agent-pill:active {
  background: var(--bg-hover);
}

.agent-pill.active {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.agent-pill .pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ---- FAB (Floating Action Button) ---- */

.fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--text-primary);
  color: var(--bg-void);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  z-index: 10;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fab:active {
  transform: scale(0.92);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* ---- Task Creation Form ---- */

.create-task-form {
  max-height: 70vh;
}

.create-task-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.ct-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xs);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.ct-input:focus {
  border-color: rgba(255, 255, 255, 0.15);
}

.ct-input::placeholder {
  color: var(--text-tertiary);
}

.ct-textarea {
  resize: none;
  min-height: 60px;
}

.ct-row {
  display: flex;
  gap: 12px;
}

.ct-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ct-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ct-select {
  padding: 10px 12px;
  border: 1px solid var(--input-border);
  border-radius: var(--radius-xs);
  background: var(--input-bg);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.ct-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}

/* ---- More List (replaces Menu Grid) ---- */

.more-list {
  display: flex;
  flex-direction: column;
}

.more-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s;
}

.more-item:active {
  background: var(--bg-hover);
}

.more-item:last-child {
  border-bottom: none;
}

.more-item svg:first-child {
  color: var(--text-secondary);
  flex-shrink: 0;
}

.more-item span {
  flex: 1;
}

.more-chevron {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ---- Controls Panel ---- */

.ctrl-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding: 18px 0 8px;
}

.ctrl-section-label:first-child {
  padding-top: 4px;
}

.ctrl-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
}

.ctrl-info {
  flex: 1;
  min-width: 0;
}

.ctrl-name {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctrl-desc {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 1px;
}

.ctrl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.ctrl-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ctrl-run-btn {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.ctrl-run-btn:active {
  background: var(--bg-hover);
}

.ctrl-run-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.ctrl-server-row {
  padding: 14px 0;
}

.ctrl-server-btn {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s;
}

.ctrl-server-btn:active {
  background: var(--bg-hover);
}

.ctrl-server-btn.armed {
  background: var(--bg-hover);
  border-color: var(--priority-2);
  color: var(--priority-2);
}

.ctrl-server-btn.danger {
  border-color: rgba(160, 128, 112, 0.25);
  color: #c0a090;
}

.ctrl-server-btn.danger.armed {
  border-color: var(--status-failed);
  color: var(--status-failed);
}

.ctrl-server-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.ctrl-server-hint {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 6px;
  text-align: center;
}

.ctrl-server-hint.danger {
  color: var(--status-failed);
}

/* ---- Selection ---- */

::selection { background: rgba(240, 237, 232, 0.15); }

/* ============================================================
   RTS Viz — Agent Network Canvas + Activity Feed
   ============================================================ */

.viz-container {
  position: absolute;
  inset: 0;
  background: var(--bg-void);
  overflow: hidden;
}

#viz-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 65%;
  cursor: pointer;
}

.viz-feed {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(to bottom, rgba(5, 5, 5, 0.7), rgba(5, 5, 5, 0.95));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.viz-feed-header {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  padding: 10px 16px 6px;
  flex-shrink: 0;
}

.viz-feed-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.viz-feed-list::-webkit-scrollbar { width: 2px; }
.viz-feed-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.06); }

.viz-feed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  animation: feedSlideIn 0.2s ease-out;
  border-left: 2px solid transparent;
}

.viz-feed-item .feed-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.viz-feed-item .feed-text {
  flex: 1;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.viz-feed-item .feed-time {
  font-size: 10px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.viz-feed-placeholder {
  color: var(--text-tertiary);
  font-size: 12px;
  text-align: center;
  padding: 20px;
}

@keyframes feedSlideIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}
