/* -- ClaudeCode: CS-Designer Localhost — Phase 0 styles. ALL selectors prefixed .cs-designer
   except for the iframe + html/body resets. Lint-enforced (master spec §0.3 Layer 5). */

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0f1419;
  font-family: -apple-system, 'Inter', 'Segoe UI', sans-serif;
}

/* ------- Address bar (top, browser-style — single row with datalist input) ------- */
.cs-designer-addressbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 44px;
  background: #161c24;
  border-bottom: 1px solid #2a3340;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  z-index: 2147483630;
  box-sizing: border-box;
}
.cs-designer-addressbar-label {
  color: #f4f6f9;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.cs-designer-addressbar-input {
  flex: 1;
  height: 28px;
  background: #0f1419;
  border: 1px solid #2a3340;
  border-radius: 6px;
  color: #d6dde6;
  padding: 0 10px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  outline: none;
  min-width: 200px;
}
.cs-designer-addressbar-input:focus {
  border-color: #1565c0;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.15);
}
.cs-designer-addressbar-current {
  color: #93a0b2;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 320px;
  padding: 0 6px;
  border-left: 1px solid #2a3340;
  height: 28px;
  display: flex;
  align-items: center;
  flex-shrink: 1;
  min-width: 0;
}
.cs-designer-addressbar-current:empty {
  display: none;
}

#csd-iframe {
  position: fixed;
  top: 44px;       /* below address bar */
  left: 0;
  width: 100vw;
  height: calc(100vh - 44px);
  border: 0;
  background: #fff;
}

/* ------- Bezel (closed state) ------- */
.cs-designer-bezel {
  position: fixed;
  bottom: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: #1565c0;
  cursor: pointer;
  z-index: 2147483640;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s, box-shadow 0.1s;
}
.cs-designer-bezel:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.cs-designer-bezel-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
}
.cs-designer-bezel.hidden {
  display: none;
}

/* ------- Panel (open state) — three display modes ------- */
.cs-designer-panel {
  position: fixed;
  background: #161c24;
  color: #d6dde6;
  border: 1px solid #2a3340;
  z-index: 2147483641;
  display: flex;
  flex-direction: column;
  font-size: 13px;
}
.cs-designer-panel.hidden {
  display: none;
}

/* Mode 1: Float (default) — overlay bottom-right, page width unchanged */
body.cs-designer-mode-float .cs-designer-panel {
  bottom: 18px;
  right: 18px;
  width: var(--csd-float-width, 420px);
  height: var(--csd-float-height, 70vh);
  min-width: 320px;
  min-height: 240px;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
}
/* Float resize handle — top-left corner of the panel (because panel is anchored bottom-right) */
.cs-designer-float-resize-handle {
  display: none;
}
body.cs-designer-mode-float .cs-designer-float-resize-handle {
  display: block;
  position: absolute;
  top: -2px;
  left: -2px;
  width: 14px;
  height: 14px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, #1565c0 50%, #1565c0 70%, transparent 70%);
  z-index: 10;
}

