/* AGC-Remote // Grok Bot Multi-Bot Cockpit Stylesheet */
:root {
  --bg: #08090c;
  --obsidian-bg: #08090c;
  --cyan: #00f0ff;
  --arc-cyan: #00f0ff;
  --panel: #12141a;
  --panel-hover: #181b24;
  --card-bg: #151821;
  --line: #222530;
  --line-light: rgba(255, 255, 255, 0.08);

  /* Bot Distinct Colors */
  --agy: #3db8b0;
  --agy-dim: rgba(61, 184, 176, 0.15);
  --agy-glow: rgba(61, 184, 176, 0.35);

  --grok: #e0b04a;
  --grok-dim: rgba(224, 176, 74, 0.15);
  --grok-glow: rgba(224, 176, 74, 0.35);

  --claude: #a78bfa;
  --claude-dim: rgba(167, 139, 250, 0.15);
  --claude-glow: rgba(167, 139, 250, 0.35);

  --me: #1e293b;
  --ok: #6ee7a8;
  --bad: #f87171;
  --text: #f3f4f6;
  --text-dim: #9ca3af;
  --text-muted: #6b7280;

  --font-mono: "SF Mono", Menlo, Monaco, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

.hidden {
  display: none !important;
}

html, body {
  height: 100%;
  width: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  position: fixed;
  overscroll-behavior-x: none;
  overscroll-behavior-y: contain;
  touch-action: pan-y pinch-zoom;
}

/* PWA INSTALL FLOATING BANNER */
.pwa-install-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  background: #14171d;
  border: 1px solid rgba(89, 156, 231, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8), 0 0 16px rgba(89, 156, 231, 0.2);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 9999;
  animation: slide-down 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-install-banner.hidden {
  display: none !important;
}

@keyframes slide-down {
  from { transform: translate(-50%, -100%); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.pwa-banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.pwa-icon-glow {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #21252d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.pwa-banner-text {
  min-width: 0;
}

.pwa-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pwa-subtitle {
  font-size: 11.5px;
  color: #9aa0a6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.btn-pwa-action {
  background: #599ce7;
  color: #000000;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.12s ease;
}

.btn-pwa-action:hover {
  background: #7bb5f0;
  transform: scale(1.04);
}

.btn-pwa-close {
  background: transparent;
  border: none;
  color: #71767b;
  font-size: 15px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  transition: color 0.12s ease;
}

.btn-pwa-close:hover {
  color: #ffffff;
}

/* Install Guide Modal */
.install-guide-modal {
  max-width: 380px;
}

.install-guide-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

.install-guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #15181e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}

.step-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #599ce7;
  color: #000000;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-desc {
  font-size: 13px;
  color: #e5e7eb;
  line-height: 1.4;
}

.step-desc strong {
  color: #599ce7;
}
/* RECONNECTION BANNER */
.reconnect-banner {
  background: rgba(255, 170, 0, 0.15);
  border-bottom: 1px solid var(--status-amber);
  color: var(--status-amber);
  padding: 6px 16px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
}

.reconnect-banner.hidden {
  display: none;
}

.spinner {
  width: 10px;
  height: 10px;
  border: 2px solid var(--status-amber);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* VIEWS WRAPPER */
.views-wrapper {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.view-panel {
  display: none;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
  padding-bottom: 80px;
}

.view-panel.active {
  display: flex;
}

/* HUD CARDS */
.hud-card {
  background: var(--bg-card);
  border: 1px solid var(--border-hud);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(12px);
}

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

.card-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-cyan);
}

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

/* QUICK ACTION PILLS */
.quick-actions-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.quick-actions-scroll::-webkit-scrollbar {
  display: none;
}

.action-pill {
  flex-shrink: 0;
  padding: 7px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-hud);
  border-radius: 20px;
  color: var(--text-main);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.action-pill:active {
  transform: scale(0.95);
  background: var(--accent-cyan-dim);
  border-color: var(--accent-cyan);
}

.action-pill.power3-pill {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18) 0%, rgba(255, 94, 58, 0.18) 50%, rgba(167, 139, 250, 0.18) 100%);
  border: 1px solid rgba(0, 240, 255, 0.6);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25), inset 0 0 8px rgba(167, 139, 250, 0.2);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.action-pill.power3-pill:hover,
.action-pill.power3-pill:active {
  border-color: #fff;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.5), 0 0 10px rgba(255, 94, 58, 0.4);
  transform: scale(0.97);
}

/* ACTIVE TASK CARD */
.active-task-card {
  border-color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
}

.active-task-card.hidden {
  display: none;
}

.task-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent-cyan);
}

.btn-sm-danger {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 51, 102, 0.2);
  border: 1px solid var(--status-red);
  color: var(--status-red);
  font-size: 10px;
  font-family: var(--font-mono);
  cursor: pointer;
}

.task-cmd-text {
  font-family: var(--font-mono);
  font-size: 12px;
  color: #fff;
  margin: 6px 0;
  word-break: break-all;
}

.task-progress-bar {
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin: 6px 0;
}

.task-progress-fill {
  height: 100%;
  width: 40%;
  background: var(--accent-cyan);
  animation: task-sweep 1.5s infinite ease-in-out;
}

@keyframes task-sweep {
  0% { transform: translateX(-100%); width: 30%; }
  50% { width: 60%; }
  100% { transform: translateX(300%); width: 30%; }
}

.task-log-preview {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  max-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* COMMAND DECK INPUT */
.input-glow-wrapper {
  display: flex;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-hud);
  border-radius: 10px;
  padding: 4px;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.input-glow-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 12px;
  color: #fff;
  font-size: 13px;
  font-family: var(--font-sans);
}

.btn-action {
  background: linear-gradient(135deg, #00f0ff 0%, #0099ff 100%);
  color: #050b14;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.8px;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-action:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* ACTIVITY FEED */
.badge-count {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px;
  border-radius: 6px;
  background: rgba(19, 27, 41, 0.4);
  font-size: 11px;
}

.feed-time {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 1px;
}

.feed-body {
  color: var(--text-dim);
  word-break: break-word;
}

/* WAR ROOM */
.warroom-agents-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 8px;
}

.agent-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  position: relative;
}

.chip-avatar {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  margin-bottom: 4px;
}

.chip-agy .chip-avatar { background: var(--accent-cyan-dim); color: var(--accent-cyan); }
.chip-grok .chip-avatar { background: rgba(255, 94, 58, 0.15); color: var(--accent-grok); }
.chip-claude .chip-avatar { background: rgba(167, 139, 250, 0.15); color: var(--accent-claude); }

.chip-name {
  font-size: 11px;
  font-weight: 700;
}

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

.chip-status {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 7px;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent-cyan);
}

.chat-feed {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 280px;
  max-height: 440px;
  overflow-y: auto;
  padding: 6px 0;
}

.msg-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  line-height: 1.4;
}

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

