/* V2 LAYOUT: Claude.ai style — sidebar rail + chat + artifact panel */
/* Hide the pipeline tabs */
.pipeline-tab-input, .pipeline-tabs, label[for^="pstep_"] { display: none !important; }

/* Hide mode toggle and resize handle */
#verneModeToggle { display: none !important; }
#sidebarResizeHandle { display: none !important; }

/* Hide ALL pipeline content areas */
.pipeline-content, #step-batch, #step-titles, #step-localize, #step-export { display: none !important; }

/* Hide the right-side content container entirely */
.master-console-overlay .content-center,
.content-right,
.pipeline-steps { display: none !important; }

/* Chat sidebar takes FULL width by default */
:root { --sidebar-width: 100vw !important; }
#verneSidebar, .left-sidebar { 
  width: 100% !important; 
  max-width: 100% !important;
  min-width: 100% !important;
}

/* When collapsed, thin rail */
.left-sidebar.sidebar-collapsed {
  width: 40px !important;
  min-width: 40px !important;
  max-width: 40px !important;
}

/* When artifact panel is open, shrink chat to 50% */
body.artifact-open #verneSidebar, body.artifact-open .left-sidebar {
  width: 25vw !important;
  max-width: 25vw !important;
  min-width: 250px !important;
  transition: width 0.3s ease, max-width 0.3s ease;
}

/* Artifact Panel */

/* Left Sidebar — conversation history */
#v2LeftSidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-primary, #1a1a1a);
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  transition: width 0.3s ease, min-width 0.3s ease;
  overflow: hidden;
  box-sizing: border-box;
}
body:not(.dark-mode) #v2LeftSidebar {
  background: #faf8f4;
  border-right: 1px solid rgba(0,0,0,0.06);
}
/* Collapsed state — thin rail with chevron */
#v2LeftSidebar.collapsed {
  width: 48px;
  min-width: 48px;
  background: rgba(250, 249, 246, 0.92) !important;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-right: 1px solid rgb(226, 224, 217);
  box-shadow: 8px 0 24px rgba(0,0,0,0.06);
}
.dark-mode #v2LeftSidebar.collapsed {
  background: rgba(46, 46, 46, 0.92) !important;
  border-right: 1px solid rgba(255,255,255,0.08);
  box-shadow: 8px 0 24px rgba(0,0,0,0.2);
}
/* In workspace — solid background matching chat console */
#v2LeftSidebar.collapsed.workspace-mode {
  background: #2E2E2E !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
body:not(.dark-mode) #v2LeftSidebar.collapsed.workspace-mode {
  background: #faf8f4 !important;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
#v2LeftSidebar.collapsed .sidebar-expanded-content {
  opacity: 0;
  pointer-events: none;
}
#v2LeftSidebar.collapsed .sidebar-collapsed-content {
  opacity: 1;
  pointer-events: auto;
}
#v2LeftSidebar .sidebar-collapsed-content {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 0;
  transition: opacity 0.2s;
}
#v2LeftSidebar .sidebar-expanded-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  transition: opacity 0.2s;
}

/* Sidebar header */
#v2LeftSidebar .ls-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 12px 16px;
  flex-shrink: 0;
}
#v2LeftSidebar .ls-header-title {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
body:not(.dark-mode) #v2LeftSidebar .ls-header-title {
  color: rgba(0,0,0,0.8);
}
/* Chevron toggle */
#v2LeftSidebar .ls-chevron {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
#v2LeftSidebar .ls-chevron:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
}
body:not(.dark-mode) #v2LeftSidebar .ls-chevron {
  color: rgba(0,0,0,0.35);
}
body:not(.dark-mode) #v2LeftSidebar .ls-chevron:hover {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.7);
}
/* New conversation button */
#v2LeftSidebar .ls-new-btn {
  margin: 0 12px 12px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  font-size: 13px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}
