/* ide-project-editor.css — project-editor screen chrome and support surfaces.
 *
 * Tokens: CSS variables only. All colors via theme vars. No hardcoded hex.
 * Derived from mockup 03-top-bar-plus-compact-rail.html (project bar + sidebar ribbon)
 * and mockup 01-soft-frame.html (attach/missing/error cards).
 */

/* ── Project bar (64px above the IDE shell) ─────────────────────────────── */

.proj-editor-bar {
  height: var(--project-bar-height, 64px);
  background: color-mix(in srgb, var(--bg-secondary) 75%, var(--bg-elevated) 25%);
  border-bottom: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  padding: 0 24px;
  flex-shrink: 0;
  position: relative;
}

/* Left cluster: eyebrow + name + gold rule stacked vertically */
.pbar-identity {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin-right: 20px;
  flex-shrink: 0;
}

.pbar-eyebrow {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}

.pbar-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1;
}

.pbar-rule {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
  opacity: 0.6;
}

/* Vertical divider between identity and chips */
.pbar-vdiv {
  width: 1px;
  height: 32px;
  background: var(--border-strong);
  margin-right: 20px;
  flex-shrink: 0;
}

/* Chip row */
.pbar-chips {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.pbar-chip {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.pbar-chip--branch {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.03em;
  text-transform: none;
}

.pbar-chip--vis {
  color: var(--success);
  background: var(--success-subtle);
  border-color: color-mix(in srgb, var(--success) 40%, transparent);
}

.vis-pip {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

/* Right cluster: action buttons + bridge pill */
.pbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pbar-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 6px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pbar-btn:hover {
  background: var(--bg-surface);
  color: var(--text-primary);
}

.pbar-btn--accent {
  background: var(--accent);
  color: var(--bg-primary);
  border-color: color-mix(in srgb, var(--accent) 70%, transparent);
  font-weight: 700;
}

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

.pbar-btn--ghost {
  background: transparent;
  border-color: var(--border);
}

/* Bridge status pill */
.bridge-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--success);
  padding: 3px 8px;
  background: var(--success-subtle);
  border: 1px solid color-mix(in srgb, var(--success) 35%, transparent);
  border-radius: 20px;
}

.bridge-pill--offline {
  color: var(--text-muted);
  background: var(--bg-elevated);
  border-color: var(--border);
}

.bridge-pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
}

.bridge-pill-dot--offline {
  background: var(--text-muted);
}

/* ── Sidebar: compact identity ribbon ───────────────────────────────────── */

.identity-ribbon {
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-secondary) 60%, var(--bg-elevated) 40%);
}

.ribbon-cover-swatch {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--accent) 25%, var(--bg-elevated)) 0%,
    color-mix(in srgb, var(--success) 20%, var(--bg-secondary)) 100%
  );
  flex-shrink: 0;
  border: 1px solid var(--border-strong);
}

.ribbon-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ribbon-name {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.1;
}

.ribbon-branch-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ribbon-branch-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.ribbon-vis-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--success);
  flex-shrink: 0;
}

/* Files section header in sidebar */
.sidebar-files-hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}

.files-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.files-rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Editor / sidebar placeholders (Tier 3 only) ────────────────────────── */

.proj-editor-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.proj-editor-placeholder--files {
  flex: 1;
  padding: 16px 12px;
  justify-content: flex-start;
  align-items: flex-start;
}

.proj-editor-placeholder--editor {
  flex: 1;
  height: 100%;
}

/* ── Support surfaces (attach / missing / error cards) ──────────────────── */

/* Outer wrapper: centres the card and limits width */
.proj-editor-support-wrap {
  width: 100%;
  max-width: 720px;
  margin: 48px auto 0;
  padding: 0 32px;
}

/* Soft card: bg-surface fill, bg-elevated border (not border-strong), no shadow */
.soft-card {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 28px 32px 24px;
  position: relative;
}

.soft-card-heading {
  margin-bottom: 16px;
}

.soft-card-heading h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.25;
}

/* Card body text */
.card-lede {
  font-family: var(--font-serif);
  font-size: 15px;
  line-height: 1.72;
  color: var(--text-secondary);
  max-width: 500px;
  margin-bottom: 0;
}

.card-lede code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
}

/* Missing-path chip: error-tinted monospace block */
.path-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: color-mix(in srgb, var(--error) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--error) 22%, transparent);
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--error);
  margin: 18px 0;
}

/* Inline action row */
.card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}

/* Footnote text below action row */
.card-footnote {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  font-family: var(--font-serif);
  font-style: italic;
}