.sender-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.tag-agy { background: var(--accent-cyan-dim); color: var(--accent-cyan); }
.tag-grok { background: rgba(255, 94, 58, 0.15); color: var(--accent-grok); }
.tag-claude { background: rgba(167, 139, 250, 0.15); color: var(--accent-claude); }
.tag-user { background: rgba(255, 255, 255, 0.1); color: #fff; }

.msg-time {
  font-size: 9px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.msg-content {
  color: var(--text-main);
  word-break: break-word;
  white-space: pre-wrap;
}

.chat-input-bar {
  display: flex;
  gap: 8px;
  font-size: 15px;
  line-height: 1.45;
  overflow: hidden;
  position: fixed;
}

/* RECONNECTION BANNER */
.reconnect-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #f59e0b;
  color: #111827;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 999;
}
.reconnect-banner.hidden { display: none; }
.spinner {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(0,0,0,0.2);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* COCKPIT MAIN CONTAINER */
/* ==========================================================================
   OFFICIAL GROK BOT 3-COLUMN DESKTOP ARCHITECTURE & THEME
   Obsidian Dark Theme: #000000 Base • #090a0d Surface • #16181c Cards • #262930 Line
   ========================================================================== */

.cockpit-container {
  display: grid;
  grid-template-columns: 280px 1fr 340px;
  grid-template-rows: 100vh;
  height: 100vh;
  width: 100vw;
  background: #000000;
  color: #f3f4f6;
  overflow: hidden;
  position: relative;
  font-family: var(--font-sans);
}

.cockpit-container.aux-collapsed {
  grid-template-columns: 280px 1fr 0px;
}

/* ==========================================================================
   1. LEFT SIDEBAR: GROK BOT ROSTER
   ========================================================================== */
.grok-sidebar {
  display: flex;
  flex-direction: column;
  background: #090a0d;
  border-right: 1px solid #1c1e22;
  height: 100vh;
  overflow: hidden;
  z-index: 10;
}

.sidebar-top-bar {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

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

.sidebar-round-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #202124;
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e8eaed;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.sidebar-round-btn:hover, .sidebar-round-btn:active {
  background: #2d2f34;
  color: #ffffff;
}

.sidebar-search-overlay {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  bottom: 6px;
  background: #1c1d20;
  border-radius: 20px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  z-index: 50;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.sidebar-search-overlay.hidden {
  display: none !important;
}

.sidebar-search-overlay .search-icon {
  font-size: 13px;
  color: #8ab4f8;
  margin-right: 8px;
}

.sidebar-search-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 14px;
  color: #fff;
  outline: none;
  font-family: inherit;
}

.btn-close-search {
  background: transparent;
  border: none;
  color: #9aa0a6;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
}

.grok-bots-roster {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.grok-bot-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
  position: relative;
}

.grok-bot-item:hover {
  background: #14161a;
}

.grok-bot-item.active {
  background: #1e2025;
}

.grok-bot-avatar-wrapper {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.creature-avatar-svg {
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
}

.sidebar-user-pill {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #313131;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.grok-bot-details {
  flex: 1;
  min-width: 0;
}

.bot-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.bot-row-top-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.bot-row-top .bot-name {
  font-size: 14.5px;
  font-weight: 650;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.2px;
}

.bot-tag-pill {
  font-size: 11px;
  font-weight: 500;
  color: #9aa0a6;
  background: #222428;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 1.5px 7px;
  border-radius: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
  flex-shrink: 0;
}

.bot-row-top .bot-time {
  font-size: 12px;
  color: #71767b;
  white-space: nowrap;
  flex-shrink: 0;
}

.bot-row-bottom {
  display: flex;
  align-items: center;
  margin-top: 3px;
}

.bot-row-bottom .bot-preview {
  font-size: 13px;
  color: #71767b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  line-height: 1.3;
}

.btn-del-bot {
  opacity: 0;
  background: transparent;
  border: none;
  color: #71767b;
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: opacity 0.15s ease, color 0.15s ease;
}

.grok-bot-item:hover .btn-del-bot {
  opacity: 1;
}

.btn-del-bot:hover {
  color: #ef4444;
}

.sidebar-bottom-bar {
  border-top: 1px solid #1c1e22;
  padding: 8px 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #090a0d;
}

.sidebar-bottom-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background 0.12s ease;
}

.sidebar-bottom-item:hover {
  background: #16181c;
  color: #fff;
}

.sidebar-bottom-item .bottom-icon {
  font-size: 16px;
  color: #9ca3af;
}

.user-profile-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.user-profile-row:hover {
  background: #16181c;
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #27272a;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* ==========================================================================
   2. CENTER CHAT STAGE: CONVERSATIONAL CANVAS
   ========================================================================== */
.chat-stage-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #000000;
  position: relative;
  overflow: hidden;
}

.grok-chat-header {
  height: 52px;
  padding: 0 18px;
  border-bottom: 1px solid #1c1e22;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #000000;
  flex-shrink: 0;
  z-index: 5;
}

.grok-chat-header .header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.active-bot-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.active-bot-circle-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #52525b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}

.active-bot-titles {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.active-session-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grok-chat-header .header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: none;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.header-icon-btn:hover {
  background: #181b20;
  color: #fff;
}

.header-icon-btn.active {
  color: #fff;
}

.p3-council-btn {
  font-size: 12px;
  font-weight: 700;
  color: #e0b04a;
  border: 1px solid rgba(224, 176, 74, 0.3);
  padding: 0 8px;
  width: auto;
  border-radius: 14px;
}

.btn-drawer-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 4px;
}

.chat-main {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  padding-bottom: 90px;
}

.session-panes-viewport {
  width: 100%;
  height: 100%;
}

.session-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  padding: 24px 28px;
}

.session-pane.active {
  display: block;
}

.messages-stream {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* USER MESSAGE: RIGHT-ALIGNED COMPACT PILL */
.msg-row.user {
  display: flex;
  justify-content: flex-end;
  width: 100%;
  margin: 6px 0;
}

.user-bubble {
  background: #2f3336;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 14.5px;
  line-height: 1.45;
  max-width: 75%;
  word-break: break-word;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* BOT MESSAGE: CLEAN MARKDOWN CANVAS (ZERO CLUTTER) */
.msg-row.bot, .msg-row.agy, .msg-row.grok, .msg-row.claude {
  display: flex;
  justify-content: flex-start;
  width: 100%;
  margin: 8px 0;
}

.bot-bubble {
  background: transparent;
  color: #e5e7eb;
  font-size: 14.5px;
  line-height: 1.6;
  width: 100%;
  max-width: 100%;
}

.bot-msg-header {
  display: none; /* Distraction-free: no giant badge headers on every message */
}

/* ==========================================================================
   RICH MARKDOWN & MEDIA FORMATTING (TABLES, IMAGES, LINKS, RED PILLS)
   ========================================================================== */
.bot-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  border: 1px solid #262930;
  border-radius: 8px;
  overflow: hidden;
  font-size: 13.5px;
  background: #0d0f12;
}

.bot-bubble th, .bot-bubble td {
  border: 1px solid #262930;
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

.bot-bubble th {
  background: #16181d;
  color: #e5e7eb;
  font-weight: 650;
  letter-spacing: 0.02em;
  border-bottom: 2px solid #00F0FF;
}

.bot-bubble tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.015);
}

.bot-bubble tr:hover td {
  background: rgba(0, 240, 255, 0.035);
}

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
  border-radius: 8px;
  border: 1px solid #262930;
  background: #0d0f12;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* ==========================================================================
   COLLAPSIBLE TERMINAL LOGS & DETAILS (ZERO TEXT BRICKS)
   ========================================================================== */
.terminal-details, .bot-bubble details {
  margin: 12px 0;
  background: #0c0e12;
  border: 1px solid #262930;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.terminal-details[open], .bot-bubble details[open] {
  border-color: rgba(0, 240, 255, 0.4);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

.terminal-summary, .bot-bubble summary {
  padding: 10px 14px;
  background: #14171c;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease;
}

.terminal-summary:hover, .bot-bubble summary:hover {
  background: #181c22;
  color: #00F0FF;
}

.terminal-details[open] > .terminal-summary, .bot-bubble details[open] > summary {
  border-bottom: 1px solid #262930;
  color: #00F0FF;
}

.terminal-details .code-container, .bot-bubble details .code-container {
  margin: 0;
  border: none;
  border-radius: 0;
  background: #08090c;
}

/* RED HIGHLIGHT PILLS (MATCHING GROK BOT SCREENSHOT) */
.red-tag-pill, .bot-bubble code.inline-code-red {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 1px 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  display: inline-block;
}

.bot-bubble code.inline-code {
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  padding: 1px 6px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* RESPONSIVE IMAGE & SCREENSHOT CARDS */
.chat-image-card {
  margin: 12px 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #262930;
  background: #121418;
  display: inline-block;
  max-width: 100%;
}

.chat-image-card img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  object-fit: cover;
  cursor: zoom-in;
  transition: opacity 0.2s ease;
}

.chat-image-card img:hover {
  opacity: 0.92;
}

.chat-image-caption {
  padding: 6px 12px;
  font-size: 11.5px;
  color: #8b98a5;
  background: #14171c;
  border-top: 1px solid #202328;
}

/* CLICKABLE HYPERLINKS */
.bot-bubble a {
  color: #38bdf8;
  text-decoration: none;
  border-bottom: 1px solid rgba(56, 189, 248, 0.3);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.bot-bubble a:hover {
  color: #7dd3fc;
  border-bottom-color: #7dd3fc;
}

/* SMART HEADINGS & WHITESPACE */
.bot-bubble h1, .bot-bubble h2, .bot-bubble h3, .bot-bubble h4 {
  color: #ffffff;
  font-weight: 700;
  margin: 16px 0 8px 0;
  line-height: 1.35;
}

.bot-bubble h1 { font-size: 18px; border-bottom: 1px solid #22252c; padding-bottom: 6px; }
.bot-bubble h2 { font-size: 16px; }
.bot-bubble h3 { font-size: 14.5px; }

.bot-bubble p {
  margin: 8px 0;
  line-height: 1.6;
}

.bot-bubble ul, .bot-bubble ol {
  margin: 8px 0 8px 20px;
  padding: 0;
}

.bot-bubble li {
  margin: 4px 0;
  line-height: 1.55;
}

.bot-bubble hr {
  border: none;
  border-top: 1px solid #22252c;
  margin: 16px 0;
}

/* GITHUB-STYLE ALERT CALLOUTS */
.chat-alert {
  padding: 10px 14px;
  border-radius: 10px;
  margin: 12px 0;
  font-size: 13.5px;
  line-height: 1.5;
  border-left: 3px solid;
}

.chat-alert.tip {
  background: rgba(16, 185, 129, 0.08);
  border-color: #10b981;
  color: #d1fae5;
}

.chat-alert.note {
  background: rgba(56, 189, 248, 0.08);
  border-color: #38bdf8;
  color: #e0f2fe;
}

.chat-alert.important {
  background: rgba(245, 158, 11, 0.08);
  border-color: #f59e0b;
  color: #fef3c7;
}

.chat-alert.warning {
  background: rgba(239, 68, 68, 0.08);
  border-color: #ef4444;
  color: #fee2e2;
}

/* ==========================================================================
   FLOATING GROK BOT CAPSULE INPUT
   ========================================================================== */
.chat-footer {
  position: absolute;
  bottom: 18px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}

.grok-input-capsule {
  pointer-events: auto;
  width: 90%;
  max-width: 820px;
  background: #181a1e;
  border: 1px solid #282b32;
  border-radius: 26px;
  padding: 6px 12px 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.btn-capsule-plus {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #26282e;
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.grok-input-capsule textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  max-height: 140px;
  resize: none;
  padding: 4px 0;
}

.btn-capsule-voice {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-send-msg {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
  color: #000000;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

.btn-send-msg.has-text {
  opacity: 1;
}

/* ==========================================================================
   3. RIGHT AUXILIARY COLUMN: SCREEN & ROUTINES
   ========================================================================== */
.aux-column {
  display: flex;
  flex-direction: column;
  background: #090a0d;
  border-left: 1px solid #1c1e22;
  height: 100vh;
  overflow-y: auto;
  padding: 16px;
  gap: 16px;
  z-index: 10;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.cockpit-container.aux-collapsed .aux-column {
  display: none;
}

.aux-screen-card {
  background: #121418;
  border: 1px solid #1e2128;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.screen-preview-wrapper {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(140deg, #121318 0%, #20232d 50%, #0d0e12 100%);
  position: relative;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.screen-wallpaper {
  width: 100%;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.08), transparent 60%);
}

.screen-dock {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.dock-app-icon {
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.dock-app-icon:hover {
  transform: scale(1.2);
}

.screen-caption {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 10px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

.aux-routines-card {
  background: #121418;
  border: 1px solid #1e2128;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
}

.routines-desc {
  font-size: 12.5px;
  color: #71767b;
  line-height: 1.45;
  margin-bottom: 12px;
}

.btn-create-routine {
  background: #24272e;
  color: #ffffff;
  border: 1px solid #363a43;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-create-routine:hover {
  background: #2f343e;
  border-color: #4a505c;
}

.aux-routines-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

/* Screen Header on mobile & desktop */
.aux-screen-header {
  height: 54px;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.aux-header-bot-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.aux-header-avatar {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.aux-header-title {
  font-size: 14.5px;
  font-weight: 650;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.aux-round-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #212429;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.aux-round-btn:hover {
  background: #2d3138;
}

/* Virtual Dock Bar */
.virtual-dock-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 8px 16px;
  background: #111215;
  border-radius: 16px;
  margin: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dock-item {
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: transform 0.15s ease, background 0.15s ease;
}

.dock-item:hover {
  transform: scale(1.15);
  background: rgba(255, 255, 255, 0.08);
}

/* Bottom Virtual Screen Toolbar */
.virtual-screen-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: #0e1013;
}

.screen-tool-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #212429;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.screen-tool-btn:hover {
  background: #2d3138;
  transform: scale(1.05);
}

.screen-keyboard-hidden-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.btn-header-back {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #212429;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s ease;
  margin-right: 8px;
}

.btn-header-back:hover {
  background: #2d3138;
}

/* ==========================================================================
   RESPONSIVE: MOBILE (3-SCREEN NATIVE FLOW) & DESKTOP (3-COLUMN LAYOUT)
   ========================================================================== */
@media (max-width: 959px) {
  .cockpit-container {
    display: block !important;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
  }

  .btn-header-back {
    display: flex !important;
  }

  .btn-drawer-toggle {
    display: none !important;
  }

  /* 1. Mobile Screen: ROSTER (Default) */
  .cockpit-container[data-mobile-view="roster"] .grok-sidebar {
    display: flex !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    transform: none !important;
    z-index: 10;
    border-right: none;
  }
  .cockpit-container[data-mobile-view="roster"] .chat-stage-wrapper {
    display: none !important;
  }
  .cockpit-container[data-mobile-view="roster"] .aux-column {
    display: none !important;
  }

  /* 2. Mobile Screen: CHAT */
  .cockpit-container[data-mobile-view="chat"] .grok-sidebar {
    display: none !important;
  }
  .cockpit-container[data-mobile-view="chat"] .chat-stage-wrapper {
    display: flex !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10;
  }
  .cockpit-container[data-mobile-view="chat"] .aux-column {
    display: none !important;
  }

  /* 3. Mobile Screen: VIRTUAL SCREEN */
  .cockpit-container[data-mobile-view="screen"] .grok-sidebar {
    display: none !important;
  }
  .cockpit-container[data-mobile-view="screen"] .chat-stage-wrapper {
    display: none !important;
  }
  .cockpit-container[data-mobile-view="screen"] .aux-column {
    display: flex !important;
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    z-index: 10;
  }

  .sidebar-top-bar {
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    padding: 12px 16px;
    gap: 12px;
  }

  .sidebar-user-pill {
    display: flex;
  }

  .grok-bot-item {
    padding: 12px 16px;
    gap: 14px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  }

  .bot-row-top .bot-name {
    font-size: 15px;
    max-width: 175px;
  }

  .bot-row-bottom .bot-preview {
    font-size: 13px;
  }

  .grok-input-capsule {
    margin: 0 12px;
  }

  .p3-council-btn {
    display: none !important;
  }

  .btn-del-bot {
    display: none !important;
  }
}

@media (min-width: 960px) {
  .cockpit-container {
    display: grid !important;
    grid-template-columns: 280px 1fr 340px !important;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
  }

  .grok-sidebar {
    display: flex !important;
    position: relative !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border-right: 1px solid var(--line);
  }

  .chat-stage-wrapper {
    display: flex !important;
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
  }

  .aux-column {
    display: flex !important;
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    border-left: 1px solid var(--line);
  }

  .btn-header-back {
    display: none !important;
  }

  .sidebar-user-pill {
    display: none;
  }
}

.top-pill-btn {
  color: var(--text-dim);
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.top-pill-btn .pill-activity-dot {
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px var(--accent-cyan);
  animation: pulse-dot 1.2s infinite ease-in-out;
}
.top-pill-btn.has-activity .pill-activity-dot {
  display: inline-block;
}
.top-pill-btn.active[data-switch-bot="agy"] {
  border-color: var(--agy);
  color: var(--agy);
  background: var(--agy-dim);
}
.top-pill-btn.active[data-switch-bot="grok"] {
  border-color: var(--grok);
  color: var(--grok);
  background: var(--grok-dim);
}
.top-pill-btn.active[data-switch-bot="claude"] {
  border-color: var(--claude);
  color: var(--claude);
  background: var(--claude-dim);
}
.top-pill-btn[data-switch-bot="agy"] .pill-activity-dot {
  background: var(--agy);
  box-shadow: 0 0 8px var(--agy);
}
.top-pill-btn[data-switch-bot="grok"] .pill-activity-dot {
  background: var(--grok);
  box-shadow: 0 0 8px var(--grok);
}
.top-pill-btn[data-switch-bot="claude"] .pill-activity-dot {
  background: var(--claude);
  box-shadow: 0 0 8px var(--claude);
}

@keyframes pulse-dot {
  0% { transform: scale(0.75); opacity: 0.5; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.75); opacity: 0.5; }
}

.hud-pill {
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pill-p3 {
  border-color: rgba(224, 176, 74, 0.4);
  color: var(--grok);
}
.pill-conn {
  width: 28px;
  height: 28px;
  padding: 0;
}
.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.pill-conn.offline .conn-dot {
  background: var(--bad);
  box-shadow: none;
}
.pill-install.hidden { display: none; }

/* CHAT MAIN FEED (TMUX MULTI-PANE VIRTUAL SCREEN ARCHITECTURE) */
.chat-main {
  flex: 1;
  overflow: hidden; /* Scroll is handled by each session pane independently */
  position: relative;
  display: flex;
  flex-direction: column;
}

.session-panes-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  display: flex;
}

.session-pane {
  display: none;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 14px 16px;
  box-sizing: border-box;
  flex-direction: column;
}

.session-pane.active {
  display: flex;
}

.conversation-stream {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

/* MESSAGE ROWS & GROK MOBILE BUBBLES */
.msg-row {
  display: flex;
  flex-direction: column;
  width: 100%;
  animation: fadeIn 0.2s ease;
}
.msg-row.user-row {
  align-items: flex-end;
}
.msg-row.bot-row {
  align-items: flex-start;
}

.msg-bubble {
  word-break: break-word;
  font-size: 15px;
  line-height: 1.55;
}
.user-bubble {
  max-width: 86%;
  background: #1f2228;
  color: #f7f9f9;
  border: 1px solid #2f3336;
  padding: 10px 15px;
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.bot-bubble {
  width: 100%;
  max-width: 100%;
  background: transparent;
  color: #e7e9ea;
  border: none;
  padding: 4px 0 10px;
}

.bot-msg-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.bot-avatar-sm {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  background: #16181c;
  border: 1px solid #2f3336;
  flex-shrink: 0;
}
.bot-name-label {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
}
.bot-model-tag {
  font-size: 11px;
  color: #71767b;
}
.bot-time-tag {
  font-size: 10px;
  color: #536471;
  font-family: var(--font-mono);
  margin-left: auto;
}

.msg-body {
  font-size: 15px;
  line-height: 1.6;
  color: #e7e9ea;
}

/* COLLAPSIBLE WORK / THINKING CARDS */
.msg-work-card {
  align-self: flex-start;
  max-width: 94%;
  background: #0f1117;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 12.5px;
}
.work-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.work-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--grok);
}
.work-card-body {
  margin-top: 6px;
  color: #cbd5e1;
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  max-height: 180px;
  overflow-y: auto;
}

/* TYPOGRAPHY IN BOT RESPONSES */
.msg-bubble p { margin-bottom: 0.6em; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble h2, .msg-bubble h3 {
  font-size: 1.05em;
  font-weight: 750;
  margin: 0.8em 0 0.3em;
}
.msg-bubble h2:first-child, .msg-bubble h3:first-child { margin-top: 0; }
.msg-bubble ul, .msg-bubble ol {
  margin: 0.4em 0 0.6em;
  padding-left: 1.2em;
}
.msg-bubble li { margin: 0.2em 0; }
.msg-bubble code.inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: #090a0f;
  border: 1px solid var(--line);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: #38bdf8;
}
.msg-bubble pre.code-block {
  background: #08090d;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.45;
  margin: 0.6em 0;
}
.msg-bubble table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.6em 0;
  font-size: 12.5px;
}
.msg-bubble th, .msg-bubble td {
  border: 1px solid var(--line);
  padding: 5px 8px;
  text-align: left;
}
.msg-bubble th {
  background: #181b24;
  color: var(--grok);
}

/* HEADER NEW CHAT BUTTON */
.header-new-chat-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.1s ease, background 0.15s ease;
  flex-shrink: 0;
}
.header-new-chat-btn:active {
  transform: scale(0.92);
  background: #d1d5db;
}

/* GROK BOT EMPTY STATE / WELCOME SCREEN */
.session-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px 20px;
  max-width: 600px;
  margin: auto;
  gap: 16px;
  animation: fadeIn 0.3s ease;
}
.welcome-emblem {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #121417;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 0 24px rgba(255, 255, 255, 0.06);
}
.welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.02em;
}
.welcome-sub {
  font-size: 13.5px;
  color: #71767b;
  max-width: 380px;
  line-height: 1.5;
}
.suggestion-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  margin-top: 12px;
}
@media (max-width: 480px) {
  .suggestion-cards-grid {
    grid-template-columns: 1fr;
  }
}
.suggestion-card {
  background: #121417;
  border: 1px solid #202327;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.suggestion-card:hover {
  background: #1a1d24;
  border-color: #38444d;
  transform: translateY(-1px);
}
.suggestion-card:active {
  transform: scale(0.98);
}
.suggestion-card-title {
  font-size: 13px;
  font-weight: 650;
  color: #f7f9f9;
  display: flex;
  align-items: center;
  gap: 6px;
}
.suggestion-card-desc {
  font-size: 11px;
  color: #71767b;
  font-family: var(--font-mono);
}

/* GROK MESSAGE ACTIONS TOOLBAR */
.msg-action-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding-left: 2px;
}
.msg-action-btn {
  background: transparent;
  border: none;
  color: #71767b;
  padding: 4px 6px;
  border-radius: 6px;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.msg-action-btn:hover {
  color: #f7f9f9;
  background: rgba(255, 255, 255, 0.06);
}

/* CODE BLOCK HEADER WITH COPY BUTTON */
.code-container {
  background: #090a0d;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 0.7em 0;
  overflow: hidden;
}
.code-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #14171c;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  font-family: var(--font-mono);
  color: #8b98a5;
}
.btn-copy-code {
  background: transparent;
  border: none;
  color: #8b98a5;
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}
.btn-copy-code:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.code-container pre {
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  padding: 10px 12px !important;
}

/* FOOTER INPUT DECK (GROK MOBILE CAPSULE ALREADY DECLARED ABOVE) */

/* QUICK ACTION CHIPS BAR */
.chat-chips-bar {
  display: none; /* Clean distraction-free Grok Bot input by default */
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 8px;
  scrollbar-width: none;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.chat-chips-bar.show {
  display: flex;
}
.chat-chips-bar::-webkit-scrollbar { display: none; }
.chat-chip-btn {
  background: #121418;
  border: 1px solid #202327;
  color: #8b98a5;
  padding: 4px 10px;
  border-radius: 14px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.chat-chip-btn:hover {
  color: #f7f9f9;
  border-color: #38444d;
  background: #1a1d24;
}
.chat-chip-btn:active {
  transform: scale(0.96);
}

/* MORE ACTIONS POPUP MENU */
.more-actions-menu {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 14px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}
.more-actions-menu.hidden { display: none; }
.more-action-item {
  background: #202327;
  border: 1px solid #2f3336;
  color: #d1d5db;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.more-action-item:hover { color: #fff; border-color: #4b5563; }

/* THE GROK CAPSULE */
.grok-input-capsule {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: #16181c;
  border: 1px solid #2f3336;
  border-radius: 26px;
  padding: 6px 8px 6px 10px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.grok-input-capsule:focus-within {
  border-color: #536471;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.05);
}

.btn-capsule-plus {
  background: #202327;
  border: 1px solid #2f3336;
  color: #8b98a5;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
  margin-bottom: 2px;
}
.btn-capsule-plus:hover {
  color: #fff;
  background: #2b3038;
}
.btn-capsule-plus:active {
  transform: scale(0.92);
}

textarea#chat-input {
  flex: 1;
  resize: none;
  min-height: 34px;
  max-height: 120px;
  background: transparent;
  border: none;
  color: #f7f9f9;
  padding: 7px 4px 7px 4px;
  font: inherit;
  font-size: 14.5px;
  line-height: 1.4;
  outline: none;
  margin-bottom: 1px;
}
textarea#chat-input::placeholder {
  color: #71767b;
}

.btn-send-msg {
  background: #2b3038;
  color: #71767b;
  border: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  margin-bottom: 1px;
}
.btn-send-msg.has-text {
  background: #ffffff;
  color: #000000;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.25);
  cursor: pointer;
}
.btn-send-msg.has-text:active {
  transform: scale(0.92);
  background: #e5e7eb;
}

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

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.hidden { display: none; }
.modal-box {
  background: #11131a;
  border: 1px solid var(--line);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.8);
}
.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title {
  font-size: 14px;
  font-weight: 750;
  color: #fff;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 16px;
  cursor: pointer;
}
.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
}
.modal-bot-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.bot-radio-card {
  position: relative;
  cursor: pointer;
}
.bot-radio-card input {
  position: absolute;
  opacity: 0;
}
.bot-radio-card .card-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}
.bot-radio-card input:checked + .card-content {
  border-color: var(--agy);
  background: var(--agy-dim);
}
.bot-radio-card:nth-child(2) input:checked + .card-content {
  border-color: var(--grok);
  background: var(--grok-dim);
}
.bot-radio-card:nth-child(3) input:checked + .card-content {
  border-color: var(--claude);
  background: var(--claude-dim);
}
.card-icon { font-size: 18px; }
.card-title { font-size: 12px; font-weight: 750; color: #fff; }
.card-desc { font-size: 9px; color: var(--text-muted); }

.form-field input[type="text"], .form-select {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  outline: none;
}
.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.btn-modal-secondary {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text-dim);
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-modal-primary {
  flex: 2;
  background: var(--grok);
  color: #111;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

/* FLEET NODES LIST */
.fleet-nodes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fleet-node-card {
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 12px;
  transition: all 0.15s ease;
}
.fleet-node-card.current-machine {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.03);
}
.fleet-node-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fleet-node-name {
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.fleet-node-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
}
.fleet-node-dot.offline {
  background: var(--text-muted);
}
.fleet-node-badge {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #1e2430;
  color: var(--text-muted);
  text-transform: uppercase;
}
.fleet-node-badge.master {
  background: rgba(0, 240, 255, 0.15);
  color: var(--agy);
}
.fleet-node-badge.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
}
.fleet-node-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
  font-family: var(--font-mono);
}
.fleet-node-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.btn-fleet-deploy {
  flex: 1;
  padding: 5px 8px;
  background: #1a2233;
  border: 1px solid #2d3b55;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-fleet-deploy:hover {
  background: #23304a;
  border-color: var(--grok);
}
.btn-fleet-open {
  padding: 5px 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-fleet-open:hover {
  border-color: var(--agy);
  color: var(--agy);
}

/* CORE BOTS LIST */
.core-bots-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.core-bot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.core-bot-card:hover {
  background: var(--panel-hover);
}
.core-bot-card.active {
  border-color: var(--agy);
  background: rgba(0, 240, 255, 0.08);
}
.core-bot-card.active.grok {
  border-color: var(--grok);
  background: rgba(255, 94, 58, 0.08);
}
.core-bot-card.active.claude {
  border-color: var(--claude);
  background: rgba(167, 139, 250, 0.08);
}
.core-bot-card .core-bot-icon {
  font-size: 18px;
}
.core-bot-card .core-bot-info {
  flex: 1;
  min-width: 0;
}
.core-bot-card .core-bot-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  display: block;
}
.core-bot-card .core-bot-sub {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
}
.core-bot-card .core-bot-indicator {
  font-size: 9px;
  font-weight: 750;
  padding: 2px 6px;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.core-bot-card.active .core-bot-indicator {
  background: rgba(0, 240, 255, 0.15);
  color: var(--agy);
  border-color: rgba(0, 240, 255, 0.3);
}
.core-bot-card.active.grok .core-bot-indicator {
  background: rgba(255, 94, 58, 0.15);
  color: var(--grok);
  border-color: rgba(255, 94, 58, 0.3);
}
.core-bot-card.active.claude .core-bot-indicator {
  background: rgba(167, 139, 250, 0.15);
  color: var(--claude);
  border-color: rgba(167, 139, 250, 0.3);
}

/* WORKFORCE CARDS & ROUTINE PATROL STYLING */
.workforce-card {
  background: #0d0e12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--agy);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 6px 0;
}
.workforce-card.worker-grok {
  border-left-color: var(--grok);
  background: linear-gradient(135deg, rgba(255, 94, 58, 0.04) 0%, #0d0e12 100%);
}
.workforce-card.worker-claude {
  border-left-color: var(--claude);
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.04) 0%, #0d0e12 100%);
}
.workforce-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 11px;
}
.workforce-badge {
  font-weight: 750;
  color: #fff;
  letter-spacing: 0.3px;
}
.workforce-duration {
  font-size: 10px;
  color: var(--text-dim);
  font-family: ui-monospace, monospace;
}
.workforce-tag {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}
.routine-card {
  background: #0b0f14;
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 6px 0;
}
.routine-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.routine-icon {
  font-size: 14px;
}
.routine-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--agy);
  flex: 1;
}
.routine-badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--agy);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(0, 240, 255, 0.3);
}