#v2LeftSidebar .ls-new-btn:hover {
  background: rgba(255,255,255,0.1);
}
body:not(.dark-mode) #v2LeftSidebar .ls-new-btn {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.7);
}
body:not(.dark-mode) #v2LeftSidebar .ls-new-btn:hover {
  background: rgba(0,0,0,0.06);
}
/* Search */
#v2LeftSidebar .ls-search {
  margin: 0 12px 8px;
}
#v2LeftSidebar .ls-search input {
  width: 100%;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.8);
  font-size: 12px;
  outline: none;
  box-sizing: border-box;
}
#v2LeftSidebar .ls-search input::placeholder {
  color: rgba(255,255,255,0.3);
}
body:not(.dark-mode) #v2LeftSidebar .ls-search input {
  background: rgba(0,0,0,0.03);
  border-color: rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.7);
}
body:not(.dark-mode) #v2LeftSidebar .ls-search input::placeholder {
  color: rgba(0,0,0,0.3);
}
/* History list */
#v2LeftSidebar .ls-history {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px;
}
#v2LeftSidebar .ls-history-item {
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
#v2LeftSidebar .ls-history-item:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2LeftSidebar .ls-history-item {
  color: rgba(0,0,0,0.5);
}
body:not(.dark-mode) #v2LeftSidebar .ls-history-item:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.8);
}
#v2LeftSidebar .ls-empty {
  padding: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.3);
}
body:not(.dark-mode) #v2LeftSidebar .ls-empty {
  color: rgba(0,0,0,0.3);
}
/* Footer */
#v2LeftSidebar .ls-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
body:not(.dark-mode) #v2LeftSidebar .ls-footer {
  border-top: 1px solid rgba(0,0,0,0.06);
}
#v2LeftSidebar .ls-footer-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#v2LeftSidebar .ls-footer-name {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
body:not(.dark-mode) #v2LeftSidebar .ls-footer-name {
  color: rgba(0,0,0,0.45);
}

/* Collapsed rail icons */
.sidebar-collapsed-content .rail-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}
.sidebar-collapsed-content .rail-btn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) .sidebar-collapsed-content .rail-btn {
  color: rgba(0,0,0,0.4);
}
body:not(.dark-mode) .sidebar-collapsed-content .rail-btn:hover {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.8);
}
.sidebar-collapsed-content .rail-spacer { flex: 1; }
.sidebar-collapsed-content .rail-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Push chat over when sidebar is open */
body.left-sidebar-open #verneSidebar,
body.left-sidebar-open .left-sidebar {
  margin-left: 280px !important;
  width: calc(100% - 280px) !important;
  max-width: calc(100% - 280px) !important;
}
/* Collapsed rail push */
body.left-sidebar-collapsed #verneSidebar,
body.left-sidebar-collapsed .left-sidebar {
  margin-left: 48px !important;
  width: calc(100% - 48px) !important;
  max-width: calc(100% - 48px) !important;
}
/* Both sidebar and artifact open */
body.left-sidebar-open.artifact-open #verneSidebar,
body.left-sidebar-open.artifact-open .left-sidebar {
  margin-left: 280px !important;
  width: calc(25vw - 280px) !important;
  max-width: calc(25vw - 280px) !important;
  min-width: 200px !important;
}
body.left-sidebar-collapsed.artifact-open #verneSidebar,
body.left-sidebar-collapsed.artifact-open .left-sidebar {
  margin-left: 48px !important;
  width: calc(25vw - 48px) !important;
  max-width: calc(25vw - 48px) !important;
  min-width: 200px !important;
}
/* Hidden state (homepage) */
#v2LeftSidebar.hidden {
  transform: translateX(-100%);
}


/* Homepage sidebar trigger chevron */
#v2HomepageChevron {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 24px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: none;
  border-radius: 0 8px 8px 0;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  transition: background 0.2s, width 0.2s;
}
#v2HomepageChevron:hover {
  background: rgba(255,255,255,0.25);
  width: 28px;
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2HomepageChevron {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.4);
}
body:not(.dark-mode) #v2HomepageChevron:hover {
  background: rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.7);
}
/* Hide homepage chevron when sidebar rail is active */
body.left-sidebar-open #v2HomepageChevron,
body.left-sidebar-collapsed #v2HomepageChevron {
  display: none;
}