/* Ghost button with error hover (Remove mapping) */
.btn-ghost-error {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-strong);
}

.btn-ghost-error:hover {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 35%, transparent);
  background: color-mix(in srgb, var(--error) 10%, transparent);
}

/* ── Tier 4: files section fills sidebar below header ───────────────────── */

.proj-editor-files-section {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* ── Tier 5: tab dirty marker ────────────────────────────────────────────── */

/* Gold dot replacing the close × when a tab has unsaved changes */
.ide-tabs__dirty-dot {
  font-size: 14px;
  line-height: 1;
  color: var(--accent);
  margin-left: 5px;
  cursor: pointer;
  opacity: 0.9;
  transition: opacity var(--transition);
}

.ide-tabs__dirty-dot:hover {
  opacity: 1;
}

/* Dirty tab: slightly desaturated label to complement the gold dot */
.ide-tabs__tab--dirty .ide-tabs__label {
  opacity: 0.85;
}

/* ── Phase 13 Tier 1: enhanced tab strip ────────────────────────────────── */

/* Wrap the strip so overflow fades can be positioned absolutely over it.
   Fills the tabs-host completely. */
.ide-tabs-wrap {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  width: 100%;
  height: 28px;
}

/* Override ide.css .ide-tabs: hide browser scrollbar, use custom scroll */
.ide-tabs {
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;        /* Firefox */
  scroll-behavior: smooth;
}
.ide-tabs::-webkit-scrollbar { display: none; }

/* 28px tab height per mockup */
.ide-tabs__tab {
  height: 28px;
  padding: 0 10px;
  gap: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: none;
  border-right: 1px solid var(--bg-elevated);
  border-bottom: 2px solid transparent;
  border-top: 2px solid transparent;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
  cursor: pointer;
  position: relative;
  user-select: none;
  touch-action: none;
}

.ide-tabs__tab:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.ide-tabs__tab:hover .ide-tabs__close { opacity: 1; }

/* Active tab: gold 2px underline, elevated background */
.ide-tabs__tab--active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border-bottom-color: var(--accent);
}

/* Pinned tab: gold 2px top border */
.ide-tabs__tab--pinned {
  border-top-color: var(--accent);
}

/* Pinned AND active: both top and bottom gold */
.ide-tabs__tab--pinned.ide-tabs__tab--active {
  border-top-color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Close × — hidden by default, shown on tab hover */
.ide-tabs__close {
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  opacity: 0;
  transition: color var(--transition), opacity var(--transition);
  cursor: pointer;
  margin-left: 2px;
}
.ide-tabs__tab--active .ide-tabs__close { opacity: 0.6; }
.ide-tabs__tab--active .ide-tabs__close:hover { opacity: 1; color: var(--text-primary); }

/* Dragging state: slightly lifted appearance */
.ide-tabs__tab--dragging {
  opacity: 0.85;
  box-shadow: 0 3px 10px color-mix(in srgb, var(--shadow) 125%, transparent);
  z-index: 10;
}

/* Pin lock glyph (CSS-only, no emoji):
   A small 8×8px square with a 1px horizontal center bar */
.ide-tabs__pin-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  border: 1.5px solid var(--accent);
  border-radius: 1px;
  opacity: 0.7;
  flex-shrink: 0;
  position: relative;
}
.ide-tabs__pin-mark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 4px;
  height: 1.5px;
  background: var(--accent);
  border-radius: 1px;
}

/* Edge fade overlays — hidden by default */
.ide-tabs-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  transition: opacity 120ms ease;
}
.ide-tabs-fade--visible { opacity: 1; }
.ide-tabs-fade--left {
  left: 0;
  background: linear-gradient(90deg, var(--bg-surface) 0%, transparent 100%);
}
.ide-tabs-fade--right {
  right: 0;
  background: linear-gradient(270deg, var(--bg-surface) 0%, transparent 100%);
}

/* Chevron scroll buttons */
.ide-tabs-chev {
  display: none;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  background: var(--bg-surface);
  border: none;
  border-right: 1px solid var(--bg-elevated);
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  z-index: 3;
  transition: color var(--transition), background var(--transition);
}
.ide-tabs-chev--visible { display: flex; }
.ide-tabs-chev--left { order: -1; border-left: none; border-right: 1px solid var(--bg-elevated); }
.ide-tabs-chev--right { order: 10; border-left: 1px solid var(--bg-elevated); border-right: none; }
.ide-tabs-chev:hover { background: var(--bg-elevated); color: var(--text-primary); }

