/* VS Code–inspired dark theme + EDA studio–style workbench */
:root {
  --bg-title: #3c3c3c;
  --bg-activity: #333333;
  --bg-side: #252526;
  --bg-editor: #1e1e1e;
  --bg-tab-inactive: #2d2d2d;
  --bg-tab-active: #1e1e1e;
  --border: #3c3c3c;
  --text: #cccccc;
  --text-muted: #858585;
  --accent: #007acc;
  --accent-hover: #1177bb;
  --status-bg: #007acc;
  --btn-primary-bg: #0e639c;
  --btn-primary-hover: #1177bb;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", Monaco, Menlo, "Cascadia Mono", "Consolas", monospace;
  --activity-width: 48px;
  --activity-width-expanded: 200px;
  --side-width: 260px;
  --menu-height: 30px;
  --status-height: 22px;
  --panel-default-height: 180px;
  /* Bottom panel (Output / Problems / Log) — thin, VS Code–like scrollbars */
  --panel-scrollbar-size: 8px;
  --panel-scrollbar-track: rgba(0, 0, 0, 0.22);
  --panel-scrollbar-thumb: rgba(255, 255, 255, 0.16);
  --panel-scrollbar-thumb-hover: rgba(255, 255, 255, 0.26);
  --panel-scrollbar-thumb-active: rgba(255, 255, 255, 0.36);
  /* VS Code–style menu list */
  --menu-bg: #252526;
  --menu-border: #454545;
  --menu-hover: rgba(255, 255, 255, 0.08);
  --menu-focus: rgba(255, 255, 255, 0.12);
  --menu-sep-color: #454545;
  --menu-shortcut: #a6a6a6;
}

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

.protocol-warning {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(15, 15, 20, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.protocol-warning.hidden {
  display: none;
}

.protocol-warning-inner {
  max-width: 520px;
  background: #252526;
  border: 1px solid #555;
  border-radius: 6px;
  padding: 20px 24px;
  line-height: 1.55;
  color: #e0e0e0;
  font-size: 14px;
}

.protocol-cmd {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: #1e1e1e;
  border-radius: 4px;
  font-size: 12px;
  overflow-x: auto;
}

.bootstrap-error {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  background: #5a1d1d;
  color: #ffc8c8;
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid #a33;
}

.bootstrap-error.hidden {
  display: none;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--text);
  background: var(--bg-editor);
}

/* Grid keeps menu + main + status bar in view; flex column could push footer below 100vh when content min-heights stack */
.app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
}

/* Menu bar */
.menu-bar {
  display: flex;
  align-items: center;
  height: var(--menu-height);
  min-height: var(--menu-height);
  background: var(--bg-title);
  border-bottom: 1px solid var(--border);
  padding: 0 8px 0 12px;
  gap: 12px;
  user-select: none;
  -webkit-user-select: none;
}

.menu-bar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.menu-bar-logo {
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, #007acc 40%, #1e1e1e 40%, #1e1e1e 55%, #c586c0 55%);
  border-radius: 2px;
}

.menu-bar-title {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.menu-bar-menus {
  display: flex;
  gap: 0;
  flex: 1;
  align-items: stretch;
}

.menu-wrap {
  position: relative;
}

.menu-wrap--end .menu-dropdown--align-end {
  left: auto;
  right: 0;
}

.menu-item {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 4px 10px;
  border-radius: 2px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}

.menu-item:hover,
.menu-wrap.is-open > .menu-trigger {
  background: rgba(255, 255, 255, 0.08);
}

.menu-dropdown {
  position: absolute;
  top: calc(100% + 0px);
  left: 0;
  min-width: 220px;
  max-height: min(72vh, 480px);
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--menu-bg);
  border: 1px solid var(--menu-border);
  border-radius: 3px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.2);
  z-index: 60000;
  padding: 4px 0;
}

.menu-dropdown--wide {
  min-width: 320px;
}

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

.menu-dropdown .menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
  min-height: 28px;
  padding: 0 10px 0 12px;
  margin: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
}