/* Push all fixed/absolute content when sidebar is visible */


/* Also push the inline background div */




/* Push UI when sidebar visible */
/* Video + agency interface: slide right, keep full viewport width (overflows right edge) */
body.left-sidebar-collapsed .auth-video-background,
body.left-sidebar-collapsed .agency-video-background {
  left: 48px !important;
  width: 100vw !important;
  transition: left 0.3s ease;
}
body.left-sidebar-open .auth-video-background,
body.left-sidebar-open .agency-video-background {
  left: 280px !important;
  width: 100vw !important;
  transition: left 0.3s ease;
}

/* Nav elements: push left side, anchor right side */
body.left-sidebar-collapsed .agency-nav-elements {
  left: 68px !important;
  right: 20px !important;
  width: auto !important;
  transition: left 0.3s ease;
}
body.left-sidebar-open .agency-nav-elements {
  left: 300px !important;
  right: 20px !important;
  width: auto !important;
  transition: left 0.3s ease;
}

/* Workspace elements */
body.left-sidebar-collapsed .master-console-overlay,
body.left-sidebar-collapsed .top-header {
  left: 48px !important;
  width: calc(100vw - 48px) !important;
  transition: left 0.3s ease, width 0.3s ease;
}
body.left-sidebar-open .master-console-overlay,
body.left-sidebar-open .top-header {
  left: 280px !important;
  width: calc(100vw - 280px) !important;
  transition: left 0.3s ease, width 0.3s ease;
}

/* Prevent horizontal scrollbar from video overflow */
body.left-sidebar-collapsed,
body.left-sidebar-open {
  overflow-x: hidden !important;
}


/* Artifact toggle button — top right next to hamburger */
#v2ArtifactToggle {
  position: fixed;
  top: 12px;
  right: 52px;
  z-index: 10001;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
#v2ArtifactToggle:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2ArtifactToggle {
  color: rgba(0,0,0,0.4);
}
body:not(.dark-mode) #v2ArtifactToggle:hover {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.8);
}
#v2ArtifactToggle.v2-visible {
  display: flex;
}
/* When artifact is open, highlight the button */
body.artifact-open #v2ArtifactToggle {
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.1);
}
body:not(.dark-mode).artifact-open #v2ArtifactToggle {
  color: rgba(0,0,0,0.8);
  background: rgba(0,0,0,0.06);
}


:root { --artifact-width: 75vw; }




/* Artifact resize handle — fixed position on body */
#v2ArtifactResizeBar {
  position: fixed;
  top: 0;
  width: 8px;
  height: 100vh;
  cursor: col-resize;
  z-index: 999999;
  background: transparent;
  display: none;
}
#v2ArtifactResizeBar:hover {
  background: rgba(255,255,255,0.08);
}
.dark-mode #v2ArtifactResizeBar:hover {
  background: rgba(255,255,255,0.08);
}
body:not(.dark-mode) #v2ArtifactResizeBar:hover {
  background: rgba(0,0,0,0.06);
}
#v2ArtifactResizeBar.active {
  background: rgba(255,255,255,0.12);
}
body:not(.dark-mode) #v2ArtifactResizeBar.active {
  background: rgba(0,0,0,0.1);
}