/* ── Phase 13 Tier 1: tab context menu ───────────────────────────────────── */

.ide-tab-ctx-menu {
  position: fixed;
  min-width: 180px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), var(--shadow-xs);
  padding: 4px 0;
  z-index: 9999;
  font-family: var(--font-sans);
  font-size: 12px;
}

.ide-tab-ctx-menu__item {
  display: block;
  width: 100%;
  padding: 5px 14px;
  text-align: left;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background var(--transition);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.4;
}
.ide-tab-ctx-menu__item:hover:not(:disabled) { background: var(--bg-elevated); }

.ide-tab-ctx-menu__item--disabled {
  color: var(--text-muted);
  cursor: default;
}

.ide-tab-ctx-menu__sep {
  height: 1px;
  background: var(--border);
  margin: 3px 0;
}

/* ── Tier 8: detail-page additions ──────────────────────────────────────── */

/* Actions row inside the detail inner frame */
.proj-detail-actions-row {
  padding: 14px 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* Open-in-editor button: gold primary, disabled-look variant */
.proj-detail-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), opacity var(--transition);
  background: var(--accent);
  color: var(--bg-primary);
}
.proj-detail-open-btn:hover { background: var(--accent-hover); }
.proj-detail-open-btn--unmapped {
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
}
.proj-detail-open-btn--unmapped:hover {
  background: color-mix(in srgb, var(--bg-elevated) 80%, var(--bg-surface));
  color: var(--text-secondary);
}

/* Folder mapping status block */
.proj-detail-folder-block {
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 20px 24px 22px;
  margin-bottom: 0;
}

.proj-detail-folder-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.proj-detail-folder-rule {
  width: 28px;
  height: 1px;
  background: color-mix(in srgb, transparent 80%, var(--accent));
  margin-bottom: 14px;
}

/* Attached state */
.proj-detail-folder-attached {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.proj-detail-folder-path {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
}

.proj-detail-branch-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 20px;
  padding: 2px 9px;
}

.proj-detail-branch-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

.proj-detail-change-link {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  margin-left: auto;
  padding: 0;
  transition: color var(--transition);
}
.proj-detail-change-link:hover { color: var(--text-secondary); }

/* Detached state */
.proj-detail-folder-detached-text {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.proj-detail-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  background: var(--accent);
  color: var(--bg-primary);
  transition: background var(--transition);
}
.proj-detail-attach-btn:hover { background: var(--accent-hover); }

/* ── Tier 6: external-change conflict banner ─────────────────────────────── */

.proj-editor-conflict-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-surface));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.conflict-banner-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conflict-banner-btn {
  flex-shrink: 0;
  font-size: 11px;
  padding: 3px 10px;
}

/* ── Phase 13 Tier 2: split pane layout ─────────────────────────────────── */

/* The editor section becomes a flex container holding pane slots + split
   wrappers. When PaneManager is mounted, it appends children directly into
   the .ide-editor section. */

/* A split wrapper: flex row (horizontal) or column (vertical). */
.ide-split-wrapper {
  display: flex;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* One slot inside a split. flex value is set inline by PaneManager. */
.ide-split-slot {
  display: flex;
  flex-direction: column;
  min-width: 80px;
  min-height: 80px;
  overflow: hidden;
}

/* Drag handle between split children.
   1px visual gutter + 8px pointer grab area centred on it. */
.ide-split-handle {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  background: var(--border);
  transition: background 80ms ease;
}

.ide-split-handle--h {
  width: 1px;
  cursor: col-resize;
  /* 8px pointer grab area around the 1px bar */
  padding: 0 4px;
  margin: 0 -4px;
  background-clip: content-box;
}

.ide-split-handle--v {
  height: 1px;
  cursor: row-resize;
  padding: 4px 0;
  margin: -4px 0;
  background-clip: content-box;
}

.ide-split-handle:hover,
.ide-split-handle--dragging {
  background: var(--accent);
}

/* Pane slot: flex column holding a tab strip + editor host. */
.ide-pane-slot {
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  /* Subtle accent ring on active pane when multiple panes exist */
  outline: none;
}

/* Active pane ring — only visible in split mode (set by PaneManager JS) */
.ide-pane-slot--active {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* .ide-editor__host fills the remaining height in each pane slot */
.ide-pane-slot .ide-editor__host {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
}

/* Drop-zone highlights for drag-to-split */
.ide-pane--drop-center {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent) !important;
}
.ide-pane--drop-left::before,
.ide-pane--drop-right::after,
.ide-pane--drop-top::before,
.ide-pane--drop-bottom::after {
  content: '';
  position: absolute;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, transparent);
  pointer-events: none;
  z-index: 20;
}
.ide-pane--drop-left   { position: relative; }
.ide-pane--drop-right  { position: relative; }
.ide-pane--drop-top    { position: relative; }
.ide-pane--drop-bottom { position: relative; }
.ide-pane--drop-left::before   { top:0; left:0; bottom:0; width:30%; }
.ide-pane--drop-right::after   { top:0; right:0; bottom:0; width:30%; }
.ide-pane--drop-top::before    { top:0; left:0; right:0; height:30%; }
.ide-pane--drop-bottom::after  { bottom:0; left:0; right:0; height:30%; }

