/* B1Xagi Liquid Glass Workspace & Launchpad Styling
   100% Visual Fidelity to Liquid Light & Liquid Dark Design Targets */

.shell {
  background: transparent !important;
  --sidebar: 254px;
  --header: 66px;
  padding: 12px 14px;
  column-gap: 14px;
  row-gap: 12px;
}
.shell.no-sidebar { --sidebar: 0px; }
.main {
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 5;
}

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: 20px;
  background: var(--panel);
  background-image: var(--surface-sheen);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--line);
  box-shadow: var(--glass-shadow);
  min-height: 52px;
}
.topbar .view-mode-switcher { max-width: 680px; }
.launch-empty .topbar .view-mode-switcher, .launch-empty .workspace-subbar { display: none; }

.topbar .breadcrumb {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar .breadcrumb span { opacity: 0.5; }
.topbar .breadcrumb strong { color: var(--text); font-weight: 600; }

.topbar .connection {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
}
.topbar .connection::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}
.topbar .connection[data-online=true] {
  color: var(--green);
}
.topbar .connection[data-online=false] {
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.launch-signin {
  background: var(--cyan);
  color: var(--on-accent);
  border: 0;
  border-radius: 24px;
  padding: 8px 22px;
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  min-height: 38px;
  box-shadow: var(--b1x-primary-shadow);
  transition: transform var(--fast), background var(--fast), box-shadow var(--fast);
}
.launch-signin:hover {
  background: var(--b1x-accent-hover);
  transform: translateY(-1px);
}
:root[data-theme="light"] .launch-signin {
  background: linear-gradient(135deg, #0072f5, #0052cc);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 102, 238, 0.3);
}
:root[data-theme="dark"] .launch-signin {
  background: linear-gradient(135deg, #00e5ff, #00b4d8);
  color: #02101a;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4), 0 2px 8px rgba(0, 229, 255, 0.25);
}

.mobile-brand { display: none; }
.topbar #richard-launcher {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--raised);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar #richard-launcher img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Sidebar Brand Card */
.brand.identity {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 14px 12px;
  border-radius: 18px;
  background: var(--raised);
  border: 1px solid var(--line);
  box-shadow: var(--glass-shadow);
  margin-bottom: 16px;
  transition: transform var(--fast), border-color var(--fast), box-shadow var(--fast);
}
:root[data-theme="dark"] .brand.identity {
  background: rgba(0, 24, 40, 0.72);
  border: 1px solid rgba(0, 229, 255, 0.5);
  box-shadow: inset 0 0 16px rgba(0, 229, 255, 0.15), 0 0 18px rgba(0, 229, 255, 0.12);
}
:root[data-theme="light"] .brand.identity {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 16px rgba(28, 72, 130, 0.08);
}
.brand.identity img {
  height: auto;
  max-height: 48px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}
.brand.identity small {
  display: block;
  font: 600 8.5px var(--mono);
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
  text-transform: uppercase;
}

.sidebar .company {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  margin-top: auto;
  padding-top: 14px;
}
.sidebar .company small {
  display: block;
  font-size: 10.5px;
  margin-top: 4px;
  opacity: 0.8;
}

/* Launchpad Home Layout */
.launch-home {
  max-width: 1040px;
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 4.5vh, 48px) 24px 20px;
  box-sizing: border-box;
  flex: none;
}

.launch-eyebrow {
  text-align: center;
  font: 700 11px var(--mono);
  letter-spacing: 2.2px;
  margin: 0 0 10px;
  text-transform: uppercase;
}
:root[data-theme="light"] .launch-eyebrow {
  color: #004bb8;
}
:root[data-theme="dark"] .launch-eyebrow {
  color: #00e5ff;
}

.launch-home h1 {
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.2;
  text-align: center;
  margin: 0 0 22px;
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.025em;
}

/* Task Activity Bar */
.task-monitor {
  margin: 0 auto 10px;
  width: 100%;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  background-image: var(--surface-sheen);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  font-size: 13px;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.task-monitor summary {
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.task-monitor summary > span:first-child{min-width:0;flex:1;overflow:hidden;text-overflow:ellipsis}
.task-monitor summary::before {
  content: '▶';
  font-size: 10px;
  color: var(--cyan);
  display: inline-block;
  margin-right: 2px;
}
.task-monitor[open] { background: var(--surface-strong); }
.task-monitor[data-state=error] { border-color: var(--amber); }
.task-monitor[data-state=error] summary::before { color: var(--amber); }

.monitor-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 16px;
}
.monitor-controls button {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12px;
  background: var(--raised);
  border: 1px solid var(--line);
}
.activity-log {
  max-height: 180px;
  overflow: auto;
  line-height: 1.6;
  padding: 0 20px 14px;
  font-size: 12px;
  word-break: break-word;
}

/* Primary Composer Area */
.launch-home .composer-area {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;
  background: none;
  position: static;
  border: 0;
  flex: none;
}
.launch-home .composer-area > .activity, .launch-home .disclaimer { display: none; }

.launch-home .composer {
  padding: 14px 18px 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel);
  background-image: var(--surface-sheen);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  transition: border-color var(--fast), box-shadow var(--fast);
}
:root[data-theme="dark"] .launch-home .composer {
  border: 1px solid rgba(0, 229, 255, 0.4);
  box-shadow: inset 0 1px 1px rgba(130, 235, 255, 0.35), 0 0 22px rgba(0, 229, 255, 0.10), 0 16px 40px rgba(0, 0, 0, 0.5);
}
:root[data-theme="light"] .launch-home .composer {
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.95), 0 12px 32px rgba(28, 72, 130, 0.10);
}

.launch-home #prompt {
  min-height: 48px;
  height: 48px !important;
  font-size: 16px;
  line-height: 1.5;
  padding: 4px 6px;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
}
.launch-home #prompt::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