.menu-dropdown .menu-row:hover {
  background: var(--menu-hover);
}

.menu-dropdown .menu-row:focus {
  outline: none;
  background: var(--menu-focus);
}

.menu-label {
  flex: 1;
  min-width: 0;
}

.menu-shortcut {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--menu-shortcut);
  opacity: 0.95;
}

.menu-shortcut:empty {
  display: none;
}

.menu-dropdown .menu-row:hover .menu-shortcut {
  color: #c8c8c8;
}

.menu-sep {
  height: 1px;
  margin: 4px 0;
  background: var(--menu-sep-color);
  border: none;
  padding: 0;
}

.menu-dropdown::-webkit-scrollbar {
  width: 10px;
}

.menu-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.menu-dropdown::-webkit-scrollbar-thumb {
  background: #424242;
  border-radius: 5px;
  border: 2px solid var(--menu-bg);
}

.side-bar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.explorer-actions {
  display: flex;
  gap: 2px;
}

.icon-tool {
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 2px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.icon-tool:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

/* Overlays: command palette, quick open */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}

.overlay[hidden] {
  display: none !important;
}

.overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.overlay-panel {
  position: relative;
  width: min(560px, 92vw);
  background: var(--bg-side);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  overflow: hidden;
}

.command-palette-panel,
.quick-open-panel {
  width: min(600px, 94vw);
}

.kbd-help-panel {
  width: min(520px, 94vw);
  max-height: 80vh;
  overflow: auto;
}

.overlay-title {
  display: none;
}

.overlay-input {
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-editor);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  outline: none;
}

.overlay-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: min(50vh, 320px);
  overflow-y: auto;
}

.overlay-list li {
  padding: 6px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.overlay-list li.is-selected {
  background: #094771;
  color: #fff;
}

.overlay-list li .cmd-keys {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.overlay-list li.is-selected .cmd-keys {
  color: rgba(255, 255, 255, 0.75);
}

.overlay-hint {
  padding: 6px 12px 10px;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.overlay-hint kbd {
  display: inline-block;
  padding: 1px 5px;
  margin: 0 2px;
  border-radius: 2px;
  background: var(--bg-editor);
  border: 1px solid var(--border);
  font-size: 10px;
}

.kbd-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.kbd-table td {
  padding: 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.kbd-table td:last-child {
  text-align: right;
  color: var(--text-muted);
  white-space: nowrap;
}

.menu-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--btn-primary-bg);
  border-color: transparent;
}

.btn-primary:hover:not(:disabled) {
  background: var(--btn-primary-hover);
}

.btn-icon {
  font-size: 10px;
  line-height: 1;
}

/* Main layout: fills middle grid row; must shrink so footer status bar stays on-screen */
.main-row {
  display: flex;
  min-height: 0;
  overflow: hidden;
}

/* Activity bar (narrow icons; expand shows labels) */
.activity-bar {
  width: var(--activity-width);
  flex-shrink: 0;
  background: var(--bg-activity);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
  transition: width 0.2s ease;
}

.activity-bar.is-expanded {
  width: var(--activity-width-expanded);
}

/* Scroll icons only; footer stays a dedicated hit target (avoids overlap / flex quirks). */
.activity-bar-main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.activity-bar-items {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
  scrollbar-width: thin;
}

.activity-bar.is-expanded .activity-bar-items {
  align-items: stretch;
  padding: 8px 0;
}

.activity-bar-footer {
  flex-shrink: 0;
  width: 100%;
  background: var(--bg-activity);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 6;
}

.activity-bar-items::-webkit-scrollbar {
  width: 6px;
}

.activity-bar-items::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 3px;
}

.activity-icon {
  display: flex;
  flex-direction: row;
  align-items: center;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  border-left: 2px solid transparent;
  box-sizing: border-box;
  flex-shrink: 0;
}

.activity-bar:not(.is-expanded) .activity-icon {
  width: 48px;
  height: 48px;
  justify-content: center;
  padding: 0;
}

.activity-bar.is-expanded .activity-icon {
  width: 100%;
  min-height: 48px;
  height: 48px;
  justify-content: flex-start;
  padding: 0 10px;
  gap: 10px;
}

.activity-icon-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex-shrink: 0;
}