/* HOST RESUME / SLEEP TOAST */
.host-resume-toast {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: rgba(13, 17, 23, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 240, 255, 0.25), 0 0 16px rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 30px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  animation: slideDownToast 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.host-resume-toast.hidden {
  display: none;
}
@keyframes slideDownToast {
  from { opacity: 0; transform: translate(-50%, -20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ACTIVE PROJECT BADGE IN HEADER */
.active-project-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #00f0ff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 6px;
  max-width: 150px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.active-project-badge.hidden {
  display: none;
}

/* REAL-TIME INTENT CHIP ABOVE CHAT BAR */
.chat-intent-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.15) 0%, rgba(255, 94, 58, 0.1) 100%);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 10px;
  padding: 6px 12px;
  margin: 0 10px 8px 10px;
  font-size: 11.5px;
  color: #f3f4f6;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  animation: fadeInIntent 0.25s ease;
}
.chat-intent-chip.hidden {
  display: none !important;
}
@keyframes fadeInIntent {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.intent-chip-text {
  flex: 1;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-chip-action {
  background: #00f0ff;
  color: #050608;
  border: none;
  font-size: 10.5px;
  font-weight: 750;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn-chip-action:active {
  transform: scale(0.95);
}

/* STUDIO MODAL & REAL-TIME ASSESSMENT HUD */
.studio-modal {
  max-width: 520px;
  width: 92vw;
}
.studio-mode-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 3px;
  margin: 12px 16px 6px 16px;
  gap: 4px;
}
.studio-tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 650;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.studio-tab-btn.active {
  background: #1e2433;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* REAL-TIME INTENT ASSESSMENT HUD CARD */
.project-assessment-hud {
  background: #0a0d14;
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hud-assess-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.hud-radar-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00f0ff;
  box-shadow: 0 0 10px #00f0ff;
  animation: pulseRadar 1.5s infinite;
}
@keyframes pulseRadar {
  0% { transform: scale(0.85); opacity: 0.6; }
  50% { transform: scale(1.25); opacity: 1; box-shadow: 0 0 14px #00f0ff; }
  100% { transform: scale(0.85); opacity: 0.6; }
}
.hud-assess-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  color: #00f0ff;
  text-transform: uppercase;
}
.hud-assess-item {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
}
.hud-label {
  color: var(--text-dim);
  font-weight: 600;
  min-width: 90px;
}
.hud-value {
  color: #f3f4f6;
  font-weight: 600;
  flex: 1;
}
.hud-code {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  word-break: break-all;
  flex: 1;
}
.hud-assess-preview {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
}
.preview-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #f59e0b;
  display: block;
  margin-bottom: 3px;
}
.preview-text {
  font-size: 11.5px;
  color: #d1d5db;
  line-height: 1.4;
  margin: 0;
}

/* ==========================================================================
   IMAGE LIGHTBOX VIEWER & MEDIA PREVIEW
   ========================================================================== */
.image-lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  animation: fadeInLightbox 0.2s ease-out;
}

.image-lightbox-modal.hidden {
  display: none !important;
}

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

.lightbox-content {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 82vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.15);
  object-fit: contain;
}

.lightbox-caption {
  margin-top: 14px;
  color: #e5e7eb;
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
  max-width: 80%;
}

.lightbox-close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  z-index: 100000;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(1.08);
}