/* Brief toast for max-pane limit. */
.ide-pane-toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 16px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-lg);
  z-index: 99999;
  animation: ide-toast-in 0.15s ease forwards;
  pointer-events: none;
}

@keyframes ide-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Command Palette (640×420 compact, no serif heading, no footer strip) ── */

.cmd-palette-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--bg-primary) 72%, transparent);
  z-index: 9000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 72px;
}

.cmd-palette {
  width: 640px;
  height: 420px;
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xl), 0 0 0 1px color-mix(in srgb, var(--border-strong) 3%, transparent);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Search row */
.cmd-palette__search-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

/* Inline "Commands" label — sans-serif, 13px Manrope, muted */
.cmd-palette__label {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  flex-shrink: 0;
  user-select: none;
}

/* Search input */
.cmd-palette__input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  caret-color: var(--accent);
}

.cmd-palette__input::placeholder {
  color: var(--text-muted);
}

/* Scrollable list */
.cmd-palette__list {
  overflow-y: auto;
  flex: 1;
  padding: 2px 0 4px;
}

.cmd-palette__list::-webkit-scrollbar {
  width: 4px;
}

.cmd-palette__list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Section headers */
.cmd-palette__section-hdr {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: small-caps;
  color: var(--text-muted);
  padding: 6px 14px 2px;
  user-select: none;
}

/* Divider between sections */
.cmd-palette__divider {
  height: 1px;
  background: var(--border);
  margin: 3px 0;
}

/* Command rows */
.cmd-palette__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  cursor: pointer;
  transition: background var(--transition);
  border-left: 2px solid transparent;
}

.cmd-palette__item:hover {
  background: var(--bg-elevated);
}

/* Active row: --bg-elevated + gold left border */
.cmd-palette__item--active {
  background: var(--bg-elevated);
  border-left-color: var(--accent);
}

/* Command title */
.cmd-palette__item-label {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Shortcut chip */
.cmd-palette__item-shortcut {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Dash for commands with no shortcut */
.cmd-palette__item-shortcut--none {
  background: none;
  border: none;
  padding: 0;
  opacity: 0.4;
}

/* Empty state */
.cmd-palette__empty {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  padding: 24px 14px;
}

/* ── Fuzzy File Finder rows ──────────────────────────────────────────────── */

.file-finder-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 11px 14px;
  gap: 16px;
}

/* Basename: sans-serif primary, highlighted chars in accent */
.file-finder-basename {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
}

.file-finder-basename mark {
  background: transparent;
  color: var(--accent);
  font-weight: 600;
}

/* Directory path: mono muted, right-aligned */
.file-finder-dir {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  text-align: right;
}

/* "No files match" uses --error tint */
.file-finder-no-match {
  color: color-mix(in srgb, var(--text-muted) 60%, var(--error) 40%);
}

/* ── Breadcrumb navigation ────────────────────────────────────────────────── */

/* Nav bar: 28px high, sits directly below the tab strip */
.ide-breadcrumb {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  gap: 0;
  background: var(--bg-secondary, var(--bg-surface));
  border-bottom: 1px solid var(--border-subtle, var(--border));
  font-family: var(--font-sans);
  font-size: 13px;
  overflow: hidden;
  flex-shrink: 0;
}

/* Project root label — not interactive */
.ide-bc-root {
  color: var(--text-muted);
  user-select: none;
  white-space: nowrap;
}

/* Separator "/" in muted */
.ide-bc-sep {
  color: var(--text-muted);
  padding: 0 4px;
  user-select: none;
  font-size: 12px;
}

/* Directory/file segment button — reset button styles */
.ide-bc-seg {
  background: none;
  border: none;
  padding: 0 2px;
  margin: 0;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  line-height: 22px;
}

.ide-bc-seg:hover {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Filename (rightmost) segment — no underline hover, accent on hover */
.ide-bc-seg--file {
  cursor: pointer;
}

.ide-bc-seg--file:hover {
  color: var(--accent);
  text-decoration: none;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* ── Sibling dropdown ─────────────────────────────────────────────────────── */

.ide-bc-drop {
  position: fixed;
  z-index: 8000;
  width: 240px;
  max-height: 280px;
  overflow-y: auto;
  background: var(--bg-surface);
  border: 1px solid var(--bg-elevated, var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), var(--shadow-xs);
  padding: 4px 0;
}

.ide-bc-drop__row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  background: none;
  border: none;
  padding: 6px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
  transition: background var(--transition), color var(--transition);
}

.ide-bc-drop__row:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-primary);
}