.activity-icon-label {
  display: none;
  font-size: 12px;
  font-family: var(--font-ui);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  color: var(--text);
}

.activity-bar.is-expanded .activity-icon-label {
  display: block;
}

.activity-icon:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.activity-icon.is-active {
  color: var(--text);
  border-left-color: var(--accent);
}

.activity-bar-sep {
  width: 22px;
  height: 1px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  align-self: center;
}

.activity-bar.is-expanded .activity-bar-sep {
  width: calc(100% - 20px);
  margin: 6px 10px;
}

.activity-bar-toggle {
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 40px;
  width: 100%;
  padding: 6px 4px 8px;
  margin: 0;
  border: none;
  background: rgba(0, 0, 0, 0.15);
  color: var(--text-muted);
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  pointer-events: auto;
}

.activity-bar-toggle svg,
.activity-bar-toggle-label {
  pointer-events: none;
}

.activity-bar.is-expanded .activity-bar-toggle {
  flex-direction: row;
  justify-content: flex-start;
  gap: 8px;
  padding: 0 12px;
  min-height: 48px;
}

.activity-bar-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.activity-bar-toggle-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  flex-shrink: 0;
}

.activity-bar-toggle-chevron--collapse {
  display: none;
}

.activity-bar.is-expanded .activity-bar-toggle-chevron--expand {
  display: none;
}

.activity-bar.is-expanded .activity-bar-toggle-chevron--collapse {
  display: block;
}

.activity-bar-toggle-label {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-align: center;
  max-width: 44px;
  white-space: normal;
  word-break: break-word;
}

.activity-bar.is-expanded .activity-bar-toggle-label {
  font-size: 11px;
  max-width: none;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-panel-body {
  padding: 8px 12px 16px;
}

#panel-synthesis .tool-panel-body {
  display: flex;
  flex-direction: column;
}

#panel-synthesis .yosys-sim-run {
  margin-left: auto;
  margin-right: auto;
}

.tool-panel-lead {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
}

.tool-panel-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.tool-panel-hint code {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 2px;
  color: var(--text);
}

.extension-pack-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
}

.extension-pack-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

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

.extension-pack-item--toggle {
  padding: 0;
}

.extension-pack-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
}

.extension-pack-toggle:hover {
  background: rgba(255, 255, 255, 0.05);
}

.extension-pack-toggle:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: -1px;
}

/* Clicks always register on the button (some environments mishit nested spans). */
.extension-pack-toggle .extension-pack-item-title,
.extension-pack-toggle .extension-pack-item-badge {
  pointer-events: none;
}

.extension-pack-toggle.is-on .extension-pack-item-badge {
  color: var(--accent);
  background: rgba(0, 122, 204, 0.15);
}

.extension-pack-item-title {
  font-weight: 500;
}

.extension-pack-item-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 3px;
}

/* Side bar */
.side-bar {
  width: var(--side-width);
  flex-shrink: 0;
  background: var(--bg-side);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.side-bar-header {
  padding: 10px 12px 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.side-bar-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
}

.side-bar-panel.hidden {
  display: none;
}

/* Explorer: workspace (top) + example design sets (bottom) */
.side-bar-panel--explorer-split {
  overflow: hidden;
}

.explorer-split {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  --explorer-top-pct: 58%;
}

.explorer-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

.explorer-pane--top {
  flex: 0 0 auto;
  height: var(--explorer-top-pct);
  min-height: 72px;
  max-height: calc(100% - 5px - 100px);
}

.explorer-split-resize {
  flex: 0 0 5px;
  cursor: ns-resize;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  box-sizing: border-box;
  touch-action: none;
  position: relative;
  z-index: 2;
  transition: background 0.12s ease;
}

.explorer-split-resize:hover {
  background: rgba(0, 122, 204, 0.22);
}

.explorer-split-resize:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 1px;
}