/* BLOCKQUOTE STYLING */
.bot-bubble blockquote.chat-quote {
  border-left: 3px solid #38444d;
  padding: 6px 14px;
  margin: 10px 0;
  color: #9ca3af;
  font-style: italic;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 0 8px 8px 0;
}

/* TASK LIST ITEMS */
.task-item {
  list-style: none !important;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
}

.task-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1.5px solid #4b5563;
  border-radius: 4px;
  background: #111318;
  cursor: default;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}

.task-item input[type="checkbox"]:checked {
  background: #10b981;
  border-color: #10b981;
}

.task-item input[type="checkbox"]:checked::after {
  content: "✓";
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
}

.task-item.done {
  color: #9ca3af;
  text-decoration: line-through;
}

/* LIVE SCREEN PREVIEW IN AUX COLUMN */
.screen-preview-wrapper img.live-screen-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.screen-preview-wrapper:hover img.live-screen-feed {
  transform: scale(1.02);
}

.btn-refresh-screen {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.85;
  transition: opacity 0.15s ease, background 0.15s ease;
  z-index: 5;
}

.btn-refresh-screen:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.9);
}

/* SIDEBAR + DROPDOWN (Screenshot 2) */
.sidebar-plus-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.btn-circle-add svg {
  pointer-events: none;
}