/* Mode 2: Mini — small corner box showing last hover word */
body.cs-designer-mode-mini .cs-designer-panel {
  bottom: 18px;
  right: 18px;
  width: 280px;
  height: auto;
  min-width: 200px;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
/* In mini mode, hide tabs + tab body; show only header + mini-content */
body.cs-designer-mode-mini .cs-designer-tabs,
body.cs-designer-mode-mini .cs-designer-tab-body {
  display: none;
}
body.cs-designer-mode-mini #csd-mini-content {
  display: flex;
}
.cs-designer-mini-content {
  display: none;  /* hidden by default; only shown in mini mode */
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11px;
}
.cs-designer-mini-label {
  color: #93a0b2;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 9px;
}
.cs-designer-mini-text {
  color: #f4f6f9;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

/* Mode 3: Pinned — right column, iframe shrinks */
body.cs-designer-mode-pinned .cs-designer-panel {
  top: 44px;          /* below address bar */
  right: 0;
  bottom: 0;
  width: var(--csd-pinned-width, 480px);
  border-radius: 0;
  border-left: 1px solid #2a3340;
  border-right: none;
  border-top: none;
  border-bottom: none;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.4);
}
body.cs-designer-mode-pinned #csd-iframe {
  width: calc(100vw - var(--csd-pinned-width, 480px));
}
/* Pinned-mode divider — vertical drag bar exactly on the seam */
.cs-designer-pinned-divider {
  display: none;
}
body.cs-designer-mode-pinned .cs-designer-pinned-divider {
  display: block;
  position: fixed;
  top: 44px;
  bottom: 0;
  /* Position so the visible 1px line is EXACTLY on the panel's left edge */
  right: var(--csd-pinned-width, 480px);
  width: 9px;
  margin-right: -4px;        /* center the 9px hit area on the seam (1px line) */
  cursor: ew-resize;
  z-index: 2147483645;
  background: transparent;
  /* Visible thin line in the middle of the hit area, always visible */
  border-left: none;
  background-image: linear-gradient(to right, transparent 4px, #2a3340 4px, #2a3340 5px, transparent 5px);
  transition: background-image 0.1s;
}
body.cs-designer-mode-pinned .cs-designer-pinned-divider:hover,
body.cs-designer-mode-pinned .cs-designer-pinned-divider.dragging {
  background-image: linear-gradient(to right, transparent 3px, #1565c0 3px, #1565c0 6px, transparent 6px);
}

/* Mode buttons in panel header */
.cs-designer-mode-group {
  display: inline-flex;
  gap: 0;
  border: 1px solid #2a3340;
  border-radius: 6px;
  overflow: hidden;
}
.cs-designer-mode-btn {
  width: auto;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
  height: 22px;
  background: #1f2730;
  color: #93a0b2;
  border: none;
  border-radius: 0;
}
.cs-designer-mode-btn:hover {
  background: #2a3340;
  color: #d6dde6;
}
.cs-designer-mode-btn.cs-designer-btn-active {
  background: #1565c0;
  color: #fff;
}
.cs-designer-mode-group .cs-designer-mode-btn + .cs-designer-mode-btn {
  border-left: 1px solid #2a3340;
}

/* Inspect button in the address bar — Red = ON (recording), Blue = OFF (ready to turn on) */
/* Live/Sim mode toggle — Live = proxied sandbox (green), Sim = local render (amber) */
.cs-designer-btn-mode {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  background: #2e7d46;
  color: #fff;
  border: 1px solid #2e7d46;
}
.cs-designer-btn-mode:hover { box-shadow: 0 0 0 3px rgba(46, 125, 70, 0.25); }
.cs-designer-btn-mode[data-mode="sim"] {
  background: #b8860b;
  border-color: #b8860b;
}
.cs-designer-btn-mode[data-mode="sim"]:hover { box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.3); }

/* Sim data-session pill + inline login dropdown (upper-right) */
.cs-designer-btn-simauth {
  height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  background: #7a2e2e;
  color: #fff;
  border: 1px solid #7a2e2e;
}
.cs-designer-btn-simauth[data-authed="1"] {
  background: #2e7d46;
  border-color: #2e7d46;
}
.cs-designer-simlogin {
  position: fixed;         /* viewport-relative so the header/panel can't clip it */
  top: 40px;
  right: 8px;
  width: 260px;
  z-index: 2147483646;     /* above the pinned right panel (2147483645) */
  background: #12222e;
  border: 1px solid #2a3a47;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
}
.cs-designer-simlogin-title { color: #cfe0ea; font-size: 12px; font-weight: 700; margin-bottom: 8px; }
.cs-designer-simlogin input {
  width: 100%; box-sizing: border-box; margin: 4px 0; padding: 8px 9px;
  border: 1px solid #34505f; border-radius: 4px; background: #0c1820; color: #cfe0ea; font-size: 12px;
}
.cs-designer-simlogin button {
  width: 100%; margin-top: 8px; padding: 8px; background: #3d6a94; color: #fff;
  border: none; border-radius: 4px; font-size: 13px; cursor: pointer;
}
.cs-designer-simlogin-msg { font-size: 11px; color: #b23b3b; min-height: 14px; margin-top: 6px; }

.cs-designer-btn-inspect-bar {
  width: 32px;
  height: 28px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
  /* OFF state — blue "ready to click" */
  background: #1565c0;
  color: #fff;
  border: 1px solid #1565c0;
  box-shadow: 0 0 0 0 rgba(21, 101, 192, 0);
}
.cs-designer-btn-inspect-bar:hover {
  background: #1976d2;
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.25);
}
/* ON state — red "recording / actively inspecting" */
.cs-designer-btn-inspect-bar.cs-designer-btn-active {
  background: #e8533f;
  color: #fff;
  border-color: #e8533f;
  box-shadow: 0 0 0 0 rgba(232, 83, 63, 0);
  animation: csd-inspect-pulse 1.6s ease-in-out infinite;
}
.cs-designer-btn-inspect-bar.cs-designer-btn-active:hover {
  background: #ef6450;
  border-color: #ef6450;
}
@keyframes csd-inspect-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 83, 63, 0.5); }
  50%      { box-shadow: 0 0 0 4px rgba(232, 83, 63, 0); }
}

