/* VS Code Theme - Core Variables */
:root {
  /* Base Colors */
  --vscode-bg-primary: #1E1E1E;
  --vscode-bg-secondary: #252526;
  --vscode-bg-tertiary: #2D2D2D;
  --vscode-bg-elevated: #333333;
  --vscode-bg-input: #3C3C3C;

  /* Interactive */
  --vscode-accent-primary: #007ACC;
  --vscode-accent-hover: #1177BB;
  --vscode-accent-active: #0E639C;

  /* Text */
  --vscode-text-primary: #CCCCCC;
  --vscode-text-secondary: #858585;
  --vscode-text-accent: #FFFFFF;
  --vscode-text-muted: #6A6A6A;

  /* Borders */
  --vscode-border-primary: #252526;
  --vscode-border-secondary: #1E1E1E;
  --vscode-border-accent: #007ACC;
  --vscode-border-subtle: #454545;

  /* Semantic Colors */
  --vscode-error: #F48771;
  --vscode-warning: #CCA700;
  --vscode-success: #89D185;
  --vscode-info: #75BEFF;

  /* Syntax Highlighting (Monaco cfMonokai theme) */
  --vscode-syntax-keyword: #F92672;
  --vscode-syntax-string: #E6DB74;
  --vscode-syntax-comment: #75715E;
  --vscode-syntax-function: #A6E22E;
  --vscode-syntax-variable: #FD971F;

  /* Component Sizes */
  --vscode-activity-bar-width: 48px;
  --vscode-sidebar-min-width: 200px;
  --vscode-sidebar-default-width: 300px;
  --vscode-sidebar-max-width: 500px;
  --vscode-top-bar-height: 33px;
  --vscode-status-bar-height: 22px;
  --vscode-tab-bar-height: 35px;
  --vscode-breadcrumb-height: 24px;

  /* Spacing Scale */
  --vscode-space-xs: 4px;
  --vscode-space-sm: 8px;
  --vscode-space-md: 12px;
  --vscode-space-lg: 16px;
  --vscode-space-xl: 24px;

  /* Typography */
  --vscode-font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --vscode-font-code: 'Menlo', 'Monaco', 'Courier New', 'Consolas', monospace;
  --vscode-text-xs: 11px;
  --vscode-text-sm: 12px;
  --vscode-text-md: 13px;
  --vscode-text-lg: 14px;
}

/* ===== Light Theme ===== */
body.theme-light {
  --vscode-bg-primary: #FFFFFF;
  --vscode-bg-secondary: #F3F3F3;
  --vscode-bg-tertiary: #ECECEC;
  --vscode-bg-elevated: #E8E8E8;
  --vscode-bg-input: #FFFFFF;

  --vscode-accent-primary: #005FB8;
  --vscode-accent-hover: #0A69C6;
  --vscode-accent-active: #0E639C;

  --vscode-text-primary: #252526;
  --vscode-text-secondary: #616161;
  --vscode-text-accent: #111111;
  --vscode-text-muted: #939393;

  --vscode-border-primary: #E6E6E6;
  --vscode-border-secondary: #D0D0D0;
  --vscode-border-accent: #005FB8;
  --vscode-border-subtle: #D0D0D0;

  --vscode-error: #C74E39;
  --vscode-warning: #8E6F00;
  --vscode-success: #2D7D46;
  --vscode-info: #005FB8;
}

/* Global Styles */
* {
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

body {
  font-family: var(--vscode-font-ui) !important;
  font-size: var(--vscode-text-md) !important;
  color: var(--vscode-text-primary);
  background: var(--vscode-bg-primary);
  margin: 0;
  padding: 0;
}

/* Layout Structure */
.vscode-app-container {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 50;
}

/* Login modal must sit above the fixed IDE container (z-index: 50) */
.buttons-background {
  position: fixed !important;
  z-index: 200 !important;
}
.buttons-background .buttons {
  z-index: 201 !important;
}

body.resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.resizing * {
  user-select: none !important;
  cursor: col-resize !important;
}

body.resizing iframe {
  pointer-events: none;
}

.vscode-top-bar {
  height: var(--vscode-top-bar-height);
  background: var(--vscode-bg-elevated);
  border-bottom: 1px solid var(--vscode-border-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--vscode-space-md);
  justify-content: space-between;
  z-index: 100;
}

.vscode-main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

.vscode-status-bar {
  height: var(--vscode-status-bar-height);
  background: var(--vscode-accent-primary);
  color: var(--vscode-text-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--vscode-space-md);
  font-size: var(--vscode-text-sm);
  z-index: 100;
}
.vscode-status-bar .status-bar-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 11px;
}
.vscode-status-bar .status-bar-link:hover {
  color: #ffffff;
  text-decoration: underline;
}

/* Activity Bar */
.vscode-activity-bar {
  width: var(--vscode-activity-bar-width);
  background: var(--vscode-bg-elevated);
  border-right: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--vscode-space-sm) 0;
  flex-shrink: 0;
}

.vscode-activity-item {
  width: var(--vscode-activity-bar-width);
  height: var(--vscode-activity-bar-width);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--vscode-text-secondary);
  font-size: 24px;
  position: relative;
  border: none;
  background: transparent;
  padding: 0;
}

.vscode-activity-bar .vscode-activity-item .codicon-files {
  font-size: 22px;
}

.vscode-activity-item:hover {
  color: var(--vscode-text-primary);
  background: #2A2D2E;
}

.vscode-activity-item.active {
  color: var(--vscode-accent-primary);
}

.vscode-activity-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--vscode-accent-primary);
}

.vscode-activity-spacer {
  flex: 1;
}

/* Explorer Panel (Sidebar) */
.vscode-explorer-panel {
  width: var(--vscode-sidebar-default-width);
  min-width: var(--vscode-sidebar-min-width);
  max-width: var(--vscode-sidebar-max-width);
  background: var(--vscode-bg-secondary);
  border-right: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
}

.vscode-explorer-header {
  height: 35px;
  padding: 0 var(--vscode-space-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--vscode-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--vscode-text-primary);
  border-bottom: 1px solid var(--vscode-border-secondary);
}

/* This wrapper sits between .vscode-explorer-panel and .vscode-explorer-content.
   Without flex propagation here the height chain breaks and nav-body collapses to 0. */
.vscode-explorer-content-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vscode-explorer-content {
  flex: 1;
  min-height: 0;           /* allows this flex child to shrink below content size */
  overflow: hidden;        /* the nav-body inside handles its own scrolling now */
  padding: var(--vscode-space-sm) 0;
  display: flex;
  flex-direction: column;
}