.plus-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08);
  padding: 6px;
  min-width: 185px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  transform-origin: top right;
  animation: dropdownPop 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownPop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.plus-dropdown-menu.hidden {
  display: none !important;
}

.plus-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease;
  white-space: nowrap;
  box-sizing: border-box;
}

.plus-dropdown-item:hover, .plus-dropdown-item:active {
  background: rgba(255, 255, 255, 0.12);
}

.plus-dropdown-item svg {
  color: #a1a1aa;
  flex-shrink: 0;
  pointer-events: none;
}

.plus-dropdown-item span {
  pointer-events: none;
}

/* 1:1 CREATE NEW BOT MODAL / FULLSCREEN (Screenshot 1) */
.create-bot-modal {
  width: 100%;
  max-width: 440px;
  background: #0f1012;
  border-radius: 24px;
  padding: 20px 20px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 600px) {
  .create-bot-modal {
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    padding: calc(env(safe-area-inset-top, 16px) + 12px) 20px calc(env(safe-area-inset-bottom, 16px) + 20px);
    justify-content: space-between;
  }
}

.create-bot-top-bar {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-round-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1c1c1e;
  border: none;
  color: #ffffff;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-round-close:hover {
  background: #2c2c2e;
}

.create-bot-header-title {
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
}