.ide-bc-drop__row--current {
  color: var(--accent);
}

.ide-bc-drop__glyph {
  font-size: 9px;
  color: var(--text-muted);
  flex-shrink: 0;
  width: 12px;
  text-align: center;
}

.ide-bc-drop__row--dir .ide-bc-drop__glyph {
  color: color-mix(in srgb, var(--accent) 70%, transparent);
}

.ide-bc-drop__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-bc-drop__empty {
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
}

.ide-bc-drop__more {
  padding: 5px 10px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-subtle, var(--border));
  margin-top: 2px;
}

/* ── Minimap (Tier 6) ──────────────────────────────────────────────────────── */

/* The .ide-editor__host must be position:relative for the canvas to stack
   correctly.  This is set by JS too (failsafe), but the CSS rule is the
   canonical source. */
.ide-editor__host {
  position: relative;
}

/* The canvas is absolutely positioned at the right edge of the editor host.
   Top/bottom are set to 0 so it spans the full editor height, which already
   excludes the 28px breadcrumb (that lives in .ide-breadcrumb-host above the
   host div).  Width is fixed at 128px per the design spec. */
.ide-minimap-canvas {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 128px;
  /* Height is managed by JS (canvas.style.height) to match offsetHeight. */
  background: var(--bg-secondary);
  border-left: 1px solid var(--bg-elevated);
  /* Cursor indicates the canvas is interactive. */
  cursor: pointer;
  /* Sit above the CM editor content but below modal overlays. */
  z-index: 10;
  /* Smooth show/hide transition. */
  transition: opacity 120ms ease;
}

/* Ensure the CodeMirror scroller doesn't overflow under the minimap. */
.ide-editor__host .cm-editor {
  padding-right: 128px;
}

/* ── Editor polish (Tier 7) ────────────────────────────────────────────────── */

/* Tier 7 Task 7.1: Bracket matching — accent outline highlights the matched pair. */
.cm-matchingBracket {
  outline: 1px solid var(--accent);
  border-radius: var(--radius-sm);
}

/* Tier 7 Task 7.5: Zoom — font-size driven by CSS custom property. Default 13px.
   JS sets --ide-editor-font-size on .cm-editor via style.setProperty(). */
.cm-editor {
  --ide-editor-font-size: 13px;
  font-size: var(--ide-editor-font-size);
}

/* Tier 7 Task 7.2: Indent guide lines — subtle 1px lines at each indent level. */
.cm-indent-markers::before {
  border-left-color: var(--bg-elevated);
}

/* Tier 7 Task 7.7: Selection-match highlight on double-click.
   highlightSelectionMatches() adds .cm-selectionMatch to all matching spans. */
.cm-selectionMatch {
  background: color-mix(in srgb, var(--accent) 18%, var(--bg-elevated));
  border-radius: var(--radius-sm);
}

/* When the minimap is hidden (display:none via JS), do not leave a gap. */
.ide-editor__host .cm-editor:has(~ .ide-minimap-canvas[style*="display: none"]),
.ide-editor__host .cm-editor:has(~ .ide-minimap-canvas[style*="display:none"]) {
  padding-right: 0;
}

/* ── Phase 14 Tier 1: right sidebar ─────────────────────────────────────── */

/* Grid modifier: three-column layout when right sidebar is present.
   --ide-rsb-width transitions between expanded (320px) and collapsed (40px). */
.ide-shell--right-sidebar {
  --ide-rsb-width: 320px;
  grid-template-columns: 240px 1fr var(--ide-rsb-width);
  grid-template-areas:
    "sidebar editor    right-sidebar"
    "sidebar bottom    right-sidebar"
    "status  status    status";
  transition: grid-template-columns 160ms ease;
}

.ide-shell--right-sidebar.ide-rsb--collapsed {
  --ide-rsb-width: 40px;
}