/* Message action buttons (copy, retry, edit) */
.v2-msg-actions {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.15s;
}
.chat-message:hover .v2-msg-actions,
.console-message:hover .v2-msg-actions,
[class*="message"]:hover .v2-msg-actions {
  opacity: 1;
}
.v2-msg-action-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.4);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}
.v2-msg-action-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.2);
}
body:not(.dark-mode) .v2-msg-action-btn {
  border-color: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.35);
}
body:not(.dark-mode) .v2-msg-action-btn:hover {
  background: rgba(0,0,0,0.04);
  color: rgba(0,0,0,0.7);
  border-color: rgba(0,0,0,0.15);
}
/* Stop generation button */
#v2StopBtn {
  display: none;
  margin: 8px auto;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 13px;
  align-items: center;
  gap: 6px;
}
#v2StopBtn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2StopBtn {
  border-color: rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.03);
  color: rgba(0,0,0,0.6);
}
body:not(.dark-mode) #v2StopBtn:hover {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.8);
}
#v2StopBtn.active {
  display: flex;
}


/* Hide VE logo from workspace header — it's in the siderail now */
.master-console-overlay .project-icon { display: none !important; }

/* Siderail logo — invert for light mode */
body:not(.dark-mode) #v2LeftSidebar .rail-logo {
  filter: invert(1) brightness(0.3);
}
body:not(.dark-mode) #v2LeftSidebar .ls-header img {
  filter: invert(1) brightness(0.3);
}

#v2ArtifactPanel {
  position: fixed;
  top: 0;
  right: 0;
  width: 75vw;
  height: 100vh;
  background: var(--bg-primary, #1a1a1a);
  border-left: 2px solid rgba(255,255,255,0.15);
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow: hidden;
}
#v2ArtifactPanel.open {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  left: auto !important;
  width: 75vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  background: #1a1a1a !important;
  display: flex !important;
  flex-direction: column !important;
  transform: none !important;
}
body:not(.dark-mode) #v2ArtifactPanel.open {
  background: #f5f4ef !important;
}
body:not(.dark-mode) #v2ArtifactPanel {
  background: #ffffff;
  border-left: 2px solid rgba(0,0,0,0.08);
  box-shadow: -4px 0 24px rgba(0,0,0,0.06);
  border-left: 1px solid rgba(0,0,0,0.08);
}
#v2ArtifactPanel .artifact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
body:not(.dark-mode) #v2ArtifactPanel .artifact-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
#v2ArtifactPanel .artifact-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2ArtifactPanel .artifact-header h3 {
  color: rgba(0,0,0,0.8);
}
#v2ArtifactPanel .artifact-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
#v2ArtifactPanel .artifact-close:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2ArtifactPanel .artifact-close {
  color: rgba(0,0,0,0.4);
}
body:not(.dark-mode) #v2ArtifactPanel .artifact-close:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.8);
}

/* NUCLEAR: Force all backgrounds to match — light and dark */
.top-header, .master-console-overlay .top-header,
.master-console-overlay, .master-console-overlay > div,
#mainContainer, .left-sidebar, #verneSidebar,
body:not(.dark-mode) .top-header,
body:not(.dark-mode) .master-console-overlay .top-header,
body:not(.dark-mode) .master-console-overlay,
body:not(.dark-mode) #mainContainer,
body:not(.dark-mode) .left-sidebar,
body:not(.dark-mode) #verneSidebar {
  background: #faf8f4 !important;
  background-color: #faf8f4 !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