.explorer-split-resize.is-dragging {
  background: rgba(0, 122, 204, 0.42);
}

.explorer-pane--bottom {
  flex: 1 1 0;
  min-height: 100px;
  background: rgba(0, 0, 0, 0.14);
}

.explorer-pane-label {
  flex-shrink: 0;
  padding: 7px 12px 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.explorer-pane-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-scrollbar-thumb) var(--panel-scrollbar-track);
}

.explorer-pane-scroll::-webkit-scrollbar {
  width: var(--panel-scrollbar-size);
  height: var(--panel-scrollbar-size);
}

.explorer-pane-scroll::-webkit-scrollbar-track {
  margin: 3px 0;
  background: var(--panel-scrollbar-track);
  border-radius: 100px;
}

.explorer-pane-scroll::-webkit-scrollbar-thumb {
  background-color: var(--panel-scrollbar-thumb);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.15s ease;
}

.explorer-pane-scroll::-webkit-scrollbar-thumb:hover {
  background-color: var(--panel-scrollbar-thumb-hover);
}

.explorer-pane-scroll::-webkit-scrollbar-thumb:active {
  background-color: var(--panel-scrollbar-thumb-active);
}

.explorer-pane-scroll::-webkit-scrollbar-corner {
  background: transparent;
}

.design-set-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 8px 10px;
}

.design-set-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  text-align: left;
  font: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.design-set-item:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Selected chip: JS also sets inline border/background/shadow so highlight always wins */
#design-set-list .design-set-item.is-active {
  border-color: rgba(0, 122, 204, 0.55);
  background: rgba(0, 122, 204, 0.12);
  box-shadow: 0 0 0 1px rgba(0, 122, 204, 0.2);
}

#design-set-list .design-set-item.is-active:hover {
  border-color: rgba(0, 140, 220, 0.65);
  background: rgba(0, 122, 204, 0.16);
}

.design-set-item-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text);
}

.design-set-item-blurb {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-muted);
}

.file-tree {
  padding: 4px 0 12px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px 4px 8px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  border-left: 2px solid transparent;
}

.tree-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.tree-item.is-active {
  background: rgba(255, 255, 255, 0.06);
  border-left-color: var(--accent);
}

.tree-icon {
  opacity: 0.85;
  font-size: 14px;
}

.search-panel-body {
  padding: 0 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-field-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0;
}

.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-icon {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  opacity: 0.85;
  pointer-events: none;
  display: flex;
}

.search-input {
  width: 100%;
  padding: 6px 8px 6px 28px;
  background: var(--bg-editor);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  border-radius: 2px;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 122, 204, 0.35);
}

.search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

.search-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
  opacity: 0.9;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px;
}

.field-label {
  font-size: 12px;
  color: var(--text-muted);
}

.field select {
  padding: 6px 8px;
  background: var(--bg-editor);
  border: 1px solid var(--border);
  color: var(--text);
  font: inherit;
  border-radius: 2px;
}

/* Workbench */
.workbench {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.editor-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.editor-main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  --synth-pane-width: min(40vw, 520px);
}

.editor-topbar {
  display: flex;
  min-height: 35px;
  border-bottom: 1px solid var(--border);
  justify-content: flex-end;
  background: var(--bg-tab-inactive);
}

.editor-split-controls {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 6px 0 8px;
}

.editor-split {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  --editor-split-ratio: 0.5;
}

.editor-split.editor-split--single .editor-pane--secondary,
.editor-split.editor-split--single .editor-splitter {
  display: none !important;
}

.editor-split.editor-split--single .editor-pane--primary {
  flex-basis: 100%;
}

.editor-split.editor-split--vertical {
  flex-direction: row;
}

.editor-split.editor-split--horizontal {
  flex-direction: column;
}