.create-bot-avatar-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 8px;
}

.avatar-hero-container {
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.create-bot-input-container {
  width: 100%;
}

.create-bot-input {
  width: 100%;
  height: 52px;
  background: #1c1c1e;
  border: none;
  border-radius: 14px;
  padding: 0 16px;
  color: #ffffff;
  font-size: 16px;
  outline: none;
  text-align: left;
}

.create-bot-input::placeholder {
  color: #8e8e93;
}

.create-bot-palette-card {
  background: #1c1c1e;
  border-radius: 18px;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.palette-colors-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-start;
}

.palette-color-swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}

.palette-color-swatch:active {
  transform: scale(0.92);
}

.palette-color-swatch.active {
  box-shadow: 0 0 0 3px #1c1c1e, 0 0 0 5px #636366;
}

.palette-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  width: 100%;
}

.palette-shapes-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  max-height: 120px;
  overflow-y: auto;
  padding: 4px 0;
}

.palette-shape-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 2px;
  transition: transform 0.15s ease;
}

.palette-shape-btn:active {
  transform: scale(0.9);
}

.palette-shape-btn.active {
  box-shadow: 0 0 0 2px #636366;
  background: rgba(255, 255, 255, 0.05);
}

.create-bot-bottom-bar {
  width: 100%;
  padding-top: 6px;
}

.btn-create-submit {
  width: 100%;
  height: 52px;
  border-radius: 26px;
  border: none;
  background: #ffffff;
  color: #000000;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.1s ease;
}

.btn-create-submit:disabled {
  background: #3a3a3c;
  color: #8e8e93;
  cursor: not-allowed;
  opacity: 0.8;
}

.btn-create-submit:not(:disabled):active {
  transform: scale(0.98);
}

/* GROUP CHAT MODAL (Grok Bot Architecture) */
.group-members-picker {
  background: #1c1c1e;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.group-members-title {
  font-size: 13px;
  font-weight: 600;
  color: #8e8e93;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.group-members-count {
  font-size: 12px;
  color: #8ab4f8;
  font-weight: 600;
}

.group-members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.group-member-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: background 0.12s ease;
  user-select: none;
}

.group-member-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.group-member-item.selected {
  background: rgba(138, 180, 248, 0.12);
}

.group-member-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.group-member-name {
  font-size: 14.5px;
  font-weight: 500;
  color: #ffffff;
}

.group-member-desc {
  font-size: 12px;
  color: #8e8e93;
}

.group-member-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #5f6368;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.group-member-item.selected .group-member-checkbox {
  background: #8ab4f8;
  border-color: #8ab4f8;
  color: #000000;
  font-weight: 800;
  font-size: 13px;
}

/* IN-CHAT INTERACTIVE DECISION CARD (Screenshot 3 & 4) */
.bot-decision-card {
  background: #1c1c1e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 12px 0;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.decision-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.decision-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.decision-card-close {
  background: transparent;
  border: none;
  color: #8e8e93;
  font-size: 16px;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}

.decision-card-close:hover {
  color: #ffffff;
}

.decision-card-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.decision-option-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #2c2c2e;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.decision-option-btn:hover {
  background: #3a3a3c;
  border-color: rgba(255, 255, 255, 0.15);
}

.decision-option-btn:active {
  transform: scale(0.98);
}

.option-badge {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: #1c1c1e;
  color: #8e8e93;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-text {
  font-size: 14px;
  font-weight: 500;
  color: #ffffff;
}

.decision-card-footer {
  font-size: 12px;
  color: #8e8e93;
}

/* CHAT HEADER SINGLE PILL (Screenshot 3 & 4) */
.active-bot-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1c1c1e;
  border-radius: 20px;
  padding: 4px 12px 4px 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: calc(100vw - 140px);
}

.active-bot-pill .active-session-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   MOBILE-FIRST 5-TAB NAVIGATION BAR
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(10, 11, 15, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 100;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

@media (max-width: 959px) {
  .mobile-bottom-nav {
    display: flex;
  }

  .cockpit-container[data-mobile-view="chat"] .chat-footer {
    bottom: 0 !important;
    position: fixed !important;
    left: 0;
    width: 100vw !important;
    box-sizing: border-box;
    z-index: 50;
  }

  .cockpit-container[data-mobile-view="chat"] .session-pane {
    padding-bottom: calc(110px + var(--safe-bottom)) !important;
  }

  .cockpit-container[data-mobile-view="roster"] .grok-bots-roster {
    padding-bottom: calc(65px + var(--safe-bottom)) !important;
  }

  .cockpit-container[data-mobile-view="screen"] .aux-column {
    padding-bottom: calc(65px + var(--safe-bottom)) !important;
  }
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: #8e8e93;
  padding: 6px 0;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.1s ease;
  user-select: none;
  -webkit-user-select: none;
}

.nav-tab .nav-icon {
  font-size: 19px;
  line-height: 1.1;
  transition: transform 0.15s ease;
}

.nav-tab .nav-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.nav-tab:hover {
  color: #ffffff;
}

.nav-tab:active {
  transform: scale(0.92);
}

.nav-tab.active {
  color: var(--arc-cyan, #00f0ff);
}

.nav-tab.active .nav-icon {
  transform: translateY(-1px);
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.5));
}

/* ==========================================================================
   STREAMING ACCORDION, PROGRESS BEATS & PROOFS
   ========================================================================== */
.thinking-accordion {
  margin: 8px 0;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: border-color 0.15s ease;
}

.thinking-accordion[open] {
  border-color: rgba(167, 139, 250, 0.3);
}

.thinking-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: #a78bfa;
  font-size: 11.5px;
  font-weight: 600;
  user-select: none;
  background: rgba(167, 139, 250, 0.08);
  list-style: none;
}

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

.thinking-summary::before {
  content: '▸';
  font-size: 11px;
  transition: transform 0.15s ease;
  display: inline-block;
}