/* Right sidebar container */
.ide-right-sidebar {
  grid-area: right-sidebar;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-left: 1px solid var(--bg-elevated);
  overflow: hidden;
  min-height: 0;
  position: relative;
}

/* Header row: collapse button + (when expanded) active tab label */
.ide-rsb-header {
  height: 32px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  border-bottom: 1px solid var(--bg-elevated);
  background: color-mix(in srgb, var(--bg-surface) 85%, var(--bg-elevated) 15%);
}

/* Collapse toggle button — leftmost in header */
.ide-rsb-collapse-btn {
  width: 40px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  border-right: 1px solid var(--bg-elevated);
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition), background var(--transition);
}

.ide-rsb-collapse-btn:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}

.ide-rsb-collapse-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 160ms ease;
}

/* Arrow flips when collapsed */
.ide-rsb--collapsed .ide-rsb-collapse-btn svg {
  transform: scaleX(-1);
}

/* Active tab label shown in header when expanded */
.ide-rsb-active-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Tab icon strip: vertical column on the left edge */
.ide-rsb-tabs {
  display: flex;
  flex-direction: column;
  width: 40px;
  flex-shrink: 0;
  border-right: 1px solid var(--bg-elevated);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.ide-rsb-tabs::-webkit-scrollbar { display: none; }

/* Layout: tabs strip + content area side by side (when expanded) */
.ide-rsb-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Content area — scrollable pane for the active tab */
.ide-rsb-content {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ide-rsb-content::-webkit-scrollbar {
  width: 4px;
}
.ide-rsb-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

/* Hide content area when collapsed */
.ide-rsb--collapsed .ide-rsb-content {
  display: none;
}

/* Each tab pane inside the content area */
.ide-rsb-pane {
  display: none;
  padding: 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.5;
}

.ide-rsb-pane--active {
  display: block;
}

/* Placeholder text inside a pane (until real content is wired) */
.ide-rsb-pane__placeholder {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 4px 0;
}

/* Tab button in the icon strip */
.ide-rsb-tab-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
}

.ide-rsb-tab-btn:hover {
  background: var(--bg-elevated);
}

/* Active tab: gold left border */
.ide-rsb-tab-btn.is-active {
  border-left-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Icon inside the tab button: muted inactive, primary active */
.ide-rsb-tab-btn img {
  width: 18px;
  height: 18px;
  opacity: 0.55;
  filter: var(--icon-filter, none);
  transition: opacity var(--transition);
}

.ide-rsb-tab-btn:hover img,
.ide-rsb-tab-btn.is-active img {
  opacity: 1;
}

/* Outline icon visible when inactive; filled visible when active */
.ide-rsb-icon--outline { display: block; }
.ide-rsb-icon--filled  { display: none; }

.ide-rsb-tab-btn.is-active .ide-rsb-icon--outline { display: none; }

/* ==========================================================================
   Phase 14 Tier 2 — LSP hover tooltip (Task 2.2)
   --------------------------------------------------------------------------
   CodeMirror's @codemirror/lsp-client produces .cm-tooltip and
   .cm-tooltip-hover elements.  These rules give them the Phase 11
   design language: elevated card with border, monospace body.
   ========================================================================== */

.cm-tooltip,
.cm-tooltip-hover,
.cm-tooltip-cursor {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius, 4px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--text-primary) 10%, transparent);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  max-width: 520px;
  padding: 8px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  z-index: 200;
}

/* Diagnostic squiggles from LSP */
.cm-diagnostic-error   { border-bottom: 2px solid var(--danger); }
.cm-diagnostic-warning { border-bottom: 2px solid var(--warning); }
.cm-diagnostic-info    { border-bottom: 2px solid var(--accent); }
.cm-diagnostic-hint    { border-bottom: 1px dotted var(--text-muted); }

/* ==========================================================================
   CM panel theme override — forces dark surface regardless of CM light/dark
   heuristic. The bundled CM base theme applies a white background to
   .cm-panels in &light mode. We override with the IDE surface palette so
   window/showMessage notifications (gopls "Finished loading packages" etc.)
   render dark, not white.
   ========================================================================== */