/* Composer Toolbar Controls */
.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 6px;
}
.composer-toolbar .composer-hint,
.composer-toolbar .plugin-anchor { display: none !important; }

#composer-image-btn { border-radius: 9px !important; }

.composer-toolbar .composer-btn,
.composer-toolbar .send {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--raised);
  color: var(--cyan);
  box-shadow: var(--line-specular);
  transition: transform var(--fast), background var(--fast), border-color var(--fast);
}
.composer-toolbar .composer-btn:hover {
  background: var(--hover);
  border-color: var(--cyan);
  transform: translateY(-1px);
}
.composer-toolbar .composer-btn.image-icon-btn {
  border-radius: 9px;
}
.composer-toolbar .icon-2d { width: 15px; height: 15px; }

.composer-toolbar #profile {
  max-width: 180px;
  min-width: 110px;
  height: 32px;
  border-radius: 16px;
  padding: 0 24px 0 10px;
  background: var(--raised);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2300e5ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
:root[data-theme="light"] .composer-toolbar #profile {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%230066ee' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.composer-toolbar #composer-voice-btn {
  margin-left: auto;
}

.composer-toolbar .send {
  margin-left: 0;
  border: none;
}
:root[data-theme="light"] .composer-toolbar .send {
  background: linear-gradient(135deg, #0077ff, #0055e5);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 102, 238, 0.4);
}
:root[data-theme="dark"] .composer-toolbar .send {
  background: linear-gradient(135deg, #00e5ff, #00b4d8);
  color: #02101a;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.5);
}
.composer-toolbar .send svg { stroke: currentColor; }
.composer-toolbar .send:hover {
  transform: translateY(-1px) scale(1.04);
}

/* Six Launch Cards Grid */
.launch-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 0;
}

.launch-tool {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  min-height: 146px;
  padding: 20px 16px;
  border-radius: 20px;
  background: var(--panel);
  background-image: var(--surface-sheen);
  border: 1px solid var(--line);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text);
  text-align: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform var(--fast), border-color var(--fast), box-shadow var(--fast), background var(--fast);
}
:root[data-theme="dark"] .launch-tool {
  border: 1px solid rgba(0, 229, 255, 0.28);
  box-shadow: inset 0 1px 1px rgba(130, 235, 255, 0.35), 0 16px 36px rgba(0, 0, 0, 0.4);
}
:root[data-theme="light"] .launch-tool {
  border: 1px solid rgba(255, 255, 255, 0.88);
  box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.95), 0 12px 30px rgba(28, 72, 130, 0.08);
}

.launch-tool:hover {
  transform: translateY(-2px);
  border-color: var(--cyan);
  box-shadow: var(--glass-shadow), 0 0 24px var(--cyan-glow);
}

.launch-tool svg, .launch-tool img {
  width: 30px;
  height: 30px;
  color: var(--cyan);
  transition: transform var(--fast);
}
.launch-tool:hover svg, .launch-tool:hover img {
  transform: scale(1.08);
}

/* Companion card special neural icon box */
.launch-tool .companion-icon-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(0, 24, 40, 0.6);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 10px var(--cyan-glow);
}
.launch-tool .companion-icon-box img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
}

.launch-tool strong {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-top: 2px;
}
.launch-tool small {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.4;
}

/* Floating Action Button (Bottom Right Lens) */
#floating-lens-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--panel);
  background-image: var(--surface-sheen);
  border: 1px solid var(--line);
  box-shadow: var(--glass-shadow);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 40;
  transition: transform var(--fast), border-color var(--fast), box-shadow var(--fast);
}
#floating-lens-btn:hover {
  transform: scale(1.08) translateY(-2px);
  border-color: var(--cyan);
  box-shadow: 0 0 20px var(--cyan-glow), var(--glass-shadow);
}
#floating-lens-btn svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
}

/* Footer */
.launch-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 24px;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  padding: 16px 24px;
  margin-top: auto;
  border-top: 1px solid var(--line-light);
  flex: none;
  text-align: center;
  background: transparent;
}

/* Responsive Rules */
@media (max-width: 1024px) {
  .launch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  .shell {
    --sidebar: 0px;
    padding: 0;
    column-gap: 0;
  }
  .sidebar {
    margin: 0;
    height: 100dvh;
    border-radius: 0;
  }
  .topbar {
    margin: 0;
    border-radius: 0;
    padding: 8px 14px;
  }
  .launch-home {
    padding: 24px 16px 18px;
  }
  .launch-home h1 {
    font-size: 28px;
    margin-bottom: 18px;
  }
  .launch-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .launch-tool {
    min-height: 110px;
    padding: 16px;
  }
  #floating-lens-btn {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }
}