.cs-designer-panel-header {
  padding: 8px 10px;
  border-bottom: 1px solid #2a3340;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}
.cs-designer-panel-header:hover {
  background: #1a2129;
}
.cs-designer-title {
  flex: 1;
  font-weight: 600;
  color: #f4f6f9;
  font-size: 12px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-designer-btn-icon {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: transparent;
  color: #93a0b2;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cs-designer-btn-icon:hover {
  background: #2a3340;
  color: #f4f6f9;
  border-color: #2a3340;
}
.cs-designer-btn-icon.cs-designer-btn-active {
  background: #1565c0;
  color: #fff;
  border-color: #1565c0;
}
/* Hidden DOM stubs (kept so editor.js bindings don't crash) */
.cs-designer-hidden-text {
  display: none !important;
}
.cs-designer-status {
  font-size: 10px;
  color: #93a0b2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cs-designer-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #2a3340;
  background: #1f2730;
  color: #d6dde6;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}
.cs-designer-btn:hover {
  background: #2a3340;
}
.cs-designer-btn-kill {
  color: #e8533f;
}
.cs-designer-btn-kill:hover {
  background: #4a1f1a;
  border-color: #e8533f;
}

/* ------- Tab strip ------- */
.cs-designer-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #2a3340;
  padding: 0 6px;
}
.cs-designer-tab {
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: #93a0b2;
  cursor: pointer;
  font-size: 12px;
}
.cs-designer-tab:disabled {
  color: #5c6a7e;
  cursor: not-allowed;
}
.cs-designer-tab-active {
  color: #f4f6f9;
  border-bottom-color: #1565c0;
}

/* ------- Tab body ------- */
.cs-designer-tab-body {
  flex: 1;
  overflow: auto;
  padding: 14px;
}
.cs-designer-empty {
  color: #93a0b2;
  font-style: italic;
  margin: 0 0 16px 0;
}
.cs-designer-section-title {
  font-size: 10px;
  font-weight: 600;
  color: #93a0b2;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 12px 0 6px 0;
}

/* ------- Error log (panel surface for §0.3 Layer 2 captured errors) ------- */
.cs-designer-error-section {
  margin-top: 24px;
  padding-top: 12px;
  border-top: 1px solid #2a3340;
}
.cs-designer-error-log {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 11px;
  color: #e8533f;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.cs-designer-error-log li {
  padding: 4px 0;
  border-bottom: 1px solid #2a3340;
}

/* ------- Phase 1: Inspect mode + Inspect tab ------- */

/* Global .hidden — simple display:none for any element. Used for show/hide
   logic in editor.js. Was previously gated to .cs-designer-tab-pane.hidden
   and .cs-designer.hidden, which silently no-op'd on inner divs. */
.hidden,
.cs-designer-tab-pane.hidden,
.cs-designer.hidden {
  display: none !important;
}

/* Inspect button active state */
.cs-designer-btn-inspect {
  width: auto;
  padding: 0 10px;
  font-size: 11px;
  font-weight: 600;
}
.cs-designer-btn-active {
  background: #1565c0;
  color: #fff;
  border-color: #1565c0;
}
.cs-designer-btn-active:hover {
  background: #1976d2;
}

/* Inspect summary card */
.cs-designer-card {
  background: #1f2730;
  border: 1px solid #2a3340;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.cs-designer-card-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 0;
  font-size: 12px;
}
.cs-designer-card-row + .cs-designer-card-row {
  border-top: 1px solid #2a3340;
  padding-top: 6px;
  margin-top: 2px;
}
.cs-designer-label {
  flex: 0 0 90px;
  color: #93a0b2;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.cs-designer-value {
  flex: 1;
  color: #f4f6f9;
  word-break: break-word;
}
.cs-designer-mono {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
}
.cs-designer-pkey {
  color: #6699cd;
  font-weight: 600;
}
.cs-designer-warn {
  color: #e8913f;
  font-weight: 600;
}

/* Lists (params, columns) */
.cs-designer-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
}
.cs-designer-list li {
  padding: 5px 8px;
  border-bottom: 1px solid #2a3340;
  color: #d6dde6;
  word-break: break-word;
}
.cs-designer-list li:last-child {
  border-bottom: none;
}
.cs-designer-active-col {
  background: rgba(21, 101, 192, 0.15);
  border-left: 3px solid #1565c0;
  padding-left: 5px !important;
}

/* Breadcrumb */
.cs-designer-breadcrumb {
  color: #93a0b2;
  font-size: 11px;
  word-break: break-word;
  margin-bottom: 14px;
}
.cs-designer-breadcrumb span {
  color: #d6dde6;
}

/* Raw wConfig collapsible */
.cs-designer-details {
  margin-top: 14px;
  border: 1px solid #2a3340;
  border-radius: 6px;
  padding: 8px 10px;
}
.cs-designer-details summary {
  cursor: pointer;
  color: #93a0b2;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  padding: 2px 0;
}
.cs-designer-details summary:hover {
  color: #f4f6f9;
}
.cs-designer-pre {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: #d6dde6;
  background: #0f1419;
  padding: 8px;
  border-radius: 4px;
  overflow: auto;
  max-height: 280px;
  margin: 8px 0 0 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ------- Phase 2: XML tab — resolver candidates + file display ------- */

.cs-designer-loading {
  color: #93a0b2;
  font-style: italic;
  font-size: 12px;
  padding: 8px 0;
}
.cs-designer-error {
  color: #e8533f;
  font-size: 12px;
  padding: 8px;
  background: rgba(232, 83, 63, 0.08);
  border-radius: 4px;
}
.cs-designer-resolver-won {
  background: rgba(88, 153, 95, 0.12);
  border-left: 3px solid #58995f;
  padding-left: 5px !important;
}
.cs-designer-resolver-won .cs-designer-pkey {
  color: #58995f;
}
.cs-designer-resolver-missing {
  color: #5c6a7e;
  opacity: 0.6;
}
.cs-designer-resolver-status {
  font-size: 10px;
  color: #93a0b2;
  margin-left: 6px;
}
.cs-designer-resolver-won .cs-designer-resolver-status {
  color: #58995f;
  font-weight: 600;
}
.cs-designer-resolver-path {
  font-size: 10px;
  color: #93a0b2;
  margin-top: 2px;
  word-break: break-all;
}
.cs-designer-xml-actions {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.cs-designer-btn-action {
  width: auto;
  padding: 0 10px;
  font-size: 11px;
  height: 24px;
}
.cs-designer-xml-pre {
  max-height: 50vh;
  font-size: 10px;
  line-height: 1.5;
}
.cs-designer-xml-mark {
  background: rgba(245, 158, 11, 0.25);
  outline: 1px solid #f59e0b;
  border-radius: 2px;
}
.cs-designer-xml-block {
  max-height: 38vh;
  border-left: 3px solid #58995f;
  background: rgba(88, 153, 95, 0.05);
  margin-bottom: 14px;
}

/* ------- Phase 6: Filters tab ------- */
.cs-designer-pill-count {
  display: inline-block;
  background: #2a3340;
  color: #93a0b2;
  font-size: 9px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  margin-left: 4px;
  vertical-align: middle;
}
.cs-designer-empty-val {
  color: #5c6a7e;
  font-style: italic;
}
.cs-designer-filters-footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #2a3340;
  color: #5c6a7e;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ------- Phase 3: API tab ------- */
.cs-designer-api-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #2a3340;
  margin-bottom: 10px;
}
.cs-designer-api-summary {
  flex: 1;
  color: #93a0b2;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.cs-designer-api-row {
  border: 1px solid #2a3340;
  border-radius: 6px;
  margin-bottom: 6px;
  overflow: hidden;
  background: #1a2129;
}
.cs-designer-api-row.expanded {
  background: #1f2730;
  border-color: #1565c0;
}
.cs-designer-api-row-header {
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
}
.cs-designer-api-row-header:hover {
  background: #232c36;
}
.cs-designer-api-method {
  color: #6699cd;
  font-weight: 700;
  min-width: 36px;
}
.cs-designer-api-proc {
  color: #58995f;
  font-weight: 600;
  flex: 0 0 auto;
}
.cs-designer-api-proc-unkeyed {
  color: #93a0b2;
  font-style: italic;
  flex: 0 0 auto;
}
.cs-designer-api-meta {
  color: #93a0b2;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cs-designer-api-ok {
  color: #58995f;
}
.cs-designer-api-bad {
  color: #e8533f;
  font-weight: 700;
}
.cs-designer-api-toggle {
  color: #5c6a7e;
  width: 14px;
  text-align: center;
}
.cs-designer-api-detail {
  padding: 10px 12px;
  border-top: 1px solid #2a3340;
}
.cs-designer-api-section {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #93a0b2;
  margin: 8px 0 6px 0;
}
.cs-designer-api-body {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10px;
  color: #d6dde6;
  background: #0f1419;
  padding: 8px;
  border-radius: 4px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 320px;
  overflow: auto;
}
.cs-designer-api-row-body {
  border: 1px solid #1565c0;
  background: rgba(21, 101, 192, 0.06);
}
.cs-designer-api-actions {
  margin-top: 8px;
  display: flex;
  gap: 6px;
}

/* Array walker controls (◀ ▶ counter + jump) */
.cs-designer-array-walker {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #161c24;
  border: 1px solid #2a3340;
  border-radius: 4px 4px 0 0;
  border-bottom: none;
}
.cs-designer-walker-counter {
  color: #f4f6f9;
  font-size: 11px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-weight: 600;
  flex: 1;
  text-align: center;
}
.cs-designer-walker-jump {
  width: 60px;
  height: 22px;
  background: #0f1419;
  border: 1px solid #2a3340;
  color: #d6dde6;
  border-radius: 4px;
  padding: 0 6px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 11px;
  text-align: right;
}
.cs-designer-walker-jump:focus {
  outline: none;
  border-color: #1565c0;
}
.cs-designer-link {
  color: #6699cd;
  text-decoration: underline;
  cursor: pointer;
  font-size: 11px;
}
.cs-designer-link:hover {
  color: #93c5fd;
}

/* -- ClaudeCode 2026-07-20 (W1-D): modal XML editor. Body-mounted, z-index above the pinned panel
   (2147483645) per the stacking-context lesson. All selectors scoped .csd-editor-*. */
.csd-editor-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  background: rgba(6, 14, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 13px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.csd-editor-box {
  background: #0e1c28;
  color: #cfe0ea;
  border: 1px solid #2c4356;
  border-radius: 10px;
  width: min(1080px, 94vw);
  height: min(82vh, 900px);
  display: flex;
  flex-direction: column;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}
.csd-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #1b2c3a;
}
.csd-editor-title { color: #cfe0ea; font-size: 13px; }
.csd-editor-src {
  color: #e8a33d;
  font: 11px/1.4 "SF Mono", monospace;
  background: #16283a;
  padding: 2px 8px;
  border-radius: 4px;
}
.csd-editor-spacer { flex: 1; }
.csd-editor-btn {
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 12px;
  cursor: pointer;
}
.csd-editor-save { background: #3d6a94; color: #fff; }
.csd-editor-save:disabled { background: #22384c; color: #6b8296; cursor: default; }
.csd-editor-close { background: #22384c; color: #cfe0ea; }
.csd-editor-body { flex: 1; min-height: 0; position: relative; }
.csd-editor-body .CodeMirror {
  height: 100%;
  font: 12px/1.5 "SF Mono", "Fira Code", monospace;
}
.csd-editor-foot {
  padding: 8px 16px;
  border-top: 1px solid #1b2c3a;
  min-height: 18px;
}
.csd-editor-msg { color: #8a97a5; font-size: 12px; }
.csd-editor-msg-ok { color: #7fd4a0; }
.csd-editor-msg-err { color: #e8896b; }