.thinking-accordion[open] .thinking-summary::before {
  transform: rotate(90deg);
}

.thinking-len {
  margin-left: auto;
  font-size: 10.5px;
  color: #6b7280;
  font-weight: 500;
}

.thinking-content {
  padding: 8px 10px;
  margin: 0;
  color: #c4b5fd;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.progress-beat-ticker {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  margin: 6px 0;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #67e8f9;
  animation: pulse-border 2s infinite ease-in-out;
}

.progress-beat-ticker.beat-finished {
  background: rgba(110, 231, 168, 0.06);
  border-color: rgba(110, 231, 168, 0.25);
  color: #86efac;
  animation: none;
}

.beat-pulse {
  display: inline-block;
  animation: spin-or-pulse 1.2s infinite ease-in-out;
}

@keyframes pulse-border {
  0%, 100% { border-color: rgba(0, 240, 255, 0.2); }
  50% { border-color: rgba(0, 240, 255, 0.5); }
}

@keyframes spin-or-pulse {
  0% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.7; }
}

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

.streaming-cursor {
  display: inline-block;
  color: var(--arc-cyan, #00f0ff);
  font-weight: 700;
  animation: blink-cursor 0.9s infinite step-start;
  margin-left: 2px;
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* PROOF DECK & CARDS */
.proof-deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 6px;
}

.proof-card {
  background: #12141a;
  border: 1px solid #232733;
  border-radius: 10px;
  overflow: hidden;
  font-size: 12px;
}

.proof-card.proof-diff {
  border-left: 3px solid #00f0ff;
}
.proof-card.proof-test {
  border-left: 3px solid #34c759;
}
.proof-card.proof-file {
  border-left: 3px solid #af52de;
}
.proof-card.proof-exit {
  border-left: 3px solid #ff9500;
}
.proof-card.proof-log {
  border-left: 3px solid #8e8e93;
}

.proof-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.proof-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
}

