/* ============================================================
   IDE Core Styles — Shared layout, panels, tabs, modals, dark theme
   Extracted from CognitiveCaptureForm for reuse across IDE apps.
   ============================================================ */

:root {
  --bg: #1e1e2e;
  --bg-panel: #262637;
  --bg-input: #1a1a2a;
  --border: #3a3a5c;
  --text: #e0e0f0;
  --text-muted: #8d8daf;
  --accent: #6c63ff;
  --accent-hover: #7d75ff;
  /* The three status colours. One name and one value each — every
     `var(--danger, …)` fallback in both repos is written to match, so a
     viewer mounted standalone at /preview (outside this palette) shows the
     same colour the shell would. All three clear WCAG AA (4.5:1) against
     --bg above; `--danger` was #e05555 at 4.37:1, just under.
     Guarded by CognitiveEnhancer/tests/test_a_warning_is_one_colour_you_can_read.py */
  --danger: #e56464;
  --warn: #e0a800;
  --success: #4caf50;
  --radius: 6px;
  --header-h: 48px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

:root {
  /* Vertical band reserved for the fixed bottom docks (Processes + Log).
     Set live by ide-bottom-docks.js from the docks' real heights; 0 when no
     dock is mounted. Keeps #app content from sitting under the docks. */
  --bottom-docks-h: 0px;
  /* The band above #app held by top-edge banners (a practice copy's), set by
     ide-bottom-docks.js from their heights; 0 on every other box. */
  --top-bands-h: 0px;
}

#app {
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--bottom-docks-h) - var(--top-bands-h));
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: 0 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.logo {
  font-size: 16px;
  font-weight: 600;
  color: var(--accent);
}

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

.top-actions select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 13px;
}

/* Buttons */
.btn {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover {
  background: var(--border);
}
.btn-sm {
  padding: 3px 8px;
  font-size: 12px;
}
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
/* Action-bar state styles (action.base.ActionDefinition.availability_check):
   .btn-success marks a stage that's already been run (idempotent re-run still
   allowed); .btn-disabled marks an un-runnable stage whose prerequisite hasn't
   been met yet — the button's title= carries the reason. */
.btn-success {
  background: #2e7d32;
  border-color: #2e7d32;
  color: #fff;
}
.btn-success:hover {
  background: #388e3c;
}
.btn-disabled,
.btn-disabled:hover {
  background: var(--bg-input);
  border-color: var(--border);
  color: var(--text-muted, #8d8daf);
  cursor: not-allowed;
  opacity: 0.6;
}

/* Main Layout */
.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.workspace {
  flex: 2;
  display: flex;
  flex-direction: column;
  min-width: 400px;
  overflow: hidden;
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}

.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 2px;
}

.tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 12px;
  font-size: 13px;
  cursor: pointer;
  border-radius: var(--radius) var(--radius) 0 0;
  transition: all 0.15s;
}
.tab:hover {
  color: var(--text);
}
.tab.active {
  color: var(--text);
  background: var(--bg-input);
  border-bottom: 2px solid var(--accent);
}

.tab-content {
  display: none;
  flex: 1;
  flex-direction: column;
}
.tab-content.active {
  display: flex;
}

/* Prompt Editor */
.prompt-editor {
  flex: 1;
  min-height: 180px;
}

.prompt-editor textarea {
  flex: 1;
  resize: none;
  background: var(--bg-input);
  color: var(--text);
  border: none;
  padding: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.prompt-controls {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  align-items: center;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.prompt-controls label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.prompt-controls select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 13px;
}

.status-text {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

/* Bottom Area */
.bottom-area {
  flex: 1;
  display: flex;
  min-height: 200px;
  overflow: hidden;
}

.content-editor {
  flex: 1;
  min-width: 300px;
}

.content-body {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.content-text {
  flex: 1;
  resize: none;
  background: var(--bg-input);
  color: var(--text);
  border: none;
  padding: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.content-actions {
  display: flex;
  gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* Preview Panel */
.preview-panel {
  flex: 1;
  min-width: 300px;
}

.preview-body {
  flex: 1;
  overflow: hidden;
}

.preview-body iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

/* Resize Handles */
.resize-handle-v {
  width: 5px;
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
}
.resize-handle-v:hover {
  background: var(--accent);
}

.resize-handle-h {
  height: 5px;
  cursor: row-resize;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
}
.resize-handle-h:hover {
  background: var(--accent);
}

/* Sidebar — unified Assets + Project Files panel */
.sidebar {
  flex: 1;
  min-width: 200px;
  max-width: 50%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-section {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  min-height: 0;
}

.sidebar-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px 5px 6px;
  flex-shrink: 0;
  user-select: none;
  /* Narrow sidebars (≤ ~380px) used to clip the action buttons on
     the right (📅 Today / + New, ↻, etc.) and let them visually
     overlap the body content below. Allowing the header to wrap
     keeps the buttons fully visible — they drop onto a second
     line instead of overflowing or shrinking the title text. */
  flex-wrap: wrap;
  row-gap: 4px;
}

.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
  /* Without min-width:0, a flex item containing inline content
     refuses to shrink below its intrinsic width, which forces
     siblings (the action-buttons cluster) out of the row and
     into the next section. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-section-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.sidebar-section-toggle:hover {
  color: var(--text);
}
.sidebar-section-toggle.collapsed {
  transform: rotate(-90deg);
}

.sidebar-section-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  /* Keep the action cluster intact at narrow widths — let the
     title's text-overflow handle the squeeze instead of the
     buttons being clipped or pushed over the body content. */
  flex-shrink: 0;
}

.sidebar-section-body {
  overflow-y: auto;
  flex: 1;
  min-height: 80px;
  max-height: 50vh;
}
.sidebar-section-body.collapsed {
  display: none;
}

/* Asset Browser */
.asset-list {
  padding: 8px;
}

.asset-list .placeholder {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 32px 16px;
}

.asset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 13px;
}
.asset-item:hover {
  background: rgba(108, 99, 255, 0.1);
}
.asset-item.selected {
  background: rgba(108, 99, 255, 0.2);
  border: 1px solid var(--accent);
}

.asset-thumb {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--bg-input);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.asset-thumb img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}

.asset-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-insert {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.asset-item:hover .asset-insert {
  opacity: 1;
}

/* Asset multi-select checkbox */
.asset-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
}

.asset-selection-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgba(108, 99, 255, 0.1);
  border-bottom: 1px solid var(--accent);
  font-size: 12px;
  color: var(--accent);
}

.asset-selection-count {
  font-weight: 600;
}

/* Modal / Project Picker */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  width: min(480px, calc(100vw - 24px));
  max-height: 80vh;
  overflow-y: auto;
}
.modal h2 {
  font-size: 20px;
  margin-bottom: 4px;
}
.modal h3 {
  font-size: 15px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.modal-divider {
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.modal-form input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 14px;
  outline: none;
}
.modal-form input:focus {
  border-color: var(--accent);
}
.modal-form-actions {
  display: flex;
  gap: 8px;
}

.settings-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-top: 4px;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 300px;
  overflow-y: auto;
}

.project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
}
.project-list-item:hover {
  border-color: var(--accent);
}
.project-list-item .pli-name {
  font-size: 14px;
  font-weight: 500;
}
.project-list-item .pli-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.project-list-item .pli-date {
  font-size: 11px;
  color: var(--text-muted);
}

/* Project name in top bar */
.project-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-right: 8px;
}

/* Prompt ref badge */
.prompt-ref-badge {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--bg-input);
  border-radius: var(--radius);
}
.prompt-ref-badge code {
  color: var(--accent);
}

/* Project tree */
.project-tree {
  padding: 8px;
  font-size: 13px;
}
.project-tree .placeholder {
  color: var(--text-muted);
  text-align: center;
  padding: 16px;
}

.tree-folder {
  margin-bottom: 8px;
}
.tree-folder-name {
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.5px;
  padding: 4px 0;
}
.tree-file {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 3px;
  cursor: pointer;
  color: var(--text);
}
.tree-file:hover {
  background: rgba(108, 99, 255, 0.1);
}
.tree-file-icon {
  font-size: 12px;
}
.tree-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-file-size {
  font-size: 11px;
  color: var(--text-muted);
}

/* Action Bar — dynamic action buttons */
.action-bar {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  flex-wrap: wrap;
  min-height: 36px;
  align-items: center;
}

.action-bar .placeholder {
  color: var(--text-muted);
  font-size: 12px;
  font-style: italic;
}

/* ============================================================
   Workspace model — unified tree sidebar, plugin preview, workspace picker
   ============================================================ */

/* Workspace picker (replaces project-picker for workspace-model apps) */
.workspace-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  /* Was 300px; the list is now the picker's primary browsing surface (search/
     filter/sort live above it), so give it the room the viewport allows. */
  max-height: min(48vh, 460px);
  overflow-y: auto;
}
.workspace-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s;
}
.workspace-list-item:hover {
  border-color: var(--accent);
}
.workspace-list-item.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
}
.workspace-list-item .wli-name {
  font-size: 14px;
  font-weight: 500;
}
.workspace-list-item .wli-desc {
  font-size: 12px;
  color: var(--text-muted);
}
.workspace-list-item .wli-date {
  font-size: 11px;
  color: var(--text-muted);
}
.workspace-list-item .wli-source {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  border: 1px solid rgba(128, 128, 160, 0.28);
  border-radius: 8px;
  padding: 0 7px;
  margin-left: 6px;
  white-space: nowrap;
  vertical-align: middle;
}
/* CP-L: a workspace that is here because somebody shared it. The badge sits
   beside the source badge (same shape, so the row reads as one line of
   provenance), and the sentence under the description says who lent it and
   when it runs out. `soon` is the only colour: an ending you can still do
   something about is the one thing worth interrupting for. */
.workspace-list-item .wli-shared-badge {
  border-color: rgba(90, 160, 250, 0.45);
}
.workspace-list-item .wli-shared {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.workspace-list-item .wli-shared-soon {
  color: #d08a2a;
}
/* Group headings inside the Open-workspace list ("Recently opened", "All
   workspaces", "Shared with you"). Both group renderers already emitted this
   class; it had no rule, so the headings read as loose unlabelled text. */
.workspace-list-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 2px 2px;
}
.wli-recent-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
/* A most-used row repeats its alphabetical twin — tint it so the duplication
   reads as "this one again, up front" rather than "two different workspaces". */
.workspace-list-item.wli-recent {
  background: color-mix(in srgb, var(--accent) 6%, var(--bg-input));
}

/* Picker search / sort / filters bar (injected by IDE._ensurePickerToolbar) */
.wsp-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 8px;
}
.wsp-toolbar-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.wsp-toolbar input[type="search"] {
  flex: 1 1 160px;
  min-width: 120px;
  padding: 6px 10px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
}
.wsp-toolbar input[type="search"]:focus {
  border-color: var(--accent);
}
.wsp-toolbar select,
.wsp-filter-panel select,
.wsp-filter-panel input[type="number"] {
  padding: 5px 8px;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 12px;
}
.wsp-filter-panel {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 4%, var(--bg-input));
  font-size: 12px;
  color: var(--text-muted);
}
.wsp-filter-panel label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.wsp-filter-panel input[type="number"] {
  width: 64px;
}

/* Workspace tag chips — on rows (click to filter) and as active filters */
.wli-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.wli-tag {
  font-size: 11px;
  padding: 0 7px;
  border-radius: 9px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.wli-tag:hover {
  border-color: var(--accent);
  color: var(--text);
}
.wli-tag.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 15%, var(--bg-input));
  color: var(--text);
}
.wsp-filter-tags {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

/* Right-hand column of a picker row: date on top, counts underneath */
.workspace-list-item .wli-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 10px;
}
.workspace-list-item .wli-meta {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.workspace-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  margin-right: 8px;
}