.editor-pane {
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.editor-pane.is-drop-target {
  outline: 2px solid rgba(79, 195, 247, 0.7);
  outline-offset: -2px;
}

.editor-pane--primary {
  flex-basis: calc(var(--editor-split-ratio) * 100%);
}

.editor-pane--secondary {
  flex-basis: calc((1 - var(--editor-split-ratio)) * 100%);
  border-left: 1px solid var(--border);
}

.editor-split.editor-split--horizontal .editor-pane--secondary {
  border-left: none;
  border-top: 1px solid var(--border);
}

.editor-splitter {
  flex-shrink: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
}

.editor-split.editor-split--vertical .editor-splitter {
  width: 6px;
  cursor: ew-resize;
}

.editor-split.editor-split--horizontal .editor-splitter {
  height: 6px;
  cursor: ns-resize;
}

.editor-splitter:hover,
.editor-splitter.is-dragging {
  background: linear-gradient(180deg, rgba(0, 122, 204, 0.3), rgba(0, 122, 204, 0.14));
}

.tab-bar {
  display: flex;
  align-items: stretch;
  background: var(--bg-tab-inactive);
  min-height: 35px;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* legacy Edge */
}

.pane-tab-bar {
  border-bottom: 1px solid var(--border);
}

.pane-tab-bar.is-active-pane {
  background: rgba(79, 195, 247, 0.04);
}

.editor-pane.is-active-pane::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(79, 195, 247, 0.28);
  box-shadow: inset 0 0 0 1px rgba(79, 195, 247, 0.1);
  border-radius: 2px;
}

.editor-split.editor-split--single .pane-tab-bar.is-active-pane {
  background: transparent;
}

.editor-split.editor-split--single .editor-pane.is-active-pane::after {
  content: none;
}

.tab-bar::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Chromium */
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: var(--bg-tab-inactive);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

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

.tab.is-active {
  background: var(--bg-tab-active);
  color: var(--text);
  border-bottom: 1px solid var(--bg-tab-active);
  margin-bottom: -1px;
}

.tab-dirty {
  font-style: italic;
  opacity: 0.9;
}