.proof-badge-diff { background: rgba(0, 240, 255, 0.18); color: #00f0ff; }
.proof-badge-test { background: rgba(52, 199, 89, 0.18); color: #34c759; }
.proof-badge-file { background: rgba(175, 82, 222, 0.18); color: #c084fc; }
.proof-badge-exit { background: rgba(255, 149, 0, 0.18); color: #ff9500; }
.proof-badge-log { background: rgba(142, 142, 147, 0.18); color: #d1d5db; }

.proof-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #f3f4f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.proof-stat {
  font-size: 10.5px;
  color: #9ca3af;
}

.proof-preview {
  margin: 0;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.4;
  color: #d1d5db;
  background: transparent;
  max-height: 160px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ROUTINE DIGEST CARD */
.routine-digest-card {
  border-radius: 14px;
  padding: 12px 14px;
  background: #151821;
  border: 1px solid #232733;
}

.routine-digest-card.is-actionable {
  border-color: rgba(255, 149, 0, 0.4);
  background: linear-gradient(180deg, rgba(255, 149, 0, 0.08) 0%, #151821 100%);
}

.routine-digest-card.is-clean {
  border-color: rgba(52, 199, 89, 0.25);
}

.routine-digest-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.digest-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  flex: 1;
}

.digest-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.4px;
}

.digest-badge.badge-actionable {
  background: rgba(255, 149, 0, 0.2);
  color: #ff9500;
}

.digest-badge.badge-clean {
  background: rgba(52, 199, 89, 0.15);
  color: #34c759;
}

/* ============================================================
   GROK BOT 1:1 PIXEL-PERFECT MOBILE INTERFACE (SCREENS 1, 2, 3)
   ============================================================ */

/* Hide legacy bottom nav completely */
.mobile-bottom-nav {
  display: none !important;
}

/* Base Body & App Container */
body, html {
  background-color: #000000 !important;
  color: #ffffff !important;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

/* SCREEN 1: AGENTS HOME */
.sidebar-header-area {
  padding: 16px 18px 8px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-large-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.6px;
  margin: 0;
  color: #ffffff;
}

.btn-circle-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2c2c2e;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-circle-add:active {
  transform: scale(0.92);
  opacity: 0.8;
}

.sidebar-search-bar {
  background: #1c1c1e;
  border-radius: 12px;
  height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
}

.sidebar-search-bar input {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 16px;
  width: 100%;
  outline: none;
}

.sidebar-search-bar input::placeholder {
  color: #8e8e93;
}

.grok-bots-roster {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.roster-empty-clean {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 8px;
}

.empty-clean-sub {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: -0.3px;
}

.empty-clean-hint {
  font-size: 14px;
  color: #8e8e93;
  line-height: 1.4;
  max-width: 220px;
}

.clean-agent-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px 30px;
  text-align: center;
  gap: 12px;
}

.clean-welcome-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.clean-welcome-title {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.4px;
  margin: 0;
}

.clean-welcome-sub {
  font-size: 14px;
  color: #8e8e93;
  margin: 0;
  max-width: 280px;
  line-height: 1.4;
}

.grok-bot-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s ease;
  background: transparent;
  border: none;
}

.grok-bot-item:hover, .grok-bot-item.active {
  background: #1c1c1e !important;
}

.grok-bot-avatar-wrapper {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.grok-bot-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

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

.bot-name {
  font-size: 16.5px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bot-time {
  font-size: 13.5px;
  color: #8e8e93;
  flex-shrink: 0;
}

.bot-preview {
  font-size: 14px;
  color: #8e8e93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-bottom-bar {
  padding: 10px 14px calc(24px + env(safe-area-inset-bottom, 0px)) 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: auto;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.sidebar-footer-row:hover, .sidebar-footer-row:active {
  background: #1c1c1e;
}

.footer-row-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.user-avatar-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2c2c2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}

.footer-label {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
}

.footer-user-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.footer-host-badge {
  font-size: 11px;
  font-weight: 500;
  color: #34c759;
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.fleet-modal-box {
  width: 100%;
  max-width: 420px;
  background: #1c1c1e;
  border-radius: 20px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.fleet-machines-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.machine-card {
  display: flex;
  flex-direction: column;
  background: #2c2c2e;
  border-radius: 14px;
  padding: 14px 16px;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.machine-card.active-machine {
  border-color: rgba(52, 199, 89, 0.4);
  background: #222b24;
}

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

.machine-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
}

.machine-status-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}

.machine-status-tag.active {
  background: rgba(52, 199, 89, 0.2);
  color: #34c759;
}

.machine-status-tag.standby {
  background: rgba(255, 255, 255, 0.1);
  color: #8e8e93;
}

.machine-card-sub {
  font-size: 13px;
  color: #8e8e93;
}

.btn-switch-machine {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px 14px;
  background: #007aff;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  border: none;
  margin-top: 4px;
  transition: opacity 0.15s;
  box-sizing: border-box;
}

.btn-switch-machine:active {
  opacity: 0.8;
}

.fleet-hint-text {
  font-size: 12px;
  color: #8e8e93;
  line-height: 1.4;
  text-align: center;
  padding: 4px 8px 0;
}

/* SCREEN 2: CHAT */
.grok-chat-header {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 30;
}

.active-bot-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 20px;
}

.active-session-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
}

.header-icon-btn, .btn-header-back {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  border-radius: 50%;
}

.header-icon-btn:active, .btn-header-back:active {
  background: rgba(255, 255, 255, 0.1);
}

.chat-main {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

/* Chat Messages (Native iOS iMessage styling matching mobile-02-chat.png) */
.msg-row {
  width: 100%;
  display: flex;
  margin: 4px 0;
}

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

.msg-row.bot-row {
  justify-content: flex-start;
}

.msg-row.user-row .msg-bubble.user-bubble {
  align-self: flex-end;
  background: #007aff !important;
  color: #ffffff !important;
  border-radius: 18px 18px 4px 18px !important;
  padding: 10px 16px !important;
  max-width: 80% !important;
  font-size: 15.5px !important;
  line-height: 1.4 !important;
  margin: 4px 0 !important;
  border: none !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.msg-row.bot-row .msg-bubble.bot-bubble {
  align-self: flex-start;
  background: #1c1c1e !important;
  color: #ffffff !important;
  border-radius: 18px 18px 18px 4px !important;
  padding: 14px 16px !important;
  max-width: 88% !important;
  font-size: 15.5px !important;
  line-height: 1.45 !important;
  margin: 4px 0 !important;
  border: 1px solid rgba(255, 255, 255, 0.05) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.msg-row.bot-row .msg-bubble.bot-bubble .bot-msg-header {
  display: none !important;
}

.msg-row.bot-row .msg-bubble.bot-bubble .msg-action-bar {
  display: none !important;
}

.chat-center-timestamp {
  width: 100%;
  text-align: center;
  font-size: 12px;
  color: #8e8e93;
  margin: 14px 0 8px;
  font-weight: 500;
  display: block;
}

/* File Attachment Card */
.file-attachment-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  border-radius: 14px;
  padding: 12px 16px;
  margin: 6px 0;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  max-width: 320px;
}

.file-attachment-card:active {
  transform: scale(0.98);
  background: #252528;
}

.file-card-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8e8e93;
}

.file-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-card-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #ffffff;
  word-break: break-all;
}

.file-card-size {
  font-size: 12.5px;
  color: #8e8e93;
}

/* Decision Widget */
.decision-widget-card {
  background: #1c1c1e;
  border-radius: 18px;
  padding: 16px;
  margin: 8px 0;
  max-width: 85%;
}

.decision-question {
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  margin-bottom: 12px;
}

.decision-options-group {
  background: #252528;
  border-radius: 12px;
  overflow: hidden;
}

.decision-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid #333336;
  cursor: pointer;
  transition: background 0.15s;
}

.decision-option-row:last-child {
  border-bottom: none;
}

.decision-option-row:active {
  background: #2e2e32;
}

.decision-label {
  font-size: 15px;
  color: #ffffff;
}

.decision-checkbox {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  border: 1.5px solid #545458;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.decision-checkbox.checked {
  background: #007aff;
  border-color: #007aff;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
}

/* Chat Input Deck */
.chat-footer {
  padding: 10px 14px calc(24px + env(safe-area-inset-bottom, 0px)) 14px;
  background: #000000;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.grok-input-capsule {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-capsule-plus {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1c1c1e;
  border: none;
  color: #ffffff;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  background: #1c1c1e;
  border: none;
  border-radius: 20px;
  padding: 10px 16px;
  color: #ffffff;
  font-size: 16px;
  line-height: 20px;
  outline: none;
  min-height: 40px;
  max-height: 120px;
  resize: none;
}

.btn-capsule-voice {
  background: transparent;
  border: none;
  color: #8e8e93;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-send-msg {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #007aff;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* SCREEN 3: AGENT INFO */
.aux-screen-header {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.aux-header-title {
  font-size: 17px;
  font-weight: 600;
  color: #ffffff;
}

.aux-round-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #2c2c2e;
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.agent-info-scroll-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.aux-screen-card {
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  border-radius: 18px;
  padding: 16px;
}

.screen-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.screen-card-title-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 8px #34c759;
}

.screen-bot-name {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
}

.live-status-badge {
  border: 1px solid #34c759;
  color: #34c759;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.screen-preview-wrapper {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #0e0e10;
  aspect-ratio: 16/10;
  cursor: pointer;
}

.live-screen-feed {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.aux-routines-card {
  background: #1c1c1e;
  border: 1px solid #2c2c2e;
  border-radius: 18px;
  padding: 18px;
}

.routines-header-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #2c2c2e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  margin-bottom: 12px;
}

.routines-main-title {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 6px 0;
}

.routines-desc {
  font-size: 14px;
  color: #8e8e93;
  margin: 0 0 16px 0;
  line-height: 1.4;
}

.btn-create-routine {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: #007aff;
  border: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}

.btn-create-routine:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ==========================================================================
   Milestone 4: Mobile Cyber-HUD PWA, Action Cards & Retina Lightbox
   ========================================================================== */

/* 1. Hardware Telemetry Dock Strip */
.hud-telemetry-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(10, 12, 16, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 240, 255, 0.18);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(0, 240, 255, 0.1);
  flex-shrink: 0;
  z-index: 6;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", ui-monospace, Menlo, monospace;
}

.hud-telemetry-items {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.hud-telemetry-items::-webkit-scrollbar {
  display: none;
}

.hud-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(20, 24, 32, 0.85);
  border: 1px solid rgba(0, 240, 255, 0.22);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  color: #a0aec0;
  white-space: nowrap;
  transition: all 0.18s ease;
}

.hud-chip-label {
  font-weight: 700;
  color: #718096;
  text-transform: uppercase;
  font-size: 9px;
  letter-spacing: 0.5px;
}

.hud-chip-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 700;
  color: #00F0FF;
  font-size: 11px;
}

.hud-chip-val.active {
  color: #00F0FF;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.hud-chip-btn {
  cursor: pointer;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.4);
}

.hud-chip-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00F0FF;
}

.hud-chip-btn:active {
  transform: scale(0.96);
}

.hud-telemetry-tailscale {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  background: rgba(14, 18, 24, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
  flex-shrink: 0;
}

.hud-ts-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00F0FF;
  box-shadow: 0 0 6px #00F0FF;
  animation: hudPulse 2s infinite ease-in-out;
}

@keyframes hudPulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

.hud-ts-ip {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  color: #cbd5e1;
  font-size: 11px;
}

/* Mobile Screen Adaptation (390px - 430px) */
@media (max-width: 480px) {
  .hud-telemetry-strip {
    padding: 5px 8px;
    gap: 4px;
  }
  .hud-chip {
    padding: 2px 6px;
    font-size: 10px;
    gap: 3px;
  }
  .hud-chip-label {
    font-size: 8px;
  }
  .hud-chip-val {
    font-size: 10px;
  }
  .hud-telemetry-tailscale {
    padding: 2px 6px;
    font-size: 10px;
  }
  .hud-ts-ip {
    font-size: 10px;
  }
}

/* 2. Interactive 1-Tap Action Cards & Buttons */
.card-action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 12px;
  background: rgba(18, 22, 30, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  min-height: 34px;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chat-action-btn:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: #00F0FF;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.chat-action-btn:active {
  transform: scale(0.97);
  background: rgba(0, 240, 255, 0.2);
}

.chat-action-btn.danger {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

.chat-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Direct Artifact Links & Screen Download */
.direct-artifact-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-top: 6px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 8px;
  color: #00F0FF;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  transition: all 0.15s ease;
}

.direct-artifact-link:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00F0FF;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

.screenshot-preview-card {
  margin-top: 8px;
  background: rgba(14, 18, 24, 0.95);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}

.screenshot-preview-img-wrap {
  position: relative;
  width: 100%;
  cursor: zoom-in;
  overflow: hidden;
  background: #000000;
}

.screenshot-preview-img-wrap img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.25s ease;
}

.screenshot-preview-img-wrap:hover img {
  transform: scale(1.02);
}

.screenshot-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(10, 12, 16, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.screenshot-res-badge {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  color: #00F0FF;
  font-weight: 700;
}

/* 3. Retina Lightbox Preview with Pan & Zoom */
.image-lightbox-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 10, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  user-select: none;
}

.image-lightbox-modal.hidden {
  display: none !important;
}

.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(12, 16, 22, 0.9);
  border-bottom: 1px solid rgba(0, 240, 255, 0.25);
  flex-shrink: 0;
  z-index: 10;
  gap: 12px;
}

.lightbox-title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.lightbox-badge {
  padding: 3px 8px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid #00F0FF;
  border-radius: 4px;
  color: #00F0FF;
  font-size: 11px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
  white-space: nowrap;
}

.lightbox-caption {
  font-size: 13px;
  color: #cbd5e1;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.lightbox-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  background: rgba(22, 28, 38, 0.9);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  min-height: 36px;
}

.lightbox-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: #00F0FF;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.lightbox-close-btn {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(30, 35, 45, 0.9);
}

.lightbox-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ffffff;
}

.lightbox-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.lightbox-viewport.panning {
  cursor: grabbing;
}

.lightbox-pan-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  will-change: transform;
}

#lightbox-image {
  max-width: 95vw;
  max-height: 85vh;
  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  border-radius: 6px;
  transition: box-shadow 0.2s ease;
  user-select: none;
  -webkit-user-drag: none;
}

#lightbox-image.zoomed {
  max-width: none;
  max-height: none;
  cursor: move;
}

/* Turn 1 instant initiation animation */
.turn-timing-badge {
  font-size: 10px;
  font-family: ui-monospace, monospace;
  color: #00F0FF;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}