/* Right-click context menu on tree entries */
.tree-context-menu {
  position: fixed;
  z-index: 2000;
  min-width: 180px;
  background: var(--bg-panel, #1f2028);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.1));
  border-radius: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  padding: 4px 0;
  font-size: 13px;
}
.tree-context-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  background: transparent;
  border: 0;
  color: var(--text, #e6e6f0);
  font-size: 13px;
  cursor: pointer;
}
.tree-context-item:hover:not(:disabled) {
  background: rgba(108, 99, 255, 0.16);
}
.tree-context-item-disabled,
.tree-context-item:disabled {
  color: var(--text-muted, #8d8daf);
  cursor: default;
}
.tree-context-separator {
  height: 1px;
  background: var(--border, rgba(255, 255, 255, 0.08));
  margin: 4px 0;
}

/* Accordion category groups + icons (context-menu redesign) ------------- */
.tree-context-group {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  background: transparent;
  border: 0;
  color: var(--text, #e6e6f0);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tree-context-group:hover {
  background: rgba(108, 99, 255, 0.16);
}
.tree-context-group .caret {
  margin-left: auto;
  opacity: 0.6;
  font-size: 11px;
  transition: transform 0.12s ease;
}
.tree-context-group[aria-expanded="true"] .caret {
  transform: rotate(90deg);
}
.tree-context-group-count {
  opacity: 0.5;
  font-weight: 400;
  font-size: 11px;
}
.tree-context-icon {
  display: inline-block;
  width: 1.3em;
  text-align: center;
  flex: 0 0 auto;
}
.tree-context-children {
  display: none;
}
.tree-context-children.open {
  display: block;
}
.tree-context-item.child {
  padding-left: 34px;
}
.tree-context-item-danger {
  color: var(--danger, #e56464);
}
.tree-context-item-danger:hover:not(:disabled) {
  background: rgba(255, 107, 107, 0.16);
}

/* "+ New ▾" add-content dropdown (progressive disclosure) -------------- */
.add-menu {
  position: relative;
  display: inline-block;
}
.add-menu-trigger[aria-expanded="true"] {
  filter: brightness(1.08);
}
.add-menu-panel {
  /* Anchored under the trigger; the .tree-context-menu class supplies the
     panel chrome (bg, border, shadow). Absolute so it overlays the tree. */
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 2000;
  min-width: 200px;
}
.add-menu-group-label {
  padding: 4px 12px 2px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #8d8daf);
}
/* T25.2 — the kinds an expander ("📄 File ▸") opens, set in under it. */
.add-menu-subgroup .tree-context-item {
  padding-left: 30px;
}
/* View-control icon buttons (compact toggle, refresh) sit beside the menu. */
.btn-icon {
  padding-left: 7px;
  padding-right: 7px;
}

/* Action bar "⋯ More ▾" overflow menu (progressive disclosure) --------- */
.action-more {
  position: relative;
  display: inline-block;
}
.action-more-panel {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 2000;
  min-width: 220px;
  max-height: 60vh;
  overflow-y: auto;
}

/* Linked workspace sections (shown below the primary workspace tree) */
.linked-workspace-section {
  margin-top: 10px;
  border-top: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  padding-top: 6px;
}
.linked-workspace-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #8d8daf);
  cursor: pointer;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.linked-workspace-header:hover {
  background: rgba(108, 99, 255, 0.06);
}
.linked-workspace-caret {
  width: 12px;
  text-align: center;
  font-size: 9px;
}
.linked-workspace-icon {
  width: 18px;
  text-align: center;
}
.linked-workspace-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.linked-workspace-unlink {
  padding: 0 6px;
  font-size: 14px;
  line-height: 1;
}
.linked-workspace-body {
  padding-left: 4px;
}

/* PI-01 R1-13 — a connected drive's status strip: is it answering, and how old
   is what you're looking at? Colour is never the only signal (§7): every state
   carries its own glyph and its own words, so this reads identically in
   greyscale and to a screen reader. */
.mount-status {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 1px 6px 4px 22px; /* aligns under the drive name, past caret + ☁ */
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted, #8d8daf);
}
.mount-status-badge {
  font-size: 10px;
  line-height: 1;
}
.mount-status-words {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mount-status-connected .mount-status-badge {
  color: #3fa45b;
}
.mount-status-not_answering .mount-status-badge {
  color: var(--text-muted, #8d8daf);
}
.mount-status-needs_sign_in .mount-status-badge {
  color: #c98a12;
}
.mount-status-action {
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.6;
}
/* The "it's back" line. Deliberately quiet and deliberately temporary — it is
   good news, and good news that stays on screen becomes furniture. */
.mount-status-back {
  color: #3fa45b;
  font-style: italic;
  flex-basis: 100%;
}
/* PI-01 R1-18 — "getting newer copies". Its own row like the watch line: it
   answers "am I looking at the latest?" and must not read as part of the
   connection sentence. Uses the shared --warn token family's readable amber
   is WRONG here — nothing is wrong, so it stays the quiet muted colour. */
.mount-refreshing {
  color: var(--text-muted, #9aa3b2);
  flex-basis: 100%;
}
/* PI-01 R1-16 — "will I see it when somebody else changes a file?" Its own row
   under the connection line (`flex-basis:100%`), because it answers a different
   question and reading them as one sentence is how "Connected" gets taken to
   mean "up to date". The glyph travels in the text, so this too survives
   greyscale and a screen reader. */
.mount-watch {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-basis: 100%;
  min-width: 0;
}
.mount-watch-words {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mount-watch-on .mount-watch-words {
  color: #3fa45b;
}
.mount-watch-action {
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.6;
  flex: none;
}
.tree-entry-linked .tree-line {
  opacity: 0.92;
}

/* Unified tree entries (ide-workspace.js) */
.tree-entry {
  font-size: 13px;
  user-select: none;
}
.tree-line {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 3px;
  cursor: pointer;
}
.tree-line:hover {
  background: rgba(108, 99, 255, 0.1);
}
/* Flash a row briefly when IDE.revealInTree() scrolls it into view. */
.tree-row-flash > .tree-line {
  background: rgba(108, 99, 255, 0.3);
  transition: background 0.6s ease-out;
}
.tree-caret {
  width: 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 9px;
  flex-shrink: 0;
}
.tree-caret-spacer {
  width: 12px;
  flex-shrink: 0;
}
.tree-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}
.tree-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tree-badge {
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
  border-radius: 8px;
  text-transform: lowercase;
  flex-shrink: 0;
}
.tree-size {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
/* ASSET_BROWSER AB-1 (F-G20) — sort header, thumbnails, friendly dates */
.tree-sort-header {
  display: flex;
  gap: 2px;
  padding: 2px 6px 4px;
  position: sticky;
  top: 0;
  background: var(--bg-panel, var(--bg, #16161f));
  z-index: 2;
  border-bottom: 1px solid rgba(128, 128, 160, 0.18);
}
.tree-sort-cell {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}
.tree-sort-cell:hover {
  color: var(--text, #e8e8f2);
  background: rgba(128, 128, 160, 0.12);
}
.tree-sort-cell.active {
  color: var(--accent);
  font-weight: 600;
}
.tree-sort-cell:first-child {
  margin-right: auto;
}
.tree-thumb {
  width: 20px;
  height: 20px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}
.tree-date {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.8;
  flex-shrink: 0;
}
.tree-badge-plain {
  text-transform: none;
  background: rgba(128, 160, 128, 0.15);
  color: var(--text-muted);
}
.tree-eye {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
  opacity: 0.4;
  flex-shrink: 0;
}
.tree-line:hover .tree-eye {
  opacity: 1;
}
.tree-eye:hover {
  color: var(--accent);
}
.tree-checkbox {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

/* ─── AB-3 (§6F.2): a file made from another is its own row, under it ──
 * The rows made from a file live in a `.tree-derived` group inside that
 * file's row, one step in per generation (the margin accumulates), each led
 * by ↳. A derived row is otherwise an ordinary row (AB-INV-13). */
.tree-derived {
  margin-left: 14px;
}
.tree-derived-mark {
  color: var(--text-muted);
  font-size: 11px;
  flex-shrink: 0;
  margin-right: -2px;
}
.tree-fold {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  padding: 0 4px;
  margin-left: 2px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.tree-fold:hover,
.tree-fold:focus-visible {
  color: var(--accent);
  background: rgba(108, 99, 255, 0.12);
}
/* A record file, drawn only under ▸ Advanced ▸ Show record files. */
.tree-entry-record > .tree-line .tree-name {
  font-style: italic;
  color: var(--text-muted);
}

/* Type chip — solid colored pill carrying the file extension.
 *
 * Falls back to a neutral muted tone for extensions we don't
 * recognise. The :root variables here let a theme override every
 * type color in one place; the values match common file-format
 * brand associations (PDF red, etc.).
 */
:root {
  --chip-pdf: #d04a47;
  --chip-md: #3b82f6;
  --chip-html: #e8703b;
  --chip-rtf: #8b5cf6;
  --chip-docx: #1e6fce;
  --chip-doc: #1e6fce;
  --chip-xlsx: #16a34a;
  --chip-xls: #16a34a;
  --chip-csv: #16a34a;
  --chip-pptx: #ea580c;
  --chip-ppt: #ea580c;
  --chip-json: #ca8a04;
  --chip-yaml: #ca8a04;
  --chip-yml: #ca8a04;
  --chip-txt: #6b7280;
  --chip-png: #db2777;
  --chip-jpg: #db2777;
  --chip-jpeg: #db2777;
  --chip-mp4: #0ea5e9;
  --chip-mp3: #0891b2;
  --chip-wav: #0891b2;
  --chip-folder: var(--accent);
  --chip-default: #6b7280;
  /* Typed-postfix chips. Reuse the file-type palette where the
   * meaning is similar (lineage → slate, mapping → teal, slidesync
   * → orange) and pick fresh hues for the ones with no obvious
   * file-type cousin. */
  --chip-lineage: #475569;
  --chip-mapping: #0d9488;
  --chip-slidesync: #d97706;
  --chip-url: #2563eb;
  --chip-urls: #2563eb;
  --chip-cognitiveform: #c026d3;
}

.tree-lineage-file {
  /* The chip itself — solid background, white text, mono label so
   * extensions read as a code token. */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 4px;
  border: none;
  background: var(--chip-default);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition:
    transform 0.08s ease,
    filter 0.12s ease,
    box-shadow 0.12s ease;
}
.tree-lineage-file:hover {
  filter: brightness(1.15);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-0.5px);
}
.tree-lineage-file:active {
  transform: translateY(0);
  filter: brightness(0.95);
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.tree-lineage-file:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* Folders need slightly more room because they spell out a name
 * (e.g. "slides", "graphify-out") rather than a 3-letter extension. */
.tree-lineage-file[data-kind="folder"] {
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
  font-size: 10.5px;
}

/* Per-extension color overrides. We attribute each type-class to
 * its CSS variable so themes can rebrand a single color without
 * touching individual selectors. */
.tree-lineage-file[data-ext="pdf"] {
  background: var(--chip-pdf);
}
.tree-lineage-file[data-ext="md"] {
  background: var(--chip-md);
}
.tree-lineage-file[data-ext="html"],
.tree-lineage-file[data-ext="htm"] {
  background: var(--chip-html);
}
.tree-lineage-file[data-ext="rtf"] {
  background: var(--chip-rtf);
}
.tree-lineage-file[data-ext="docx"] {
  background: var(--chip-docx);
}
.tree-lineage-file[data-ext="doc"] {
  background: var(--chip-doc);
}
.tree-lineage-file[data-ext="xlsx"] {
  background: var(--chip-xlsx);
}
.tree-lineage-file[data-ext="xls"] {
  background: var(--chip-xls);
}
.tree-lineage-file[data-ext="csv"] {
  background: var(--chip-csv);
}
.tree-lineage-file[data-ext="pptx"] {
  background: var(--chip-pptx);
}
.tree-lineage-file[data-ext="ppt"] {
  background: var(--chip-ppt);
}
.tree-lineage-file[data-ext="json"] {
  background: var(--chip-json);
}
.tree-lineage-file[data-ext="yaml"] {
  background: var(--chip-yaml);
}
.tree-lineage-file[data-ext="yml"] {
  background: var(--chip-yml);
}
.tree-lineage-file[data-ext="txt"] {
  background: var(--chip-txt);
}
.tree-lineage-file[data-ext="png"] {
  background: var(--chip-png);
}
.tree-lineage-file[data-ext="jpg"] {
  background: var(--chip-jpg);
}
.tree-lineage-file[data-ext="jpeg"] {
  background: var(--chip-jpeg);
}
.tree-lineage-file[data-ext="mp4"] {
  background: var(--chip-mp4);
}
.tree-lineage-file[data-ext="mp3"] {
  background: var(--chip-mp3);
}
.tree-lineage-file[data-ext="wav"] {
  background: var(--chip-wav);
}
.tree-lineage-file[data-kind="folder"] {
  background: var(--chip-folder);
}
/* Typed-postfix chips (data-ext carries the type-tag, not the bare
 * filename extension — set by deriveTypeChip() when it recognises
 * a `<stem>.<type-tag>.<ext>` filename). */
.tree-lineage-file[data-ext="lineage"] {
  background: var(--chip-lineage);
}
.tree-lineage-file[data-ext="mapping"] {
  background: var(--chip-mapping);
}
.tree-lineage-file[data-ext="slidesync"] {
  background: var(--chip-slidesync);
}
.tree-lineage-file[data-ext="url"] {
  background: var(--chip-url);
}
.tree-lineage-file[data-ext="urls"] {
  background: var(--chip-urls);
}
.tree-lineage-file[data-ext="cognitiveform"] {
  background: var(--chip-cognitiveform);
}

.tree-children {
  margin-left: 18px;
  border-left: 1px dotted var(--border);
  padding-left: 4px;
}

/* Plugin preview container (legacy single-pane — deprecated by panes-root) */
#preview-container {
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bg-input);
}
#preview-container .placeholder {
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
  padding: 32px 16px;
  font-style: italic;
}

/* ============================================================
   Pane manager (ide-panes.js) — VS Code-style tabs + splits
   ============================================================ */
.panes-root {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Toolbar above the layout tree — hosts the Layout dropdown and the pane-count
   / default-pane status. Shrinks to nothing if no controls are mounted. */
.panes-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  min-height: 32px;
  position: relative;
}

.panes-stage {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

/* Layout dropdown */
.panes-layout-control {
  position: relative;
}
.panes-layout-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.panes-layout-icon,
.panes-layout-item-icon {
  display: inline-flex;
  align-items: center;
  color: currentColor;
}
.panes-layout-caret {
  font-size: 10px;
  opacity: 0.7;
}
.panes-layout-status {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.panes-layout-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1000;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 2px;
  min-width: 260px;
}
.panes-layout-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  text-align: left;
}
.panes-layout-item:hover {
  background: var(--bg-input);
  border-color: var(--border);
}
.panes-layout-item.active {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border-color: var(--accent);
}
.panes-layout-item-label {
  flex: 1;
}

.pane-split {
  flex: 1;
  display: flex;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}
.pane-split-horizontal {
  flex-direction: row;
}
.pane-split-vertical {
  flex-direction: column;
}
.pane-split-child {
  flex: 1 1 50%;
  display: flex;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.pane-resize {
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
}
.pane-resize:hover {
  background: var(--accent);
}
.pane-resize-v {
  width: 4px;
  cursor: col-resize;
}
.pane-resize-h {
  height: 4px;
  cursor: row-resize;
}

.pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--bg-panel);
  border: 1px solid var(--border);
}
.pane.active {
  /* Active pane is also the destination for new content from the asset list,
     so make the highlight slightly more prominent than a plain border swap. */
  border-color: var(--accent);
  box-shadow: inset 0 2px 0 0 var(--accent);
}

/* Tab strip */
.pane-tabs {
  display: flex;
  align-items: stretch;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
  min-height: 32px;
}
.pane-tabs.drop-hl {
  background: rgba(108, 99, 255, 0.2);
}

.pane-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-right: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  max-width: 220px;
  user-select: none;
  position: relative;
}
.pane-tab:hover {
  background: var(--bg-input);
  color: var(--text);
}
.pane-tab.active {
  background: var(--bg-input);
  color: var(--text);
}
.pane-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent);
}
.pane-tab-icon {
  font-size: 13px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}
.pane-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

/* Type-coded chip sized down for tab strips (pane tabs +
 * Knowledge Pane history tabs). Reuses every per-type
 * [data-ext]/[data-kind] color rule already declared above by
 * sharing the .tree-lineage-file class; this rule just makes the
 * chip smaller and removes the hover lift since tabs already have
 * their own active/hover treatment. */
.type-chip-sm {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  line-height: 1.3;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}
.type-chip-sm:hover {
  /* Tab carries the click; don't compete with its hover effect. */
  transform: none;
  filter: none;
  box-shadow:
    0 1px 0 rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}
.type-chip-sm[data-kind="folder"] {
  /* Folders use the full name (no extension stripping); they need
   * a bit more padding so two-word folder labels read comfortably. */
  padding: 1px 6px;
  font-size: 9.5px;
}

.pane-tab-close {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  opacity: 0.4;
}
.pane-tab:hover .pane-tab-close {
  opacity: 1;
}
.pane-tab-close:hover {
  background: rgba(224, 85, 85, 0.25);
  color: var(--danger);
}
.pane-tab-nav {
  background: var(--bg-panel);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 10px;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.pane-tab-nav-fwd {
  border-right: none;
  border-left: 1px solid var(--border);
  margin-left: auto; /* push to the right edge of the strip */
}
.pane-tab-nav:hover:not(:disabled) {
  background: var(--bg-input);
  color: var(--text);
}
.pane-tab-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pane-tab-add {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  padding: 4px 10px;
  cursor: pointer;
}
.pane-tab-add:hover {
  color: var(--text);
}

/* Pane body */
.pane-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  position: relative;
}

.pane-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.pane-tab-textarea {
  flex: 1;
  resize: none;
  background: var(--bg-input);
  color: var(--text);
  border: none;
  padding: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.viewer-host {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  background: var(--bg-input);
}

/* Shared content-editor action bar for viewer tabs. Rendered above the
   viewer body; viewers append a `toolbarRoot` element via ctx.toolbar.
   Empty by default (and so collapses to zero height) — plugins opt in. */
.viewer-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  background: transparent;
  border-bottom: 0;
  flex: 0 0 auto;
  min-height: 0;
}
.viewer-toolbar:not(:empty) {
  padding: 6px 10px;
  background: var(--bg-panel, #252526);
  border-bottom: 1px solid var(--border, #333);
  min-height: 34px;
}

/* Drag-and-drop overlays — rendered via CSS based on .drop-* classes */
.pane-body.drop-left::before,
.pane-body.drop-right::before,
.pane-body.drop-top::before,
.pane-body.drop-bottom::before,
.pane-body.drop-center::before {
  content: "";
  position: absolute;
  background: rgba(108, 99, 255, 0.3);
  border: 2px dashed var(--accent);
  pointer-events: none;
  z-index: 10;
}
.pane-body.drop-center::before {
  inset: 0;
}
.pane-body.drop-left::before {
  top: 0;
  bottom: 0;
  left: 0;
  width: 50%;
}
.pane-body.drop-right::before {
  top: 0;
  bottom: 0;
  right: 0;
  width: 50%;
}
.pane-body.drop-top::before {
  left: 0;
  right: 0;
  top: 0;
  height: 50%;
}
.pane-body.drop-bottom::before {
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
}

/* Multi-select button state (both models) */
#btn-multi-select.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Drag-and-drop import into the Assets panel */
#asset-list {
  position: relative;
  min-height: 120px;
}
#asset-list.dnd-active {
  outline: 2px dashed var(--accent);
  outline-offset: -4px;
  background: rgba(108, 99, 255, 0.08);
}
#asset-list.dnd-active::after {
  content: "Drop to import";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  z-index: 2;
}
#asset-list.dnd-uploading {
  opacity: 0.6;
  pointer-events: none;
}

/* Internal tree drag-and-drop (rearranging assets within the workspace).
   A dragged row fades; a folder row that is a valid drop target gets a
   tinted highlight so the user can see exactly where the move will land. */
.tree-line-dragging {
  opacity: 0.45;
}
.tree-line-drop-target {
  background: rgba(108, 99, 255, 0.18);
  outline: 1px dashed var(--accent);
  outline-offset: -2px;
  border-radius: var(--radius);
}
#asset-list.dnd-uploading::after {
  /* `--upload-said` carries a live percentage while a big import is running
     (IDE._sayUploading). Without it the banner is the plain word, which is
     what a folder of two files should say. */
  content: var(--upload-said, "Uploading…");
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  background: var(--bg-input);
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 600;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================================
   Prompt Editor (single-editor redesign) + Template panel
   ============================================================ */

.prompt-area {
  display: flex;
  flex-direction: column;
  flex: 0 0 320px;
  min-height: 220px;
  max-height: 70vh;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

.prompt-area-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.prompt-panel {
  flex: 2;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  min-width: 320px;
  overflow: hidden;
}

.prompt-panel .panel-header {
  gap: 10px;
  flex-wrap: wrap;
}

.prompt-editor-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}
.prompt-editor-toolbar select {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px 6px;
  font-size: 12px;
  max-width: 180px;
}
.prompt-editor-toolbar label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
}

.prompt-template-badge {
  font-size: 11px;
  color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius);
  border: 1px solid rgba(108, 99, 255, 0.3);
}
.prompt-template-badge code {
  color: var(--accent);
}

#prompt-text {
  flex: 1;
  resize: none;
  background: var(--bg-input);
  color: var(--text);
  border: none;
  padding: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 13px;
  line-height: 1.5;
  outline: none;
}

.prompt-footer {
  display: flex;
  gap: 8px;
  padding: 6px 10px;
  border-top: 1px solid var(--border);
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.prompt-footer .status-text {
  font-size: 11px;
  margin-left: auto;
  color: var(--text-muted);
}

/* AI Output panel to the right of the prompt editor — streams events and
   agent goals as they arrive. Replaces the old template-panel. */
.ai-output-panel {
  flex: 1;
  min-width: 260px;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  border-left: 1px solid var(--border);
  overflow: hidden;
}
.ai-output-panel .panel-header {
  gap: 8px;
  align-items: center;
}
.ai-output-status {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-output-status[data-kind="error"] {
  color: var(--danger, #e56464);
}
.ai-output-status[data-kind="done"] {
  color: var(--success, #4caf50);
}
.ai-output-status[data-kind="running"] {
  color: var(--accent);
}
.ai-output-goals-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(108, 99, 255, 0.3);
  font-weight: 600;
}
.ai-output-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ai-output-goals {
  border-bottom: 1px solid var(--border);
  padding: 6px 10px 8px;
  background: rgba(108, 99, 255, 0.04);
  max-height: 40%;
  overflow-y: auto;
  flex-shrink: 0;
}
.aio-goals-header {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.aio-goals-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.aio-goal {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
}
.aio-goal-icon {
  flex-shrink: 0;
  width: 14px;
  text-align: center;
  font-family: ui-monospace, monospace;
  color: var(--text-muted);
}
.aio-goal-completed {
  color: var(--text-muted);
  text-decoration: line-through;
}
.aio-goal-completed .aio-goal-icon {
  color: var(--success, #4caf50);
}
.aio-goal-in_progress .aio-goal-icon {
  color: var(--accent);
}
.aio-goal-in_progress {
  font-weight: 600;
}
.ai-output-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.aio-entry {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
}
.aio-entry-head {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
  margin-bottom: 4px;
}
.aio-entry-kind {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(108, 99, 255, 0.15);
  color: var(--accent);
  flex-shrink: 0;
}
.aio-entry-tool-call .aio-entry-kind,
.aio-entry-tool-result .aio-entry-kind {
  background: rgba(126, 198, 153, 0.15);
  color: var(--success, #4caf50);
}
.aio-entry-todo-update .aio-entry-kind {
  background: rgba(108, 99, 255, 0.3);
  color: var(--accent);
}
.aio-entry-error .aio-entry-kind {
  background: rgba(224, 108, 117, 0.2);
  color: var(--danger, #e56464);
}
.aio-entry-log .aio-entry-kind {
  background: rgba(160, 160, 170, 0.15);
  color: var(--text-muted);
}
.aio-entry-title {
  font-weight: 600;
  font-size: 11px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.aio-entry-body {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  line-height: 1.4;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 240px;
  overflow-y: auto;
}
.aio-entry-assistant .aio-entry-body {
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  max-height: none;
}
.aio-entry-error .aio-entry-body {
  color: var(--danger, #e56464);
}
.aio-entry-tool-call .aio-entry-head,
.aio-entry-log .aio-entry-head {
  margin-bottom: 0;
}
.aio-entry-tool-call {
  padding: 4px 8px;
  background: transparent;
  border-color: transparent;
}
.aio-entry-tool-call .aio-entry-title {
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--text);
}
.aio-entry-log {
  padding: 3px 8px;
  background: transparent;
  border-color: transparent;
}
.aio-entry-log .aio-entry-title {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 11px;
}
.aio-entry-log .aio-entry-body {
  color: var(--text-muted);
  font-size: 10px;
  max-height: 120px;
}
.aio-entry-tool-result .aio-entry-title {
  color: var(--text-muted);
  font-weight: 400;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}
.aio-entry-toggle {
  margin-top: 4px;
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 10px;
  cursor: pointer;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.aio-entry-toggle:hover {
  text-decoration: underline;
}
.aio-entry-permission {
  border-color: var(--warn, #e0a800);
  background: rgba(229, 192, 123, 0.08);
}
.aio-entry-permission .aio-entry-kind {
  background: rgba(229, 192, 123, 0.25);
  color: var(--warn, #e0a800);
}
.aio-entry-permission[data-resolved="1"] {
  opacity: 0.6;
}
.aio-permission-msg {
  margin: 4px 0 8px;
  font-size: 12px;
  color: var(--text);
  line-height: 1.4;
  word-break: break-word;
}
.aio-permission-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.prompt-template-resize {
  width: 5px;
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
}
.prompt-template-resize:hover {
  background: var(--accent);
}

/* Template review modal — placeholders */
.placeholder-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}
.placeholder-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  gap: 8px;
  align-items: center;
}
.ph-req {
  color: var(--danger);
  font-weight: 700;
}
.ph-source {
  font-size: 10px;
  color: var(--text-muted);
  padding: 1px 6px;
  background: var(--bg-input);
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.ph-missing {
  font-size: 10px;
  color: var(--danger);
  font-style: italic;
}
.placeholder-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.placeholder-row input,
.placeholder-row textarea {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 13px;
  font-family: "SF Mono", "Fira Code", monospace;
  outline: none;
  width: 100%;
}
.placeholder-row textarea {
  resize: vertical;
  min-height: 80px;
}

#template-placeholders {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* Paper-plane insert icon on tree rows */
.tree-plane {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
  opacity: 0.35;
  flex-shrink: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
}
.tree-line:hover .tree-plane {
  opacity: 1;
}
.tree-plane:hover {
  color: var(--accent);
}

/* ▾ caret next to the plane — opens the IDE.Send target picker */
.tree-plane-menu {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 10px;
  padding: 0 3px 0 0;
  opacity: 0.35;
  flex-shrink: 0;
  transition:
    opacity 0.15s,
    color 0.15s;
}
.tree-line:hover .tree-plane-menu {
  opacity: 1;
}
.tree-plane-menu:hover {
  color: var(--accent);
}

/* Paper-plane floating in active text tab */
.pane-tab-plane {
  position: absolute;
  top: 6px;
  right: 8px;
  background: var(--bg-input);
  color: var(--accent);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  opacity: 0.4;
  transition:
    opacity 0.15s,
    background 0.15s;
}
.pane-tab-plane:hover {
  opacity: 1;
  background: var(--accent);
  color: #fff;
}
.pane-tab-content {
  position: relative;
}

/* =========================================================
   Find / Replace bar (text tabs)
   ========================================================= */

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

.pane-search-bar {
  flex: 0 0 auto;
  background: var(--bg-panel, #252526);
  border-bottom: 1px solid var(--border, #333);
  padding: 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
}

.pane-search-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pane-search-toggle {
  width: 18px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-muted, #8d8daf);
  cursor: pointer;
  font-size: 9px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}
.pane-search-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #ddd);
}

.pane-search-spacer {
  display: inline-block;
  width: 18px;
  flex: 0 0 18px;
}

.pane-search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-input, #1e1e1e);
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 3px;
  padding: 0 2px 0 6px;
  min-width: 0;
}
.pane-search-input-wrap:focus-within {
  border-color: var(--accent, #6c63ff);
}

.pane-search-input,
.pane-replace-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text, #ddd);
  padding: 4px 4px;
  font-size: 12px;
  font-family: inherit;
}

.pane-replace-input {
  background: var(--bg-input, #1e1e1e);
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 3px;
  padding: 4px 6px;
}
.pane-replace-input:focus {
  border-color: var(--accent, #6c63ff);
}

.pane-search-opts {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.pane-search-opt {
  width: 22px;
  height: 22px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text-muted, #8d8daf);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.pane-search-opt:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text, #ddd);
}
.pane-search-opt.active {
  background: rgba(108, 99, 255, 0.22);
  color: var(--accent, #6c63ff);
  border-color: var(--accent, #6c63ff);
}

.pane-search-count {
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  min-width: 70px;
  text-align: right;
  padding: 0 4px;
  flex-shrink: 0;
}
.pane-search-count.pane-search-count-empty {
  color: #e07070;
}

.pane-search-nav {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--text-muted, #8d8daf);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.pane-search-nav:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #ddd);
}

.pane-search-close {
  width: 24px;
  height: 24px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text-muted, #8d8daf);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  flex-shrink: 0;
}
.pane-search-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text, #ddd);
}

/* Match highlight overlay — lives behind the textarea; the overlay renders
   the full text with <mark> spans where the search hits, and the textarea
   sits on top with a transparent background so the mark colours show
   through. The overlay's text is itself transparent. */
.pane-hl-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-input, #1e1e1e);
}
.pane-hl-wrap > textarea {
  background: transparent;
  position: relative;
  z-index: 1;
}
.pane-hl-overlay {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.pane-hl-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  box-sizing: border-box;
  color: transparent;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: break-word;
  will-change: transform;
  margin: 0;
}
.pane-hl-content mark {
  color: transparent;
  background: transparent;
  padding: 0;
  border-radius: 2px;
}
.pane-hl-content mark.pane-hl-match {
  background: rgba(234, 180, 40, 0.35);
}
.pane-hl-content mark.pane-hl-current {
  background: rgba(234, 180, 40, 0.65);
  outline: 1px solid rgba(234, 180, 40, 0.95);
  outline-offset: -1px;
}

/* =========================================================
   Templates Dialog — list + editor modal
   ========================================================= */

.modal.templates-dialog {
  width: min(960px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.templates-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.templates-dialog-body {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.templates-dialog-list-pane {
  width: 280px;
  min-width: 220px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
}

.templates-dialog-list-header {
  display: flex;
  gap: 6px;
  padding: 8px;
  border-bottom: 1px solid var(--border);
  align-items: center;
  flex-shrink: 0;
}

.templates-dialog-search {
  flex: 1;
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px 8px;
  font-size: 12px;
  outline: none;
}
.templates-dialog-search:focus {
  border-color: var(--accent);
}

.templates-dialog-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.td-item {
  all: unset;
  display: block;
  cursor: pointer;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text);
}
.td-item:hover {
  border-color: var(--accent);
}
.td-item-selected {
  border-color: var(--accent);
  background: rgba(108, 99, 255, 0.1);
}
.td-item-muted {
  opacity: 0.55;
}
.td-item-head {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}
.td-item-label {
  font-weight: 600;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.td-item-tag {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.td-item-builtin {
  background: rgba(160, 160, 170, 0.15);
  color: var(--text-muted);
}
.td-item-user {
  background: rgba(126, 198, 153, 0.15);
  color: var(--success, #4caf50);
}
.td-item-desc {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.td-item-meta {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 4px;
}
.td-item-cat {
  font-size: 10px;
  padding: 1px 6px;
  background: rgba(108, 99, 255, 0.12);
  color: var(--accent);
  border-radius: 8px;
}
.td-item-applicable {
  font-size: 10px;
  color: var(--success, #4caf50);
}
.td-item-not-applicable {
  font-size: 10px;
  color: var(--text-muted);
}

.templates-dialog-editor {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.templates-dialog-editor-head {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tde-head-main {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tde-head-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.tde-head-id {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.tde-head-id code {
  color: var(--accent);
}

.templates-dialog-editor-fields {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tde-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tde-row-body {
  flex: 1;
  min-height: 260px;
}
.tde-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}
.tde-input {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  font-size: 13px;
  outline: none;
}
.tde-input:focus {
  border-color: var(--accent);
}
.tde-input:read-only,
.tde-input:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.tde-body-textarea {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-family: "SF Mono", "Fira Code", ui-monospace, monospace;
  font-size: 12px;
  line-height: 1.5;
  outline: none;
  resize: vertical;
  min-height: 240px;
  flex: 1;
}
.tde-body-textarea:focus {
  border-color: var(--accent);
}
.tde-body-textarea:read-only,
.tde-body-textarea:disabled {
  opacity: 0.75;
}
.tde-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
}

.templates-dialog-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.tde-dirty-badge {
  font-size: 11px;
  color: var(--danger, #e56464);
  font-weight: 600;
}

@media (max-width: 760px) {
  .templates-dialog-body {
    flex-direction: column;
  }
  .templates-dialog-list-pane {
    width: 100%;
    max-height: 35vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
}

/* ============================================================
   Process List — bottom-right list of background jobs
   Oldest at top, newest appended at the bottom.
   ============================================================ */
.ide-process-list {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 2000;
  width: min(420px, 90vw);
  max-height: min(60vh, 520px);
  font-size: 12px;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
}
.ide-process-list.has-error {
  border-color: var(--danger, #e56464);
}

.ide-process-list .ipl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}
.ide-process-list .ipl-head-title {
  flex: 1;
}
.ide-process-list .ipl-head-count {
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(108, 99, 255, 0.2);
  color: var(--accent);
}
.ide-process-list .ipl-clear {
  text-transform: none;
  letter-spacing: 0;
}

.ide-process-list .ipl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.ide-process-list .ipl-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(58, 58, 92, 0.4);
}
.ide-process-list .ipl-row:last-child {
  border-bottom: none;
}
.ide-process-list .ipl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-top: 4px;
  flex-shrink: 0;
  background: var(--text-muted);
}
.ide-process-list .ipl-dot[data-state="running"] {
  background: var(--accent);
  box-shadow: 0 0 6px rgba(108, 99, 255, 0.7);
  animation: ipl-pulse 1.6s ease-in-out infinite;
}
.ide-process-list .ipl-dot[data-state="paused"] {
  background: #e5b94b;
}
.ide-process-list .ipl-dot[data-state="completed"] {
  background: var(--success, #4caf50);
}
.ide-process-list .ipl-dot[data-state="error"] {
  background: var(--danger, #e56464);
}

.ide-process-list .ipl-row-main {
  flex: 1;
  min-width: 0;
}
.ide-process-list .ipl-row-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}
.ide-process-list .ipl-row-name {
  font-weight: 600;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.ide-process-list .ipl-row-chip {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  background: rgba(108, 99, 255, 0.18);
  color: var(--accent);
}
.ide-process-list .ipl-row-chip[data-state="running"] {
  background: rgba(108, 99, 255, 0.18);
  color: var(--accent);
}
.ide-process-list .ipl-row-chip[data-state="paused"] {
  background: rgba(229, 185, 75, 0.2);
  color: #e5b94b;
}
.ide-process-list .ipl-row-chip[data-state="completed"] {
  background: rgba(76, 175, 80, 0.18);
  color: var(--success, #4caf50);
}
.ide-process-list .ipl-row-chip[data-state="error"] {
  background: rgba(224, 85, 85, 0.18);
  color: var(--danger, #e56464);
}

.ide-process-list .ipl-row-msg {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  word-break: break-word;
}
.ide-process-list .ipl-row-error {
  color: var(--danger, #e56464);
}

.ide-process-list .ipl-row-bar {
  height: 4px;
  background: rgba(108, 99, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 6px;
}
.ide-process-list .ipl-row-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.25s ease-out;
}
.ide-process-list .ipl-row-error .ipl-row-bar span {
  background: var(--danger, #e56464);
}

.ide-process-list .ipl-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ide-process-list .ipl-row-actions .btn {
  padding: 2px 8px;
  font-size: 11px;
  line-height: 1.4;
}

.ide-process-list .ipl-row-error {
  background: rgba(224, 85, 85, 0.08);
}
.ide-process-list .ipl-row-paused {
  background: rgba(229, 185, 75, 0.06);
}
.ide-process-list .ipl-row-completed {
  opacity: 0.75;
}

@keyframes ipl-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

/* ============================================================
   IDE.OrganizeFallback — inline organize-into-folder panel.
   Used by direct-view office plugins when the in-browser
   renderer fails. See Common/server/ide/static/js/ide-organize-fallback.js.
   ============================================================ */
.ide-org-fallback {
  max-width: 560px;
  margin: 32px auto;
  padding: 24px 28px;
  background: var(--bg-input, #1e1e2e);
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 8px;
  color: var(--text, #ddd);
  font-size: 13px;
  line-height: 1.5;
}

.ide-org-head {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text, #fff);
}
.ide-org-reason {
  margin: 0 0 12px 0;
  color: var(--text-muted, #a0a0b0);
  font-style: italic;
}
.ide-org-body {
  margin: 0 0 16px 0;
}
.ide-org-body code {
  background: rgba(255, 255, 255, 0.06);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 12px;
}

.ide-org-form {
  margin-top: 12px;
}
.ide-org-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted, #a0a0b0);
  margin-bottom: 4px;
}
.ide-org-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: var(--bg, #0f0f1e);
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 4px;
  color: var(--text, #ddd);
  font-family: inherit;
  font-size: 14px;
}
.ide-org-input:focus {
  outline: none;
  border-color: var(--accent, #7aa2f7);
}
.ide-org-input:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.ide-org-hint {
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  margin-top: 4px;
  font-family: "SF Mono", Menlo, monospace;
}

.ide-org-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.ide-org-buttons .btn-primary,
.ide-org-buttons .ide-org-go {
  background: var(--accent, #7aa2f7);
  color: #0f0f1e;
  border-color: transparent;
  font-weight: 600;
}
.ide-org-buttons .btn-primary:disabled,
.ide-org-buttons .ide-org-go:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ide-org-status {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted, #a0a0b0);
  min-height: 16px;
}
.ide-org-status-error {
  color: #e05555;
}

/* ============================================================
 * Capture toolbar — selection-aware floating bar (Cognitron Phase 3)
 *
 * Shown at the bottom-right of the workspace when IDE.Selection has
 * a non-empty value. Buttons: 📎 Pin (refs), 🧠 Remember (mnemon),
 * 📖 Promote (Phase 5).
 * ============================================================ */
.ide-cap-bar {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: var(--bg-panel, #2b2b35);
  border: 1px solid var(--border-color, #444);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  font-size: 12px;
  max-width: min(640px, calc(100vw - 24px));
  color: var(--text, #ddd);
}
.ide-cap-bar.hidden {
  display: none;
}
.ide-cap-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 360px;
}
.ide-cap-source {
  font-weight: 600;
  color: var(--text, #ddd);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-cap-kind {
  font-family: "SF Mono", Menlo, monospace;
  font-size: 10px;
  background: var(--bg-hover, #3a3a45);
  color: var(--text-muted, #aaa);
  padding: 1px 5px;
  border-radius: 3px;
}
.ide-cap-text {
  color: var(--text-muted, #aaa);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-cap-btn {
  flex: 0 0 auto;
}
.ide-cap-btn--primary {
  background: var(--accent, #2d6cdf);
  color: white;
  border-color: var(--accent, #2d6cdf);
}
.ide-cap-btn--primary:hover:not(:disabled) {
  filter: brightness(1.1);
}
.ide-cap-status {
  font-size: 11px;
  color: var(--text-muted, #aaa);
  min-height: 14px;
  flex: 0 0 auto;
}
.ide-cap-status--ok {
  color: #7ec77e;
}
.ide-cap-status--error {
  color: #e05555;
}
.ide-cap-close {
  background: transparent;
  border: none;
  color: var(--text-muted, #8d8daf);
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.ide-cap-close:hover {
  color: var(--text, #ddd);
}

/* ============================================================
 * Trust pill (Cognitron Phase 8) — workspace-header companion to the
 * prompt-panel "Trust input" checkbox. Click toggles trust_mode.
 * ============================================================ */
.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  user-select: none;
}
.trust-pill--trusted {
  background: rgba(120, 200, 120, 0.18);
  color: #7ec77e;
  border-color: rgba(120, 200, 120, 0.4);
}
.trust-pill--trusted:hover {
  background: rgba(120, 200, 120, 0.28);
}
.trust-pill--untrusted {
  background: rgba(224, 85, 85, 0.18);
  color: #e07a7a;
  border-color: rgba(224, 85, 85, 0.4);
}
.trust-pill--untrusted:hover {
  background: rgba(224, 85, 85, 0.28);
}
.trust-pill-icon {
  font-size: 12px;
}

/* When the workspace is in untrusted mode, paint a thin red border
   around the whole shell so the operator never forgets that the next
   ingest will be wrapped in the security envelope. */
body.ws-untrusted #app {
  box-shadow: inset 0 0 0 2px rgba(224, 85, 85, 0.45);
}

/* ── IDE overlays (AUTH-5 quick switcher, AUTH-6 command palette) ── */

.ide-overlay {
  position: fixed;
  inset: 0;
  z-index: 8000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 12vh;
}
.ide-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.ide-overlay-panel {
  position: relative;
  width: min(640px, 92vw);
  background: var(--bg-panel, #1a1a2e);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}
.ide-overlay-panel input {
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text, #e0e0f0);
  border-bottom: 1px solid var(--border, #3a3a5e);
}
.ide-overlay-panel input::placeholder {
  color: var(--text-muted, #8d8daf);
}
.ide-overlay-panel ul {
  margin: 0;
  padding: 6px 0;
  list-style: none;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}
.ide-qs-row,
.ide-cp-row {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  cursor: pointer;
  color: var(--text, #e0e0f0);
}
.ide-qs-row--active,
.ide-cp-row--active {
  background: rgba(122, 162, 247, 0.18);
}
.ide-qs-icon,
.ide-cp-icon {
  text-align: center;
  font-size: 14px;
  opacity: 0.85;
}
.ide-qs-label,
.ide-cp-label {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-qs-sub,
.ide-cp-sub {
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.ide-qs-status,
.ide-cp-status {
  padding: 4px 16px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  border-bottom: 1px solid rgba(58, 58, 94, 0.5);
}
.ide-qs-status:empty,
.ide-cp-status:empty {
  display: none;
}

/* ── Backlinks sidebar pane (AUTH-7) ───────────────────────────── */

.ide-backlinks-section .ide-bl-header {
  cursor: pointer;
  user-select: none;
}
.ide-backlinks-section .ide-bl-chev {
  display: inline-block;
  width: 12px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-backlinks-section .ide-bl-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  font-weight: normal;
}
.ide-bl-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
.ide-bl-group {
  margin-bottom: 6px;
}
.ide-bl-src-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #a0a0b0);
  padding: 4px 0 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-bl-src-header:hover {
  color: var(--text, #e0e0f0);
}
.ide-bl-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 6px;
  padding: 3px 4px 3px 14px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
}
.ide-bl-row:hover {
  background: rgba(122, 162, 247, 0.1);
}
.ide-bl-row-icon {
  font-size: 11px;
  opacity: 0.7;
  text-align: center;
}
.ide-bl-row-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text, #e0e0f0);
}
.ide-bl-section {
  color: var(--accent, #7aa2f7);
}
.ide-bl-line {
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ide-bl-truncated {
  font-style: italic;
  padding-top: 4px;
}

/* ── Tags sidebar pane (AUTH-10) ──────────────────────────────── */

.ide-tags-section .ide-tag-header {
  cursor: pointer;
  user-select: none;
}
.ide-tag-chev {
  display: inline-block;
  width: 12px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-tag-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  font-weight: normal;
}
.ide-tag-body {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
.ide-tag-row {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
}
.ide-tag-row:hover {
  background: rgba(122, 162, 247, 0.1);
}
.ide-tag-row--active {
  background: rgba(122, 162, 247, 0.22);
}
.ide-tag-bar {
  display: block;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.ide-tag-bar > span {
  display: block;
  height: 100%;
  background: var(--accent, #7aa2f7);
  opacity: 0.7;
}
.ide-tag-name {
  color: var(--text, #e0e0f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-tag-num {
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* F-G16 (TAG-4) — faceted key rows + nested value list */
.ide-tag-keyrow {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  align-items: center;
  gap: 6px;
  padding: 3px 4px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 600;
}
.ide-tag-keyrow:hover {
  background: rgba(122, 162, 247, 0.1);
}
.ide-tag-key-chev {
  color: var(--text-muted, #8d8daf);
  font-size: 10px;
}
.ide-tag-key-name {
  color: var(--text, #e0e0f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-tag-values {
  margin-left: 14px;
  border-left: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  padding-left: 4px;
}

/* ── Workspace search overlay (AUTH-11) ───────────────────────── */

.ide-srch-panel {
  max-height: 78vh;
}
.ide-srch-row {
  display: block;
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid rgba(58, 58, 94, 0.3);
}
.ide-srch-row:last-child {
  border-bottom: none;
}
.ide-srch-row--active {
  background: rgba(122, 162, 247, 0.18);
}
.ide-srch-row-head {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.ide-srch-icon {
  text-align: center;
  font-size: 12px;
  opacity: 0.85;
}
.ide-srch-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #e0e0f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-srch-path {
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.ide-srch-snippet {
  font-size: 11px;
  color: var(--text-muted, #aaa);
  padding-left: 26px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}
.ide-srch-snippet mark {
  background: rgba(122, 162, 247, 0.4);
  color: var(--text, #e0e0f0);
  border-radius: 2px;
  padding: 0 2px;
}

/* ── Lineage sidebar pane (LINEAGE D) ─────────────────────────── */

.ide-lineage-section .ide-ln-header {
  cursor: pointer;
  user-select: none;
}
.ide-ln-chev {
  display: inline-block;
  width: 12px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-ln-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  font-weight: normal;
}
.ide-ln-body {
  max-height: 360px;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
.ide-ln-group {
  margin-bottom: 8px;
}
.ide-ln-group-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #a0a0b0);
  padding: 4px 0 2px;
  letter-spacing: 0.02em;
}
.ide-ln-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 6px;
  padding: 3px 4px 3px 12px;
  font-size: 12px;
  align-items: center;
}
.ide-ln-row:hover {
  background: rgba(122, 162, 247, 0.08);
  border-radius: 3px;
}
.ide-ln-row-path {
  color: var(--text, #e0e0f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-ln-action,
.ide-ln-engine,
.ide-ln-params {
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
  background: rgba(255, 255, 255, 0.04);
  padding: 1px 5px;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ide-ln-depth {
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-ln-goto {
  padding: 0 6px;
  font-size: 11px;
  line-height: 1.2;
}
.ide-ln-group-variants .ide-ln-lid {
  padding: 4px 0 0 8px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-ln-group-variants .ide-ln-lid code {
  background: transparent;
}
.ide-ln-variant {
  padding-left: 20px;
}

/* ── Properties sidebar pane (AUTH-8) ─────────────────────────── */

.ide-props-section .ide-props-header {
  cursor: pointer;
  user-select: none;
}
.ide-props-chev {
  display: inline-block;
  width: 12px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-props-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  font-weight: normal;
}
.ide-props-body {
  max-height: 400px;
  overflow-y: auto;
  padding: 6px 8px 8px;
}
.ide-props-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 6px;
  align-items: center;
  padding: 3px 0;
}
.ide-props-row label {
  font-size: 11px;
  color: var(--text-muted, #a0a0b0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-props-row input[type="text"],
.ide-props-row input[type="number"] {
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 3px;
  font-size: 12px;
  padding: 3px 6px;
  width: 100%;
  box-sizing: border-box;
}
.ide-props-row input[type="text"]:focus,
.ide-props-row input[type="number"]:focus {
  outline: 1px solid var(--accent, #7aa2f7);
  outline-offset: -1px;
}
.ide-props-tokens {
  display: flex;
  gap: 4px;
}
.ide-props-tokens input {
  flex: 1;
}
.ide-props-row--readonly code {
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 6px;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-props-remove {
  padding: 0 5px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--text-muted, #8d8daf);
}
.ide-props-remove:hover {
  color: #e07a7a;
}
.ide-props-add-row {
  padding: 6px 0 0;
}
.ide-props-newkey {
  background: transparent !important;
  border: 1px dashed var(--border, #3a3a5e) !important;
  color: var(--text-muted, #8d8daf);
  font-size: 11px;
  padding: 3px 6px !important;
  width: 100%;
  box-sizing: border-box;
}
.ide-props-newkey:focus {
  color: var(--text, #e0e0f0);
}
.ide-props-add {
  padding: 8px 0;
  text-align: center;
}

/* ── Local mini-graph pane (AUTH-12) ──────────────────────────── */

.ide-mg-section .ide-mg-header {
  cursor: pointer;
  user-select: none;
}
.ide-mg-chev {
  display: inline-block;
  width: 12px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-mg-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  font-weight: normal;
}
.ide-mg-depth-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-mg-depth {
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 3px;
  width: 36px;
  padding: 1px 4px;
  font-size: 11px;
}
.ide-mg-body {
  position: relative;
  padding: 4px 6px 6px;
}
.ide-mg-canvas {
  width: 100%;
  height: 320px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}
.ide-mg-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: var(--text-muted, #8d8daf);
  font-size: 12px;
}

/* ── Chain predictor sidebar (AE-7) ───────────────────────────── */

.ide-cp-section .ide-cp-header {
  cursor: pointer;
  user-select: none;
}
.ide-cp-chev {
  display: inline-block;
  width: 12px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-cp-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  font-weight: normal;
}
.ide-cp-body {
  max-height: 380px;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
.ide-cp-cthint {
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
  padding: 2px 0 6px;
}
.ide-cp-row {
  padding: 6px;
  margin-bottom: 4px;
  border: 1px solid var(--border, #2a2a42);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.02);
}
.ide-cp-row:hover {
  background: rgba(122, 162, 247, 0.08);
}
.ide-cp-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ide-cp-name {
  color: var(--text, #e0e0f0);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-cp-runs {
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ide-cp-row-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 6px;
}
.ide-cp-flow {
  font-size: 10px;
  color: var(--text-muted, #aaa);
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 5px;
  border-radius: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-cp-vars {
  font-size: 10px;
  color: var(--accent, #7aa2f7);
}
.ide-cp-row-acts {
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}
.ide-cp-status {
  font-size: 11px;
  color: var(--text-muted, #a0a0b0);
  padding: 6px 8px;
  border-top: 1px solid var(--border, #2a2a42);
}

/* ── Chain editor modal (AE-9) ────────────────────────────────── */

.ide-ce-panel {
  width: min(820px, 94vw);
  padding: 12px 16px 14px;
  max-height: 86vh;
}
.ide-ce-head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ide-ce-name,
.ide-ce-desc {
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 3px;
  padding: 6px 10px;
  font-size: 13px;
  outline: none;
}
.ide-ce-name:focus,
.ide-ce-desc:focus,
.ide-ce-origin:focus {
  border-color: var(--accent, #7aa2f7);
}
.ide-ce-desc {
  width: 100%;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.ide-ce-origin {
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 3px;
  padding: 5px 6px;
  font-size: 12px;
}
.ide-ce-cancel {
  font-size: 16px;
  line-height: 1;
}
.ide-ce-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted, #a0a0b0);
  margin: 8px 0 3px;
  letter-spacing: 0.02em;
}
.ide-ce-steps,
.ide-ce-vars {
  width: 100%;
  background: var(--bg-input, #0f0f1e);
  color: var(--text, #e0e0f0);
  border: 1px solid var(--border, #3a3a5e);
  border-radius: 3px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  resize: vertical;
  outline: none;
  box-sizing: border-box;
}
.ide-ce-steps:focus,
.ide-ce-vars:focus {
  border-color: var(--accent, #7aa2f7);
}
.ide-ce-foot {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.ide-ce-status {
  font-size: 11px;
  color: var(--text-muted, #a0a0b0);
}
.ide-ce-status--err {
  color: #e07a7a;
}

/* PROMPT-F prompts-referencing pane */
.ide-pr-section .ide-pr-header {
  cursor: pointer;
  user-select: none;
}
.ide-pr-chev {
  display: inline-block;
  width: 12px;
  font-size: 10px;
  color: var(--text-muted, #8d8daf);
}
.ide-pr-count {
  margin-left: 6px;
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  font-weight: normal;
}
.ide-pr-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 4px 8px 8px;
}
.ide-pr-group {
  margin-bottom: 8px;
}
.ide-pr-tpl-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #a0a0b0);
  padding: 4px 0 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-pr-tpl-head:hover {
  color: var(--text, #e0e0f0);
}
.ide-pr-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 6px;
  align-items: center;
  padding: 3px 4px 3px 14px;
  font-size: 11px;
  border-radius: 3px;
}
.ide-pr-row:hover {
  background: rgba(122, 162, 247, 0.08);
}
.ide-pr-time {
  color: var(--text-muted, #8d8daf);
  font-family: ui-monospace, monospace;
}
.ide-pr-model {
  color: var(--accent, #7aa2f7);
}
.ide-pr-status {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 2px;
}
.ide-pr-status-ok {
  background: rgba(126, 199, 126, 0.12);
  color: #7ec77e;
}
.ide-pr-status-error {
  background: rgba(224, 122, 122, 0.12);
  color: #e07a7a;
}
.ide-pr-status-cancelled {
  background: rgba(224, 175, 104, 0.12);
  color: #e0af68;
}

/* ── + Prompt button on Panes toolbar (LAYOUT-UNIFY-A) ─────────── */
.ide-prompt-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(122, 162, 247, 0.14);
  color: var(--accent, #7aa2f7);
  border: 1px solid rgba(122, 162, 247, 0.32);
  font-weight: 600;
}
.ide-prompt-add-btn:hover {
  background: rgba(122, 162, 247, 0.24);
}
.ide-prompt-add-glyph {
  font-size: 14px;
  line-height: 1;
}

/* ── Quick capture popover (NOTES Wave N1) ─────────────────────── */
.ide-qc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 12000;
}
.ide-qc-overlay.hidden {
  display: none;
}
.ide-qc-modal {
  width: 560px;
  max-width: calc(100vw - 32px);
  background: var(--bg, #0f1117);
  color: var(--fg, #e6e8eb);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ide-qc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ide-qc-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
}
.ide-qc-icon {
  font-size: 16px;
}
.ide-qc-close {
  background: transparent;
  color: inherit;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 2px 6px;
  opacity: 0.6;
}
.ide-qc-close:hover {
  opacity: 1;
}
.ide-qc-trust {
  padding: 8px 14px;
  font-size: 11px;
  color: #f7768e;
  background: rgba(247, 118, 142, 0.08);
  border-bottom: 1px solid rgba(247, 118, 142, 0.18);
}
.ide-qc-trust[hidden] {
  display: none;
}
.ide-qc-trust code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.ide-qc-anchor {
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(122, 162, 247, 0.08);
  border-bottom: 1px solid rgba(122, 162, 247, 0.16);
  font-size: 12px;
}
.ide-qc-anchor[hidden] {
  display: none;
}
.ide-qc-anchor-icon {
  font-size: 14px;
}
.ide-qc-anchor-label {
  flex: 1 1 auto;
  color: var(--accent, #7aa2f7);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-qc-drop {
  background: transparent;
  border: none;
  color: inherit;
  opacity: 0.5;
  cursor: pointer;
  font-size: 14px;
}
.ide-qc-drop:hover {
  opacity: 1;
}
.ide-qc-body {
  border: none;
  outline: none;
  background: transparent;
  color: inherit;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto,
    sans-serif;
  font-size: 13px;
  line-height: 1.55;
  padding: 14px;
  resize: vertical;
  min-height: 120px;
}
.ide-qc-body::placeholder {
  color: rgba(230, 232, 235, 0.35);
}
.ide-qc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}
.ide-qc-dest {
  font-size: 11px;
  opacity: 0.6;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ide-qc-actions {
  display: flex;
  gap: 6px;
}
.ide-qc-save {
  background: var(--accent, #7aa2f7);
  color: #0f1117;
  border-color: var(--accent, #7aa2f7);
  font-weight: 600;
}

/* ── IDE.Embed passage cards (NOTES Wave N4) ────────────────────── */
.ide-embed-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  margin: 12px 0;
  background: rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.ide-embed-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
}
.ide-embed-icon {
  font-size: 14px;
}
.ide-embed-target {
  flex: 1 1 auto;
  color: var(--accent, #7aa2f7);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-embed-goto {
  flex: 0 0 auto;
}
.ide-embed-body {
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
}
.ide-embed-loading {
  opacity: 0.5;
  font-style: italic;
}
.ide-embed-error {
  color: #f7768e;
}
.ide-embed-fact {
  font-size: 13px;
}
.ide-embed-tags {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ide-embed-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}
.ide-embed-pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.04);
  padding: 8px 10px;
  border-radius: 4px;
  margin: 0 0 6px 0;
  overflow-x: auto;
  white-space: pre-wrap;
}
.ide-embed-loc {
  font-size: 10px;
  opacity: 0.5;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ide-embed-quote {
  margin-top: 4px;
  font-style: italic;
  color: rgba(230, 232, 235, 0.7);
  border-left: 2px solid rgba(122, 162, 247, 0.4);
  padding-left: 8px;
}
.ide-embed-slide-ref {
  font-weight: 600;
}
.ide-embed-generic {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  opacity: 0.7;
}
.ide-embed-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 6px;
  display: inline-block;
}

/* ── Notes sidebar pane (NOTES Wave N5) ─────────────────────── */
.ide-notes-pane-section {
  margin-top: 6px;
}
.ide-np-header {
  cursor: pointer;
}
.ide-np-body {
  padding: 8px 10px;
}
.ide-np-search {
  width: 100%;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: inherit;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 12px;
  margin-bottom: 8px;
  outline: none;
}
.ide-np-search:focus {
  border-color: var(--accent, #7aa2f7);
}
.ide-np-results {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ide-np-row {
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  border: 1px solid transparent;
}
.ide-np-row:hover {
  background: rgba(122, 162, 247, 0.08);
  border-color: rgba(122, 162, 247, 0.18);
}
.ide-np-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ide-np-kind {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(122, 162, 247, 0.16);
  color: var(--accent, #7aa2f7);
  flex: 0 0 auto;
}
.ide-np-kind--anchored {
  background: rgba(158, 206, 106, 0.18);
  color: #9ece6a;
}
.ide-np-kind--composite {
  background: rgba(255, 158, 100, 0.18);
  color: #ff9e64;
}
.ide-np-kind--daily {
  background: rgba(187, 154, 247, 0.18);
  color: #bb9af7;
}
.ide-np-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.ide-np-when {
  font-size: 10px;
  opacity: 0.55;
  flex: 0 0 auto;
}
.ide-np-excerpt {
  font-size: 11px;
  opacity: 0.65;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.45;
}
/* Term-Note pane: inbox chip + status meta line (EN/WA repoint). */
.ide-np-inbox {
  font-size: 11px;
  padding: 4px 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: rgba(230, 170, 70, 0.14);
  border: 1px solid rgba(230, 170, 70, 0.32);
  color: var(--text, #e0e0f0);
  cursor: pointer;
}
.ide-np-inbox:hover {
  background: rgba(230, 170, 70, 0.24);
}
.ide-np-inbox-count {
  font-weight: 700;
}
.ide-np-meta {
  opacity: 0.55;
  -webkit-line-clamp: 1;
}
.ide-np-status--curated {
  color: #50c878;
  opacity: 0.85;
}
/* NP-5 (CONTENT_FEEDBACK §31) — a Concept's delete and Recently deleted. */
.ide-np-del {
  margin-left: 4px;
  padding: 0 4px;
  border: none;
  background: none;
  color: var(--text-secondary, #888);
  cursor: pointer;
  font-size: 12px;
}
.ide-np-del:hover,
.ide-np-del:focus-visible {
  color: var(--text, inherit);
}
.ide-np-link {
  padding: 0;
  border: none;
  background: none;
  color: var(--accent, #7aa2ff);
  cursor: pointer;
  font-size: 12px;
}
.ide-np-said {
  margin: 6px 0;
  font-size: 12px;
}
.ide-np-deleted {
  margin-top: 8px;
}
.ide-np-deleted-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-top: 1px solid var(--border, #444);
  font-size: 12px;
}
.ide-np-clash {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.ide-np-empty {
  font-size: 11px;
  opacity: 0.5;
  font-style: italic;
  margin: 0;
}
.ide-np-empty kbd {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 4px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
}

/* ── Notes margin overlay (NOTES Wave N6) ───────────────────── */
.ide-notes-margin-icon {
  background: rgba(255, 215, 0, 0.18);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.ide-notes-margin-icon--inline {
  position: absolute;
  right: -28px;
  top: 0;
}
.ide-notes-margin-icon:hover {
  background: rgba(255, 215, 0, 0.36);
}
.ide-notes-popover {
  background: var(--bg, #0f1117);
  color: var(--fg, #e6e8eb);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  width: 340px;
  max-width: calc(100vw - 16px);
  z-index: 10000;
  font-size: 12px;
  overflow: hidden;
}
.ide-notes-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 215, 0, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 600;
}
.ide-notes-popover-close {
  background: transparent;
  color: inherit;
  border: none;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.6;
}
.ide-notes-popover-close:hover {
  opacity: 1;
}
.ide-notes-popover-body {
  max-height: 320px;
  overflow-y: auto;
}
.ide-notes-popover-row {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ide-notes-popover-row:last-child {
  border-bottom: none;
}
.ide-notes-popover-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ide-notes-popover-kind {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(122, 162, 247, 0.16);
  color: var(--accent, #7aa2f7);
}
.ide-notes-popover-title {
  font-weight: 600;
  flex: 1 1 auto;
}
.ide-notes-popover-excerpt {
  margin-top: 4px;
  font-style: italic;
  opacity: 0.7;
}
.ide-notes-popover-row-actions {
  margin-top: 6px;
  display: flex;
  justify-content: flex-end;
}

/* ── Notes backlinks panel (NOTES Wave N6) ──────────────────── */
.ide-notes-bl-section {
  margin-top: 6px;
}
.ide-nb-count {
  opacity: 0.6;
  font-size: 11px;
}
.ide-nb-body {
  padding: 6px 10px;
}
.ide-nb-group-head {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.55;
  margin: 6px 0 2px;
}
.ide-nb-row {
  padding: 4px 6px;
  border-radius: 4px;
}
.ide-nb-row:hover {
  background: rgba(255, 215, 0, 0.08);
}
.ide-nb-row-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.ide-nb-icon {
  font-size: 12px;
}
.ide-nb-kind {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(122, 162, 247, 0.14);
  color: var(--accent, #7aa2f7);
}
.ide-nb-title {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.ide-nb-excerpt {
  font-size: 11px;
  opacity: 0.65;
  margin-top: 3px;
  font-style: italic;
}
.ide-nb-placeholder {
  font-size: 11px;
  opacity: 0.5;
  font-style: italic;
  margin: 0;
}

/* ── Notes daily-note carousel (NOTES Wave N10) ─────────────── */
.ide-np-carousel {
  display: flex;
  gap: 2px;
  margin-bottom: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.ide-np-chip {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(230, 232, 235, 0.5);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.ide-np-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--fg, #e6e8eb);
}
.ide-np-chip--filled {
  background: rgba(187, 154, 247, 0.16);
  border-color: rgba(187, 154, 247, 0.28);
  color: #bb9af7;
}
.ide-np-chip--filled:hover {
  background: rgba(187, 154, 247, 0.3);
}
.ide-np-chip--today {
  outline: 2px solid rgba(122, 162, 247, 0.5);
  outline-offset: -1px;
}

/* ── Things pane (MEDIA_OBJECT Wave M5) ─────────────────────────── */
.ide-tp-section {
  margin-top: 6px;
}
.ide-tp-header {
  cursor: pointer;
}
.ide-tp-count {
  opacity: 0.6;
  font-size: 11px;
}
.ide-tp-body {
  padding: 6px 10px;
}
.ide-tp-placeholder {
  font-size: 11px;
  opacity: 0.55;
  font-style: italic;
  margin: 0;
}
.ide-tp-aligned-note {
  font-size: 10px;
  opacity: 0.55;
  margin-bottom: 6px;
  font-style: italic;
}
.ide-tp-thing {
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.ide-tp-thing:last-child {
  border-bottom: none;
}
.ide-tp-thing-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-size: 12px;
}
.ide-tp-kind {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 8px;
  background: rgba(122, 162, 247, 0.16);
  color: var(--accent, #7aa2f7);
  flex: 0 0 auto;
}
.ide-tp-kind--entity {
  background: rgba(158, 206, 106, 0.18);
  color: #9ece6a;
}
.ide-tp-kind--concept {
  background: rgba(187, 154, 247, 0.18);
  color: #bb9af7;
}
.ide-tp-kind--timeline {
  background: rgba(255, 158, 100, 0.18);
  color: #ff9e64;
}
.ide-tp-thing-name {
  font-weight: 600;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ide-tp-conf {
  font-size: 10px;
  opacity: 0.5;
}
.ide-tp-qid {
  font-size: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--accent, #7aa2f7);
  text-decoration: none;
  padding: 1px 4px;
  border: 1px solid rgba(122, 162, 247, 0.3);
  border-radius: 3px;
}
.ide-tp-qid:hover {
  background: rgba(122, 162, 247, 0.1);
}
.ide-tp-untrusted {
  font-size: 11px;
  color: #f7768e;
}
.ide-tp-on-this {
  font-size: 11px;
  font-style: italic;
  opacity: 0.7;
  margin-top: 4px;
  border-left: 2px solid rgba(122, 162, 247, 0.4);
  padding-left: 6px;
}
.ide-tp-also-head {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  opacity: 0.55;
}
.ide-tp-also-record {
  margin-top: 3px;
}
.ide-tp-also-record summary {
  cursor: pointer;
  font-size: 11px;
  padding: 2px 4px;
  border-radius: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.ide-tp-also-record summary:hover {
  background: rgba(255, 255, 255, 0.04);
}
.ide-tp-also-count {
  opacity: 0.55;
}
.ide-tp-also-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px 2px 18px;
  font-size: 11px;
}
.ide-tp-also-meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  opacity: 0.6;
  flex: 0 0 auto;
}
.ide-tp-also-excerpt {
  flex: 1 1 auto;
  opacity: 0.7;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ============================================================
 * IDE.AISettings — per-workspace AI plugin picker modal
 * ============================================================ */
.ai-settings-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 24, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
}
.ai-settings-modal {
  background: #1e1e2e;
  color: #d8d8ee;
  width: min(620px, 92vw);
  max-height: 86vh;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  border: 1px solid #3a3a5c;
  overflow: hidden;
}
.ai-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid #3a3a5c;
  background: #262637;
}
.ai-settings-header h2 {
  font-size: 14px;
  font-weight: 600;
  color: #7d75ff;
  margin: 0;
}
.ai-settings-close {
  background: transparent;
  border: none;
  color: #d8d8ee;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.ai-settings-body {
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ai-settings-row {
  border: 1px solid #3a3a5c;
  border-radius: 6px;
  padding: 8px 12px 12px;
}
.ai-settings-row legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  color: #7d75ff;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ai-settings-hint {
  font-size: 12px;
  color: #8d8daf;
  margin: 4px 0 8px;
}
.ai-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ai-settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: #8d8daf;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.ai-settings-grid select {
  background: #262637;
  color: #d8d8ee;
  border: 1px solid #3a3a5c;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
}
.ai-settings-warn {
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(255, 180, 90, 0.08);
  border: 1px solid rgba(255, 180, 90, 0.35);
  border-radius: 4px;
  font-size: 11px;
  color: #ffc285;
}
.ai-settings-empty {
  font-size: 13px;
  color: #8d8daf;
  padding: 12px 0;
}
.ai-settings-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid #3a3a5c;
  background: #262637;
}
.ai-settings-status {
  margin-right: auto;
  font-size: 12px;
  color: #8d8daf;
}

/* Header trigger — sits next to .trust-pill */
.ai-settings-trigger {
  background: #3a3a5c;
  color: #d8d8ee;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.ai-settings-trigger:hover {
  background: #4a4a72;
}

/* ============================================================
 * Term-Note capture (ENHANCED_NOTE EN-1) — toast + switcher
 * ============================================================ */
.ide-note-toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-panel, #2b2b35);
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
  color: var(--text, #ddd);
  max-width: min(680px, calc(100vw - 24px));
}
.ide-note-toast-msg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-note-toast-btn {
  flex: 0 0 auto;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-hover, #3a3a45);
  color: var(--text, #ddd);
  cursor: pointer;
}
.ide-note-toast-btn:hover {
  background: var(--accent, #2d6cdf);
  border-color: var(--accent, #2d6cdf);
  color: #fff;
}
.ide-note-toast-close {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--text-muted, #8d8daf);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
}

.ide-note-switcher-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
}
.ide-note-switcher {
  width: min(520px, calc(100vw - 32px));
  background: var(--bg-panel, #2b2b35);
  border: 1px solid var(--border-color, #444);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ide-note-switcher-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted, #aaa);
}
.ide-note-switcher-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1e1e26);
  color: var(--text, #ddd);
  font-size: 13px;
}
.ide-note-switcher-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.ide-note-switcher-row {
  text-align: left;
  border: none;
  background: none;
  color: var(--text, #ddd);
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  cursor: pointer;
  display: block;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-note-switcher-row:hover {
  background: var(--bg-hover, #3a3a45);
}
.ide-note-sw-hint {
  color: var(--text-muted, #8d8daf);
  font-size: 11px;
  margin-left: 6px;
}
/* F-G15 — inline create panel inside the capture switcher. */
.ide-note-create-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
}
.ide-note-create-panel label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted, #aaa);
}
.ide-note-create-panel input {
  flex: 1;
  box-sizing: border-box;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1e1e26);
  color: var(--text, #ddd);
  font-size: 13px;
}
.ide-note-create-panel label > button {
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1e1e26);
  color: var(--text, #ddd);
  border-radius: 5px;
  padding: 4px 7px;
  font-size: 11px;
  cursor: pointer;
}
.ide-note-create-panel label > button:hover {
  background: var(--bg-hover, #3a3a45);
}
.ide-note-create-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.ide-note-create-actions button {
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1e1e26);
  color: var(--text, #ddd);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  cursor: pointer;
}
.ide-note-create-actions button.nc-primary {
  background: var(--accent, #4a7dff);
  border-color: var(--accent, #4a7dff);
  color: #fff;
}
.ide-note-create-actions button:hover {
  filter: brightness(1.1);
}

/* ---- KD-1 link capture (＋ Add link + paste toast) ---- */
.ide-link-toast {
  position: fixed;
  bottom: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-panel, #2b2b35);
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-size: 12.5px;
  color: var(--text, #ddd);
  max-width: min(680px, calc(100vw - 24px));
}
.ide-link-toast-msg {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ide-link-toast-url {
  color: var(--accent, #7d8cff);
}
.ide-link-toast-btn {
  flex: 0 0 auto;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-hover, #3a3a45);
  color: var(--text, #ddd);
  cursor: pointer;
}
.ide-link-toast-btn:hover {
  background: var(--accent, #2d6cdf);
  border-color: var(--accent, #2d6cdf);
  color: #fff;
}
.ide-link-toast-close {
  flex: 0 0 auto;
  border: none;
  background: none;
  color: var(--text-muted, #8d8daf);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
}
.ide-add-link-modal {
  position: fixed;
  inset: 0;
  z-index: 9600;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.ide-add-link-card {
  width: min(440px, calc(100vw - 32px));
  background: var(--bg-panel, #2b2b35);
  border: 1px solid var(--border-color, #444);
  border-radius: 10px;
  padding: 18px 20px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.ide-add-link-head {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #eee);
  margin-bottom: 12px;
}
.ide-add-link-lbl {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted, #8d8daf);
  margin: 8px 0 4px;
}
.ide-add-link-card input {
  width: 100%;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1c1c24);
  color: var(--text, #eee);
  font-size: 13px;
  box-sizing: border-box;
}
.ide-add-link-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
/* SG-1 — topics the workspace already uses that this address mentions. They
   are OFFERED, so they read as outlines rather than as chips already on the
   link; one click moves a word from this row into the editor above. */
.ide-add-link-suggested {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.ide-add-link-suggested-lbl {
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
}
.ide-add-link-suggested-chip {
  font: inherit;
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px dashed var(--border-color, #555);
  background: transparent;
  color: var(--text-muted, #aaa);
  cursor: pointer;
}
.ide-add-link-suggested-chip:hover {
  color: var(--text, #eee);
  border-style: solid;
}

/* ---- KD-3 scheduled tasks panel ---- */
.settings-subhead {
  margin: 18px 0 8px;
  font-size: 13px;
  color: var(--text-muted, #8d8daf);
}
.sched-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-color, #333);
  /* The "what it does" line wraps under the toggle + cadence rather than
     squeezing them: a task running unattended must be able to say what it
     will do at whatever width the settings panel happens to be. */
  flex-wrap: wrap;
}
.sched-what {
  flex-basis: 100%;
  font-size: 11.5px;
  color: var(--text-muted, #8d8daf);
}
.sched-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  cursor: pointer;
}
.sched-when {
  font-size: 11.5px;
  color: var(--text-muted, #8d8daf);
}
.sched-del {
  border: none;
  background: none;
  color: var(--text-muted, #8d8daf);
  cursor: pointer;
  font-size: 13px;
}
.sched-del:hover {
  color: var(--danger, #e56464);
}
.sched-empty,
.sched-err {
  font-size: 12.5px;
  color: var(--text-muted, #8d8daf);
  padding: 6px 0;
}
.sched-addform {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.sched-choices {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}
.sched-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text, #eee);
}
.sched-choice select {
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1c1c24);
  color: var(--text, #eee);
}
/* What arming this would clear TODAY — shown before the button is pressed,
   so nobody schedules a destructive job without seeing its size. */
.sched-preview {
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color, #444);
  background: var(--bg-input, #1c1c24);
  font-size: 12.5px;
  color: var(--text-muted, #8d8daf);
}
.sched-addform select,
.sched-addform input {
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1c1c24);
  color: var(--text, #eee);
  font-size: 12.5px;
}

/* ---- KD-5 Discover tab ---- */
.disc-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, #333);
}
.disc-title {
  font-size: 14px;
  font-weight: 600;
}
.disc-because {
  font-size: 11.5px;
  color: var(--text-muted, #8d8daf);
  margin-top: 2px;
}
.disc-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}
.disc-chip {
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 12px;
  cursor: pointer;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1c1c24);
  color: var(--text-muted, #aaa);
}
.disc-chip.on {
  background: var(--accent, #6c63ff);
  border-color: var(--accent, #6c63ff);
  color: #fff;
}
/* 🎬 Content ideas — the media trend-radar pair (topics + scan). Hidden
   until asked for, so the controls row stays one line. */
.disc-media-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(127, 127, 127, 0.3);
}
.disc-media-panel[hidden] {
  display: none;
}
.disc-media-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}
.disc-media-row input {
  font: inherit;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(127, 127, 127, 0.35);
  background: var(--bg-input, rgba(127, 127, 127, 0.08));
  color: inherit;
}
/* QD-1a — the box holds the WHOLE list, so it has to say so: removing a topic
   here is the only way to stop following it. */
.disc-media-hint {
  margin: -2px 0 0;
  font-size: 0.78rem;
  opacity: 0.7;
}
.disc-media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.disc-media-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.85rem;
  opacity: 0.85;
}
.disc-controls {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.disc-btn {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: var(--accent, #6c63ff);
  color: #fff;
}
.disc-btn:hover {
  filter: brightness(1.1);
}
.disc-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
.disc-btn-ghost {
  background: transparent;
  border: 1px solid var(--border-color, #555);
  color: var(--text, #ddd);
}
.disc-cards {
  padding: 4px 0;
}
.disc-card {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color, #2c2c44);
}
.disc-card-done {
  opacity: 0.6;
}
.disc-card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--accent, #7d75ff);
  text-decoration: none;
  display: block;
}
.disc-card-title:hover {
  text-decoration: underline;
}
.disc-card-meta {
  font-size: 11px;
  color: var(--text-muted, #8d8daf);
  margin-top: 2px;
}
.disc-card-why {
  font-size: 12px;
  color: var(--text, #ccc);
  margin: 5px 0;
}
.disc-card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 4px 0;
}
.disc-tag {
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--bg-input, #1c1c24);
  color: var(--text-muted, #99a);
}
.disc-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.disc-saved {
  font-size: 11.5px;
  color: var(--text-muted, #8a8);
}
.disc-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-muted, #8d8daf);
  font-size: 13px;
}
.disc-empty-sub {
  font-size: 11.5px;
}
.disc-loading {
  padding: 20px;
  color: var(--text-muted, #8d8daf);
}

/* ---- KD-5 Settings ▸ Discovery ---- */
.settings-keep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 13px;
}
.settings-keep-row select {
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg-input, #1c1c24);
  color: var(--text, #eee);
}
.settings-hint {
  font-size: 11.5px;
  color: var(--text-muted, #8d8daf);
  margin: 6px 0;
}
/* T6.1 — "what is taking room in this workspace?"
   ⚠ The row's own sentence takes --text, not --text-muted: it is what tells
   somebody whether the row is safe to clear, not decoration (UL-0's
   measurement). Only the file count is quieter. */
.wsr-row {
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #3a3a5c);
}
.wsr-row:last-child {
  border-bottom: none;
}
.wsr-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  justify-content: space-between;
}
.wsr-head b {
  font-size: 13px;
  color: var(--text, #e0e0f0);
}
.wsr-size {
  font-size: 12px;
  color: var(--text, #e0e0f0);
  font-variant-numeric: tabular-nums;
}
.wsr-bar {
  height: 4px;
  border-radius: 3px;
  background: var(--bg-input, #1a1a2a);
  margin: 5px 0 4px;
  overflow: hidden;
}
.wsr-bar i {
  display: block;
  height: 100%;
  background: var(--accent, #6c63ff);
}
.wsr-say {
  margin: 0;
  font-size: 12px;
  color: var(--text, #e0e0f0);
  opacity: 0.85;
}
.wsr-files {
  color: var(--text-muted, #8d8daf);
}
.wsr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.wsr-actions:empty {
  display: none;
}
.wsr-clears {
  font-size: 12px;
  color: var(--text, #e0e0f0);
  opacity: 0.85;
}
.settings-interests {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.settings-interest-chip {
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 12px;
  cursor: pointer;
  background: var(--bg-input, #1c1c24);
  border: 1px solid var(--border-color, #555);
  color: var(--text, #ddd);
}
.settings-interest-chip:hover {
  border-color: var(--danger, #e56464);
}

/* ---- KD-8 bookmarklet ---- */
.settings-bookmarklet {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 6px;
  background: var(--accent, #6c63ff);
  color: #fff;
  text-decoration: none;
  font-size: 12.5px;
  cursor: grab;
}
.settings-bookmarklet:active {
  cursor: grabbing;
}

/* ---- D13 cross-workspace digest ---- */
.disc-ws {
  color: var(--accent, #7d75ff);
}
.disc-btn-ghost.on {
  background: var(--accent, #6c63ff);
  border-color: var(--accent, #6c63ff);
  color: #fff;
}

/* ASSET_BROWSER AB-2 (F-G20) — the Finder-style browser view */
.browser-host {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.browser-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(128, 128, 160, 0.18);
  flex-wrap: wrap;
}
.browser-crumbs {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}
.browser-crumb {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
}
.browser-crumb:hover {
  background: rgba(128, 128, 160, 0.12);
}
.browser-crumb-sep {
  color: var(--text-muted);
  font-size: 11px;
}
.browser-spacer {
  margin-left: auto;
}
.browser-sort,
.browser-mode {
  background: none;
  border: 1px solid rgba(128, 128, 160, 0.25);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 6px;
}
.browser-sort.active {
  color: var(--accent);
  border-color: var(--accent);
}
.browser-body {
  flex: 1;
  overflow: auto;
  outline: none;
  padding: 8px;
}
.browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  align-content: start;
}
.browser-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 6px;
  border-radius: 10px;
  cursor: default;
  text-align: center;
}
.browser-tile:hover {
  background: rgba(128, 128, 160, 0.1);
}
.browser-tile.focused {
  background: rgba(108, 99, 255, 0.18);
}
.browser-tile-pic {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
}
.browser-tile-pic img {
  max-width: 96px;
  max-height: 96px;
  border-radius: 8px;
  object-fit: cover;
}
.browser-tile-name {
  font-size: 12px;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browser-tile-sub {
  font-size: 10px;
  color: var(--text-muted);
}
.browser-list {
  display: flex;
  flex-direction: column;
}
.browser-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: default;
}
.browser-row:hover {
  background: rgba(128, 128, 160, 0.1);
}
.browser-row.focused {
  background: rgba(108, 99, 255, 0.18);
}
.browser-row-pic {
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}
.browser-row-pic img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
}
.browser-row-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.browser-row-badge {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(128, 160, 128, 0.15);
  border-radius: 8px;
  padding: 1px 6px;
  flex-shrink: 0;
}
.browser-row-size {
  width: 70px;
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.browser-row-date {
  width: 74px;
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ------------------------------------------------------------------
   VT-2 (F-V2) — "My notes": the reader's own highlights and notes.
   ------------------------------------------------------------------ */

/* The capture bar in personal mode. Same bar, reader's verbs. */
.ide-cap-private {
  font-size: 11px;
  color: var(--text-muted, #aaa);
  flex: 0 0 auto;
  white-space: nowrap;
}

/* The opener. Bottom-left so it never sits under the capture bar (bottom
   right) — a control that a selection can cover is a control people stop
   trusting. 44px min target: this is a tablet surface. */
.ide-mynotes-open {
  position: fixed;
  bottom: 12px;
  left: 12px;
  z-index: 8990;
  min-height: 44px;
  padding: 0 14px;
}

.ide-mynotes-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100vw);
  z-index: 9100;
  display: flex;
  flex-direction: column;
  background: var(--bg-panel, #2b2b35);
  border-left: 1px solid var(--border-color, #444);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.35);
  color: var(--text, #ddd);
}
.ide-mynotes-drawer.hidden {
  display: none;
}
.ide-mynotes-head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color, #444);
}
.ide-mynotes-head h2 {
  margin: 0;
  font-size: 15px;
}
.ide-mynotes-private {
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--text-muted, #aaa);
}
/* The two ways to start a note, on their own row under the privacy line.
   Placed EXPLICITLY: the header is a grid and auto-placement happened to put
   them right, which is not the same as saying so. */
.ide-mynotes-add,
.ide-mynotes-ask {
  grid-row: 3;
  min-height: 36px;
  cursor: pointer;
}
.ide-mynotes-add {
  grid-column: 1;
}
.ide-mynotes-ask {
  grid-column: 2;
}
.ide-mynotes-close {
  grid-row: 1;
  grid-column: 2;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted, #aaa);
  cursor: pointer;
  opacity: 0.7;
}
.ide-mynotes-close:hover {
  opacity: 1;
}
.ide-mynotes-list {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 14px 16px;
}
.ide-mynotes-empty {
  color: var(--text-muted, #aaa);
  font-size: 13px;
  line-height: 1.5;
  margin: 16px 0;
}
.ide-mynotes-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color, #3a3a45);
}
.ide-mynotes-row-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ide-mynotes-kind {
  font-size: 11px;
  font-weight: 600;
  color: var(--text, #ddd);
}
.ide-mynotes-goto,
.ide-mynotes-remove {
  background: transparent;
  border: none;
  padding: 4px 2px;
  font-size: 11px;
  cursor: pointer;
  color: var(--accent, #6c9ef8);
}
.ide-mynotes-remove {
  margin-left: auto;
  color: var(--text-muted, #aaa);
}
/* IK-2 — a kept drawing, small, on white (a slide's ground). */
.ide-mynotes-drawing {
  display: block;
  margin: 6px 0 0;
  max-width: 100%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  background: #fff;
}
.ide-mynotes-body {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text, #ddd);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ide-mynotes-toast {
  position: fixed;
  bottom: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9200;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 24px));
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--bg-panel, #2b2b35);
  border: 1px solid var(--border-color, #444);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  font-size: 13px;
  color: var(--text, #ddd);
  transition: opacity 0.3s ease;
}
.ide-mynotes-toast.is-error {
  border-color: #e05555;
  color: #ffb3b3;
}
.ide-mynotes-toast.leaving {
  opacity: 0;
}

/* The drawer is a sheet on a phone, not a 380px column on a 375px screen. */
@media (max-width: 520px) {
  .ide-mynotes-drawer {
    width: 100vw;
    top: auto;
    height: 72vh;
    border-left: none;
    border-top: 1px solid var(--border-color, #444);
    border-radius: 10px 10px 0 0;
  }
}

/* The note composer — inside the drawer, never a browser dialog. */
.ide-mynotes-compose {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color, #444);
  background: var(--bg-hover, #32323d);
}
.ide-mynotes-compose.hidden {
  display: none;
}
.ide-mynotes-compose-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
}
.ide-mynotes-where {
  font-weight: 400;
  color: var(--text-muted, #aaa);
}
.ide-mynotes-quote {
  margin: 0 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--border-color, #555);
  font-size: 12px;
  font-style: italic;
  color: var(--text-muted, #aaa);
  overflow-wrap: anywhere;
}
.ide-mynotes-textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 13px;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color, #555);
  background: var(--bg, #1e1e2e);
  color: var(--text, #ddd);
  resize: vertical;
}
.ide-mynotes-textarea.is-empty {
  border-color: #e0a355;
}
.ide-mynotes-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.ide-mynotes-compose-actions .btn {
  min-height: 36px;
}

/* PI-01 R1-4 — "some of this is out of date". Shown under the drive sections
   when a file on a mounted drive has changed since something here was made
   from it. It reports; it never remakes (see ide/services/mount_rederive.py). */
.mount-stale-section {
  border-left: 3px solid var(--warn, #e0a800);
  padding: 8px 10px;
  margin: 6px 0;
}
.mount-stale-head {
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 6px;
}
.mount-stale-list {
  list-style: none;
  margin: 0 0 6px 0;
  padding: 0;
  font-size: 12px;
}
.mount-stale-list li {
  padding: 2px 0;
}
.mount-stale-open {
  color: var(--accent, #6aa9ff);
  text-decoration: none;
}
.mount-stale-open:hover {
  text-decoration: underline;
}
.mount-stale-from {
  opacity: 0.65;
}
.mount-stale-clear,
.mount-stale-check {
  background: none;
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  font-size: 11px;
  padding: 3px 8px;
}
/* CONTENT_REFRESH CR-0 — the row's door and the footer that holds "Check now".
   `display: block` on the door because it sits under the name + "made from"
   line: the three together are one sentence about one file, and a button
   squeezed onto the end of a wrapping filename is unreadable in a sidebar this
   narrow (a `width` on an inline element would do nothing at all — see the
   width-on-a-span trap). */
.mount-stale-foot {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.mount-stale-door {
  display: block;
  margin: 3px 0 2px 0;
  background: none;
  border: 1px solid var(--border, #444);
  border-radius: 4px;
  color: inherit;
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
}
.mount-stale-door:hover {
  border-color: var(--accent, #6aa9ff);
}

/* ── The 🔔 (CFB-1) ───────────────────────────────────────────────────────
   §3b(1): a class on a <button> must set `color` — a button does not inherit
   it and the UA default is black on this dark shell. */
.ide-notices-bell {
  /* inline-flex + nowrap: the glyph and the count are ONE label. As a block
     button in a narrow header slot they wrapped onto two lines, which reads
     as two controls (browser check, 2026-08-24). */
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  background: none;
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 6px;
  color: var(--text, #ddd);
  cursor: pointer;
  font-size: 12px;
  line-height: 1.2;
  padding: 4px 9px;
}
.ide-notices-bell:hover {
  border-color: var(--accent, #8f88ff);
}
.ide-notices-bell[hidden] {
  /* [hidden] loses to a flex rule on the row — the ce.css lesson. */
  display: none !important;
}
.ide-notices-panel {
  /* fixed, not absolute: the header is at the top of the viewport and
     `.top-actions` is not a positioned ancestor, so `absolute` would anchor to
     whatever happens to be. */
  position: fixed;
  top: 44px;
  right: 12px;
  z-index: 60;
  width: min(380px, 92vw);
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-panel, #1d1d1d);
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
  padding: 8px;
  color: var(--text, #ddd);
}
.ide-notices-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 4px 8px;
  border-bottom: 1px solid var(--border, #3a3a3a);
}
.ide-notices-allread {
  background: none;
  border: 1px solid var(--border, #3a3a3a);
  border-radius: 5px;
  color: var(--text, #ddd);
  cursor: pointer;
  font-size: 11px;
  padding: 2px 7px;
}
.ide-notice-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--border, #2c2c2c);
  color: var(--text, #ddd);
  cursor: pointer;
  padding: 8px 4px;
  font-size: 12.5px;
  line-height: 1.35;
}
.ide-notice-row:hover {
  background: var(--bg-input, #262626);
}
.ide-notice-row.is-unseen .ide-notice-msg {
  font-weight: 600;
}
.ide-notice-when {
  color: var(--text-muted, #999);
  font-size: 11px;
}
.ide-notices-empty {
  color: var(--text-muted, #999);
  font-size: 12.5px;
  padding: 10px 4px;
  margin: 0;
}

/* ── Who can see private feedback (CFB-6) ─────────────────────────────── */
.cfa-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}
.cfa-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border, #2c2c2c);
  font-size: 12.5px;
}
.cfa-who {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cfa-why {
  font-size: 11.5px;
  white-space: nowrap;
}
/* ⚠ `inherit`, not the shell's dark tokens: this panel mounts inside the
   Share dialog, which paints its own LIGHT card. Forcing --text/--bg-input
   here put a dark input in a white dialog (browser check, 2026-08-24).
   Inheriting adapts to either host — and it still satisfies §3b(1), because a
   button that says `color: inherit` is not the UA's buttontext black. */
.cfa-x,
.cfa-add button {
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11.5px;
  padding: 2px 7px;
  opacity: 0.85;
}
.cfa-x:hover,
.cfa-add button:hover {
  opacity: 1;
}
.cfa-x:hover,
.cfa-add button:hover {
  border-color: var(--accent, #8f88ff);
}
.cfa-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cfa-input {
  flex: 1 1 180px;
  min-width: 0;
  /* The UA default (white ground, dark ink) suits the light Share dialog and
     stays legible anywhere; only the shape is ours. */
  border: 1px solid currentColor;
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12.5px;
  font-family: inherit;
}
.cfa-hint {
  color: inherit;
  opacity: 0.7;
  font-size: 11.5px;
  margin: 4px 0 0;
  line-height: 1.4;
}
.cfa-why {
  opacity: 0.7;
}
.ide-notices-waiting .ide-notices-head {
  margin-top: 8px;
}

/* ── IDE.NoteSwap — "there is a contents note about this file" (F-OK5) ──────
 * ⚠ Quiet by design: the offer must not compete with the file it sits above.
 * The button sets `color` explicitly — a <button> does not inherit it and this
 * shell declares no `color-scheme`, so an unstyled one renders black on dark.
 */
.ide-noteswap {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 10px;
  margin: 0 0 8px;
  border: 1px solid var(--border, #3a3a5c);
  border-radius: 6px;
  background: var(--bg-panel, #262637);
  font-size: 12.5px;
}

.ide-noteswap-text {
  color: var(--text-muted, #8d8daf);
}

.ide-noteswap-btn {
  font: inherit;
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 5px;
  border: 1px solid var(--border, #3a3a5c);
  background: var(--bg-input, #1a1a2a);
  color: var(--text, #e0e0f0);
  cursor: pointer;
}

.ide-noteswap-btn:hover {
  border-color: var(--accent, #6c63ff);
}

/* The source row's badge: "there is a contents note about this one". */
.tree-note-badge {
  margin-left: 6px;
  font-size: 10.5px;
  color: var(--text-muted, #8d8daf);
  opacity: 0.85;
}

/* ── IK-2/IK-3 — the drawing lane, on any viewer (INK_MARKS §5/§6) ───────
   👁 and ✎ in their own bar, top left of the slide (the caption bar is top
   right, and hidden on a deck with no captions). The bar fades with the
   chrome; the ink bar while drawing does not. */
.ide-ink-controls {
  position: absolute;
  top: 10px;
  left: 12px;
  display: flex;
  gap: 6px;
  z-index: 6;
}
.ide-ink-controls:empty { display: none; }
.ide-chrome-hidden .ide-ink-controls { display: none; }
/* A viewer whose controls fade says so in its own class; the deck's is
   `ss-chrome-hidden` (SV-3), and its rule lives in its own sheet. */
.ide-ink-eye, .ide-ink-draw {
  min-width: 36px;
  min-height: 32px;
  font-size: 16px;
  background: rgba(0, 0, 0, 0.55);
}
.ide-ink-eye[aria-pressed="true"] { background: #495057; }
.ide-ink-menu {
  position: absolute;
  top: 48px;
  left: 12px;
  z-index: 8;
  background: var(--bg-panel, #fff);
  color: var(--text, #212529);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
.ide-ink-menu button { text-align: left; font: inherit; padding: 4px 2px; background: none; border: 0; cursor: pointer; color: inherit; }
.ide-ink-menu-head { font-size: 11px; text-transform: uppercase; opacity: 0.7; margin-top: 4px; }
.ide-ink-menu-row { display: flex; gap: 6px; align-items: center; cursor: pointer; }
.ide-ink-chip {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 8;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: min(560px, 92%);
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(20, 20, 20, 0.86);
  color: #fff;
  font-size: 14px;
}
.ide-ink-chip button { background: #4c6ef5; color: #fff; border: 0; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.ide-ink-chip button:last-child { background: transparent; padding: 4px 6px; }
/* ONE row where it fits — tools, then where it goes — so the bar sits in the
   strip under the picture rather than over the slide somebody is drawing on. */
.ide-ink-bar {
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  z-index: 9;
  width: min(900px, 98%);
  background: var(--bg-panel, #fff);
  color: var(--text, #212529);
  border-radius: 10px;
  padding: 6px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ide-ink-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.ide-ink-tools, .ide-ink-saves { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.ide-ink-saves { justify-content: flex-end; margin-left: auto; }
.ide-ink-tools button {
  min-width: 34px; min-height: 34px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.12);
  background: transparent; cursor: pointer; font-size: 16px;
}
.ide-ink-tools button[aria-pressed="true"] { outline: 3px solid #4c6ef5; outline-offset: 1px; }
.ide-ink-swatch { min-width: 26px !important; min-height: 26px !important; border-radius: 50% !important; }
.ide-ink-saves button {
  font: inherit; padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.2);
  background: transparent; color: inherit; cursor: pointer;
}
.ide-ink-saves button.ide-ink-primary { background: #4c6ef5; border-color: #4c6ef5; color: #fff; }
.ide-ink-saves button:disabled { opacity: 0.45; cursor: default; }
.ide-ink-reach, .ide-ink-problem { margin: 0; font-size: 11px; text-align: right; }
.ide-ink-problem { font-size: 12px; font-weight: 600; }
.ide-ink-reach { opacity: 0.75; }
.ide-inking .ss-slide-img { cursor: crosshair; }

/* IK-4 — ❓ Ask the AI about this part, and the answer it gives back.
   The button sits with 👁 and ✎ in the ink controls; the answer is a panel
   over the bar's host, dismissible, and never covers the picture's middle. */
.ide-ink-ask {
  appearance: none;
  border: 0;
  border-radius: 999px;
  width: 34px;
  height: 34px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
}
.ide-ink-ask:hover { background: rgba(0, 0, 0, 0.72); }

.ide-ink-answer {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 6;
  max-height: 45%;
  overflow: auto;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-panel, #fff);
  color: var(--text, #111);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  line-height: 1.45;
}
.ide-ink-answer-text > :first-child { margin-top: 0; }
.ide-ink-answer-text > :last-child { margin-bottom: 0; }
.ide-ink-answer-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}
.ide-ink-answer-row button {
  appearance: none;
  border: 1px solid var(--border, #d4d4d8);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  background: transparent;
  color: inherit;
}
.ide-ink-answer-row [data-role="ink-answer-keep"] {
  background: var(--accent, #2563eb);
  border-color: transparent;
  color: #fff;
}

/* ============================================================
   RC-1 — Room for the content (CONTENT_WORKBENCH §29–§30, F-CW22/F-CW23)
   ============================================================ */

/* The workspace's name IS its menu. The ▾ is a pseudo-element, so the
   modules that set this element's text never wipe it. */
.workspace-name.ws-menu-trigger {
  cursor: pointer;
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  max-width: 34vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.workspace-name.ws-menu-trigger::after {
  content: " ▾";
  font-size: 11px;
  opacity: 0.75;
}
.workspace-name.ws-menu-trigger:hover,
.workspace-name.ws-menu-trigger:focus-visible,
.workspace-name.ws-menu-trigger[aria-expanded="true"] {
  background: rgba(108, 99, 255, 0.12);
  outline: none;
}
/* One line: with six buttons gone, nothing on the bar needs to wrap. */
.top-actions > .btn {
  white-space: nowrap;
}
/* The 🔓 badge: shown only while outside-content safety is on (CW-INV-25). */
.trust-pill[hidden] {
  display: none !important;
}
/* ⚠ The origin chip sets `display:inline-flex` inline, which beat its own
   `hidden` — so every workspace with no origin showed an EMPTY pill beside
   its name (the owner's screenshot, 2026-09-24). `hidden` wins. */
#origin-chip[hidden] {
  display: none !important;
}
#trust-pill .trust-pill-text {
  display: none;
}

/* The pane toolbar folds into the tab strip row (ide-panes.js places it). */
.panes-root.panes-root--folded {
  position: relative;
}
.panes-root.panes-root--folded > .panes-toolbar {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 4;
  min-height: 0;
  padding: 0 6px;
  border-bottom: 0;
  background: var(--bg);
}

/* Processes and Log share ONE row while both are folded; opening either
   gives it the full width, exactly as before. */
body:has(.ide-process-view.ide-process-view--collapsed):has(.ide-log-view.ide-log-view--collapsed)
  .ide-process-view {
  bottom: 0;
  right: 50%;
}
body:has(.ide-process-view.ide-process-view--collapsed):has(.ide-log-view.ide-log-view--collapsed)
  .ide-log-view {
  left: 50%;
  border-left: 1px solid var(--border);
}
.ide-log-view--collapsed .ide-log-view-filter,
.ide-log-view--collapsed .ide-log-view-clear {
  display: none;
}

/* The action bar's placeholder ("Select assets to see available actions")
   was meant to leave at CW-5; it is hidden wherever the Actions tab runs. */
body.has-actions-tab #action-bar {
  display: none;
}

/* NP-1 (CONTENT_FEEDBACK Part III §29, UX §16) — the 📝 Notes tab: the
   person's own notes, following the slide. The BOX leads and is big enough to
   invite typing; everything else is a chip, one of four buttons, or behind ⋯. */
.ide-mynp {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 10px 12px;
  color: var(--text, #ddd);
}
.ide-mynp-about {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.ide-mynp-scope {
  font: inherit;
  font-weight: 600;
  background: transparent;
  color: inherit;
  border: 1px solid var(--border-color, #444);
  border-radius: 6px;
  padding: 2px 6px;
}
.ide-mynp-drift {
  font-size: 12px;
  color: var(--text-muted, #aaa);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.ide-mynp-box {
  width: 100%;
  box-sizing: border-box;
  min-height: 9.5em; /* eight lines */
  max-height: 60vh;
  resize: vertical;
  padding: 8px 10px;
  font: 14px/1.5 system-ui, -apple-system, sans-serif;
  color: inherit;
  background: var(--bg-input, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
}
.ide-mynp-box.is-empty {
  border-color: var(--danger, #e56464);
}
.ide-mynp-suggest {
  font-size: 12px;
  color: var(--text-muted, #aaa);
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.ide-mynp-suggest:empty {
  display: none;
}
.ide-mynp-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.ide-mynp-actions [data-np-act="full"] {
  margin-left: auto;
}
.ide-mynp-hint {
  font-size: 12px;
  color: var(--text-muted, #aaa);
  margin: 0;
}
.ide-mynp-hint.is-error {
  color: var(--danger, #e56464);
}
.ide-mynp-list {
  border-top: 1px solid var(--border-color, #444);
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ide-mynp-group-title {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted, #aaa);
  margin: 6px 0 2px;
}
.ide-mynp-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
}
.ide-mynp-row:hover,
.ide-mynp-row:focus-visible {
  background: var(--bg-hover, #32323d);
}
.ide-mynp-row-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* NP-3 (§32) — an AI note's life under its row, and its tick sheet. */
.ide-mynp-ask {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -2px 0 6px 12px;
  font-size: 12px;
  color: var(--text-muted, #888);
}
.ide-mynp-ask .btn-xs {
  font-size: 11px;
  padding: 1px 8px;
}
.ide-mynp-ask-confirm,
.ide-mynp-ask-experts,
.ide-mynp-ask-sheet {
  flex-basis: 100%;
  margin: 4px 0 0;
}
.ide-mynp-ask-experts,
.ide-mynp-ask-sheet {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px 8px;
  border: 1px solid var(--border, #444);
  border-radius: 6px;
  color: var(--text, inherit);
}
.ide-mynp-ask-item {
  display: block;
  line-height: 1.4;
}
.ide-mynp-ask-sources {
  display: block;
  margin-left: 20px;
  font-size: 11px;
}
.ide-mynp-ask-sources a {
  color: var(--accent, #7aa2ff);
}
.ide-mynp-ask-prompt {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 11px;
}
/* NP-4 (§33) — your own computer answers. */
/* NP-5 (CONTENT_FEEDBACK §34) — Concepts on this slide, and their card. */
.ide-mynp-concepts {
  margin: 8px 0 4px;
}
.ide-mynp-concept-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}
.ide-mynp-concept-chip {
  padding: 3px 10px;
  border: 1px solid var(--border, #444);
  border-radius: 999px;
  background: var(--bg-secondary, transparent);
  color: var(--text, inherit);
  font-size: 12px;
  cursor: pointer;
}
.ide-mynp-concept-chip.is-open,
.ide-mynp-concept-chip:hover {
  border-color: var(--accent, #4a9eff);
}
.ide-mynp-concept-far {
  color: var(--text-secondary, #888);
  font-size: 11px;
}
.ide-mynp-concept-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border, #444);
  border-radius: 6px;
  color: var(--text, inherit);
}
.ide-mynp-concept-term {
  font-weight: 600;
}
.ide-mynp-concept-meaning {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}
.ide-mynp-concept-refs {
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
}
.ide-mynp-concept-name input {
  width: 100%;
  margin-top: 2px;
}
.ide-mynp-concept-where {
  font-size: 12px;
}
.ide-mynp-pc {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  font-size: 12px;
}
.ide-mynp-pc-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.ide-mynp-pc-input,
.ide-mynp-pc-code {
  width: 100%;
  font-size: 12px;
  padding: 4px 6px;
}
.ide-mynp-row-when {
  font-size: 12px;
  color: var(--text-muted, #aaa);
  white-space: nowrap;
}
.ide-mynp-row.is-deleted {
  cursor: default;
  opacity: 0.85;
}
.ide-mynp-chip {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-color, #444);
  white-space: nowrap;
  color: inherit;
  background: transparent;
}
.ide-mynp-chip.is-offer {
  cursor: pointer;
  border-style: dashed;
}
.ide-mynp-more {
  border: none;
  background: transparent;
  color: inherit;
  font-size: 16px;
  min-width: 28px;
  min-height: 28px;
  cursor: pointer;
  border-radius: 6px;
}
.ide-mynp-more:hover {
  background: var(--bg-hover, #32323d);
}
.ide-mynp-link,
.ide-mynp-goto {
  border: none;
  background: transparent;
  color: var(--accent, #6c63ff);
  text-align: left;
  padding: 4px 6px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
}
.ide-mynp-empty {
  color: var(--text-muted, #aaa);
  font-size: 13px;
  margin: 6px 0;
}
.ide-mynp-menu {
  position: fixed;
  z-index: 9300;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  padding: 4px;
  background: var(--bg-panel, #2b2b35);
  color: var(--text, #ddd);
  border: 1px solid var(--border-color, #444);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.ide-mynp-menu button {
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  padding: 8px 10px;
  border-radius: 6px;
  font: inherit;
  cursor: pointer;
}
.ide-mynp-menu button:hover,
.ide-mynp-menu button:focus-visible {
  background: var(--bg-hover, #32323d);
}
/* ⤢ — the pane takes the content area; the viewer is hidden, not unloaded. */
.ide-mynotes-pane-section.ide-mynp-full {
  position: fixed;
  inset: 48px 12px 12px 12px;
  z-index: 9000;
  overflow: auto;
  background: var(--bg-panel, #2b2b35);
  border: 1px solid var(--border-color, #444);
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}
.ide-mynotes-pane-section.ide-mynp-full .ide-mynp-box {
  min-height: 50vh;
}
.ide-mynp-page-overlay {
  position: fixed;
  inset: 0;
  z-index: 9400;
  background: rgba(8, 8, 16, 0.5);
  display: grid;
  place-items: center;
  padding: 16px;
}
.ide-mynp-page {
  width: min(680px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: var(--bg-panel, #2b2b35);
  color: var(--text, #ddd);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ide-mynp-page header,
.ide-mynp-page footer {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  flex-wrap: wrap;
}
.ide-mynp-page-body {
  white-space: pre-wrap;
  font-size: 15px;
  line-height: 1.6;
}