.dark-mode .top-header,
.dark-mode .master-console-overlay .top-header {
  background: #2E2E2E !important;
  background-color: #2E2E2E !important;
}
.dark-mode .master-console-overlay,
.dark-mode .master-console-overlay > div,
.dark-mode #mainContainer,
.dark-mode .left-sidebar,
.dark-mode #verneSidebar {
  background: #2E2E2E !important;
  background-color: #2E2E2E !important;
  border-bottom: none !important;
  box-shadow: none !important;
}
/* When starfield is active, make panels transparent so stars show through */
/* #verneSidebar stays opaque so workspace sidebar has a solid background */
.starfield-active .dark-mode .master-console-overlay,
.starfield-active .dark-mode .master-console-overlay > div,
.starfield-active .dark-mode #mainContainer,
.starfield-active .dark-mode .left-sidebar,
.dark-mode .starfield-active .master-console-overlay,
.dark-mode .starfield-active .master-console-overlay > div,
.dark-mode .starfield-active #mainContainer,
.dark-mode .starfield-active .left-sidebar,
html.starfield-active .dark-mode .master-console-overlay,
html.starfield-active .dark-mode .master-console-overlay > div,
html.starfield-active .dark-mode #mainContainer,
html.starfield-active .dark-mode .left-sidebar {
  background: transparent !important;
  background-color: transparent !important;
}
/* Keep sidebar opaque when starfield is active */
.starfield-active .dark-mode #verneSidebar,
.dark-mode .starfield-active #verneSidebar,
html.starfield-active .dark-mode #verneSidebar {
  background: #2E2E2E !important;
  background-color: #2E2E2E !important;
}
#v2ArtifactPanel .artifact-body,
#v2ArtifactPanel #artifactBody {
  flex: 1 !important;
  overflow: auto !important;
  min-height: 0 !important;
  padding: 16px;
}

/* === FRESH ARTIFACT OVERLAY — direct child of body, no V1 stacking context === */
#v2-artifact-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 75vw;
  height: 100vh;
  background: #1a1a1a;
  border-left: 2px solid rgba(255,255,255,0.15);
  z-index: 100000;
  display: none;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0,0,0,0.1);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  overflow: hidden;
}
#v2-artifact-overlay.open {
  display: flex;
}
body:not(.dark-mode) #v2-artifact-overlay {
  background: #f5f4ef;
  border-left: 1px solid rgba(0,0,0,0.08);
  box-shadow: -4px 0 24px rgba(0,0,0,0.06);
}
#v2-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
body:not(.dark-mode) #v2-overlay-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
#v2-overlay-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2-overlay-title {
  color: rgba(0,0,0,0.8);
}
#v2-overlay-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}
#v2-overlay-close:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
body:not(.dark-mode) #v2-overlay-close {
  color: rgba(0,0,0,0.4);
}
body:not(.dark-mode) #v2-overlay-close:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.8);
}
#v2-overlay-body {
  flex: 1 !important;
  overflow: auto !important;
  min-height: 0 !important;
  padding: 16px;
}
#v2-overlay-resize {
  position: absolute;
  left: -4px;
  top: 0;
  width: 8px;
  height: 100%;
  cursor: ew-resize;
  z-index: 1;
}
/* V2: Center chat content like Claude.ai */
#consoleChatHistory {
  max-width: 672px !important;
  margin: 0 auto !important;
  padding: 20px 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

/* Center the input area */
.sidebar-bottom {
  border-top: none !important;
  background: transparent !important;
  padding: 0 !important;
  width: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
}
.sidebar-bottom .cost-notice {
  max-width: 672px !important;
  margin: 0 auto !important;
  padding: 4px 24px !important;
}
.sidebar-bottom .input-area {
  max-width: 672px !important;
  margin: 0 auto !important;
  padding: 0 24px 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}