/* Resize Handle */
.vscode-resize-handle {
  width: 4px;
  cursor: col-resize;
  background: var(--vscode-bg-primary);
  position: relative;
  flex-shrink: 0;
  z-index: 10;
  user-select: none;
}

.vscode-resize-handle::after {
  content: '';
  position: absolute;
  width: 1px;
  height: 100%;
  left: 50%;
  background: transparent;
  transition: opacity 0.1s;
}

.vscode-resize-handle:hover {
  background: var(--vscode-accent-primary);
}

.vscode-resize-handle:hover::after {
  opacity: 0;
}

.vscode-resize-handle:active {
  background: var(--vscode-accent-active);
}

/* Welcome tab embedded inside the IDE — fills the editor area when active. */
.vscode-welcome-tab-content {
  flex: 1;
  overflow-y: auto;
  background: var(--vscode-bg-primary);
}

.cf-welcome-tab-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.cf-welcome-tab-split {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.cf-welcome-tab-left {
  flex: 1;
  padding: 32px 36px;
  overflow-y: auto;
}

.cf-welcome-tab-right {
  width: 300px;
  flex-shrink: 0;
  padding: 24px 20px;
  overflow-y: auto;
  background: var(--vscode-bg-secondary);
  border-left: 1px solid var(--vscode-border-primary);
}

.cf-welcome-tab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.cf-welcome-tab-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #2a2d2e;
  border: 1px solid #3a3a3a;
  border-left: 3px solid #8b5cf6;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.12s;
}

.cf-welcome-tab-tile:hover {
  background: #333;
  border-color: #8b5cf6;
  transform: translateY(-1px);
}