.vim-status-host {
  flex-shrink: 0;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  background: var(--bg-side);
  border-bottom: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.vim-status-host:not([hidden]) {
  max-height: 48px;
  min-height: 22px;
  overflow: visible;
  border-bottom-color: var(--border);
  padding: 2px 8px;
}

.editor-container {
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.synth-pane {
  width: var(--synth-pane-width);
  min-width: 300px;
  max-width: 58vw;
  border-left: 1px solid var(--border);
  background: var(--bg-side);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.synth-pane-resize-handle {
  width: 6px;
  cursor: ew-resize;
  border-left: 1px solid var(--border);
  border-right: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  flex-shrink: 0;
}

.synth-pane-resize-handle:hover,
.synth-pane-resize-handle.is-dragging {
  background: linear-gradient(90deg, rgba(0, 122, 204, 0.3), rgba(0, 122, 204, 0.14));
}

.synth-pane-header {
  min-height: 32px;
  border-bottom: 1px solid var(--border);
  padding: 0 8px;
}

.synth-pane-tabs {
  display: flex;
  height: 100%;
}

.synth-pane-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  padding: 8px 10px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.synth-pane-tab:hover {
  color: var(--text);
}

.synth-pane-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.synth-pane-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 10px;
}

.synth-pane-content {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
  height: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
  padding: 10px 12px;
}

.synth-pane-content.hidden {
  display: none;
}

.synth-pane-graph {
  height: 100%;
  color: var(--text-muted);
  display: block;
  text-align: left;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.synth-pane-graph svg {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
}

.synth-diagram-shell {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  --diagram-text-size: 12px;
}

.synth-diagram-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
}

.diagram-ctrl-btn {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #2d2d30;
  color: var(--text);
  border-radius: 6px;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.diagram-ctrl-btn:hover {
  border-color: rgba(0, 122, 204, 0.55);
  background: #34373a;
}

.diagram-ctrl-btn:active {
  transform: translateY(1px);
}

.diagram-zoom-label {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

.synth-diagram-viewport {
  min-height: 0;
  overflow: auto;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.synth-diagram-wrap {
  width: 100%;
  min-width: 0;
  max-width: none;
  flex: 0 0 auto;
}

.synth-diagram-wrap svg .node text,
.synth-diagram-wrap svg .edge text {
  font-size: var(--diagram-text-size) !important;
}

.synth-pane-graph.hidden {
  display: none;
}

.synth-pane-content,
.synth-pane-graph,
.synth-diagram-viewport {
  scrollbar-width: thin;
  scrollbar-color: var(--panel-scrollbar-thumb) var(--panel-scrollbar-track);
}

.synth-pane-content::-webkit-scrollbar,
.synth-pane-graph::-webkit-scrollbar,
.synth-diagram-viewport::-webkit-scrollbar {
  width: var(--panel-scrollbar-size);
  height: var(--panel-scrollbar-size);
}

.synth-pane-content::-webkit-scrollbar-track,
.synth-pane-graph::-webkit-scrollbar-track,
.synth-diagram-viewport::-webkit-scrollbar-track {
  background: var(--panel-scrollbar-track);
  border-radius: 999px;
}

.synth-pane-content::-webkit-scrollbar-thumb,
.synth-pane-graph::-webkit-scrollbar-thumb,
.synth-diagram-viewport::-webkit-scrollbar-thumb {
  background-color: var(--panel-scrollbar-thumb);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.synth-pane-content::-webkit-scrollbar-thumb:hover,
.synth-pane-graph::-webkit-scrollbar-thumb:hover,
.synth-diagram-viewport::-webkit-scrollbar-thumb:hover {
  background-color: var(--panel-scrollbar-thumb-hover);
}

.synth-pane-content::-webkit-scrollbar-thumb:active,
.synth-pane-graph::-webkit-scrollbar-thumb:active,
.synth-diagram-viewport::-webkit-scrollbar-thumb:active {
  background-color: var(--panel-scrollbar-thumb-active);
}

.synth-pane-content::-webkit-scrollbar-corner,
.synth-pane-graph::-webkit-scrollbar-corner,
.synth-diagram-viewport::-webkit-scrollbar-corner {
  background: transparent;
}

.synth-fallback-pre {
  margin: 0;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.synth-result-summary {
  display: grid;
  gap: 8px;
}

.synth-result-kv {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
}

.synth-result-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  display: grid;
  gap: 8px;
}

.synth-result-meta {
  gap: 6px;
}

.synth-result-meta-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  align-items: baseline;
  font-size: 12px;
}

.synth-result-meta-row span {
  color: var(--text-muted);
}

.synth-result-meta-row strong {
  color: var(--text);
  font-weight: 500;
  font-family: var(--font-mono);
}

.synth-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.synth-result-title {
  font-size: 12px;
  color: var(--text);
  font-weight: 600;
}

.synth-sort-toggle {
  display: inline-flex;
  gap: 4px;
}

.synth-sort-btn {
  border: 1px solid var(--border);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  padding: 3px 8px;
  font-size: 11px;
  cursor: pointer;
}

.synth-sort-btn:hover {
  color: var(--text);
}

.synth-sort-btn.is-active {
  color: var(--text);
  background: rgba(79, 195, 247, 0.14);
  border-color: rgba(79, 195, 247, 0.45);
}

.synth-area-list {
  display: grid;
  gap: 6px;
}

.synth-area-layout {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 12px;
  align-items: start;
}

.synth-area-chart {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  display: grid;
  place-items: center;
}

.synth-area-chart-inner {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: var(--bg-side);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.synth-area-chart-total {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--text);
  line-height: 1;
}

.synth-area-chart-label {
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}

.synth-area-legend {
  display: grid;
  gap: 6px;
}

.synth-area-legend-row {
  display: grid;
  grid-template-columns: 10px 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.synth-area-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.synth-area-legend-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.synth-area-legend-val,
.synth-area-legend-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.synth-area-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 8px;
  align-items: center;
}

.synth-area-name {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.synth-area-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.synth-area-fill {
  height: 100%;
  background: linear-gradient(90deg, #0e639c, #4fc3f7);
}

.synth-area-val {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
}

.panel-content--synth {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 8px;
  min-height: 0;
  align-content: start;
}

.synth-log-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.synth-log-title {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.synth-log-pre {
  margin: 0;
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.panel-resize-handle {
  height: 6px;
  cursor: ns-resize;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  flex-shrink: 0;
}

.panel-resize-handle:hover,
.panel-resize-handle.is-dragging {
  background: linear-gradient(180deg, rgba(0, 122, 204, 0.3), rgba(0, 122, 204, 0.14));
}

/* Bottom panel */
.panel {
  display: flex;
  flex-direction: column;
  height: var(--panel-default-height);
  min-height: 80px;
  max-height: 70vh;
  border-top: 1px solid var(--border);
  background: var(--bg-side);
  flex-shrink: 0;
}

.panel.is-collapsed {
  height: auto;
  min-height: 0;
}

.panel.is-collapsed .panel-body {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  padding: 0 8px 0 12px;
  border-bottom: 1px solid transparent;
}

.panel-tabs {
  display: flex;
  gap: 0;
}

.panel-tab {
  padding: 6px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}

.panel-tab:hover {
  color: var(--text);
}

.panel-tab.is-active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

.panel-actions {
  display: flex;
}

.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1;
}

.icon-btn:hover {
  color: var(--text);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 8px 12px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--panel-scrollbar-thumb) var(--panel-scrollbar-track);
}

.panel-body::-webkit-scrollbar {
  width: var(--panel-scrollbar-size);
  height: var(--panel-scrollbar-size);
}

.panel-body::-webkit-scrollbar-track {
  margin: 4px 0;
  background: var(--panel-scrollbar-track);
  border-radius: 100px;
}

.panel-body::-webkit-scrollbar-thumb {
  background-color: var(--panel-scrollbar-thumb);
  border-radius: 100px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background-color 0.15s ease;
}

.panel-body::-webkit-scrollbar-thumb:hover {
  background-color: var(--panel-scrollbar-thumb-hover);
}

.panel-body::-webkit-scrollbar-thumb:active {
  background-color: var(--panel-scrollbar-thumb-active);
}

.panel-body::-webkit-scrollbar-corner {
  background: transparent;
}

.panel-content {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

.panel-content.hidden {
  display: none;
}

/* Status bar: bottom of the window (VS Code style). Left: language/EOL/encoding; right: flow icons + line/col. */
.status-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 12px;
  min-height: 26px;
  height: auto;
  padding: 3px 10px 3px 12px;
  background: var(--status-bg);
  color: #fff;
  font-size: 12px;
  user-select: none;
  overflow-x: hidden;
  overflow-y: hidden;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
  z-index: 5;
}

.status-bar-left {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-bar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  justify-self: end;
  width: max-content;
  max-width: 100%;
}

.status-left,
.status-mid,
.status-cursor {
  opacity: 0.95;
}

.status-mid {
  padding: 0 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.status-pipeline {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px 0 4px;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  margin-right: 2px;
  flex: 0 0 auto;
  flex-shrink: 0;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 2px;
  box-sizing: border-box;
  border-radius: 3px;
  color: #fff;
  cursor: default;
  flex-shrink: 0;
  transition:
    opacity 0.18s ease,
    filter 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

.status-chip svg {
  width: 15px;
  height: 15px;
  display: block;
  flex-shrink: 0;
  overflow: visible;
}

/* Pending: still visible; softer + light blur (heavy blur + low opacity hid icons) */
.status-chip:not(.is-done) {
  opacity: 0.78;
  filter: blur(0.35px);
  background: rgba(0, 0, 0, 0.12);
  box-shadow: none;
}

/* Completed: crisp + highlighted */
.status-chip.is-done {
  opacity: 1;
  filter: none;
  background: rgba(255, 255, 255, 0.22);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45),
    0 1px 3px rgba(0, 0, 0, 0.2);
}

.status-chip.is-done svg {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.6));
}

.status-cursor {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: nowrap;
}