.sidebar-bottom .console-chat-container {
  max-width: 100% !important;
  margin: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Remove separator lines */
.sidebar-bottom, .dark-mode .sidebar-bottom,
.dark-mode .master-console-overlay .sidebar-bottom {
  border-top: none !important;
  border-bottom: none !important;
}

.cost-notice { display: none !important; }

/* Center user messages too */
.user-input-section {
  max-width: 672px !important;
  margin: 0 auto !important;
  width: 100% !important;
}

/* When artifact is open, keep centering but within the 50% space */
body.artifact-open #consoleChatHistory,
body.artifact-open .sidebar-bottom .input-area,
body.artifact-open .sidebar-bottom .console-chat-container,
body.artifact-open .sidebar-bottom .cost-notice {
  max-width: 100% !important;
  padding-left: 12px !important;
  padding-right: 12px !important;
}
/* Remove top header bar border and X close button */

/* Hide the close/X button in top right */
.console-close-btn, .master-console-close {
  display: none !important;
}

/* Sidebar drawer (left side) */
#v2SidebarDrawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: var(--bg-primary, #1a1a1a);
  border-right: 1px solid rgba(255,255,255,0.08);
  z-index: 10000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#v2SidebarDrawer.open {
  transform: translateX(0);
}
body:not(.dark-mode) #v2SidebarDrawer {
  background: #faf9f6;
  border-right: 1px solid rgba(0,0,0,0.08);
}
#v2SidebarDrawer .drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
body:not(.dark-mode) #v2SidebarDrawer .drawer-header {
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
#v2SidebarDrawer .drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
#v2SidebarDrawer .drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
body:not(.dark-mode) #v2SidebarDrawer .drawer-footer {
  border-top: 1px solid rgba(0,0,0,0.08);
}
/* Sidebar overlay */
#v2SidebarOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: none;
}
#v2SidebarOverlay.open {
  display: block;
}
/* Hamburger button */
#v2SidebarToggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 10001;
}
#v2SidebarToggle:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
}
/* Hidden by default — shown when workspace opens via .v2-visible */
#v2SidebarToggle { display: none !important; }
#v2SidebarToggle.v2-visible { display: block !important; }
/* Drawer text colors — light/dark reactive */
.drawer-title { color: rgba(255,255,255,0.9); }
body:not(.dark-mode) .drawer-title { color: rgba(0,0,0,0.85); }
.drawer-close-btn { color: rgba(255,255,255,0.5); }
.drawer-close-btn:hover { color: rgba(255,255,255,0.9); }
body:not(.dark-mode) .drawer-close-btn { color: rgba(0,0,0,0.4); }
body:not(.dark-mode) .drawer-close-btn:hover { color: rgba(0,0,0,0.8); }
.drawer-new-btn { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); color: rgba(255,255,255,0.8); }
.drawer-new-btn:hover { background: rgba(255,255,255,0.1); }
body:not(.dark-mode) .drawer-new-btn { background: rgba(0,0,0,0.03); border: 1px solid rgba(0,0,0,0.1); color: rgba(0,0,0,0.7); }
body:not(.dark-mode) .drawer-new-btn:hover { background: rgba(0,0,0,0.06); }
.drawer-section-label { color: rgba(255,255,255,0.3); }
body:not(.dark-mode) .drawer-section-label { color: rgba(0,0,0,0.35); }
.drawer-history-text { color: rgba(255,255,255,0.5); }
body:not(.dark-mode) .drawer-history-text { color: rgba(0,0,0,0.4); }
.drawer-footer-text { color: rgba(255,255,255,0.5); }
body:not(.dark-mode) .drawer-footer-text { color: rgba(0,0,0,0.4); }
body:not(.dark-mode) #v2SidebarDrawer .drawer-header { border-bottom: 1px solid rgba(0,0,0,0.08); }
body:not(.dark-mode) #v2SidebarDrawer .drawer-footer { border-top: 1px solid rgba(0,0,0,0.08); }

body:not(.dark-mode) #v2SidebarToggle {
  color: rgba(0,0,0,0.5);
}
body:not(.dark-mode) #v2SidebarToggle:hover {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.8);
}

/* Artifact slide transitions */
.artifact-transition-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}
@keyframes artifactSlideOutLeft {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(-30%); opacity: 0; }
}
@keyframes artifactSlideInRight {
  from { transform: translateX(30%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes artifactSlideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(30%); opacity: 0; }
}
@keyframes artifactSlideInLeft {
  from { transform: translateX(-30%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.artifact-slide-out-left { animation: artifactSlideOutLeft 250ms ease-out forwards; }
.artifact-slide-in-right { animation: artifactSlideInRight 250ms ease-out forwards; }
.artifact-slide-out-right { animation: artifactSlideOutRight 250ms ease-out forwards; }
.artifact-slide-in-left { animation: artifactSlideInLeft 250ms ease-out forwards; }