body.theme-light .cf-welcome-tab-right { background: var(--vscode-bg-tertiary); border-left-color: var(--vscode-border-secondary); }
body.theme-light .cf-welcome-tab-tile { background: #f6f6f6; border-color: #e0e0e0; border-left-color: #8b5cf6; }
body.theme-light .cf-welcome-tab-tile:hover { background: #ececec; }
body.theme-light .cf-welcome-tab-tile span { color: #1f1f1f !important; }

/* Editor Area */
.vscode-editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--vscode-bg-primary);
  overflow: hidden;
  min-width: 0;
  position: relative;   /* positioning context for the z-index layering of editor/welcome */
}

.vscode-editor-tabs {
  height: var(--vscode-tab-bar-height);
  background: var(--vscode-bg-tertiary);
  display: flex;
  align-items: flex-end;
  border-bottom: 1px solid var(--vscode-border-primary);
  overflow-x: auto;
  overflow-y: hidden;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.vscode-editor-tab {
  height: var(--vscode-tab-bar-height);
  padding: 0 var(--vscode-space-md);
  background: var(--vscode-bg-tertiary);
  border-right: 1px solid var(--vscode-border-primary);
  display: flex;
  align-items: center;
  gap: var(--vscode-space-sm);
  cursor: pointer;
  font-family: var(--vscode-font-ui) !important;
  font-size: var(--vscode-text-md) !important;
  font-weight: normal !important;
  color: var(--vscode-text-secondary);
  white-space: nowrap;
  position: relative;
  border: none;
  min-width: 60px;
  max-width: 160px;
  flex-shrink: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vscode-editor-tab > span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.vscode-editor-tab:hover {
  color: var(--vscode-text-primary);
}

.vscode-editor-tab.active {
  background: var(--vscode-bg-primary);
  color: var(--vscode-text-accent);
  border-top: 1px solid var(--vscode-accent-primary);
}

/* Tab close affordance. The glyph is drawn via ::before so we can swap
   between × (close) and ● (unsaved-changes dot) without React having to
   manage hover state. Matches VS Code's tab UX:
     - clean tab : × shows only on hover (or when active)
     - dirty tab : ● shows always; on hover it flips to × so the user
                   can still click to close. */
.vscode-editor-tab .tab-close {
  font-size: 14px;
  line-height: 1;
  color: var(--vscode-text-secondary);
  padding: 0 2px;
  border-radius: 3px;
  opacity: 0;
  margin-left: 2px;
  flex-shrink: 0;
  width: 16px;
  text-align: center;
  display: inline-block;
}

.vscode-editor-tab .tab-close::before { content: '\00d7'; }   /* × */

.vscode-editor-tab:hover .tab-close,
.vscode-editor-tab.active .tab-close {
  opacity: 1;
}

.vscode-editor-tab .tab-close:hover {
  background: rgba(255,255,255,0.15);
  color: var(--vscode-text-accent);
}

/* Dirty tab — always show the dot, and use a more visible color so the
   "unsaved" signal reads even when the tab isn't hovered/active. The glyph
   is the full-weight BLACK CIRCLE (\25CF) at ~2× the close-× font size so it
   reads as a deliberate indicator rather than a stray punctuation mark. */
.vscode-editor-tab.dirty .tab-close          { opacity: 1; color: #d4d4d4; }
.vscode-editor-tab.dirty .tab-close::before  {
  content: '\25CF';
  font-size: 14px;
  line-height: 14px;          /* keep the row from growing taller than the × baseline */
  vertical-align: middle;
}
.vscode-editor-tab.dirty .tab-close:hover::before {
  content: '\00d7';
  font-size: 15px;
  line-height: 1;
}
body.theme-light .vscode-editor-tab.dirty .tab-close { color: #1f1f1f; }

.vscode-breadcrumb {
  height: var(--vscode-breadcrumb-height);
  background: var(--vscode-bg-primary);
  border-bottom: 1px solid var(--vscode-border-primary);
  display: flex;
  align-items: center;
  padding: 0 var(--vscode-space-lg);
  font-family: var(--vscode-font-ui) !important;
  font-size: var(--vscode-text-sm) !important;
  font-weight: normal !important;
  color: var(--vscode-text-secondary);
  flex-shrink: 0;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
}

/* Clickable segments rendered between '>' separators. App + file segments
   carry click handlers (open app / focus editor); folders are passive. */
.vscode-breadcrumb-segment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 4px;
  border-radius: 3px;
  cursor: default;
  color: var(--vscode-text-secondary);
}
.vscode-breadcrumb-segment .codicon {
  font-size: 13px;
  flex-shrink: 0;
}
.vscode-breadcrumb-segment.vscode-breadcrumb-app,
.vscode-breadcrumb-segment.vscode-breadcrumb-file {
  cursor: pointer;
  color: var(--vscode-text-primary);
}
.vscode-breadcrumb-segment.vscode-breadcrumb-app:hover,
.vscode-breadcrumb-segment.vscode-breadcrumb-file:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--vscode-text-accent, #ffffff);
}
.vscode-breadcrumb-segment.vscode-breadcrumb-file .codicon {
  color: #4fa6ff;
}
.vscode-breadcrumb-segment.vscode-breadcrumb-app    .codicon { color: #dcb67a; }
.vscode-breadcrumb-segment.vscode-breadcrumb-folder .codicon { color: #dcb67a; }
.vscode-breadcrumb-separator {
  color: var(--vscode-text-secondary);
  font-size: 12px;
  opacity: 0.65;
  user-select: none;
  padding: 0 2px;
}

body.theme-light .vscode-breadcrumb-segment.vscode-breadcrumb-app:hover,
body.theme-light .vscode-breadcrumb-segment.vscode-breadcrumb-file:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #1f1f1f;
}
body.theme-light .vscode-breadcrumb-segment.vscode-breadcrumb-file .codicon {
  color: #007ACC;
}

.vscode-editor-content {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.vscode-editor-content .code-editor {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: none;
  background: var(--vscode-bg-primary);
  padding: 0;
}

/* Hide old editor heading - info now in breadcrumb and tabs */
.vscode-editor-content .editor-heading {
  display: none;
}

/* Style run controls as a toolbar — pinned at the bottom of the code-editor
   flex column. flex-wrap keeps the Run button visible even on narrow widths;
   border-top sits flush against whatever is above it (Monaco or preview slot). */
.vscode-editor-content .code-editor > span.code-editor-toolbar,
.vscode-editor-content .code-editor > span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 4px;
  column-gap: 8px;
  gap: 8px;
  padding: 6px 12px;
  background: var(--vscode-bg-secondary);
  border-top: 1px solid var(--vscode-border-primary);
  border-bottom: none;
  flex-shrink: 0;
  min-height: 38px;
  box-sizing: border-box;
}

/* Horizontal-layout preview slot — sits between Monaco and the run/version
   toolbar. Height is controlled by inline style (state.previewHeight in px)
   and adjustable via the drag handle along its top edge. */
.vscode-editor-content .code-editor-preview-slot-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 100px;
  overflow: hidden;
  background: var(--vscode-bg-primary);
}

.vscode-editor-content .code-editor-preview-slot-wrap > .vscode-preview-panel {
  flex: 1 1 auto;
  width: 100% !important;
  min-width: 0;
  max-width: none;
  min-height: 0;
}

/* Horizontal resize handle (used for the preview slot in landscape layout) */
.vscode-resize-handle.vscode-resize-handle-horizontal {
  width: 100%;
  height: 4px;
  cursor: row-resize;
  flex-shrink: 0;
}

.vscode-editor-content .run-btn {
  background: #16a34a;
  color: #ffffff;
  border: none;
  padding: 4px 12px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vscode-editor-content .run-btn:hover {
  background: #1bb656;
}

.vscode-editor-content .version-dd {
  background: var(--vscode-bg-input);
  color: var(--vscode-text-primary);
  border: 1px solid var(--vscode-border-subtle);
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 12px;
  cursor: pointer;
}

.vscode-editor-content .version-label {
  color: var(--vscode-text-secondary);
  font-size: 12px;
}

/* Make Monaco editor container fill available space */
.vscode-editor-content .code-editor > div:not(.editor-heading):not(.modal):not([class]) {
  flex: 1;
  overflow: hidden;
}

/* Preview Panel */
.vscode-preview-panel {
  flex: none;
  min-width: 200px;
  max-width: 800px;
  background: var(--vscode-bg-primary);
  border: 3px solid var(--vscode-border-primary);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vscode-preview-header {
  height: 35px;
  background: var(--vscode-bg-tertiary);
  border-bottom: 1px solid var(--vscode-border-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--vscode-space-md);
  flex-shrink: 0;
}

.vscode-preview-tabs {
  display: flex;
  gap: 0;
  height: 100%;
}

.vscode-preview-tab {
  height: 100%;
  padding: 0 var(--vscode-space-md);
  background: transparent;
  border: none;
  color: var(--vscode-text-secondary);
  cursor: pointer;
  font-family: var(--vscode-font-ui) !important;
  font-size: var(--vscode-text-md) !important;
  font-weight: normal !important;
  position: relative;
  display: flex;
  align-items: center;
}

.vscode-preview-tab:hover {
  color: var(--vscode-text-primary);
}

.vscode-preview-tab.active {
  color: var(--vscode-text-accent);
}

.vscode-preview-tab.active::after {
  display: none;
}

.vscode-preview-content {
  flex: 1;
  overflow: hidden;
  background: var(--vscode-bg-primary);
  display: flex;
  flex-direction: column;
}

/* cf-preview fills the full preview content area */
.vscode-preview-content .cf-preview {
  position: relative !important;
  flex: 1;
  min-height: 0;
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  overflow: hidden;
}

.vscode-preview-content .cf-preview .preview-header {
  display: none !important;
}

/* scrollable output area — sits above the footer */
.vscode-preview-content .cf-preview .preview-container {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 22px !important;   /* leave room for footer */
  overflow: auto !important;
  border: none !important;
  background: #fff !important;
  box-shadow: none !important;
  padding: 0 !important;
  height: auto !important;
}

.vscode-preview-content .cf-preview .preview-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  display: block !important;
}

/* status bar footer — pinned to bottom of cf-preview */
.vscode-preview-content .cf-preview .preview-footer {
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 22px !important;
  background: #007ACC !important;
  color: #fff !important;
  font-size: 11px !important;
  padding: 0 8px !important;
  display: flex !important;
  align-items: center !important;
  box-sizing: border-box !important;
}

.preview-footer-content {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.preview-footer-status {
  font-weight: 500;
}

/* The whole footer bar carries the status colour — blue on success, red on
   failure. We have to use !important because the parent rule
   `.vscode-preview-content .cf-preview .preview-footer { background: ... !important }`
   would otherwise win. Container chrome and text stay neutral; only the bar flips. */
.cf-preview .preview-footer.preview-footer-failure,
.vscode-preview-content .cf-preview .preview-footer.preview-footer-failure {
  background: #b91c1c !important;
}
.cf-preview .preview-footer.preview-footer-ok,
.vscode-preview-content .cf-preview .preview-footer.preview-footer-ok {
  background: #007ACC !important;
}

.preview-footer-status.success { color: #ffffff; }
.preview-footer-status.pending { color: #d9d9d9; opacity: 0.85; }
.preview-footer-status.error   { color: #ffffff; font-weight: 600; }

.preview-footer-sep {
  opacity: 0.6;
}

/* Error layout — slim banner pinned to the top, then the response body
   (iframe srcdoc for HTML, monospace pre for plain text) filling the rest.
   The container is otherwise normal-coloured; the colour cue lives in the
   footer pill. */
.preview-error-wrap {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
.preview-error-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: rgba(255, 80, 80, 0.10);
  border-bottom: 1px solid rgba(255, 80, 80, 0.35);
  color: #c93b3b;
  font-size: 12px;
  font-weight: 500;
  flex-shrink: 0;
}
.preview-error-banner .codicon { font-size: 14px; flex-shrink: 0; }
.preview-error-banner-msg  { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-error-banner-code {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(201, 59, 59, 0.18);
  letter-spacing: 0.3px;
}
.preview-error-empty {
  padding: 24px;
  color: #9b9b9b;
  font-size: 13px;
  text-align: center;
}
.preview-error-text {
  flex: 1;
  margin: 0;
  padding: 12px 16px;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow: auto;
  background: #1e1e1e;
  color: #d4d4d4;
}

body.theme-light .preview-error-banner {
  background: rgba(220, 38, 38, 0.08);
  border-bottom-color: rgba(220, 38, 38, 0.35);
  color: #b91c1c;
}
body.theme-light .preview-error-banner-code {
  background: rgba(185, 28, 28, 0.15);
}
body.theme-light .preview-error-text {
  background: #ffffff;
  color: #1f1f1f;
}

/* Buttons */
.vscode-btn {
  padding: 6px 14px;
  border-radius: 2px;
  font-size: var(--vscode-text-md);
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-family: var(--vscode-font-ui);
}

.vscode-btn-primary {
  background: var(--vscode-accent-primary);
  color: var(--vscode-text-accent);
}

.vscode-btn-primary:hover {
  background: var(--vscode-accent-hover);
}

.vscode-btn-secondary {
  background: transparent;
  color: var(--vscode-text-primary);
  border: 1px solid var(--vscode-border-subtle);
}

.vscode-btn-secondary:hover {
  background: #2A2D2E;
  border-color: var(--vscode-accent-primary);
}

.vscode-btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--vscode-text-secondary);
  border: none;
  cursor: pointer;
  border-radius: 3px;
  font-size: 18px;
}

.vscode-btn-icon:hover {
  background: #2A2D2E;
  color: var(--vscode-text-primary);
}

/* Tree Items */
.vscode-tree-item {
  padding: 4px var(--vscode-space-lg);
  font-size: var(--vscode-text-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--vscode-text-primary);
}

.vscode-tree-item:hover {
  background: #2A2D2E;
}

.vscode-tree-item.selected {
  background: #37373D;
  color: var(--vscode-text-accent);
}

.vscode-tree-item-icon {
  font-size: 16px;
  color: var(--vscode-text-secondary);
  flex-shrink: 0;
}

.vscode-tree-item-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--vscode-bg-primary);
}

::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4E4E4E;
}

/* Responsive */
@media (max-width: 1200px) {
  .vscode-explorer-panel {
    position: absolute;
    left: var(--vscode-activity-bar-width);
    top: 0;
    bottom: 0;
    z-index: 50;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.5);
  }

  .vscode-explorer-panel.collapsed {
    display: none;
  }

  .vscode-preview-panel {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  .vscode-main-content {
    flex-direction: column;
  }

  .vscode-activity-bar {
    flex-direction: row;
    width: 100%;
    height: var(--vscode-activity-bar-width);
    border-right: none;
    border-bottom: 1px solid var(--vscode-border-primary);
  }

  .vscode-activity-item::before {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 2px;
  }

  .vscode-preview-panel {
    width: 100%;
    border-left: none;
    border-top: 1px solid var(--vscode-border-primary);
  }
}

/* ============================================================
   Navigator (File Explorer) — Dark Theme Overrides
   Overrides the legacy light-themed .cf-navigator styles
   ============================================================ */

.cf-navigator {
  background: var(--vscode-bg-secondary);
  color: var(--vscode-text-primary);
  font-family: var(--vscode-font-ui) !important;
  font-size: var(--vscode-text-md) !important;
  font-weight: normal !important;
  padding: 0 !important;
  height: 100%;
}

/* Remove old light-themed structural containers. The legacy SCSS sets
   `height: 100%` on each of these which prevents the parent
   .vscode-explorer-content (overflow-y:auto) from ever seeing overflow —
   the containers grow to content size and push the parent. Override with
   flex/min-height:0 so the scroll container clips and the tree scrolls.

   Specificity: `.vscode-explorer-content .cf-navigator` beats any bare
   `.cf-navigator` rule from the SCSS bundle regardless of source order. */
.vscode-explorer-content .cf-navigator {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

.vscode-explorer-content .cf-navigator .nav-body {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  background: var(--vscode-bg-secondary) !important;
  border: none !important;
  color: var(--vscode-text-primary) !important;
  padding: 0 !important;
}

.vscode-explorer-content .cf-navigator .file-list-container,
.vscode-explorer-content .cf-navigator .file-list-inner-border {
  background: var(--vscode-bg-secondary) !important;
  border: none !important;
  color: var(--vscode-text-primary) !important;
  padding: 0 !important;
  height: auto !important;
}

.cf-navigator .nav-header {
  display: none; /* header is now in vscode-explorer-header */
}

/* File list scroll area */
.cf-navigator .file-list {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--vscode-bg-secondary);
  outline: none;
}

/* Tree indentation — applies to EVERY <ul> inside the navigator, including
   the outermost Applications list. Browsers default to padding-left:40px on
   <ul>, which compounds at each nesting level (40 → 80 → 120 → 160…). A
   single small consistent step keeps the tree readable inside the 260-px
   sidebar even four levels deep. */
.cf-navigator ul {
  padding-left: 14px;
  margin: 0;
  list-style: none;
}

/* Cancel (✕) button at the right of the inline "new file/folder" input.
   Replaces the legacy pixelated sprite icon with a crisp codicon glyph that
   inherits the sidebar text colour and gets a subtle hover affordance. */
.cf-navigator .add-new-file .add-new-file-close {
  font-size: 14px;
  margin-left: 6px;
  padding: 2px;
  border-radius: 3px;
  color: var(--vscode-text-secondary, #9b9b9b);
  cursor: pointer;
  flex-shrink: 0;
}
.cf-navigator .add-new-file .add-new-file-close:hover {
  background: rgba(255, 80, 80, 0.18);
  color: #ff6f6f;
}
body.theme-light .cf-navigator .add-new-file .add-new-file-close { color: #616161; }
body.theme-light .cf-navigator .add-new-file .add-new-file-close:hover {
  background: rgba(220, 38, 38, 0.10);
  color: #b91c1c;
}

/* Each tree row */
.cf-navigator .list-item {
  font-family: var(--vscode-font-ui) !important;
  font-size: var(--vscode-text-md) !important;
  font-weight: normal !important;
  padding: 0 !important;
  color: var(--vscode-text-primary);
  list-style: none;
  background: transparent !important;
}

.cf-navigator .list-item.highlight {
  background: #37373D !important;
}

/* Visually selected folder. Slightly different shade than .highlight (used
   for currently-open files) so the two states are distinguishable at a glance:
   blue-tinted background for folders, neutral grey for the focused file. */
.cf-navigator .list-item.folder-selected > .item-content {
  background: rgba(14, 99, 156, 0.22);
  border-radius: 3px;
}

body.theme-light .cf-navigator .list-item.folder-selected > .item-content {
  background: rgba(0, 122, 204, 0.14);
}

/* Remove alternating row colors */
.cf-navigator .list-item.application:nth-child(even) {
  background: transparent !important;
}

/* Row content — the clickable row */
.cf-navigator .item-content {
  display: flex;
  align-items: center;
  padding: 3px 8px 3px 4px;
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  min-height: 22px;
}

.cf-navigator .list-item:hover > .item-content {
  background: #2A2D2E;
}

.cf-navigator .list-item.highlight > .item-content {
  background: #37373D;
}

/* File/folder icons — force dim color on dark bg */
.cf-navigator .cf-icon {
  flex-shrink: 0;
  opacity: 0.75;
  filter: brightness(1.4);
}

.cf-navigator .item-content .file {
  margin-left: 16px;
}

/* File and app names */
.cf-navigator .file-name {
  color: var(--vscode-text-primary);
  font-family: var(--vscode-font-ui) !important;
  font-size: var(--vscode-text-md) !important;
  font-weight: normal !important;
  padding-left: 4px;
  cursor: pointer;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: auto;
}

.cf-navigator .file-name.app-name {
  font-weight: normal !important;
  color: var(--vscode-text-primary);
  width: auto;
}

/* "My Apps" section header */
.cf-navigator .selected-application {
  background: #37373D;
  color: var(--vscode-text-accent);
}

/* Context menu trigger (…) */
.cf-navigator .download-btn.tip-container {
  flex-shrink: 0;
}

.cf-navigator .more-icon {
  margin: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.1s;
}

.cf-navigator .list-item:hover .more-icon {
  opacity: 1;
}

/* Dropdown context menu — Navigator JS sets position:fixed + top/left/right
   inline at show time so the menu escapes the .vscode-explorer-panel /
   .vscode-explorer-content overflow clipping. Keep z-index very high so it
   lands on top of the tab bar, breadcrumb, and any sibling panels. */
/* The legacy `.tip-container .tooltip-menu` rule in page/home.scss has the
   same specificity as `.cf-navigator .tooltip-menu` and wins on source order
   (it's injected at runtime by webpack's style-loader while this stylesheet
   loads via static <link>). Bump our selector to 3 classes so the dark theme
   reliably wins, and override every property the legacy rule sets — otherwise
   the white background, fat padding, and 100px width bleed through. */
body .cf-navigator .tooltip-menu {
  display: none;
  background: var(--vscode-bg-tertiary);
  border: 1px solid var(--vscode-border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  padding: 4px 0;
  border-radius: 2px;
  min-width: 200px;
  width: auto;
  right: 0;
  z-index: 9999;
  font-family: var(--vscode-font-ui);
}

body .cf-navigator .tooltip-menu.tip-show {
  display: block;
}

body.theme-light .cf-navigator .tooltip-menu {
  background: #ffffff;
  border-color: #d0d0d0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #1f1f1f;
}

body .cf-navigator .tip-item {
  padding: 6px 12px 6px 16px;
  font-size: var(--vscode-text-md);
  font-family: var(--vscode-font-ui);
  color: var(--vscode-text-primary);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 12px;
}

body.theme-light .cf-navigator .tip-item {
  color: #1f1f1f;
}

.cf-navigator .tip-item:hover {
  background: var(--vscode-accent-primary);
  color: #fff;
}

.cf-navigator .tip-item .tip-item-label {
  flex: 1;
}

/* Shortcut hint, right-aligned and muted — VS Code menu style. */
.cf-navigator .tip-item .tip-item-kbd {
  font-family: var(--vscode-font-mono, 'Menlo','Monaco',monospace);
  font-size: 11px;
  color: var(--vscode-text-muted, #858585);
  opacity: 0.85;
  margin-left: auto;
  padding-left: 8px;
}

.cf-navigator .tip-item:hover .tip-item-kbd {
  color: #fff;
  opacity: 0.9;
}

/* Rename input */
.cf-navigator .rename-file-container {
  background: var(--vscode-bg-secondary);
  padding: 3px 8px;
}

.cf-navigator .rename-file-input {
  background: var(--vscode-bg-input);
  color: var(--vscode-text-primary);
  border: 1px solid var(--vscode-accent-primary);
  padding: 2px 6px;
  font-size: var(--vscode-text-md);
  outline: none;
  width: 80%;
}

/* Delete confirmation dialog */
.cf-confirm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  /* Must sit above .modal-overlay (z-index 10000) — the file-collision and
     app-name dialogs open from inside the TemplateSelector modal, so they'd
     otherwise render under the modal and look like nothing happened. */
  z-index: 10500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cf-confirm-dialog {
  background: var(--vscode-bg-tertiary);
  border: 1px solid var(--vscode-border-subtle);
  border-radius: 4px;
  padding: 20px 24px;
  min-width: 300px;
  max-width: 420px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-family: var(--vscode-font-ui);
}

.cf-confirm-title {
  font-size: var(--vscode-text-lg);
  font-weight: 600;
  color: var(--vscode-text-accent);
  margin-bottom: 10px;
}

.cf-confirm-message {
  font-size: var(--vscode-text-md);
  color: var(--vscode-text-primary);
  margin-bottom: 20px;
  line-height: 1.4;
}

.cf-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cf-confirm-btn {
  font-family: var(--vscode-font-ui);
  font-size: var(--vscode-text-md);
  padding: 5px 14px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid var(--vscode-border-subtle);
  background: var(--vscode-bg-elevated);
  color: var(--vscode-text-primary);
}

.cf-confirm-btn:hover {
  background: var(--vscode-bg-input);
  color: var(--vscode-text-accent);
}

.cf-confirm-btn-danger {
  background: #C72E2E;
  border-color: #C72E2E;
  color: #fff;
}

.cf-confirm-btn-danger:hover {
  background: #A52323;
  border-color: #A52323;
  color: #fff;
}

.cf-confirm-btn-primary {
  background: var(--vscode-accent-primary, #0e639c);
  border-color: var(--vscode-accent-primary, #0e639c);
  color: #fff;
}

.cf-confirm-btn-primary:hover {
  background: var(--vscode-accent-hover, #1177bb);
  border-color: var(--vscode-accent-hover, #1177bb);
  color: #fff;
}

.cf-confirm-btn.disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* ----------------------------------------------------------------------
   File-type icon tints. Codicons are monochrome; the recognizable per-type
   colour is what makes the explorer / breadcrumb / tabs readable at a glance.
   Palette pulls from the conventional Seti / GitHub colours where applicable
   so a developer used to VS Code sees familiar shades. CF gets Adobe's
   ColdFusion brand colours so .cfm / .cfc are clearly identifiable as CF.
   ---------------------------------------------------------------------- */
.codicon.cf-icon-cfm     { color: #0078d4; }   /* CF blue — matches the breadcrumb accent and the --cf-blue-primary brand var */
.codicon.cf-icon-cfc     { color: #519aba; }   /* CF teal */
.codicon.cf-icon-html    { color: #4db33d; }   /* HTML green */
.codicon.cf-icon-xml     { color: #519aba; }   /* steel blue */
.codicon.cf-icon-svg     { color: #ffb13b; }   /* SVG yellow */
.codicon.cf-icon-md      { color: #519aba; }
.codicon.cf-icon-css     { color: #1572b6; }   /* CSS blue */
.codicon.cf-icon-sass    { color: #cd6799; }   /* Sass pink */
.codicon.cf-icon-less    { color: #1d365d; }   /* Less navy */
.codicon.cf-icon-js      { color: #f1e05a; }   /* JS yellow */
.codicon.cf-icon-ts      { color: #3178c6; }   /* TypeScript blue */
.codicon.cf-icon-json    { color: #cbcb41; }   /* JSON yellow */
.codicon.cf-icon-yaml    { color: #cb171e; }   /* YAML red */
.codicon.cf-icon-toml    { color: #9c4221; }
.codicon.cf-icon-config  { color: #6d8086; }
.codicon.cf-icon-image   { color: #a074c4; }   /* image purple (Seti) */
.codicon.cf-icon-archive { color: #8d6748; }   /* archive brown (Seti) */
.codicon.cf-icon-pdf     { color: #b30b00; }   /* Adobe PDF red */
.codicon.cf-icon-log     { color: #6d8086; }   /* slate */
.codicon.cf-icon-txt     { color: #6d8086; }

/* Single-line text input inside the confirm-style dialog (app-name prompt). */
.cf-confirm-input {
  width: 100%;
  font-family: var(--vscode-font-mono, 'Menlo','Monaco',monospace);
  font-size: var(--vscode-text-md);
  padding: 6px 10px;
  margin-bottom: 18px;
  background: var(--vscode-bg-input);
  color: var(--vscode-text-primary);
  border: 1px solid var(--vscode-border-subtle);
  border-radius: 3px;
  outline: none;
}

.cf-confirm-input:focus {
  border-color: var(--vscode-accent-primary, #0e639c);
}

.cf-confirm-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cf-radio-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--vscode-text-md);
  color: var(--vscode-text-primary);
  cursor: pointer;
  margin-bottom: 6px;
  user-select: none;
}

.cf-radio-row input[type="radio"] {
  accent-color: var(--vscode-accent-primary, #0e639c);
  cursor: pointer;
}

.cf-confirm-select {
  width: 100%;
  font-family: var(--vscode-font-ui);
  font-size: var(--vscode-text-md);
  padding: 6px 8px;
  margin-bottom: 12px;
  background: var(--vscode-bg-input);
  color: var(--vscode-text-primary);
  border: 1px solid var(--vscode-border-subtle);
  border-radius: 3px;
  outline: none;
}

.cf-confirm-select:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Muted file-list status hint — replaces the old red error banner for
   transient network failures (504, timeouts). Shows a small grey line that
   auto-clears on the next successful fetch. */
.cf-navigator .file-list-hint {
  font-size: var(--vscode-text-xs);
  color: var(--vscode-text-muted, #6A6A6A);
  padding: 6px 16px;
  font-style: italic;
  text-align: center;
}

/* New file inline input */
.cf-navigator .add-new-file {
  background: var(--vscode-bg-secondary);
  border: none;
  padding: 4px 8px;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.cf-navigator .add-new-file .file-add-input {
  background: var(--vscode-bg-input);
  color: var(--vscode-text-primary);
  border: 1px solid var(--vscode-accent-primary);
  padding: 2px 6px;
  font-size: var(--vscode-text-md);
  font-style: normal;
  outline: none;
  flex: 1;
}

.cf-navigator .add-new-file .file-add-input:focus {
  border-color: var(--vscode-accent-primary);
  box-shadow: 0 0 0 1px var(--vscode-accent-primary);
}

/* Empty state message */
.cf-navigator .empty-mesg {
  color: var(--vscode-text-secondary);
  font-size: var(--vscode-text-sm);
  padding: 12px 16px;
}

/* Feedback messages */
.cf-navigator .feedback {
  font-size: var(--vscode-text-xs);
  padding: 4px 8px;
  color: var(--vscode-error);
}

/* Import/export buttons */
.cf-navigator .import,
.cf-navigator .export {
  background: var(--vscode-bg-secondary);
  color: var(--vscode-text-primary);
  font-weight: normal;
  font-family: var(--vscode-font-ui);
}

.cf-navigator .import:hover,
.cf-navigator .export:hover {
  background: #2A2D2E;
  color: var(--vscode-text-accent);
}

/* ============================================================
   AppMenu — "Applications" section header + context menu
   ============================================================ */

.app-menu {
  background: var(--vscode-bg-secondary) !important;
  height: auto !important;
  display: block !important;
}

.app-menu .app-menu-container {
  display: flex;
  align-items: center;
  padding: 8px 8px 4px 8px;
  position: relative;
}

/* "Applications" section label — VSCode-style uppercase dim header */
.app-menu .app-menu-container .applications {
  font-size: var(--vscode-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--vscode-text-secondary);
  background: transparent !important;
  padding-left: 8px;
  flex: 1;
}

/* "…" button next to Applications header */
.app-menu .tip-container {
  font-size: 14px;
  margin-right: 4px;
  flex-shrink: 0;
}

/* Positioned dropdown for AppMenu */
.app-menu .tip-container .tooltip-menu {
  background: #2D2D2D;
  border: 1px solid #454545;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  padding: 4px 0;
  border-radius: 2px;
  z-index: 200;
  width: 180px;
  top: 28px;
  right: 0;
}

/* Fix triangle arrow for dark theme */
.app-menu .triangle:after {
  border-bottom-color: #2D2D2D;
}

.app-menu .triangle:before {
  border-bottom-color: #454545;
}

/* Create App inline input row */
.app-menu .add-new-file {
  background: var(--vscode-bg-secondary) !important;
  border-top: 1px solid var(--vscode-border-subtle) !important;
  border-bottom: none !important;
  padding: 4px 8px !important;
  display: flex !important;
  align-items: center !important;
  margin-top: 0 !important;
}

.app-menu .file-add-input {
  background: var(--vscode-bg-input) !important;
  color: var(--vscode-text-primary) !important;
  border: 1px solid var(--vscode-accent-primary) !important;
  padding: 2px 6px !important;
  font-size: var(--vscode-text-md) !important;
  font-style: normal !important;
  outline: none !important;
  flex: 1 !important;
  min-width: 0 !important;
}

.app-menu .file-add-input:focus {
  box-shadow: 0 0 0 1px var(--vscode-accent-primary) !important;
}

.app-menu .feedback {
  color: var(--vscode-error);
  font-size: var(--vscode-text-xs);
  padding: 4px 8px;
}

/* ===== Light theme: hardcoded-colour overrides ===== */
body.theme-light .cf-navigator .list-item.highlight {
  background: #E3E8F5 !important;
}
body.theme-light .cf-navigator .list-item:hover > .item-content {
  background: #ECECEC !important;
}
body.theme-light .cf-navigator .list-item.highlight > .item-content {
  background: #E3E8F5 !important;
}
body.theme-light .cf-navigator .list-item {
  color: #252526 !important;
}
body.theme-light .vscode-editor-tab.active {
  background: #FFFFFF;
  color: #111111;
  border-top-color: #005FB8;
}
body.theme-light .vscode-editor-tab {
  background: #ECECEC;
  color: #616161;
}
body.theme-light .vscode-editor-tab:hover {
  color: #252526;
}
body.theme-light .vscode-resize-handle {
  background: #D0D0D0;
}
body.theme-light .preview-footer {
  background: #005FB8 !important;
}
body.theme-light .cf-navigator .nav-body,
body.theme-light .cf-navigator .file-list-container,
body.theme-light .cf-navigator .file-list-inner-border {
  background: #F3F3F3 !important;
  color: #252526 !important;
}
body.theme-light .cf-navigator .file-list {
  background: #F3F3F3 !important;
}
body.theme-light .app-menu {
  background: #F3F3F3 !important;
}
body.theme-light .preview-container {
  background: #FFFFFF !important;
}

/* ============================================================
   "Save changes?" confirmation dialog
   Rendered inline inside .code-editor when there are unsaved
   changes. Selector uses .modal.save-modal so it ties the
   specificity of common.css's `.modal.show { display: block }`
   rule and wins via being later in the cascade — otherwise the
   dialog falls back to display:block + top:5% and stretches.
   ============================================================ */
.modal.save-modal,
.modal.show.save-modal {
  position: fixed;
  inset: 0;
  top: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--vscode-font-ui);
  height: 100%;
  width: 100%;
}
.modal.save-modal .clone-app {
  width: 360px;
  max-width: 90vw;
  padding: 18px 22px 16px;
  background: var(--vscode-bg-secondary, #252526);
  color: var(--vscode-text-primary, #cccccc);
  border: 1px solid var(--vscode-border-subtle, #454545);
  border-radius: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  margin: 0;
  font-family: var(--vscode-font-ui);
  font-weight: normal;
}
.modal.save-modal .clone-text {
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 16px;
  color: var(--vscode-text-primary, #cccccc);
}
.modal.save-modal .clone-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.modal.save-modal .clone-buttons .btn {
  padding: 6px 14px;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--vscode-accent-primary, #007ACC);
  color: #ffffff;
  float: none;
}
.modal.save-modal .clone-buttons .btn:hover {
  background: #1f8be0;
}
.modal.save-modal .clone-buttons .btn.secondary {
  background: transparent;
  border-color: var(--vscode-border-subtle, #454545);
  color: var(--vscode-text-primary, #cccccc);
}
.modal.save-modal .clone-buttons .btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-light .modal.save-modal .clone-app {
  background: #ffffff;
  color: #1f1f1f;
  border-color: #d4d4d4;
}
body.theme-light .modal.save-modal .clone-text {
  color: #1f1f1f;
}
body.theme-light .modal.save-modal .clone-buttons .btn.secondary {
  color: #1f1f1f;
  border-color: #c0c0c0;
}
body.theme-light .modal.save-modal .clone-buttons .btn.secondary:hover {
  background: rgba(0, 0, 0, 0.05);
}

/* ============================================================
   Search panel (activity bar → codicon-search)
   Replaces the Navigator inside the .vscode-explorer-panel when
   the search activity-item is active.
   ============================================================ */
.search-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--vscode-bg-secondary, #252526);
  color: var(--vscode-text-primary, #cccccc);
}
.search-panel-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--vscode-border-primary, #1e1e1e);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--vscode-bg-input, #3c3c3c);
  border: 1px solid var(--vscode-border-subtle, #454545);
  border-radius: 3px;
  padding: 2px 4px;
}
.search-input-wrap:focus-within {
  border-color: var(--vscode-accent-primary, #007ACC);
}
.search-panel-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: var(--vscode-text-primary, #cccccc);
  font-size: 13px;
  padding: 5px 6px;
}
.search-toggle {
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: #9b9b9b;
  font-size: 11px;
  font-weight: 700;
  font-family: 'Menlo', 'Monaco', monospace;
  padding: 4px 6px;
  cursor: pointer;
}
.search-toggle:hover  { background: rgba(255,255,255,0.08); color: #fff; }
.search-toggle.active { background: rgba(0,122,204,0.35); color: #fff; }

.search-scope-dropdown {
  position: relative;
  width: 100%;
  outline: none;
}
.search-scope-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: var(--vscode-bg-input, #3c3c3c);
  border: 1px solid var(--vscode-border-subtle, #454545);
  border-radius: 3px;
  color: var(--vscode-text-primary, #cccccc);
  font-size: 12px;
  padding: 4px 6px;
  cursor: pointer;
  user-select: none;
}
.search-scope-trigger .codicon {
  font-size: 10px;
  color: #858585;
  margin-left: 4px;
}
.search-scope-value {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-scope-menu {
  z-index: 10000;
  background: #3C3C3C;
  border: 1px solid #454545;
  border-radius: 3px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}
.search-scope-item {
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 500;
  color: #E0E0E0;
  cursor: pointer;
}
.search-scope-item:hover {
  background: #094771;
  color: #FFFFFF;
}
.search-scope-item.selected {
  background: #04395E;
  color: #FFFFFF;
}

.search-panel-body {
  flex: 1;
  overflow: auto;
  padding: 6px 4px 12px;
}
.search-status {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--vscode-text-secondary, #9b9b9b);
}
.search-status.search-error { color: #ff7f7f; }
.search-status.search-hint  { line-height: 1.55; }
.search-status code {
  background: rgba(255,255,255,0.08);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 11px;
}
.search-summary {
  padding: 4px 12px 8px;
  font-size: 11px;
  color: var(--vscode-text-secondary, #9b9b9b);
}

/* Result file group */
.search-file-group { margin-bottom: 4px; }
.search-file-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  cursor: pointer;
  user-select: none;
  font-size: 12px;
  color: var(--vscode-text-primary, #cccccc);
}
.search-file-header:hover { background: rgba(255,255,255,0.04); }
.search-file-header .codicon { font-size: 14px; flex-shrink: 0; color: #9b9b9b; }
.search-file-name { font-weight: 500; }
.search-file-path {
  color: var(--vscode-text-secondary, #9b9b9b);
  font-size: 11px;
  margin-left: 4px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-file-count {
  background: #4a4a4a;
  color: #cccccc;
  border-radius: 9px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
}

.search-file-hits { padding: 2px 0 6px; }
.search-hit-row {
  display: flex;
  gap: 8px;
  padding: 2px 8px 2px 28px;
  cursor: pointer;
  font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: var(--vscode-text-primary, #cccccc);
}
.search-hit-row:hover { background: rgba(255,255,255,0.06); }
.search-hit-lineno {
  color: #6a6a6a;
  min-width: 28px;
  text-align: right;
  flex-shrink: 0;
  user-select: none;
}
.search-hit-line {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-hit-line mark {
  background: #623e0c;
  color: #ffd58a;
  padding: 0 1px;
  border-radius: 2px;
}

/* Light-theme overrides */
body.theme-light .search-panel        { background: #f3f3f3; color: #1f1f1f; }
body.theme-light .search-panel-header { border-bottom-color: #d4d4d4; }
body.theme-light .search-input-wrap   { background: #ffffff; border-color: #d0d0d0; }
body.theme-light .search-panel-input  { color: #1f1f1f; }
body.theme-light .search-toggle       { color: #616161; }
body.theme-light .search-toggle:hover { background: rgba(0,0,0,0.06); color: #1f1f1f; }
body.theme-light .search-toggle.active{ background: rgba(0,122,204,0.18); color: #003B6E; }
body.theme-light .search-scope-trigger { background: #ffffff; border-color: #d0d0d0; color: #1f1f1f; }
body.theme-light .search-scope-menu { background: #ffffff; border-color: #d0d0d0; box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
body.theme-light .search-scope-item { color: #252526; }
body.theme-light .search-scope-item:hover { background: #E8E8E8; color: #111111; }
body.theme-light .search-scope-item.selected { background: #D6EBFF; color: #005FB8; }
body.theme-light .search-status       { color: #616161; }
body.theme-light .search-status code  { background: rgba(0,0,0,0.06); }
body.theme-light .search-summary      { color: #616161; }
body.theme-light .search-file-header  { color: #1f1f1f; }
body.theme-light .search-file-header:hover { background: rgba(0,0,0,0.05); }
body.theme-light .search-file-header .codicon { color: #616161; }
body.theme-light .search-file-path    { color: #616161; }
body.theme-light .search-file-count   { background: #d4d4d4; color: #1f1f1f; }
body.theme-light .search-hit-row      { color: #1f1f1f; }
body.theme-light .search-hit-row:hover{ background: rgba(0,0,0,0.05); }
body.theme-light .search-hit-lineno   { color: #9a9a9a; }
body.theme-light .search-hit-line mark{ background: #fff3c0; color: #5a3700; }

/* ============================================================
   Global Notification Toasts
   ============================================================ */
.cf-notification-container {
  position: fixed;
  top: 40px;
  right: 16px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
  pointer-events: none;
}

.cf-notification {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-family: var(--vscode-font-ui);
  color: #fff;
  background: var(--vscode-bg-elevated);
  border: 1px solid var(--vscode-border-subtle);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
  animation: cf-notification-slide-in 0.2s ease-out;
}

@keyframes cf-notification-slide-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.cf-notification .codicon {
  font-size: 16px;
  flex-shrink: 0;
}

.cf-notification-message {
  flex: 1;
  line-height: 1.4;
  word-break: break-word;
}

.cf-notification-close {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 3px;
  opacity: 0.7;
}
.cf-notification-close::before { content: '\00d7'; font-size: 16px; }
.cf-notification-close:hover { opacity: 1; background: rgba(255,255,255,0.1); }

/* Type-specific styling */
.cf-notification-error {
  border-left: 3px solid var(--vscode-error);
}
.cf-notification-error .codicon { color: var(--vscode-error); }

.cf-notification-warning {
  border-left: 3px solid var(--vscode-warning);
}
.cf-notification-warning .codicon { color: var(--vscode-warning); }

.cf-notification-success {
  border-left: 3px solid var(--vscode-success);
}
.cf-notification-success .codicon { color: var(--vscode-success); }

.cf-notification-info {
  border-left: 3px solid var(--vscode-info);
}
.cf-notification-info .codicon { color: var(--vscode-info); }

/* Light theme overrides */
body.theme-light .cf-notification {
  background: #fff;
  color: #252526;
  border-color: #d0d0d0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}
body.theme-light .cf-notification-close:hover { background: rgba(0,0,0,0.06); }