.cm-panels,
.cm-panels-top,
.cm-panels-bottom {
  background: var(--bg-surface) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

.cm-lsp-message {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  padding: 6px 12px;
}

.cm-lsp-message-error   { color: var(--danger); }
.cm-lsp-message-warning { color: var(--warning); }
.cm-lsp-message-info    { color: var(--text-primary); }

/* Submit/action buttons inside CM panels */
.cm-panels button {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 12px;
  cursor: pointer;
  transition: background var(--transition);
}
.cm-panels button:hover { background: var(--bg-surface); }

/* CM lint panel — uses cm-panel-lint */
.cm-panel-lint { background: var(--bg-surface) !important; color: var(--text-primary) !important; }
.cm-panel-lint [aria-selected] { background: var(--bg-elevated) !important; }

/* Completion dropdown */
.cm-tooltip.cm-completionInfo,
.cm-tooltip-autocomplete {
  font-size: 12px;
}

.cm-completionLabel {
  font-family: var(--font-mono);
}

.cm-completionDetail {
  color: var(--text-muted);
  font-style: normal;
  margin-left: 8px;
  font-size: 11px;
}

.cm-completionMatchedText {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

/* ==========================================================================
   Phase 14 Tier 2 — References pane (Task 2.4)
   ========================================================================== */

.ide-refs-pane {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.ide-refs-header {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.ide-refs-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.ide-refs-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-sans);
  padding: 16px 12px;
  margin: 0;
  line-height: 1.5;
}

.ide-refs-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 6px 12px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.ide-refs-row:hover,
.ide-refs-row:focus-visible {
  background: color-mix(in srgb, var(--text-primary) 6%, transparent);
  outline: none;
}

.ide-refs-row__name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.ide-refs-row__pos {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  margin-left: 2px;
}

.ide-refs-row__path {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  word-break: break-all;
}

.ide-refs-row__preview {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ==========================================================================
   Phase 14 Tier 2 — Symbol palette modal (Task 2.6)
   ========================================================================== */

.ide-sym-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: color-mix(in srgb, var(--bg-primary) 30%, transparent);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
}

.ide-sym-dialog {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius, 4px);
  box-shadow: 0 8px 32px color-mix(in srgb, var(--text-primary) 18%, transparent);
  width: 560px;
  max-width: calc(100vw - 48px);
  max-height: 480px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ide-sym-input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 13px;
  outline: none;
  flex-shrink: 0;
}

.ide-sym-input::placeholder {
  color: var(--text-muted);
}

.ide-sym-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0;
}

.ide-sym-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-family: var(--font-sans);
  padding: 16px;
  margin: 0;
}

.ide-sym-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font: inherit;
}

.ide-sym-row:hover,
.ide-sym-row--active {
  background: color-mix(in srgb, var(--text-primary) 8%, transparent);
  outline: none;
}

.ide-sym-row__kind {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  min-width: 52px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ide-sym-row__name {
  font-family: var(--font-mono);
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ide-sym-row__path {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ==========================================================================
   Phase 14 Tier 2 — LSP rename inline indicator (Task 2.5)
   ========================================================================== */

/* The CM lsp-client renders a rename prompt in a tooltip when F2 is pressed.
   Ensure it gets the same elevated-card treatment as hover tooltips. */
.cm-tooltip.cm-rename-tooltip {
  padding: 10px 14px;
}

.cm-rename-input {
  background: var(--bg-primary);
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 3px 6px;
  outline: none;
}

/* ==========================================================================
   Phase 14 Tier 2 — LSP status badge in the pane tab bar (Task 2.1)
   ========================================================================== */

.ide-lsp-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 0 6px;
  height: 22px;
  border-radius: var(--radius-sm, 2px);
  white-space: nowrap;
}

.ide-lsp-status--ok      { color: var(--success); }
.ide-lsp-status--warn    { color: var(--warning); }
.ide-lsp-status--error   { color: var(--danger); }

.ide-rsb-tab-btn.is-active .ide-rsb-icon--filled  { display: block; }

/* ── Prepared-card slot ──────────────────────────────────────────────────── */

.ide-prepared-card-slot {
  flex-shrink: 0;
}

.prepared-card {
  background: var(--bg-elevated, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius, 4px);
  box-shadow: var(--shadow-sm);
  margin: 10px 10px 0;
  overflow: hidden;
}

.prepared-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.prepared-card__heading {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

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

.prepared-card__rescan,
.prepared-card__dismiss {
  font-size: 11px;
  padding: 2px 8px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.prepared-card__body {
  padding: 8px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.prepared-card__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 22px;
}

.prepared-card__row--chips {
  align-items: flex-start;
}

.prepared-card__row-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  min-width: 100px;
  flex-shrink: 0;
  padding-top: 2px;
}

.prepared-card__cmd-chip {
  font-family: var(--font-mono);
  font-size: 11px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-primary);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-radius: var(--radius-sm, 2px);
  padding: 1px 6px;
  white-space: pre;
}

.prepared-card__text-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  word-break: break-all;
}

.prepared-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.prepared-card__chip {
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--text-muted) 12%, transparent);
  color: var(--text-secondary);
  white-space: nowrap;
}

.prepared-card__chip--lsp {
  background: color-mix(in srgb, var(--info) 15%, transparent);
  color: var(--info);
}

.prepared-card__chip--debug {
  background: color-mix(in srgb, var(--warning) 15%, transparent);
  color: var(--warning);
}

.prepared-card__row-note {
  font-size: 10px;
  color: var(--text-muted);
  font-style: italic;
  padding-top: 2px;
}

/* ── Architecture overview panel (Phase 20 Tier 4) ──────────────────────── */

.arch-overview-panel {
  background: var(--bg-elevated, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius, 4px);
  box-shadow: var(--shadow-sm);
  margin: 8px 10px 0;
  overflow: hidden;
}

.arch-overview-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.arch-overview-panel__heading {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin: 0;
  flex: 1;
}

.arch-overview-panel__header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.arch-overview-panel__rescan,
.arch-overview-panel__dismiss {
  font-size: 11px;
  padding: 2px 8px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.arch-overview-panel__body {
  padding: 8px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ── Sections ─────────────────────────────────────────────────────────────── */

.arch-overview-panel__section {
  padding: 6px 14px 8px;
  border-bottom: 1px solid var(--border-subtle, var(--border));
}

.arch-overview-panel__section:last-child {
  border-bottom: none;
}

.arch-overview-panel__section-heading {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 5px;
}

/* ── Directory tree ──────────────────────────────────────────────────────── */

.arch-overview-panel__tree {
  list-style: none;
  margin: 0;
  padding: 0;
}

.arch-overview-panel__tree-entry {
  margin: 0;
}

.arch-overview-panel__tree-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border-radius: 2px;
  font-size: 11px;
  font-family: var(--font-mono);
  min-height: 20px;
}

.arch-overview-panel__tree-label {
  flex: 1;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arch-overview-panel__tree-score {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex-shrink: 0;
}

/* ── Top 5 files ─────────────────────────────────────────────────────────── */

.arch-overview-panel__file-row {
  display: grid;
  grid-template-columns: 1fr 60px 32px 36px;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
  min-height: 22px;
}

.arch-overview-panel__file-name {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--accent);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.arch-overview-panel__file-name:hover {
  color: var(--accent-hover, var(--accent));
}

.arch-overview-panel__score-bar-wrap {
  height: 6px;
  background: var(--bg-surface, var(--bg-secondary));
  border-radius: 3px;
  overflow: hidden;
}

.arch-overview-panel__score-bar {
  height: 100%;
  border-radius: 3px;
  background: var(--accent);
  min-width: 2px;
  transition: width 0.2s ease;
}

.arch-overview-panel__score-bar.ide-heatmap--elevated {
  background: var(--attention);
}

.arch-overview-panel__score-bar.ide-heatmap--hot {
  background: var(--attention);
}

.arch-overview-panel__score-bar.ide-heatmap--critical {
  background: var(--error);
}

.arch-overview-panel__score-val {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--text-muted);
  text-align: right;
}

.arch-overview-panel__lang-chip {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-surface, var(--bg-secondary));
  border: 1px solid var(--border-subtle, var(--border));
  border-radius: 2px;
  padding: 0 4px;
  text-align: center;
  letter-spacing: 0.03em;
}

/* ── Pattern placeholder ─────────────────────────────────────────────────── */

.arch-overview-panel__placeholder {
  font-size: 11px;
  color: var(--text-muted);
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

/* ── Sparkline ───────────────────────────────────────────────────────────── */

.arch-overview-panel__sparkline {
  display: block;
  width: 100%;
  height: 36px;
}

.arch-overview-panel__sparkline-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 2px;
}

.arch-overview-panel__sparkline-label {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}

.arch-overview-panel__sparkline-summary {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  margin-top: 4px;
}

/* ── Contributor strip ───────────────────────────────────────────────────── */

.arch-overview-panel__contributor-strip {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.arch-overview-panel__contributor {
  display: flex;
  align-items: center;
  gap: 8px;
}

.arch-overview-panel__contributor-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 20%, var(--bg-surface, var(--bg-secondary)));
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-sans);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
}

.arch-overview-panel__contributor-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.arch-overview-panel__contributor-name {
  font-size: 11px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.arch-overview-panel__contributor-commits {
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-sans);
}
