* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  height: 100vh;
  overflow: hidden;
}

main,
main.cowork-layout {
  display: grid;
  grid-template-columns: 16rem minmax(360px, 1fr) minmax(440px, 1.25fr);
  height: 100vh;
  width: 100vw;
  margin: 0;
  overflow: hidden;
  background: var(--bg-canvas);
  color: var(--text-primary);
}

/* Left GPT-4 Style Sidebar */
.gpt-sidebar {
  background: #0f172a;
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.9rem 0.75rem;
  border-right: 1px solid #1e293b;
  overflow-y: auto;
  gap: 1rem;
}

.sidebar-top {
  display: grid;
  gap: 0.75rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.25rem 0.35rem;
}

.brand-badge {
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.5rem;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.92rem;
  display: grid;
  place-items: center;
  letter-spacing: 0.03em;
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 0.95rem;
  color: #ffffff;
}

.brand-text span {
  font-size: 0.74rem;
  color: #94a3b8;
}

.new-chat-btn {
  width: 100%;
  min-height: 2.5rem;
  margin: 0;
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  background: #1d4ed8;
  color: #ffffff;
  border: 1px solid #3b82f6;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.new-chat-btn:hover {
  background: #2563eb;
  border-color: #60a5fa;
}

.sidebar-section,
.sidebar-Section-Prompts {
  display: grid;
  gap: 0.4rem;
}

.sidebar-heading {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  padding: 0 0.4rem;
}

.thread-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.25rem;
}

.thread-item-btn {
  width: 100%;
  min-height: 2.2rem;
  margin: 0;
  padding: 0.4rem 0.65rem;
  border-radius: 0.45rem;
  background: transparent;
  color: #e2e8f0;
  border: 1px solid transparent;
  font-size: 0.83rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.thread-item-btn:hover {
  background: #1e293b;
}

.thread-item-btn-active {
  background: #1e293b;
  border-color: #334155;
  color: #ffffff;
  font-weight: 600;
}

.sidebar-presets {
  display: grid;
  gap: 0.25rem;
}

.sidebar-preset-item {
  width: 100%;
  min-height: 2.05rem;
  margin: 0;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  background: transparent;
  color: #cbd5e1;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}

.sidebar-preset-item:hover {
  background: #1e293b;
  color: #ffffff;
  border-color: #334155;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #1e293b;
  display: grid;
  gap: 0.4rem;
}

.sidebar-tool-btn {
  width: 100%;
  min-height: 2.35rem;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border-radius: 0.45rem;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #334155;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.sidebar-tool-btn:hover {
  background: #334155;
  border-color: #475569;
}

.sidebar-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: #0f172a;
  color: #93c5fd;
  border: 1px solid #3b82f6;
}

.sidebar-model-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.4rem 0.1rem;
  font-size: 0.72rem;
  color: #94a3b8;
}

.sidebar-model-status code {
  color: #cbd5e1;
  background: transparent;
  border: 0;
  padding: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: #22c55e;
  flex-shrink: 0;
}

/* Center GPT-4 Main Chat Area */
.gpt-main-pane {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #ffffff;
  min-width: 0;
  overflow: hidden;
}

.gpt-topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e2e8f0;
  background: #ffffff;
  flex-shrink: 0;
}

.model-selector {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.model-selector h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.model-tag {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-context-pill {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  padding: 0.25rem 0.6rem;
  border-radius: 0.4rem;
}

.topbar-btn {
  width: auto;
  min-height: 2.1rem;
  margin: 0;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  border-radius: 0.4rem;
  cursor: pointer;
}

.topbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* Scrollable Conversation Stream */
.chat-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.25rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: #ffffff;
}

.chat-turn {
  width: min(50rem, 100%);
  margin: 0 auto;
  display: grid;
  gap: 0.4rem;
  font-size: 0.96rem;
}

.chat-turn-user {
  justify-items: end;
}

.chat-turn-user .chat-turn-body {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  padding: 0.75rem 1.05rem;
  border-radius: 1.1rem 1.1rem 0.25rem 1.1rem;
  max-width: 85%;
}

.chat-turn-assistant {
  padding: 0.25rem 0;
}

.chat-turn-meta {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-turn-body {
  display: grid;
  gap: 0.65rem;
  line-height: 1.65;
  color: var(--text-primary);
}

.chat-heading {
  margin: 0.35rem 0 0;
  font-size: 1.04rem;
  font-weight: 700;
  color: var(--text-primary);
}

.chat-paragraph {
  margin: 0;
}

.chat-list {
  margin: 0;
  padding-left: 1.35rem;
  display: grid;
  gap: 0.35rem;
}

code,
.chat-inline-code,
.md-inline-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.85rem;
  background: var(--code-bg, var(--bg-subtle));
  color: var(--code-text, var(--text-primary));
  border: 1px solid var(--code-border, var(--border-hairline));
  padding: 0.1rem 0.35rem;
  border-radius: 0.3rem;
}

.chat-code-wrapper {
  border: 1px solid #1e293b;
  border-radius: 0.55rem;
  overflow: hidden;
  margin: 0.35rem 0;
}

.chat-code-header {
  background: #1e293b;
  color: #cbd5e1;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #334155;
}

.copy-code-btn {
  width: auto;
  min-height: 1.5rem;
  margin: 0;
  padding: 0.15rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: #334155;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 0.3rem;
  cursor: pointer;
}

.copy-code-btn:hover {
  background: #475569;
}

.chat-code-block {
  margin: 0;
  padding: 0.85rem 1rem;
  background: #0f172a;
  color: #f8fafc;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.83rem;
  line-height: 1.5;
  overflow-x: auto;
}

.inline-patch-bar {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Bottom GPT-4 Composer Dock */
.gpt-composer-dock {
  width: min(52rem, 100%);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 1rem;
  background: #ffffff;
  flex-shrink: 0;
}

.starter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.chip-btn {
  width: auto;
  min-height: 1.95rem;
  margin: 0;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
}

.chip-btn:hover {
  background: #eff6ff;
  color: #1e3a8a;
  border-color: #93c5fd;
}

.gpt-composer-form {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem 0.55rem 0.95rem;
  border: 1px solid #94a3b8;
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 0.2rem 0.85rem rgba(15, 23, 42, 0.06);
}

.gpt-composer-form:focus-within {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.15);
}

.composer-field {
  flex: 1;
  min-width: 0;
}

#claude-chat-input {
  width: 100%;
  min-height: 1.75rem;
  max-height: 9rem;
  border: 0;
  padding: 0.2rem 0;
  margin: 0;
  font: inherit;
  font-size: 0.96rem;
  color: var(--text-primary);
  background: transparent;
  resize: none;
  line-height: 1.45;
}

#claude-chat-input:focus {
  outline: none;
}

.composer-send-btn {
  width: auto;
  min-height: 2.25rem;
  margin: 0;
  padding: 0.4rem 1.05rem;
  border-radius: 0.65rem;
  background: #1d4ed8;
  color: #ffffff;
  border: 1px solid #1d4ed8;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.composer-send-btn:hover {
  background: #1e40af;
}

.composer-footnote {
  margin: 0.45rem 0 0;
  text-align: center;
  font-size: 0.73rem;
  color: #64748b;
}

/* Modal Windows for Workspace & Diagnostics */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.modal-window {
  width: min(74rem, 100%);
  max-height: 90vh;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 0.85rem;
  box-shadow: 0 1.25rem 3rem rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-window-wide {
  width: min(88rem, 100%);
}

.modal-header {
  padding: 1rem 1.4rem;
  background: #ffffff;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

.modal-close-btn {
  width: auto;
  min-height: 2.25rem;
  margin: 0;
  padding: 0.4rem 0.9rem;
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  border-radius: 0.45rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.modal-close-btn:hover {
  background: var(--bg-hover);
}

.modal-body {
  padding: 1.25rem;
  overflow-y: auto;
  display: grid;
  gap: 1.15rem;
}

.workspace-modal-grid {
  grid-template-columns: 19rem minmax(0, 1fr);
  align-items: start;
}

/* Shared Form, Table & Diagnostic Styles inside Modals */
.studio-panel {
  padding: 1.15rem 1.4rem;
  border: 1px solid var(--border-hairline);
  border-radius: 0.75rem;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.eyebrow {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #1d4ed8;
  margin-bottom: 0.15rem;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
}

.metric-card {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-hairline);
  border-radius: 0.5rem;
  background: var(--bg-surface);
  display: grid;
  gap: 0.2rem;
}

.metric-card-wide {
  grid-column: span 2;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.panel-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.panel-badge {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.preset-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.preset-btn,
.table-action-btn {
  width: auto;
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  margin-top: 0;
  font-size: 0.8rem;
  font-weight: 600;
  background: #eff6ff;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
  border-radius: 0.4rem;
  cursor: pointer;
}

.preset-btn:hover,
.table-action-btn:hover {
  background: #dbeafe;
  border-color: #3b82f6;
}

form {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1rem;
  align-items: end;
}

.prompt-form {
  grid-template-columns: 1fr auto;
}

.admit-form {
  grid-template-columns: 1fr 1.4fr;
}

.button-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.button-row button {
  width: auto;
  min-width: 12rem;
  margin-top: 0;
}

.field {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-primary);
}

input, select, textarea {
  width: 100%;
  min-height: 2.35rem;
  border: 1px solid var(--border-strong);
  border-radius: 0.4rem;
  padding: 0.4rem 0.65rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--bg-surface);
}

button {
  width: auto;
  min-height: auto;
  border: 1px solid #1d4ed8;
  border-radius: 0.4rem;
  padding: 0.35rem 0.75rem;
  font: inherit;
  font-size: 0.84rem;
  background: #1d4ed8;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0;
}

input:focus, select:focus, button:focus {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

#application-form button,
.workspace-new-form button {
  width: 100%;
  grid-column: 1 / -1;
  min-height: 2.4rem;
  margin-top: 0.35rem;
}

.prompt-form button {
  grid-column: auto;
  margin-top: 0;
  padding: 0.45rem 1rem;
}

button:hover {
  background: #1e40af;
  border-color: #1e40af;
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.reply-card {
  margin-top: 1rem;
  border: 1px solid #bfdbfe;
  border-radius: 0.6rem;
  background: #f8fafc;
  padding: 1rem;
}

.reply-card-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.reply-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: #1e3a8a;
  text-transform: uppercase;
}

.mode-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: #dbeafe;
  color: #1e3a8a;
  border: 1px solid #93c5fd;
}

.mode-badge-fallback {
  background: #fef3c7;
  color: #92400e;
  border-color: #f59e0b;
}

output {
  display: block;
  min-height: 2.25rem;
  margin-top: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 0.4rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.88rem;
  word-break: break-word;
  background: #ffffff;
  border: 1px solid #cbd5e1;
}

.prose-output {
  margin-top: 0;
  margin-bottom: 0.85rem;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
}

output:empty {
  display: none;
}

.diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.6rem;
}

.diag-item {
  padding: 0.5rem 0.7rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.4rem;
  display: grid;
  gap: 0.15rem;
}

.diag-item-span2 {
  grid-column: span 2;
}

.diag-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
}

.diag-item code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text-primary);
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.studio-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.studio-table th,
.studio-table td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-hairline);
  text-align: left;
  vertical-align: middle;
}

.studio-table td {
  color: var(--text-secondary);
}

.studio-table th {
  background: var(--bg-subtle);
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.row-highlight {
  background: #eff6ff;
  font-weight: 600;
}

.phase-tag {
  display: inline-block;
  padding: 0.12rem 0.4rem;
  border-radius: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.phase-prompt {
  background: #e0e7ff;
  color: #1e3a8a;
}

.phase-boundary {
  background: #fef3c7;
  color: #92400e;
}

.phase-reply {
  background: #dcfce7;
  color: #166534;
}

.ide-pane {
  padding: 1rem;
  border: 1px solid var(--border-hairline);
  border-radius: 0.6rem;
  background: var(--bg-surface);
  display: grid;
  gap: 0.8rem;
  min-width: 0;
}

.pane-subheader {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border-hairline);
  font-size: 0.88rem;
  color: var(--text-primary);
}

.workspace-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.workspace-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--border-hairline);
  border-radius: 0.4rem;
  background: var(--bg-subtle);
  font-size: 0.8rem;
}

.workspace-item-active {
  border-color: var(--accent-border);
  background: var(--accent-soft);
}

.workspace-file-select {
  width: auto;
  min-height: 1.8rem;
  padding: 0.15rem 0.4rem;
  margin: 0;
  background: transparent;
  color: var(--text-primary);
  border: 0;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.workspace-pin-btn {
  width: auto;
  min-height: 1.65rem;
  padding: 0.1rem 0.45rem;
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  background: #e2e8f0;
  color: #1e293b;
  border: 1px solid #94a3b8;
}

.workspace-pin-btn-active {
  background: #dcfce7;
  color: #166534;
  border-color: #22c55e;
}

.workspace-new-form {
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.patch-card {
  padding: 0.8rem;
  border: 1px solid #93c5fd;
  border-radius: 0.5rem;
  background: #f8fafc;
  display: grid;
  gap: 0.55rem;
}

.code-block,
.code-textarea {
  width: 100%;
  margin: 0;
  padding: 0.65rem 0.8rem;
  border: 1px solid #4b5563;
  border-radius: 0.4rem;
  background: #0f172a;
  color: #f8fafc;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.45;
  overflow-x: auto;
}

.code-textarea:focus {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

button:disabled {
  background: #94a3b8;
  border-color: #94a3b8;
  color: #f8fafc;
  cursor: not-allowed;
}

/* ============================================================================
   Cowork 3-Column Dockable Canvas & Interactive Component Styles
   ============================================================================ */

.dockable-canvas-pane {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  background: #f8fafc;
  overflow: hidden;
  border-left: 1px solid #e2e8f0;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.75rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  min-height: 2.75rem;
  gap: 0.5rem;
}

.canvas-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
}

.canvas-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #64748b;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  white-space: nowrap;
}

.canvas-tab-btn:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.canvas-tab-btn.active {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.canvas-tab-pill {
  padding: 0.1rem 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
}

.canvas-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem;
}

.canvas-panel {
  display: none;
}

.canvas-panel.active {
  display: block;
}

.workspace-panel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* Inline Collapsible <thinking> Accordion */
.chat-thinking-accordion {
  margin: 0.5rem 0;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #f8fafc;
  overflow: hidden;
}

.chat-thinking-summary {
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  user-select: none;
  background: #f1f5f9;
}

.chat-thinking-summary:hover {
  background: #e2e8f0;
}

.thinking-icon {
  font-size: 0.95rem;
}

.thinking-title {
  font-weight: 700;
  color: #1e293b;
}

.thinking-meta {
  font-size: 0.72rem;
  color: #64748b;
  margin-left: auto;
}

.chat-thinking-body {
  padding: 0.75rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: #334155;
  white-space: pre-wrap;
  word-break: break-word;
  border-top: 1px solid #e2e8f0;
}

/* Inline Tool Execution Cards */
.chat-tool-card {
  margin: 0.5rem 0;
  border: 1px solid #93c5fd;
  border-radius: 0.5rem;
  background: #f0f9ff;
  padding: 0.75rem;
  display: grid;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.tool-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tool-title-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tool-icon {
  font-size: 0.9rem;
}

.tool-name {
  font-weight: 700;
  color: #0369a1;
}

.tool-status-pill {
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
}

.tool-status-complete {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.tool-badge {
  font-size: 0.7rem;
  color: #64748b;
}

.tool-card-section {
  display: grid;
  gap: 0.25rem;
}

.tool-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tool-code-block {
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 1px solid #bae6fd;
  border-radius: 0.35rem;
  background: #ffffff;
  color: #0f172a;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  overflow-x: auto;
  max-height: 12rem;
}

.tool-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.tool-action-btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #0284c7;
  background: #ffffff;
  border: 1px solid #7dd3fc;
  border-radius: 0.35rem;
  cursor: pointer;
}

.tool-action-btn:hover {
  background: #e0f2fe;
}

/* Feed Cards */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.feed-grid {
  display: grid;
  gap: 0.85rem;
}

.feed-card {
  padding: 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  background: #ffffff;
  display: grid;
  gap: 0.45rem;
}

.feed-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.feed-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
}

.feed-arxiv-badge {
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 0.3rem;
  background: #e0e7ff;
  color: #3730a3;
  white-space: nowrap;
}

.feed-authors {
  font-size: 0.78rem;
  color: #64748b;
}

.feed-abstract {
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.45;
}

.feed-hypothesis-box {
  padding: 0.5rem 0.65rem;
  border-left: 3px solid #1d4ed8;
  background: #f8fafc;
  font-size: 0.78rem;
  color: #1e293b;
  display: grid;
  gap: 0.35rem;
}

.feed-test-btn {
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #ffffff;
  background: #1d4ed8;
  border: 0;
  border-radius: 0.35rem;
  cursor: pointer;
  justify-self: start;
}

/* Weight Consolidation Runner */
.consolidation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.panel-description {
  font-size: 0.82rem;
  color: #475569;
  margin: 0 0 1rem 0;
}

.consolidation-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.progress-bar-container {
  width: 100%;
  margin-bottom: 1rem;
}

.progress-bar-fill {
  width: 100%;
  height: 0.65rem;
  border-radius: 999px;
}

.console-box {
  margin-top: 1rem;
  display: grid;
  gap: 0.35rem;
}

.console-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.console-log-stream {
  margin: 0;
  padding: 0.65rem;
  background: #0f172a;
  color: #38bdf8;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.4;
  border-radius: 0.4rem;
  max-height: 14rem;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Traces Tab */
.traces-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.traces-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* 3D Holographic Neural Viewport & WebGL Canvas */
#neural-3d-viewport,
.neural-3d-viewport {
  display: flex;
  flex-direction: column;
  background: #08090d;
  border: 1px solid #1e293b;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.neural-3d-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  background: #0b0e14;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.neural-3d-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.neural-3d-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e2e8f0;
  letter-spacing: 0.02em;
}

.neural-3d-status {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 0.25rem;
  background: rgba(30, 41, 59, 0.75);
  border: 1px solid #334155;
  color: #38bdf8;
}

.neural-3d-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.neural-btn {
  width: auto;
  min-height: auto;
  margin: 0;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 0.25rem 0.55rem;
  border-radius: 0.3rem;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.neural-btn:hover {
  background: #334155;
  border-color: #475569;
}

.neural-btn:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.neural-cognitive-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  background: #0d111a;
  border-bottom: 1px solid #1e293b;
}

.cognitive-stage-pill {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.28rem 0.45rem;
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid #1e293b;
  min-width: 75px;
  flex: 1 1 80px;
}

.cognitive-stage-pill.active {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(14, 116, 144, 0.16);
}

.cognitive-stage-pill .stage-step {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cognitive-stage-pill code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 600;
  color: #38bdf8;
  background: transparent;
  border: 0;
  padding: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neural-3d-canvas-wrap {
  position: relative;
  width: 100%;
  min-height: 250px;
  max-height: 520px;
  height: 415px;
  background: radial-gradient(ellipse at 50% 46%, #0d1629 0%, #06080e 78%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.neural-3d-canvas {
  width: 100%;
  height: 100%;
  min-width: 200px;
  min-height: 200px;
  display: block;
  touch-action: none;
  cursor: grab;
}

.neural-3d-canvas:active {
  cursor: grabbing;
}

.neural-3d-canvas:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: -3px;
}

.neural-3d-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 4;
}

.neural-label-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 0.16rem 0.42rem;
  border-radius: 0.3rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.63rem;
  line-height: 1.25;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(56, 189, 248, 0.38);
  background: rgba(8, 12, 22, 0.78);
  color: #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  transition: opacity 0.12s ease;
}

.neural-label-pin .pin-title {
  display: block;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #7dd3fc;
}

.neural-label-pin .pin-sub {
  display: block;
  font-size: 0.59rem;
  color: #cbd5e1;
}

.neural-label-pin.pin-anatomy {
  border-color: rgba(56, 189, 248, 0.28);
  background: rgba(8, 12, 22, 0.72);
  padding: 0.1rem 0.38rem;
  transform: translate(-50%, -50%);
  border-radius: 999px;
}

.neural-label-pin.pin-anatomy .pin-title {
  color: #bae6fd;
  font-size: 0.56rem;
}

.neural-label-pin.pin-anatomy .pin-sub {
  display: none;
}

.neural-label-pin.pin-hop {
  border-color: #10b981;
  background: rgba(6, 36, 28, 0.88);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.45);
  transform: none;
  z-index: 6;
}

.neural-label-pin.pin-hop .pin-title {
  color: #6ee7b7;
  font-size: 0.67rem;
}

.neural-label-pin.pin-hop.pin-firing {
  border-color: #fbbf24;
  background: rgba(66, 32, 6, 0.92);
  box-shadow: 0 0 18px rgba(251, 191, 36, 0.75);
}

.neural-label-pin.pin-hop.pin-firing .pin-title {
  color: #fde68a;
}

.neural-label-pin.pin-flock {
  border-color: rgba(251, 191, 36, 0.55);
  background: rgba(45, 28, 6, 0.78);
}

.neural-label-pin.pin-flock .pin-title {
  color: #fcd34d;
}

.neural-label-pin.pin-engram {
  border-color: rgba(192, 132, 252, 0.6);
  background: rgba(38, 16, 62, 0.82);
}

.neural-label-pin.pin-engram .pin-title {
  color: #e9d5ff;
}

.pin-charge-track {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 2px;
  margin-top: 2px;
  overflow: hidden;
}

.pin-charge-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #fbbf24);
  border-radius: 2px;
}

.neural-ospf-ticker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.36rem 0.75rem;
  background: #090d16;
  border-top: 1px solid #1e293b;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.68rem;
  color: #cbd5e1;
  overflow-x: auto;
  white-space: nowrap;
}

.ospf-ticker-badge {
  padding: 0.1rem 0.38rem;
  border-radius: 0.25rem;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.ospf-ticker-route {
  color: #e2e8f0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.neural-3d-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.1rem;
  padding: 0.5rem 0.85rem;
  background: #0b0e14;
  border-top: 1px solid #1e293b;
  font-size: 0.73rem;
  color: #94a3b8;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-swatch {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-clifford {
  background: #06b6d4;
  box-shadow: 0 0 6px #06b6d4;
}

.legend-icosian {
  background: #fbbf24;
  box-shadow: 0 0 6px #fbbf24;
}

.legend-layers {
  background: #3b82f6;
  box-shadow: 0 0 6px #3b82f6;
}

.legend-synapse {
  background: #a855f7;
  box-shadow: 0 0 6px #a855f7;
}

.legend-trajectory {
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.legend-starfield {
  background: #6366f1;
  box-shadow: 0 0 4px #6366f1;
}


.trace-waterfall-tree {
  border: 1px solid #cbd5e1;
  border-radius: 0.4rem;
  background: #ffffff;
  padding: 0.75rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  max-height: 28rem;
  overflow-y: auto;
}

.trace-waterfall-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.75rem;
  color: #475569;
}

.trace-meta-label {
  font-weight: 600;
  color: #0f172a;
}

.trace-select-wrapper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.trace-select-dropdown {
  font-family: inherit;
  font-size: 0.75rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.25rem;
  background: #ffffff;
  color: #0f172a;
}

.trace-select-dropdown:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.trace-spans-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.trace-node {
  border: 1px solid #e2e8f0;
  border-radius: 0.35rem;
  background: #f8fafc;
  overflow: hidden;
}

.trace-node-header {
  padding: 0.4rem 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  background: #ffffff;
  transition: background 0.15s ease;
  user-select: none;
}

.trace-node-header:hover {
  background: #f1f5f9;
}

.trace-node-header:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.trace-toggle-icon {
  font-size: 0.7rem;
  color: #64748b;
  width: 0.8rem;
}

.span-pill {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.pill-turn {
  background: #ede9fe;
  color: #4338ca;
  border: 1px solid #c4b5fd;
}

.pill-tokenize {
  background: #e0e7ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.pill-trunk {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.pill-routing {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.pill-decode {
  background: #cffafe;
  color: #0e7490;
  border: 1px solid #a5f3fc;
}

.pill-generic {
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.trace-timing-badge {
  font-size: 0.68rem;
  color: #64748b;
  white-space: nowrap;
}

.trace-node-summary {
  flex: 1;
  font-size: 0.72rem;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.span-link-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  background: #faf5ff;
  color: #6b21a8;
  border: 1px solid #e9d5ff;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.span-link-badge:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.trace-node-body {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.trace-section-title {
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
}

.clifford-grade-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  background: #ffffff;
  padding: 0.4rem;
  border-radius: 0.25rem;
  border: 1px solid #e2e8f0;
}

.clifford-grade-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #f1f5f9;
  padding: 0.2rem;
  border-radius: 0.2rem;
}

.grade-label {
  font-size: 0.65rem;
  color: #64748b;
}

.grade-val {
  font-weight: 700;
  color: #0f172a;
}

.trace-candidates-table,
.trace-attr-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.25rem;
}

.trace-candidates-table th,
.trace-candidates-table td,
.trace-attr-table td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid var(--border-hairline);
  text-align: left;
}

.trace-candidates-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.68rem;
}

.attr-key {
  font-weight: 600;
  color: var(--text-muted);
  width: 35%;
}

.attr-val {
  color: var(--text-primary);
  word-break: break-all;
}

.trace-provenance-card {
  background: #fdf4ff;
  border: 1px solid #f0abfc;
  border-radius: 0.25rem;
  padding: 0.4rem 0.6rem;
}

.prov-link-item {
  font-size: 0.72rem;
  color: #701a75;
}

.prov-type {
  font-weight: 700;
  text-transform: capitalize;
}

.prov-tag {
  font-size: 0.65rem;
  font-weight: 600;
  color: #047857;
  background: #ecfdf5;
  padding: 0.05rem 0.3rem;
  border-radius: 0.2rem;
  border: 1px solid #a7f3d0;
}

.trace-empty-notice {
  padding: 1.5rem;
  text-align: center;
  color: #64748b;
  font-style: italic;
}

/* Sidebar Thread Management */
.sidebar-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.sidebar-action-icon-btn {
  background: transparent;
  border: 0;
  color: #94a3b8;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 0.25rem;
}

.sidebar-action-icon-btn:hover {
  color: #ffffff;
  background: #1e293b;
}

.thread-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  border-radius: 0.375rem;
  padding: 0.15rem 0.25rem;
}

.thread-item:hover {
  background: #1e293b;
}

.thread-item-btn {
  flex: 1;
  text-align: left;
  background: transparent;
  border: 0;
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 0.3rem 0.4rem;
  border-radius: 0.25rem;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-item-active .thread-item-btn {
  color: #ffffff;
  font-weight: 700;
  background: #1e293b;
}

.thread-delete-btn {
  background: transparent;
  border: 0;
  color: #64748b;
  font-size: 0.85rem;
  padding: 0.2rem 0.35rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

.thread-delete-btn:hover {
  color: #ef4444;
  background: #334155;
}

/* ============================================================================
   LexLean-R4 / PrismPM Design System & Claude Cowork Studio Polish (v4)
   Conforms strictly to prismpm/browser-provenance/1 & WCAG 2.1 AA / 2.2 tokens
   ============================================================================ */

:root {
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --bg-canvas: #121214;
  --bg-surface: #1a1a1d;
  --bg-subtle: #222226;
  --bg-hover: #2a2a30;
  --bg-muted: #34343c;
  --sidebar-bg: #141413;
  --sidebar-surface: #1e1e1c;
  --sidebar-hover: #292825;
  --sidebar-border: #2a2926;
  --text-primary: #f4f4f5;
  --text-main: #f4f4f5;
  --text-secondary: #d4d4d8;
  --text-muted: #9ca3af;
  --border-hairline: #2a2a2e;
  --border-subtle: #3a3a42;
  --border-strong: #4f4f5a;
  --topbar-bg: rgba(18, 18, 20, 0.94);
  --accent-primary: #2563eb;
  --accent-primary-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.15);
  --accent-border: #3b82f6;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 14px -2px rgba(0, 0, 0, 0.4);
  --shadow-composer: 0 8px 28px -4px rgba(0, 0, 0, 0.5);
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --transition-fast: 140ms cubic-bezier(0.16, 1, 0.3, 1);
  --code-bg: #222226;
  --code-text: #f4f4f5;
  --code-border: #3a3a42;
  --code-block-bg: #121214;
  --code-block-header: #1a1a1d;
  --code-block-text: #f4f4f5;
  --code-block-border: #2a2a2e;
}

/* Subtle Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.28);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.48);
}

body {
  background: var(--bg-canvas);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main,
main.cowork-layout {
  background: var(--bg-canvas);
  color: var(--text-primary);
}

main:has(#dockable-canvas-pane[hidden]),
main.canvas-drawer-closed {
  grid-template-columns: 16rem minmax(0, 1fr);
}

main.sidebar-collapsed {
  grid-template-columns: minmax(360px, 1fr) minmax(440px, 1.25fr);
}

main.sidebar-collapsed:has(#dockable-canvas-pane[hidden]),
main.sidebar-collapsed.canvas-drawer-closed {
  grid-template-columns: minmax(0, 1fr);
}

main.sidebar-collapsed .gpt-sidebar {
  display: none;
}

/* Obsidian-Ink Left Sidebar */
.gpt-sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  padding: 0.85rem 0.7rem;
  gap: 0.85rem;
}

.brand-badge {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  border-radius: 0.5rem;
}

.new-chat-btn {
  background: var(--sidebar-surface);
  color: #f8fafc;
  border: 1px solid #33322e;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.new-chat-btn:hover {
  background: var(--sidebar-hover);
  border-color: #4b5563;
}

.thread-item {
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast);
}

.thread-item:hover {
  background: var(--sidebar-surface);
}

.thread-item-active,
.thread-item-active .thread-item-btn {
  background: var(--sidebar-hover);
  color: #ffffff;
}

.sidebar-collapsible {
  border-top: 1px solid var(--sidebar-border);
  padding-top: 0.55rem;
}

.sidebar-summary {
  cursor: pointer;
  user-select: none;
  margin-bottom: 0.4rem;
  color: #a1a1aa;
  transition: color var(--transition-fast);
}

.sidebar-summary:hover {
  color: #f4f4f5;
}

.sidebar-surfaces-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.sidebar-surfaces-grid .sidebar-tool-btn {
  min-height: 2rem;
  padding: 0.3rem 0.45rem;
  font-size: 0.72rem;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.sidebar-surfaces-grid .sidebar-tool-btn:hover {
  background: var(--sidebar-hover);
  border-color: #52525b;
}

.sidebar-surfaces-grid .sidebar-pill {
  font-size: 0.62rem;
  padding: 0.05rem 0.32rem;
  background: rgba(59, 130, 246, 0.14);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

/* Warm Stone Center Pane & Translucent Header */
.gpt-main-pane {
  background: var(--bg-canvas);
}

.gpt-topbar {
  padding: 0.38rem 0.9rem;
  gap: 0.4rem;
  flex-wrap: nowrap;
  background: var(--topbar-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-hairline);
}

.model-selector {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  min-width: 0;
  flex-shrink: 1;
}

.model-selector h1 {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
}

.model-tag {
  font-size: 0.69rem;
  font-weight: 600;
  color: #1e3a8a;
  background: rgba(219, 234, 254, 0.65);
  border: 1px solid #bfdbfe;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.25rem;
  overflow-x: auto;
  min-width: max-content;
  flex-shrink: 0;
}

.topbar-btn {
  width: auto;
  min-height: 1.65rem;
  padding: 0.18rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.topbar-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.topbar-btn-accent {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
  font-weight: 600;
}

.topbar-btn-accent:hover {
  background: #dbeafe;
  border-color: #60a5fa;
  color: #1e3a8a;
}

.topbar-context-pill {
  font-size: 0.69rem;
  padding: 0.12rem 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Slim 1-Line Context Strip */
.cowork-agent-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0.24rem 0.9rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
  font-size: 0.7rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.status-strip-items {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.4) transparent;
}

.status-strip-items::-webkit-scrollbar {
  height: 3px;
}

.status-strip-items::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
}

.status-strip-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-strip-summary {
  color: var(--text-muted);
  max-width: 7rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-strip-close-btn {
  width: auto;
  min-height: auto;
  padding: 0.1rem 0.4rem;
  font-size: 0.9rem;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.status-strip-close-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

/* Chat Stream & Message Cards */
.chat-transcript {
  background: var(--bg-canvas);
  padding: 1.75rem 1.5rem 2.25rem;
  gap: 1.35rem;
}

.chat-turn {
  width: min(48rem, 100%);
  margin: 0 auto;
  gap: 0.45rem;
}

.chat-turn-user .chat-turn-body {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-hairline);
  padding: 0.75rem 1.1rem;
  border-radius: 1.15rem 1.15rem 0.3rem 1.15rem;
  box-shadow: var(--shadow-sm);
}

.chat-turn-assistant {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.chat-turn-meta {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

/* Collapsible <thinking> & Tool Accordions */
.chat-thinking-accordion {
  margin: 0.35rem 0;
  border: 1px solid var(--border-hairline);
  border-left: 3px solid #6366f1;
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  overflow: hidden;
}

.chat-thinking-summary {
  padding: 0.4rem 0.7rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  transition: background var(--transition-fast);
}

.chat-thinking-summary:hover {
  background: var(--bg-muted);
}

.chat-thinking-content {
  padding: 0.55rem 0.75rem;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--text-secondary);
  background: var(--bg-canvas);
  border-top: 1px solid var(--border-hairline);
  white-space: pre-wrap;
}

.chat-tool-card {
  margin: 0.35rem 0;
  border: 1px solid var(--border-hairline);
  border-left: 3px solid #0284c7;
  border-radius: var(--radius-sm);
  background: var(--bg-canvas);
  padding: 0.6rem 0.75rem;
}

.chat-tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tool-status {
  font-size: 0.68rem;
  font-weight: 700;
  color: #15803d;
  background: #dcfce7;
  border: 1px solid #86efac;
  padding: 0.06rem 0.38rem;
  border-radius: 999px;
}

.chat-tool-args {
  margin: 0;
  padding: 0.4rem 0.6rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-primary);
  overflow-x: auto;
}

/* Ultra-Compact Single-Line Pill Composer Bar (v6) */
.gpt-composer-dock {
  width: min(48rem, 100%);
  padding: 0.3rem 1rem 0.55rem;
  background: transparent;
}

.composer-shell {
  position: relative;
}

.gpt-composer-form,
.gpt-composer-form.ts-rich-composer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.45rem 0.65rem 0.4rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md, 0.75rem);
  background: var(--bg-surface);
  box-shadow: var(--shadow-composer);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gpt-composer-form:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.12), var(--shadow-composer);
}

.composer-inline-left,
.composer-inline-right,
.composer-send-bar-left,
.composer-send-bar-right {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.composer-field {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
}

#claude-chat-input {
  width: 100%;
  height: 1.5rem;
  min-height: 1.5rem;
  max-height: 8rem;
  padding: 0 0.15rem;
  margin: 0;
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5rem;
  border: 0;
  background: transparent;
  resize: none;
  color: var(--text-primary);
  box-sizing: border-box;
}

#claude-chat-input:focus {
  outline: none;
}

/* Dedicated Send Bar directly beneath input */
.composer-send-bar {
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.3rem;
  border-top: 1px solid var(--border-hairline);
  margin-top: 0.15rem;
}

.composer-action-btn {
  width: 1.5rem;
  height: 1.5rem;
  min-height: 1.5rem;
  margin: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.95rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.composer-action-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border-color: #93c5fd;
}

.composer-action-btn:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
  color: var(--text-primary);
}

.composer-model-select,
select.composer-model-select {
  width: auto;
  max-width: 10.5rem;
  min-height: 1.55rem;
  height: 1.55rem;
  margin: 0;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.composer-model-select:hover {
  border-color: #93c5fd;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.composer-model-select:focus-visible {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
  color: var(--text-primary);
}

.composer-attachments-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0;
  border: 0;
}

.composer-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.18rem;
  padding: 0.06rem 0.35rem;
  border-radius: 999px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.67rem;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-primary);
  border: 1px solid var(--accent-border);
  white-space: nowrap;
}

.composer-chip-arxiv {
  background: #f5f3ff;
  color: #5b21b6;
  border-color: #ddd6fe;
}

.composer-chip-claim {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.composer-chip-remove {
  width: auto;
  min-height: auto;
  padding: 0 0.1rem;
  font-size: 0.75rem;
  line-height: 1;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
}

.composer-mode-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  padding: 0.08rem;
  gap: 0.05rem;
}

.composer-mode-btn {
  width: auto;
  min-height: auto;
  padding: 0.1rem 0.36rem;
  font-size: 0.66rem;
  font-weight: 600;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
}

.composer-mode-btn:hover {
  color: var(--text-primary);
}

.composer-mode-btn.active {
  color: var(--accent-primary);
  background: var(--bg-surface);
  border-color: var(--border-hairline);
  box-shadow: var(--shadow-sm);
}

.composer-trigger-pill {
  width: 1.45rem;
  height: 1.45rem;
  min-height: 1.45rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  border-radius: 999px;
  cursor: pointer;
}

.composer-trigger-pill:hover {
  background: var(--accent-soft);
  color: var(--accent-primary);
  border-color: #93c5fd;
}

.composer-token-badge {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0 0.25rem;
}

.composer-send-btn {
  width: 1.75rem;
  height: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  display: inline-grid;
  place-items: center;
  font-size: 0.85rem;
  border-radius: 999px;
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(29, 78, 216, 0.25);
}

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

/* Slash Command & @Context Autocomplete Menu */
.composer-autocomplete-menu {
  position: absolute;
  bottom: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-composer);
  padding: 0.35rem;
  max-height: 15rem;
  overflow-y: auto;
  display: grid;
  gap: 0.15rem;
}

.composer-ac-header {
  padding: 0.25rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-hairline);
  margin-bottom: 0.15rem;
}

.composer-ac-item {
  width: 100%;
  min-height: auto;
  padding: 0.38rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  cursor: pointer;
}

.composer-ac-item:hover,
.composer-ac-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.composer-ac-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.composer-ac-cmd {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--accent-primary);
  background: rgba(29, 78, 216, 0.08);
  padding: 0.08rem 0.38rem;
  border-radius: 0.25rem;
  white-space: nowrap;
}

.composer-ac-title {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-ac-badge {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.08rem 0.38rem;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  white-space: nowrap;
}

/* Right-Hand Dockable Canvas Drawer */
.dockable-canvas-pane {
  background: var(--bg-canvas);
  border-left: 1px solid var(--border-strong);
  box-shadow: -6px 0 24px -8px rgba(17, 24, 39, 0.07);
}

.canvas-header {
  padding: 0.5rem 0.85rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
}

.canvas-tabs {
  background: var(--bg-subtle);
  padding: 0.15rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-hairline);
  gap: 0.15rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  min-width: 0;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

.canvas-tabs::-webkit-scrollbar {
  height: 4px;
}

.canvas-tabs::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

.canvas-tabs .canvas-tab-pill {
  display: none;
}

.canvas-tab-btn {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 0.24rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

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

.canvas-tab-btn.active {
  color: var(--text-primary);
  background: var(--bg-surface);
  border-color: var(--border-hairline);
  box-shadow: var(--shadow-sm);
}

.canvas-close-btn {
  width: auto;
  min-height: 1.8rem;
  padding: 0.22rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.canvas-close-btn:hover {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}

/* Studio Panels, Feed Cards & Frontier Ledger Cards */
.studio-panel,
.feed-card,
.frontier-ledger-card,
.metric-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.feed-card {
  padding: 0.95rem 1.05rem;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.feed-card:hover,
.frontier-ledger-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.agent-status-code {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.06rem 0.35rem;
  border-radius: 0.25rem;
}

.agent-mini-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.agent-mini-btn {
  width: auto;
  min-height: auto;
  padding: 0.12rem 0.38rem;
  font-size: 0.68rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.agent-mini-btn-active {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}

.agent-mini-btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary-hover);
  color: #ffffff;
}

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

.chat-meta-otel-pill {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.67rem;
  font-weight: 600;
  color: var(--accent-primary);
  background: var(--accent-soft);
  border: 1px solid var(--accent-border);
  padding: 0.08rem 0.42rem;
  border-radius: 999px;
}

.chat-otel-footer {
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.chat-otel-info {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 0.69rem;
  color: var(--text-muted);
}

.chat-otel-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.frontier-ledger-section {
  display: grid;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}

.frontier-summary-banner {
  background: var(--bg-surface);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 0.95rem;
  box-shadow: var(--shadow-sm);
}

.frontier-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  color: var(--accent-primary);
}

.frontier-banner-desc {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.frontier-summary-banner .paper-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#verdant-synthesis-kpi-grid {
  margin-bottom: 0.75rem;
}

.frontier-claims-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.frontier-ledger-card {
  padding: 0.65rem 0.8rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.45rem;
}

.frontier-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.74rem;
}

.frontier-card-desc {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.paper-test-btn {
  width: auto;
  min-height: auto;
  padding: 0.28rem 0.65rem;
  font-size: 0.74rem;
  border-radius: var(--radius-sm);
}

.paper-consolidate-btn {
  background: var(--accent-primary);
  border-color: var(--accent-primary-hover);
  color: #ffffff;
}

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

.api-harness-box {
  margin-bottom: 1rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   R1, R2, R3 Integrated Web Overhaul Styles:
   LaTeX Math AST, Markdown Format, In-Browser Terminal, Navigation & Panels
   ========================================================================== */

/* Terminal Emulator: lexlean-sh */
.terminal-container {
  display: flex;
  flex-direction: column;
  background: #0d1117;
  color: #c9d1d9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  border: 1px solid #30363d;
  border-radius: var(--radius-md);
  height: 100%;
  min-height: 420px;
  overflow: hidden;
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  background: #161b22;
  border-bottom: 1px solid #30363d;
}

.terminal-title {
  display: flex;
  align-items: center;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.term-red { background: #ef4444; }
.term-yellow { background: #f59e0b; }
.term-green { background: #10b981; }

.terminal-name {
  font-size: 0.75rem;
  color: #8b949e;
  margin-left: 0.5rem;
  font-weight: 600;
}

.terminal-actions {
  display: flex;
  gap: 0.35rem;
}

.btn-terminal-action {
  padding: 0.2rem 0.5rem;
  font-size: 0.75rem;
  font-family: inherit;
  border: 1px solid #30363d;
  border-radius: 4px;
  background: #21262d;
  color: #c9d1d9;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-terminal-action:hover {
  background: #30363d;
}

.btn-terminal-action:focus {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

.terminal-output {
  flex: 1;
  padding: 0.75rem;
  overflow-y: auto;
  font-size: 0.8125rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
}

.terminal-form {
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  background: #161b22;
  border-top: 1px solid #30363d;
  gap: 0.5rem;
}

.terminal-prompt {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #58a6ff;
  white-space: nowrap;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #f0f6fc;
  font-family: inherit;
  font-size: 0.8125rem;
}

.terminal-input:focus {
  outline: 3px solid #1d4ed8;
  outline-offset: 2px;
}

/* ANSI Color Decoder Spans */
.ansi-bold { font-weight: 700; }
.ansi-dim { opacity: 0.7; }
.ansi-italic { font-style: italic; }
.ansi-underline { text-decoration: underline; }
.ansi-red { color: #f87171; }
.ansi-green { color: #4ade80; }
.ansi-yellow { color: #facc15; }
.ansi-blue { color: #60a5fa; }
.ansi-magenta { color: #c084fc; }
.ansi-cyan { color: #38bdf8; }
.ansi-white { color: #f3f4f6; }

/* Pure In-Browser LaTeX Math AST Styles */
.latex-math-block {
  display: block;
  overflow-x: auto;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
  text-align: center;
  font-family: "Latin Modern Math", "Cambria Math", "STIX Two Math", serif;
  font-size: 1.05rem;
}

.latex-math-inline {
  display: inline-flex;
  align-items: baseline;
  font-family: "Latin Modern Math", "Cambria Math", "STIX Two Math", serif;
  font-size: 0.95em;
  padding: 0 0.15em;
}

.latex-frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: 0.9em;
  padding: 0 0.2em;
}

.latex-num {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.latex-denom {
  padding-top: 1px;
}

.latex-sqrt {
  display: inline-flex;
  align-items: stretch;
  vertical-align: middle;
}

.latex-radical {
  font-size: 1.1em;
  margin-right: -0.1em;
}

.latex-sqrt-body {
  border-top: 1px solid currentColor;
  padding: 0 0.2em;
}

.latex-script-wrap {
  display: inline-flex;
  align-items: center;
  vertical-align: baseline;
}

.latex-subsup,
.latex-scripts {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  font-size: 0.72em;
  line-height: 1.05;
  margin-left: 0.08em;
}

.latex-sup {
  transform: translateY(-0.35em);
}

.latex-sub {
  transform: translateY(0.28em);
}

.latex-scripts:has(.latex-sup):has(.latex-sub) .latex-sup {
  transform: translateY(-0.1em);
}

.latex-scripts:has(.latex-sup):has(.latex-sub) .latex-sub {
  transform: translateY(0.1em);
}

.latex-matrix {
  display: inline-table;
  vertical-align: middle;
  border-left: 2px solid currentColor;
  border-right: 2px solid currentColor;
  border-radius: 4px;
  padding: 0.1em 0.3em;
  margin: 0 0.2em;
}

.latex-matrix-row {
  display: table-row;
}

.latex-matrix-cell {
  display: table-cell;
  padding: 0.1em 0.35em;
  text-align: center;
}

.latex-bigop {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin: 0 0.18em;
}

.latex-op-symbol {
  font-size: 1.35em;
  line-height: 1;
}

.latex-limits {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  font-size: 0.68em;
  line-height: 1.05;
  margin-left: 0.1em;
  text-align: left;
}

.latex-symbol,
.latex-greek {
  font-style: italic;
}

/* Markdown Formatter Enhancements */
.chat-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
  font-size: 0.875rem;
}

.chat-table th,
.chat-table td {
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

.chat-table th {
  background: var(--bg-hover);
  font-weight: 600;
}

.chat-blockquote {
  border-left: 4px solid var(--accent-primary);
  margin: 0.75rem 0;
  padding: 0.5rem 1rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.chat-task-list {
  list-style: none;
  padding-left: 0;
  margin: 0.5rem 0;
}

.chat-task-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.chat-task-checkbox {
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.chat-hr {
  border: none;
  border-top: 1px solid var(--border-subtle);
  margin: 1rem 0;
}

/* Sidebar Views Navigation */
.sidebar-views-nav {
  display: flex;
  gap: 0.22rem;
  padding: 0.28rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-surface);
}

.sidebar-view-btn {
  flex: 1;
  min-height: 1.75rem;
  margin: 0;
  padding: 0.28rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}

.sidebar-view-btn:hover {
  background: var(--sidebar-hover);
  color: #f8fafc;
}

.sidebar-view-btn.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 1px 4px rgba(37, 99, 235, 0.35);
}

.sidebar-view-btn:focus {
  outline: 3px solid #60a5fa;
  outline-offset: 2px;
}

.sidebar-view-panel {
  display: none;
}

.sidebar-view-panel.active {
  display: block;
}

/* Planning DAG & Checklist */
.plan-dag-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  margin-top: 0.45rem;
}

.dag-node {
  width: 100%;
  padding: 0.38rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--sidebar-border);
  background: #18181b;
  color: #d4d4d8;
}

.dag-node.dag-done {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(20, 83, 45, 0.35);
  color: #86efac;
}

.dag-node.dag-active {
  border-color: rgba(59, 130, 246, 0.65);
  background: rgba(30, 58, 138, 0.45);
  color: #93c5fd;
  font-weight: 600;
}

.dag-node.dag-pending {
  color: #a1a1aa;
}

.dag-arrow {
  font-size: 0.72rem;
  color: #71717a;
}

.plan-task-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.5rem;
  font-size: 0.76rem;
}

.plan-task-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0;
  color: #d4d4d8;
}

.plan-task-item.done {
  color: #86efac;
}

.plan-task-item.active {
  color: #93c5fd;
  font-weight: 600;
}

/* Subagent Pool & Review */
.pool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.pool-card {
  padding: 0.45rem;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  background: var(--sidebar-surface);
}

.pool-card-active {
  border-color: #3b82f6;
  background: rgba(30, 58, 138, 0.32);
}

.pool-card-role {
  font-weight: 600;
  font-size: 0.76rem;
  color: #f8fafc;
}

.pool-card-status {
  font-size: 0.68rem;
  color: #93c5fd;
  margin: 0.12rem 0;
}

.pool-card-detail {
  font-size: 0.66rem;
  color: #a1a1aa;
}

.pool-review-card {
  padding: 0.65rem;
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  background: var(--sidebar-surface);
  margin-top: 0.45rem;
}

.pool-review-file {
  font-size: 0.78rem;
  font-weight: 600;
  color: #f8fafc;
}

.pool-review-stats {
  font-size: 0.72rem;
  color: #86efac;
  margin: 0.2rem 0 0.45rem;
}

.pool-review-actions {
  display: flex;
  gap: 0.4rem;
}

.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  border-radius: 4px;
  cursor: pointer;
}

.workspace-summary-box {
  padding: 0.65rem;
  background: var(--sidebar-surface);
  border: 1px solid var(--sidebar-border);
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  line-height: 1.55;
  color: #e4e4e7;
  margin-top: 0.45rem;
}

.git-branch-pill {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  background: #e0e7ff;
  color: #3730a3;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
}

.summary-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Inspector, MCP, Customizations Panels */
.inspector-panel-container,
.mcp-panel-container,
.customizations-panel-container {
  padding: 1rem;
  overflow-y: auto;
  height: 100%;
}

.inspector-section {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
}

.inspector-section h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.inspector-sparkline-grid {
  display: flex;
  gap: 2px;
  align-items: flex-end;
  height: 48px;
  background: #111827;
  padding: 4px;
  border-radius: 4px;
}

.inspector-clifford-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
}

.grade-cell {
  padding: 0.4rem;
  background: var(--bg-hover);
  border-radius: 4px;
  font-size: 0.75rem;
  text-align: center;
}

.grade-title {
  display: block;
  font-weight: 600;
  color: var(--text-main);
}

.grade-dim {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.inspector-icosian-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.inspector-e8-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
}

.mcp-tools-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mcp-tool-card {
  padding: 0.6rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
}

.mcp-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
}

.mcp-badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 4px;
  font-weight: 600;
}

.mcp-tool-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.mcp-audit-log {
  max-height: 160px;
  overflow-y: auto;
  padding: 0.5rem;
  background: #111827;
  color: #a7f3d0;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
}

.mcp-log-item {
  padding: 0.15rem 0;
}

.mcp-log-info {
  color: #a7f3d0;
}

.mcp-log-notice {
  color: #93c5fd;
}

.mcp-log-warning {
  color: #fcd34d;
}

.mcp-log-critical {
  color: #f87171;
  font-weight: 700;
}

.mcp-audit-actions {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.5rem;
}

.inspector-sparkline-grid {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 64px;
  background: var(--bg-surface, #1e293b);
  padding: 6px;
  border-radius: var(--radius-sm, 4px);
  border: 1px solid var(--border-subtle, #334155);
}

.sparkline-bar {
  flex: 1;
  background: #38bdf8;
  border-radius: 1px;
  min-height: 4px;
  transition: height 0.15s ease, background 0.15s ease;
}

.sparkline-bar:hover {
  background: #0284c7;
}

.sparkline-bar-high {
  background: #a855f7;
}

.sparkline-bar-high:hover {
  background: #9333ea;
}

.icosian-card {
  padding: 0.35rem 0.5rem;
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.72rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.icosian-card-dominant {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.icosian-card-title {
  font-weight: 700;
  color: var(--text-main, #f8fafc);
}

.icosian-card-dominant .icosian-card-title {
  color: #fbbf24;
}

.icosian-card-hopf {
  font-family: monospace;
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
}

.e8-cell {
  background: var(--bg-surface, #1e293b);
  border: 1px solid var(--border-subtle, #334155);
  border-radius: 2px;
  font-size: 0.65rem;
  font-family: monospace;
  text-align: center;
  padding: 0.25rem 0.1rem;
  color: var(--text-muted, #94a3b8);
}

.e8-cell-winner {
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
  border-color: #059669;
}

body.density-compact {
  font-size: 0.8rem;
}

body.density-compact .gpt-topbar {
  padding: 0.22rem 0.65rem;
  min-height: 2.15rem;
}

body.density-compact .chat-turn {
  padding: 0.4rem 0.65rem;
  margin-bottom: 0.4rem;
}

body.density-compact .chat-turn-body {
  font-size: 0.8125rem;
  line-height: 1.4;
}

body.density-compact .chat-turn-meta {
  font-size: 0.68rem;
  padding: 0.12rem 0;
}

body.density-compact .thread-item-btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
}

body.density-compact .sidebar-tool-btn {
  min-height: 1.6rem;
  padding: 0.15rem 0.4rem;
  font-size: 0.72rem;
}

body.density-compact .canvas-tab-btn {
  padding: 0.28rem 0.5rem;
  font-size: 0.72rem;
}

body.density-compact .canvas-panel {
  padding: 0.45rem 0.6rem;
}

body.density-compact .gpt-composer-card {
  padding: 0.35rem 0.55rem;
}

body.density-compact .agent-card,
body.density-compact .pool-card {
  padding: 0.35rem 0.5rem;
}

.dropzone-active {
  outline: 3px dashed #3b82f6 !important;
  outline-offset: -3px;
  background: rgba(59, 130, 246, 0.05) !important;
}

body.theme-warm-light {
  color: #111827;
  --bg-canvas: #faf9f5;
  --bg-surface: #ffffff;
  --bg-subtle: #f3f1ea;
  --bg-hover: #f3f1ea;
  --bg-muted: #eae6dc;
  --sidebar-bg: #141413;
  --sidebar-surface: #1e1e1c;
  --sidebar-hover: #292825;
  --sidebar-border: #2a2926;
  --text-primary: #111827;
  --text-main: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --border-hairline: #e5e2d9;
  --border-subtle: #e5e2d9;
  --border-strong: #d1cdc0;
  --topbar-bg: rgba(250, 249, 245, 0.94);
  --accent-primary: #1d4ed8;
  --accent-primary-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-border: #bfdbfe;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(17, 24, 39, 0.06), 0 1px 3px rgba(17, 24, 39, 0.04);
  --shadow-composer: 0 8px 28px -4px rgba(17, 24, 39, 0.08), 0 2px 6px rgba(17, 24, 39, 0.04);
  --code-bg: #f3f1ea;
  --code-text: #111827;
  --code-border: #e5e2d9;
  --code-block-bg: #faf9f5;
  --code-block-header: #f3f1ea;
  --code-block-text: #111827;
  --code-block-border: #e5e2d9;
}

@media (max-width: 64rem) {
  main,
  main.cowork-layout,
  main.canvas-drawer-closed {
    grid-template-columns: 1fr;
  }
  .gpt-sidebar {
    display: none;
  }
  .workspace-modal-grid,
  .frontier-claims-grid {
    grid-template-columns: 1fr;
  }
}

.diff-toolbar-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.table-action-btn.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1e40af;
}

.diff-file-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.diff-file-pill {
  width: auto;
  min-height: 1.75rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.74rem;
  font-weight: 600;
  font-family: var(--font-mono);
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 0.35rem;
  cursor: pointer;
}

.diff-file-pill.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #60a5fa;
}

body.theme-warm-light .diff-file-pill {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

body.theme-warm-light .diff-file-pill.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #1e40af;
}

.diff-colored-block {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 0.6rem;
  overflow-x: auto;
}

.diff-line {
  display: block;
  padding: 0.08rem 0.45rem;
  border-radius: 0.2rem;
  white-space: pre;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.4;
}

.diff-line-add {
  background: #064e3b;
  color: #ecfdf5;
  border-left: 3px solid #10b981;
}

.diff-line-del {
  background: #7f1d1d;
  color: #fef2f2;
  border-left: 3px solid #ef4444;
}

.diff-line-hunk {
  background: #1e3a8a;
  color: #eff6ff;
  border-left: 3px solid #60a5fa;
  font-weight: 600;
}

.diff-line-ctx {
  color: inherit;
}

body.theme-warm-light .diff-line-add {
  background: #dcfce7;
  color: #064e3b;
  border-left-color: #16a34a;
}

body.theme-warm-light .diff-line-del {
  background: #fee2e2;
  color: #7f1d1d;
  border-left-color: #dc2626;
}

body.theme-warm-light .diff-line-hunk {
  background: #dbeafe;
  color: #1e3a8a;
  border-left-color: #2563eb;
}

.artifact-preview-container {
  padding: 0.85rem;
  background: var(--code-block-bg, #0d1117);
  color: var(--code-block-text, #f3f4f6);
  border: 1px solid var(--code-block-border, #30363d);
  border-radius: 0.5rem;
  min-height: 12rem;
}

.artifact-svg-stage {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem;
  background: #0b0f19;
  border: 1px solid #334155;
  border-radius: 0.45rem;
  margin-bottom: 0.75rem;
}

/* ============================================================================
   CURSOR 3-PANE IDE WORKBENCH LAYOUT (100% Local In-Browser UOR-R4)
   Left: File Explorer / SCM / Shards (#threads-sidebar)
   Center: Multi-Tab Code Editor + Integrated Bottom Terminal (#dockable-canvas-pane)
   Right: Cursor AI Chat / Composer / Agent (#claude-code-desktop)
   Bottom: Local UOR-R4 Status Bar (#cursor-status-bar)
   ============================================================================ */

/* ============================================================================
   CURSOR 3-PANE IDE WORKBENCH LAYOUT (100% Local In-Browser UOR-R4)
   Left: 48px Activity Bar + 260px File Explorer / SCM / Shards (#threads-sidebar)
   Center: Multi-Tab Code Editor + Integrated Bottom Terminal (#dockable-canvas-pane)
   Right: Cursor AI Chat / Composer / Agent (#claude-code-desktop)
   Bottom: Local UOR-R4 Status Bar (#ide-status-bar)
   Aligned with Foundation.View.Browser.V1.Design & HologramDesign
   ============================================================================ */

main,
main.cursor-ide-workbench,
main.cowork-layout {
  display: grid;
  grid-template-columns: 308px minmax(360px, 1fr) minmax(380px, 430px);
  grid-template-rows: minmax(0, 1fr) 26px;
  height: 100vh;
  width: 100vw;
  margin: 0;
  overflow: hidden;
}

main > #threads-sidebar,
main.cursor-ide-workbench > #threads-sidebar,
main.cowork-layout > #threads-sidebar {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  width: 308px;
  max-width: 308px;
  padding: 0 !important;
  gap: 0 !important;
  display: flex !important;
  flex-direction: row;
  overflow: hidden;
  border-right: 1px solid var(--border-hairline);
  background: var(--sidebar-bg, #141416);
}

main > #dockable-canvas-pane,
main.cursor-ide-workbench > #dockable-canvas-pane,
main.cowork-layout > #dockable-canvas-pane {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  border-left: 1px solid var(--border-strong);
  border-right: 1px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main > #claude-code-desktop,
main.cursor-ide-workbench > #claude-code-desktop,
main.cowork-layout > #claude-code-desktop {
  grid-column: 3;
  grid-row: 1;
  min-width: 0;
  min-height: 0;
  height: 100% !important;
  max-height: 100% !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

main > #ide-status-bar,
main > #cursor-status-bar,
main.cursor-ide-workbench > #ide-status-bar,
main.cowork-layout > #ide-status-bar {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  z-index: 100;
}

/* Sidebar collapsed state */
main.sidebar-collapsed,
main:has(#threads-sidebar.sidebar-collapsed) {
  grid-template-columns: 48px minmax(360px, 1fr) minmax(380px, 430px);
}

main.sidebar-collapsed > #threads-sidebar,
#threads-sidebar.sidebar-collapsed {
  width: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
}

#threads-sidebar.sidebar-collapsed .workbench-sidebar-content {
  display: none !important;
}

main.sidebar-collapsed > #dockable-canvas-pane {
  grid-column: 2;
}

main.sidebar-collapsed > #claude-code-desktop {
  grid-column: 3;
}

main:has(#dockable-canvas-pane[hidden]) > #claude-code-desktop,
main.canvas-drawer-closed > #claude-code-desktop {
  grid-column: 2 / -1;
}

/* 48px Far-Left Activity Bar */
.activity-bar,
.cursor-activity-bar {
  width: 48px;
  min-width: 48px;
  max-width: 48px;
  flex: 0 0 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0;
  background: #0e0e10;
  border-right: 1px solid var(--border-hairline, #2a2a2e);
  height: 100%;
  box-sizing: border-box;
  gap: 0.25rem;
}

.activity-bar-btn,
.cursor-act-btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-radius: 6px;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  border: 1px solid transparent;
  padding: 0;
}

.activity-bar-btn:hover,
.cursor-act-btn:hover {
  background: #27272a;
  color: #ffffff;
}

.activity-bar-btn.active,
.cursor-act-btn.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #3b82f6;
}

.activity-icon {
  width: 19px;
  height: 19px;
}

.activity-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.56rem;
  font-weight: 700;
  padding: 0.04rem 0.22rem;
  border-radius: 0.3rem;
  background: #2563eb;
  color: #ffffff;
  line-height: 1;
}

.activity-bar-spacer {
  flex: 1 1 auto;
}

/* 260px Collapsible Sidebar Body */
.workbench-sidebar-content {
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--sidebar-bg, #141416);
  box-sizing: border-box;
  padding: 0;
}

/* Compact 35px Sidebar Title Bar (aligned with #editor-tabs-bar) */
.workbench-sidebar-content > .sidebar-top {
  height: 35px;
  min-height: 35px;
  max-height: 35px;
  padding: 0 0.5rem;
  border-bottom: 1px solid var(--sidebar-border, #2a2a2e);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.workbench-sidebar-content .brand-row {
  width: 100%;
  padding: 0;
  gap: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.workbench-sidebar-content .brand-badge {
  width: 1.45rem;
  height: 1.45rem;
  font-size: 0.68rem;
  border-radius: 0.3rem;
  flex-shrink: 0;
}

.workbench-sidebar-content .brand-text {
  flex: 1 1 auto;
  min-width: 0;
}

.workbench-sidebar-content .brand-text strong {
  font-size: 0.76rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

.workbench-sidebar-content .brand-text span {
  display: none;
}

.workbench-sidebar-content #close-sidebar-btn {
  width: 1.4rem;
  height: 1.4rem;
  min-height: 1.4rem;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1;
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  border-radius: 4px;
  flex-shrink: 0;
}

.workbench-sidebar-content #close-sidebar-btn:hover {
  background: #27272a;
  color: #ffffff;
}

.sidebar-view-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  padding: 0.4rem 0.45rem;
  overflow-x: hidden;
}

.sidebar-view-content[hidden] {
  display: none !important;
}

.cursor-explorer-section {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0;
  background: transparent;
  border: 0;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

body:not([data-layout-mode="chat"]) #workbench-sidebar-content:has(#sidebar-view-history[hidden]) > #sidebar-panel-history,
body:not([data-layout-mode="chat"]) #workbench-sidebar-content:has(#sidebar-view-history[hidden]) > #sidebar-panel-projects,
body:not([data-layout-mode="chat"]) #workbench-sidebar-content:has(#sidebar-view-history[hidden]) > .sidebar-footer {
  display: none !important;
}

.sidebar-view-panel.active:not([hidden]) {
  display: block;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

.cursor-explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  min-width: 0;
}

.cursor-explorer-header .sidebar-heading {
  padding: 0;
  font-size: 0.65rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cursor-explorer-title {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.cursor-explorer-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
}

.btn-xs {
  width: auto;
  min-height: 1.35rem;
  padding: 0.1rem 0.38rem;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
}

.cursor-mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 1.35rem;
  min-height: 1.35rem;
  padding: 0.1rem 0.36rem;
  font-size: 0.65rem;
  font-weight: 600;
  border: 1px solid #3f3f46;
  background: #18181b;
  color: #e4e4e7;
  border-radius: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cursor-mini-btn:hover {
  background: #27272a;
  border-color: #52525b;
  color: #fafafa;
}

.cursor-mini-btn:active {
  background: #3f3f46;
}

.cursor-explorer-search-row,
.cursor-tree-filter-wrap {
  display: flex;
  width: 100%;
  min-width: 0;
}

.cursor-tree-filter {
  width: 100%;
  min-height: 1.5rem;
  height: 1.5rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.69rem;
  background: #09090b;
  color: #f8fafc;
  border: 1px solid #3f3f46;
  border-radius: 0.28rem;
}

.cursor-file-tree {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.1rem;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
}

.cursor-tree-folder {
  margin: 0;
  min-width: 0;
}

.cursor-tree-folder > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.14rem 0.28rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #e2e8f0;
  border-radius: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.cursor-tree-folder > summary::-webkit-details-marker {
  display: none;
}

.cursor-tree-folder > summary:hover {
  background: #27272a;
}

.cursor-tree-folder-children {
  display: flex;
  flex-direction: column;
  gap: 0.06rem;
  padding-left: 0.45rem;
  border-left: 1px solid #27272a;
  margin-left: 0.3rem;
  min-width: 0;
}

.cursor-tree-item {
  width: 100%;
  min-height: 1.4rem;
  padding: 0.12rem 0.3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  background: transparent;
  color: #e2e8f0;
  border: 1px solid transparent;
  border-radius: 0.25rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  overflow: hidden;
}

.cursor-tree-item:hover {
  background: #27272a;
  color: #ffffff;
}

.cursor-tree-item.active {
  background: #1e3a8a;
  color: #ffffff;
  border-color: #3b82f6;
}

.cursor-tree-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
  flex: 1 1 auto;
}

.cursor-tree-badges {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-shrink: 0;
}

.cursor-git-badge {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  padding: 0.03rem 0.22rem;
  border-radius: 0.2rem;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  white-space: nowrap;
}

.cursor-git-m {
  background: #78350f;
  color: #fef3c7;
  border-color: #f59e0b;
}

.cursor-git-u {
  background: #064e3b;
  color: #ecfdf5;
  border-color: #10b981;
}

.cursor-git-diff {
  background: #1e1b4b;
  color: #e0e7ff;
  border-color: #6366f1;
}

.cursor-scm-summary,
.cursor-shards-summary {
  font-size: 0.7rem;
  color: #cbd5e1;
  padding: 0.25rem 0;
}

.cursor-scm-list,
.cursor-shards-grid {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  max-height: 9rem;
  overflow-y: auto;
}

/* Center Workbench: Multi-Tab Code Editor + Integrated Bottom Panel */
.cursor-center-workbench {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.cursor-editor-tabs-bar,
.editor-tabs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding: 0 0.45rem;
  background: var(--bg-surface, #18181b);
  border-bottom: 1px solid var(--border-hairline, #27272a);
  flex-shrink: 0;
  height: 35px;
  min-height: 35px;
  max-height: 35px;
  box-sizing: border-box;
  overflow: hidden;
}

.cursor-editor-tabs,
.editor-tabs {
  display: flex;
  align-items: center;
  gap: 3px;
  overflow-x: auto;
  min-width: 0;
  flex: 1 1 auto;
  scrollbar-width: none;
}

.cursor-editor-tabs::-webkit-scrollbar,
.editor-tabs::-webkit-scrollbar {
  display: none;
}

.cursor-editor-tab,
.editor-tab {
  width: auto;
  height: 25px;
  min-height: 25px;
  padding: 0 0.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  background: var(--bg-subtle, #27272a);
  color: var(--text-secondary, #a1a1aa);
  border: 1px solid var(--border-strong, transparent);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  flex-shrink: 0;
}

.cursor-editor-tab:hover,
.editor-tab:hover {
  background: var(--bg-hover, #3f3f46);
  color: var(--text-primary, #f4f4f5);
}

.cursor-editor-tab.active,
.editor-tab.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #3b82f6;
  font-weight: 600;
}

.editor-tab.dirty .editor-tab-title {
  color: #93c5fd;
}

.cursor-editor-tab-close,
.editor-tab-close {
  font-size: 0.78rem;
  line-height: 1;
  opacity: 0.7;
  padding: 0 2px;
  border-radius: 2px;
}

.cursor-editor-tab-close:hover,
.editor-tab-close:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.cursor-workbench-toolbar,
.cursor-editor-tab-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.cursor-breadcrumbs-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  padding: 0 0.6rem;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-hairline);
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  overflow: hidden;
}

.cursor-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cursor-crumb-active {
  font-weight: 700;
  color: var(--text-primary);
}

.cursor-crumb-symbol {
  color: var(--accent-primary);
  font-weight: 600;
}

.cursor-breadcrumb-meta,
.cursor-breadcrumbs-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Split Center Workbench:
   1. Top Code Editor (#canvas-panel-workspace, order: 1)
   2. Middle Bottom-Panel Tab Bar (.canvas-header, order: 2)
   3. Bottom Active Panel (.canvas-panel:not(#canvas-panel-workspace), order: 3) */
#dockable-canvas-pane.cursor-center-workbench .canvas-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0;
}

#dockable-canvas-pane.cursor-center-workbench #canvas-panel-workspace {
  display: flex !important;
  flex-direction: column;
  order: 1;
  flex: 1 1 60%;
  min-height: 0;
  padding: 0.3rem 0.45rem;
  overflow: hidden;
  border-bottom: 1px solid var(--border-strong);
}

#dockable-canvas-pane.cursor-center-workbench .canvas-header {
  order: 2;
  height: 29px;
  min-height: 29px;
  max-height: 29px;
  padding: 0 0.45rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.3rem;
}

#dockable-canvas-pane.cursor-center-workbench .canvas-tabs {
  padding: 0.1rem;
  gap: 0.1rem;
  background: transparent;
  border: 0;
}

#dockable-canvas-pane.cursor-center-workbench .canvas-tab-btn {
  padding: 0.15rem 0.42rem;
  font-size: 0.67rem;
  height: 22px;
  min-height: 22px;
}

#dockable-canvas-pane.cursor-center-workbench .canvas-close-btn {
  height: 22px;
  min-height: 22px;
  padding: 0 0.45rem;
  font-size: 0.66rem;
}

#dockable-canvas-pane.cursor-center-workbench.cursor-bottom-panel-collapsed #canvas-panel-workspace,
#dockable-canvas-pane.cursor-center-workbench .canvas-body:not(:has(.canvas-panel.active:not(#canvas-panel-workspace))) #canvas-panel-workspace {
  flex: 1 1 100%;
  border-bottom: 0;
}

#dockable-canvas-pane.cursor-center-workbench .canvas-panel:not(#canvas-panel-workspace) {
  order: 3;
  flex: 0 0 40%;
  min-height: 150px;
  max-height: 44%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.3rem 0.45rem;
}

/* Give rich inspection panels (3D Brain, Diagnostics, Self-Improvement, Inspector) more room when active */
#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-traces.active) #canvas-panel-workspace,
#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-diagnostics.active) #canvas-panel-workspace,
#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-feed.active) #canvas-panel-workspace,
#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-inspector.active) #canvas-panel-workspace {
  flex: 1 1 38%;
}

#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-traces.active) #canvas-panel-traces,
#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-diagnostics.active) #canvas-panel-diagnostics,
#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-feed.active) #canvas-panel-feed,
#dockable-canvas-pane.cursor-center-workbench .canvas-body:has(#canvas-panel-inspector.active) #canvas-panel-inspector {
  flex: 1 1 62%;
  max-height: 62%;
}

/* Terminal Panel: Flex column so #terminal-form prompt is always pinned and visible at the bottom */
#dockable-canvas-pane.cursor-center-workbench #canvas-panel-terminal.active {
  display: flex !important;
  flex-direction: column;
  overflow: hidden;
  padding: 0.25rem 0.35rem;
}

#dockable-canvas-pane.cursor-center-workbench #terminal-container {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0 !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#dockable-canvas-pane.cursor-center-workbench #terminal-topbar {
  padding: 0.22rem 0.55rem;
  min-height: 26px;
  flex-shrink: 0;
}

#dockable-canvas-pane.cursor-center-workbench .btn-terminal-action {
  padding: 0.1rem 0.4rem;
  font-size: 0.66rem;
  min-height: 18px;
}

#dockable-canvas-pane.cursor-center-workbench #terminal-output {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.35rem 0.6rem;
  font-size: 0.74rem;
  line-height: 1.4;
  overflow-y: auto;
}

#dockable-canvas-pane.cursor-center-workbench #terminal-form {
  padding: 0.25rem 0.6rem;
  min-height: 28px;
  flex-shrink: 0;
}

#dockable-canvas-pane.cursor-center-workbench #terminal-input {
  min-height: 20px;
  height: 20px;
  padding: 0 0.25rem;
  font-size: 0.75rem;
}

#dockable-canvas-pane.cursor-center-workbench.cursor-bottom-panel-collapsed .canvas-panel:not(#canvas-panel-workspace) {
  display: none !important;
}

/* Compact Workspace Editor Header & Line-Numbered Surface */
#canvas-panel-workspace .workspace-panel-grid,
#canvas-panel-workspace .cursor-editor-grid,
#canvas-panel-workspace .workspace-modal-grid {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1 1 auto;
  min-height: 0;
}

#canvas-panel-workspace .workspace-file-sidebar,
#canvas-panel-workspace #workspace-pane,
#canvas-panel-workspace .workspace-status-strip,
#canvas-panel-workspace #editor-trainer-pane > .pane-subheader {
  display: none !important;
}

#canvas-panel-workspace .workspace-editor-pane,
#canvas-panel-workspace #editor-trainer-pane {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  flex: 1 1 auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#canvas-panel-workspace .cursor-editor-field {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
}

#cowork-agent-status-bar[hidden] {
  display: none !important;
}

#cowork-agent-status-bar:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 0.72rem;
}

.cursor-editor-surface {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  border: 1px solid var(--code-block-border, #2a2a2e);
  border-radius: 0.35rem;
  background: var(--code-block-bg, #111113);
  overflow: hidden;
  position: relative;
}

.cursor-line-gutter,
.editor-line-numbers {
  grid-column: 1;
  grid-row: 1;
  width: 44px;
  min-width: 44px;
  max-width: 44px;
  padding: 0.45rem 0.35rem;
  background: #09090b;
  color: #71717a;
  border-right: 1px solid #27272a;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.45;
  text-align: right;
  user-select: none;
  overflow: hidden;
  white-space: pre;
  box-sizing: border-box;
}

body.theme-warm-light .cursor-line-gutter,
body.theme-warm-light .editor-line-numbers {
  background: #f1f5f9;
  color: #475569;
  border-right-color: #cbd5e1;
}

#workspace-editor-textarea.cursor-code-textarea {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  min-height: 0 !important;
  height: 100% !important;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.45;
  tab-size: 4;
  white-space: pre-wrap;
  word-break: break-all;
  background: transparent;
  color: var(--code-block-text, #f4f4f5);
  resize: none !important;
  overflow-y: auto;
}

#cursor-ghost-overlay.cursor-ghost-overlay,
.cursor-ghost-overlay {
  grid-column: 2;
  grid-row: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0.45rem 0.65rem;
  border: 0;
  border-radius: 0;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.45;
  tab-size: 4;
  white-space: pre-wrap;
  word-break: break-all;
  background: transparent;
  pointer-events: none !important;
  user-select: none !important;
  overflow: hidden;
  box-sizing: border-box;
  transition: opacity 0.12s ease;
}

/* Only show inline ghost overlay while editor is actively focused so initial code is never obscured */
#cursor-editor-surface:not(:focus-within) .cursor-ghost-overlay {
  opacity: 0;
}

.cursor-ghost-prefix {
  color: transparent !important;
  opacity: 0 !important;
}

.cursor-ghost-inline {
  color: #94a3b8;
  font-style: italic;
  opacity: 0.85;
}

body.theme-warm-light .cursor-ghost-inline {
  color: #6b7280;
}

/* Cmd+K Inline Floating Edit Bar & Red/Green Diff Hunks */
.cursor-cmdk-bar {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.4rem 0.55rem;
  margin-bottom: 0.25rem;
  background: var(--bg-surface);
  border: 1px solid #3b82f6;
  border-left: 4px solid #2563eb;
  border-radius: 0.4rem;
  box-shadow: var(--shadow-md);
  transition: all 120ms ease;
  flex-shrink: 0;
}

.cursor-cmdk-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cursor-cmdk-title-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.cursor-cmdk-badge {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.08rem 0.38rem;
  border-radius: 0.25rem;
  background: #1d4ed8;
  color: #ffffff;
}

.cursor-cmdk-range {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-secondary);
}

.cursor-cmdk-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 0.25rem;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}

.cursor-cmdk-close:hover {
  color: var(--text-primary);
  background: var(--bg-hover, rgba(255, 255, 255, 0.08));
}

.cursor-cmdk-form,
.cursor-cmdk-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.cursor-cmdk-input {
  flex: 1 1 12rem;
  min-height: 1.55rem;
  height: 1.55rem;
  padding: 0.15rem 0.45rem;
  font-size: 0.74rem;
  background: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 0.28rem;
  outline: none;
}

.cursor-cmdk-input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.cursor-cmdk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.18rem 0.48rem;
  font-family: var(--font-sans, system-ui, sans-serif);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  border-radius: 0.28rem;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.cursor-cmdk-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.cursor-cmdk-btn-generate {
  background: #2563eb;
  color: #ffffff;
  border-color: #1d4ed8;
}

.cursor-cmdk-btn-generate:hover:not(:disabled) {
  background: #1d4ed8;
}

.cursor-cmdk-btn-accept {
  background: #15803d;
  color: #ffffff;
  border-color: #166534;
}

.cursor-cmdk-btn-accept:hover:not(:disabled) {
  background: #166534;
}

.cursor-cmdk-btn-reject {
  background: #b91c1c;
  color: #ffffff;
  border-color: #991b1b;
}

.cursor-cmdk-btn-reject:hover:not(:disabled) {
  background: #991b1b;
}

.cursor-cmdk-diff-hunk {
  max-height: 8rem;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 0.35rem;
  background: var(--code-block-bg, #0d1117);
  color: var(--code-block-text, #f4f4f5);
  padding: 0.35rem;
}

body.theme-warm-light .cursor-cmdk-diff-hunk {
  background: var(--code-block-bg, #faf9f5);
  color: var(--code-block-text, #111827);
  border-color: var(--border-subtle, #e5e2d9);
}

/* Compact Toolbar Trigger Button Styling inside #editor-tabs-bar */
.cursor-wb-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  height: 23px;
  min-height: 23px;
  padding: 0 0.38rem;
  font-size: 0.66rem;
  font-weight: 600;
  border-radius: 0.25rem;
  border: 1px solid var(--border-subtle, #3a3a42);
  background: var(--bg-surface, #1a1a1d);
  color: var(--text-primary, #f4f4f5);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 120ms ease;
}

.cursor-wb-btn:hover {
  background: var(--bg-hover, #2a2a30);
  border-color: var(--border-strong, #4f4f5a);
}

.cursor-wb-btn-accent {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #2563eb;
}

.cursor-wb-btn-accent:hover {
  background: #2563eb;
}

/* Compact Cursor Tab Ghost-Text Bar, R4-32 Problems Strip & Editor Action Bar */
.cursor-ghost-text-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  height: 22px;
  min-height: 22px;
  padding: 0 0.45rem;
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  flex-shrink: 0;
  overflow: hidden;
}

.cursor-ghost-pill,
.cursor-ghost-badge {
  padding: 0.04rem 0.3rem;
  border-radius: 0.22rem;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  font-size: 0.6rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.cursor-ghost-preview {
  color: var(--text-secondary);
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 0.25rem;
  border: 0;
  background: transparent;
  font-size: 0.66rem;
}

.cursor-ghost-meta {
  font-size: 0.62rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.cursor-ghost-accept-btn {
  height: 18px;
  min-height: 18px;
  padding: 0 0.36rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  background: #1d4ed8;
  color: #ffffff;
  border: 1px solid #3b82f6;
  border-radius: 0.22rem;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.cursor-problems-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  height: 21px;
  min-height: 21px;
  padding: 0 0.45rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0.28rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  flex-shrink: 0;
  overflow: hidden;
  white-space: nowrap;
}

.cursor-problems-title {
  color: var(--text-secondary);
  font-weight: 600;
}

.cursor-problems-ok {
  color: #10b981;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cursor-editor-actions.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
  margin: 0;
}

.cursor-editor-actions.button-row button {
  min-width: 0;
  height: 21px;
  min-height: 21px;
  padding: 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 0.25rem;
  white-space: nowrap;
}

#workspace-status {
  display: none !important;
}

/* Right Pane (#claude-code-desktop): Cursor AI Topbar, Context Bar & Composer Dock */
#claude-code-desktop .gpt-topbar {
  height: 35px;
  min-height: 35px;
  max-height: 35px;
  padding: 0 0.55rem;
  gap: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  overflow: hidden;
}

#claude-code-desktop .model-selector {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

#claude-code-desktop .model-selector h1 {
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hide redundant status badges in narrow right-pane topbar (already shown in breadcrumbs & status bar) */
#claude-code-desktop #topbar-model-tag,
#claude-code-desktop #weight-cache-badge,
#claude-code-desktop #chat-target-badge {
  display: none;
}

#claude-code-desktop .topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  flex-shrink: 0;
  min-width: max-content;
}

#claude-code-desktop .topbar-btn {
  height: 23px;
  min-height: 23px;
  padding: 0 0.38rem;
  font-size: 0.66rem;
  border-radius: 0.25rem;
}

#claude-code-desktop .topbar-btn-accent {
  background: rgba(37, 99, 235, 0.22);
  border-color: #3b82f6;
  color: #93c5fd;
}

body.theme-warm-light #claude-code-desktop .topbar-btn-accent {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.cursor-ai-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.22rem;
  height: 28px;
  min-height: 28px;
  padding: 0 0.5rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-hairline);
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.cursor-ai-context-bar::-webkit-scrollbar {
  display: none;
}

.cursor-ai-modes,
.cursor-ai-mode-switch,
.cursor-ai-ctx-pills,
.cursor-context-pills,
.cursor-composer-patch-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.cursor-ai-mode-pill,
.cursor-ctx-pill,
.cursor-context-pill,
.cursor-patch-action-btn {
  width: auto;
  height: 19px;
  min-height: 19px;
  padding: 0 0.32rem;
  font-family: var(--font-mono);
  font-size: 0.61rem;
  font-weight: 600;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.cursor-ai-mode-pill:hover,
.cursor-ctx-pill:hover,
.cursor-context-pill:hover,
.cursor-patch-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.cursor-ai-mode-pill.active,
.cursor-ctx-pill.active,
.cursor-context-pill.active {
  background: #1d4ed8;
  color: #ffffff;
  border-color: #60a5fa;
}

.cursor-patch-accept {
  border-color: rgba(16, 185, 129, 0.45);
  color: #10b981;
}

.cursor-patch-reject {
  border-color: rgba(239, 68, 68, 0.45);
  color: #f87171;
}

#claude-code-desktop .chat-transcript {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0.75rem 0.75rem 1rem;
  gap: 0.85rem;
  overflow-y: auto;
  overflow-x: hidden;
}

#claude-code-desktop .gpt-composer-dock {
  width: 100%;
  padding: 0.35rem 0.55rem 0.45rem;
  flex-shrink: 0;
  box-sizing: border-box;
}

#claude-code-desktop .gpt-composer-form,
#claude-code-desktop .gpt-composer-form.ts-rich-composer {
  padding: 0.4rem 0.5rem 0.35rem;
  gap: 0.28rem;
}

#claude-code-desktop .composer-send-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  padding-top: 0.25rem;
}

#claude-code-desktop .composer-send-bar-left,
#claude-code-desktop .composer-send-bar-right {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}

#claude-code-desktop .composer-action-btn,
#claude-code-desktop .composer-trigger-pill {
  width: 1.3rem;
  height: 1.3rem;
  min-height: 1.3rem;
  font-size: 0.7rem;
  flex-shrink: 0;
}

#claude-code-desktop .composer-model-select {
  max-width: 6.8rem;
  height: 1.35rem;
  min-height: 1.35rem;
  font-size: 0.65rem;
  padding: 0 0.35rem;
  text-overflow: ellipsis;
}

#claude-code-desktop .composer-mode-group {
  padding: 0.05rem;
  gap: 0.02rem;
}

#claude-code-desktop .composer-mode-btn {
  padding: 0.06rem 0.26rem;
  font-size: 0.61rem;
}

#claude-code-desktop .composer-token-badge {
  font-size: 0.6rem;
  padding: 0 0.12rem;
}

#claude-code-desktop .composer-send-btn {
  width: 1.45rem;
  height: 1.45rem;
  min-height: 1.45rem;
  font-size: 0.76rem;
  flex-shrink: 0;
}

/* Cmd+P Quick Open & Cmd+Shift+P Command Palette Modal */
.cursor-command-palette {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}

.cursor-command-palette[hidden] {
  display: none !important;
}

.cursor-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 9, 11, 0.65);
  backdrop-filter: blur(3px);
}

.cursor-palette-dialog {
  position: relative;
  z-index: 1;
  width: min(38rem, 92vw);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 0.6rem;
  box-shadow: var(--shadow-composer);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cursor-palette-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border-hairline);
}

.cursor-palette-mode-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.42rem;
  border-radius: 0.28rem;
  background: #1d4ed8;
  color: #ffffff;
  white-space: nowrap;
}

.cursor-palette-input {
  flex: 1 1 auto;
  min-height: 1.75rem;
  padding: 0.2rem 0.5rem;
  font-size: 0.82rem;
  background: var(--bg-canvas);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  border-radius: 0.35rem;
}

.cursor-palette-list {
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cursor-palette-item {
  width: 100%;
  min-height: 1.85rem;
  padding: 0.3rem 0.55rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid transparent;
  border-radius: 0.35rem;
  text-align: left;
  cursor: pointer;
  font-size: 0.76rem;
}

.cursor-palette-item:hover,
.cursor-palette-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
}

.cursor-palette-item-meta {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  color: var(--text-secondary);
}

.cursor-palette-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-hairline);
  font-size: 0.68rem;
  color: var(--text-secondary);
}

/* Cursor IDE Bottom Status Bar (#ide-status-bar) */
.ide-status-bar,
.cursor-status-bar,
#ide-status-bar {
  grid-column: 1 / -1;
  grid-row: 2;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 0 0.65rem;
  background: #0f172a;
  color: #f8fafc;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 100;
}

.status-bar-left,
.cursor-status-left,
.status-bar-center,
.status-bar-right,
.cursor-status-right {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}

.cursor-status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #f8fafc;
  white-space: nowrap;
}

.cursor-status-local {
  font-weight: 700;
  color: #6ee7b7;
}

.cursor-status-btn {
  width: auto;
  min-height: 1.15rem;
  padding: 0.04rem 0.36rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: 0.25rem;
  cursor: pointer;
}

.cursor-status-btn:hover {
  background: #1d4ed8;
  border-color: #60a5fa;
}

/* ============================================================================
   Minimalist Cursor IDE Clone Layout & Visual De-Cluttering (v5)
   ============================================================================ */

/* 1. Authentic Cursor 3-Pane Proportions:
      224px Left Explorer | Wide Center Code Editor | 360px Right AI Chat */
body main,
body main.cursor-ide-workbench,
body main.cowork-layout {
  grid-template-columns: 224px minmax(440px, 1fr) 360px;
  grid-template-rows: minmax(0, 1fr) 22px;
}

body main.sidebar-collapsed,
body main.cursor-ide-workbench.sidebar-collapsed {
  grid-template-columns: minmax(440px, 1fr) 360px;
}

/* 2. Quiet Left Activity Bar & File Explorer (#threads-sidebar) */
body main > #threads-sidebar {
  width: 224px;
  max-width: 224px;
}

body .cursor-activity-bar {
  width: 38px;
  min-width: 38px;
  max-width: 38px;
  flex: 0 0 38px;
  padding: 0.35rem 0;
  background: #111113;
  border-right: 1px solid #1e1e22;
}

body .cursor-act-btn {
  width: 30px;
  height: 30px;
  min-height: 30px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #71717a;
}

body .cursor-act-btn:hover {
  background: transparent;
  color: #d4d4d8;
}

body .cursor-act-btn.active {
  background: transparent;
  color: #f4f4f5;
  border-left-color: #3b82f6;
}

/* Hide redundant sidebar brand banner and permanent filter input box */
body .workbench-sidebar-content {
  width: auto;
  min-width: 0;
  max-width: none;
  flex: 1 1 0%;
}

body .workbench-sidebar-content > .sidebar-top,
body #sidebar-view-explorer .cursor-tree-filter-wrap {
  display: none !important;
}

body .sidebar-view-content {
  padding: 0.3rem 0.35rem;
}

body .cursor-explorer-header {
  height: 26px;
  min-height: 26px;
  padding: 0 0.25rem;
  margin-bottom: 0.15rem;
}

body .cursor-explorer-title {
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #71717a;
}

body .cursor-explorer-actions .cursor-mini-btn {
  height: 20px;
  min-height: 20px;
  padding: 0 0.28rem;
  font-size: 0.62rem;
  font-weight: 500;
  background: transparent;
  border-color: transparent;
  color: #71717a;
}

body .cursor-explorer-actions .cursor-mini-btn:hover {
  background: #27272a;
  color: #e4e4e7;
}

body .cursor-tree-folder > summary {
  padding: 0.14rem 0.25rem;
  font-size: 0.71rem;
  font-weight: 600;
  color: #a1a1aa;
}

body .cursor-tree-item {
  min-height: 22px;
  height: 22px;
  padding: 0 0.35rem;
  border: 0;
  border-radius: 3px;
  font-size: 0.72rem;
  color: #a1a1aa;
}

body .cursor-tree-item:hover {
  background: #1f1f23;
  color: #e4e4e7;
}

body .cursor-tree-item.active {
  background: #27272a;
  color: #f4f4f5;
  border-color: transparent;
  font-weight: 500;
}

/* Hide noisy line-count & +N/-0 diff pills in file tree; keep only clean M / U letters */
body .cursor-tree-badges .cursor-git-diff,
body .cursor-tree-badges .cursor-git-badge:not(.cursor-git-m):not(.cursor-git-u) {
  display: none !important;
}

body .cursor-tree-badges .cursor-git-m,
body .cursor-tree-badges .cursor-git-u {
  background: transparent !important;
  border: 0 !important;
  padding: 0 0.1rem;
  font-size: 0.65rem;
  font-weight: 700;
}

body .cursor-tree-badges .cursor-git-m {
  color: #e2c08d !important;
}

body .cursor-tree-badges .cursor-git-u {
  color: #73c991 !important;
}

/* 3. Clean Center Editor Tabs & Breadcrumb Bar */
body .cursor-editor-tabs-bar,
body .editor-tabs-bar {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 0.35rem 0 0;
  background: #141416;
  border-bottom: 1px solid #1e1e22;
}

body .cursor-editor-tabs,
body .editor-tabs {
  gap: 0;
  height: 100%;
  flex: 0 1 auto;
}

body #editor-new-tab-btn {
  margin-right: auto;
  height: 34px;
  min-height: 34px;
  padding: 0 0.55rem;
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #71717a;
}

body #editor-new-tab-btn:hover {
  background: #1a1a1e;
  color: #e4e4e7;
}

body .cursor-editor-tab,
body .editor-tab {
  height: 34px;
  min-height: 34px;
  padding: 0 0.75rem;
  border: 0;
  border-right: 1px solid #1e1e22;
  border-top: 2px solid transparent;
  border-radius: 0;
  background: #141416;
  color: #71717a;
  font-size: 0.72rem;
}

body .cursor-editor-tab:hover,
body .editor-tab:hover {
  background: #1a1a1e;
  color: #d4d4d8;
}

body .cursor-editor-tab.active,
body .editor-tab.active {
  background: #111113;
  color: #f4f4f5;
  border-top-color: #3b82f6;
  font-weight: 500;
}

/* Hide redundant Cmd+P / Cmd+Shift+P buttons in tab bar; make remaining actions subtle */
body #cursor-quickopen-btn,
body #cursor-palette-btn {
  display: none !important;
}

body .cursor-wb-btn,
body .cursor-wb-btn-accent {
  height: 22px;
  min-height: 22px;
  padding: 0 0.38rem;
  font-size: 0.65rem;
  font-weight: 500;
  background: transparent;
  border-color: transparent;
  color: #71717a;
}

body .cursor-wb-btn:hover,
body .cursor-wb-btn-accent:hover {
  background: #27272a;
  border-color: transparent;
  color: #e4e4e7;
}

body .cursor-breadcrumbs-bar {
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  padding: 0 0.75rem;
  background: #111113;
  border-bottom: 1px solid #1a1a1e;
  font-size: 0.66rem;
  color: #71717a;
}

body #cursor-crumb-symbol {
  background: transparent;
  border: 0;
  padding: 0;
  color: #a1a1aa;
  font-size: 0.66rem;
}

body .cursor-breadcrumb-meta,
body .cursor-breadcrumbs-meta {
  display: none !important;
}

/* 4. Full-Bleed Uncluttered Center Code Editor Surface */
body #dockable-canvas-pane.cursor-center-workbench #canvas-panel-workspace {
  flex: 1 1 75%;
  padding: 0;
  border-bottom: 0;
}

body .cursor-editor-surface {
  border: 0;
  border-radius: 0;
  background: #111113;
}

body .cursor-line-gutter,
body .editor-line-numbers {
  background: #111113;
  border-right: 1px solid #1a1a1e;
  color: #52525b;
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 0.55rem 0.45rem;
}

body #workspace-editor-textarea.cursor-code-textarea,
body #cursor-ghost-overlay.cursor-ghost-overlay {
  font-size: 0.78rem;
  line-height: 1.55;
  padding: 0.55rem 0.85rem;
}

/* Hide the 3 redundant bars stacked below the code editor */
body #cursor-ghost-text-bar,
body #cursor-problems-strip,
body .cursor-editor-actions.button-row {
  display: none !important;
}

/* 5. Sleek Compact Bottom Terminal & Panel Bar */
body #dockable-canvas-pane.cursor-center-workbench .canvas-header {
  height: 27px;
  min-height: 27px;
  max-height: 27px;
  padding: 0 0.55rem;
  background: #141416;
  border-top: 1px solid #222226;
  border-bottom: 1px solid #1a1a1e;
}

body #dockable-canvas-pane.cursor-center-workbench .canvas-tab-pill,
body #dockable-canvas-pane.cursor-center-workbench #canvas-tab-workspace,
body #dockable-canvas-pane.cursor-center-workbench #canvas-tab-mcp:not(.active),
body #dockable-canvas-pane.cursor-center-workbench #canvas-tab-customizations:not(.active),
body #dockable-canvas-pane.cursor-center-workbench #canvas-tab-feed:not(.active),
body #dockable-canvas-pane.cursor-center-workbench #canvas-tab-consolidation:not(.active) {
  display: none !important;
}

body #dockable-canvas-pane.cursor-center-workbench .canvas-tab-btn {
  height: 26px;
  min-height: 26px;
  padding: 0 0.42rem;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: #71717a !important;
  font-size: 0.63rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body #dockable-canvas-pane.cursor-center-workbench .canvas-tab-btn:hover {
  color: #d4d4d8 !important;
}

body #dockable-canvas-pane.cursor-center-workbench .canvas-tab-btn.active {
  color: #f4f4f5 !important;
  border-bottom-color: #3b82f6 !important;
}

body #dockable-canvas-pane.cursor-center-workbench .canvas-close-btn {
  background: transparent;
  border: 0;
  color: #71717a;
}

body #dockable-canvas-pane.cursor-center-workbench .canvas-panel:not(#canvas-panel-workspace) {
  flex: 0 0 160px;
  min-height: 130px;
  max-height: 25%;
  padding: 0;
}

body #dockable-canvas-pane.cursor-center-workbench #canvas-panel-terminal.active {
  padding: 0;
}

body #dockable-canvas-pane.cursor-center-workbench #terminal-topbar {
  display: none !important;
}

body #dockable-canvas-pane.cursor-center-workbench #terminal-container {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #0d0d10;
}

/* 6. Clean Cursor Right AI Chat Sidebar (#claude-code-desktop) */
body #claude-code-desktop {
  border-left: 1px solid #1e1e22;
  background: #141416;
}

body #claude-code-desktop .gpt-topbar {
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  padding: 0 0.65rem;
  background: #141416;
  border-bottom: 1px solid #1e1e22;
}

body #claude-code-desktop #toggle-sidebar-btn,
body #claude-code-desktop #topbar-terminal-btn,
body #claude-code-desktop #load-weights-topbar-btn,
body #claude-code-desktop #toggle-right-drawer-btn {
  display: none !important;
}

body #claude-code-desktop .model-selector h1 {
  font-size: 0.74rem;
  font-weight: 600;
  color: #a1a1aa;
  letter-spacing: 0.02em;
}

body #claude-code-desktop #sync-weights-btn {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #71717a;
  font-size: 0.65rem;
  font-weight: 500;
}

body #claude-code-desktop #sync-weights-btn:hover {
  background: #27272a;
  color: #e4e4e7;
}

body .cursor-ai-context-bar {
  height: 28px;
  min-height: 28px;
  padding: 0 0.55rem;
  background: #141416;
  border-bottom: 1px solid #1e1e22;
}

body .cursor-ai-mode-pill {
  background: transparent;
  border: 0;
  border-radius: 4px;
  color: #71717a;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 0 0.42rem;
  height: 20px;
}

body .cursor-ai-mode-pill.active {
  background: #27272a;
  color: #f4f4f5;
}

body .cursor-ctx-pill {
  background: transparent;
  border: 1px solid #27272a;
  border-radius: 4px;
  color: #71717a;
  font-size: 0.62rem;
  font-weight: 500;
  height: 18px;
  padding: 0 0.3rem;
}

/* De-clutter Chat Transcript cards inside #claude-code-desktop */
body #claude-code-desktop .chat-transcript {
  padding: 0.55rem 0.65rem;
  gap: 0.45rem;
}

body #claude-code-desktop .chat-turn {
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid #1e1e22 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  padding: 0.35rem 0.15rem 0.6rem !important;
}

body #claude-code-desktop .chat-meta-otel-pill,
body #claude-code-desktop .chat-otel-info,
body #claude-code-desktop .chat-tools-accordion {
  display: none !important;
}

body #claude-code-desktop .chat-turn-meta {
  margin-bottom: 0.2rem;
  font-size: 0.68rem;
  color: #71717a;
}

body #claude-code-desktop .chat-role-badge {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  color: #a1a1aa !important;
  font-size: 0.7rem;
  font-weight: 600;
}

body #claude-code-desktop .chat-thinking-accordion {
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 0 0.25rem 0 !important;
}

body #claude-code-desktop .chat-thinking-summary {
  padding: 0.05rem 0 !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  color: #71717a !important;
  background: transparent !important;
}

body #claude-code-desktop .chat-otel-footer {
  background: transparent !important;
  border: 0 !important;
  padding: 0.2rem 0 0 0 !important;
  margin-top: 0.15rem !important;
  justify-content: flex-start;
}

body #claude-code-desktop .chat-otel-actions .agent-mini-btn,
body #claude-code-desktop .chat-otel-actions .agent-mini-btn-primary {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #71717a !important;
  font-size: 0.64rem !important;
  font-weight: 500 !important;
  padding: 0.05rem 0.45rem 0.05rem 0 !important;
}

body #claude-code-desktop .chat-otel-actions .agent-mini-btn:hover {
  color: #d4d4d8 !important;
  text-decoration: underline;
}

/* De-clutter Composer Box inside #claude-code-desktop */
body #claude-code-desktop #composer-attach-btn,
body #claude-code-desktop #composer-slash-btn,
body #claude-code-desktop .composer-mode-group,
body #claude-code-desktop #composer-token-badge,
body #claude-code-desktop .composer-footer-hint {
  display: none !important;
}

body #claude-code-desktop .composer-model-select {
  max-width: 11rem;
  background: transparent;
  border-color: transparent;
  color: #8b949e;
  font-size: 0.68rem;
}

body #claude-code-desktop #claude-chat-input:focus,
body #claude-code-desktop #claude-chat-input:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

body #claude-code-desktop .gpt-composer-form:focus-within {
  border-color: #3f3f46 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
}

/* 7. Quiet 22px Bottom Status Bar (#cursor-status-bar) */
body .cursor-status-bar {
  height: 22px;
  min-height: 22px;
  max-height: 22px;
  padding: 0 0.6rem;
  font-size: 0.65rem;
}

body #ide-status-bar .cursor-status-btn {
  background: transparent;
  border-color: transparent;
  padding: 0 0.25rem;
  font-weight: 500;
}

body #ide-status-bar .cursor-status-btn:hover {
  background: #1e293b;
}

body #status-git-dirty,
body #status-model-badge,
body #status-active-file,
body #cursor-status-ghost,
body #cursor-status-q12,
body #status-tab-prediction,
body #status-uncommitted-count,
body #status-model-tag {
  display: none !important;
}

/* ==========================================================================
   V10 CONNECTED CHAT-FIRST LANDING, INSTANT STUDIO IDE TOGGLE,
   CLEAN MVM BOTTOM TERMINAL & FULL-HEIGHT INSPECTORS MODAL (R4-39)
   ========================================================================== */

.header-brain-pulse-canvas {
  width: 88px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: rgba(9, 13, 22, 0.85);
  cursor: pointer;
  flex-shrink: 0;
}

body.theme-warm-light .header-brain-pulse-canvas {
  background: #f1f5f9;
  border-color: #94a3b8;
}

body #claude-code-desktop .topbar-pill-web-on {
  background: rgba(16, 185, 129, 0.14) !important;
  border: 1px solid rgba(16, 185, 129, 0.45) !important;
  color: #34d399 !important;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.2rem 0.62rem;
}

body.theme-warm-light #claude-code-desktop .topbar-pill-web-on {
  background: #ecfdf5 !important;
  border-color: #059669 !important;
  color: #065f46 !important;
}

body #claude-code-desktop .topbar-pill-web-off {
  background: rgba(113, 113, 122, 0.14) !important;
  border: 1px solid rgba(113, 113, 122, 0.4) !important;
  color: #a1a1aa !important;
  border-radius: 999px;
  padding: 0.2rem 0.62rem;
}

body.theme-warm-light #claude-code-desktop .topbar-pill-web-off {
  background: #f4f4f5 !important;
  border-color: #71717a !important;
  color: #3f3f46 !important;
}

body #claude-code-desktop .topbar-btn-studio-toggle {
  background: #2563eb !important;
  border: 1px solid #3b82f6 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  border-radius: 6px;
  padding: 0.24rem 0.72rem !important;
}

body #claude-code-desktop .topbar-btn-studio-toggle:hover {
  background: #1d4ed8 !important;
}

body.theme-warm-light #claude-code-desktop .topbar-btn-studio-toggle {
  background: #1d4ed8 !important;
  border-color: #1e40af !important;
  color: #ffffff !important;
}

/* 1. Chat-First Default Mode (body[data-layout-mode="chat"]) */
body[data-layout-mode="chat"] > main {
  display: grid !important;
  grid-template-columns: 260px minmax(0, 1fr) !important;
  grid-template-rows: minmax(0, 1fr) !important;
  height: 100vh !important;
  width: 100vw !important;
  overflow: hidden !important;
}

body[data-layout-mode="chat"] > main.sidebar-collapsed {
  grid-template-columns: 0px minmax(0, 1fr) !important;
}

body[data-layout-mode="chat"] #dockable-canvas-pane,
body[data-layout-mode="chat"] #ide-status-bar,
body[data-layout-mode="chat"] #cursor-activity-bar,
body[data-layout-mode="chat"] #sidebar-view-explorer,
body[data-layout-mode="chat"] #sidebar-view-search,
body[data-layout-mode="chat"] #sidebar-view-scm,
body[data-layout-mode="chat"] #sidebar-view-shards,
body[data-layout-mode="chat"] #sidebar-panel-projects,
body[data-layout-mode="chat"] #sidebar-agent-surfaces,
body[data-layout-mode="chat"] #cursor-ai-context-bar,
body[data-layout-mode="chat"] #chat-target-badge,
body[data-layout-mode="chat"] #topbar-terminal-btn,
body[data-layout-mode="chat"] #load-weights-topbar-btn,
body[data-layout-mode="chat"] #toggle-right-drawer-btn {
  display: none !important;
}

body[data-layout-mode="chat"] #sidebar-panel-history[hidden],
body[data-layout-mode="chat"] #sidebar-panel-planning[hidden],
body[data-layout-mode="chat"] #sidebar-panel-pool[hidden] {
  display: none !important;
}

body[data-layout-mode="chat"] #sidebar-panel-planning:not([hidden]),
body[data-layout-mode="chat"] #sidebar-panel-pool:not([hidden]) {
  display: flex !important;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem 0.75rem;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
}

body[data-layout-mode="chat"] #threads-sidebar {
  grid-column: 1 !important;
  grid-row: 1 !important;
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  padding: 0 !important;
  background: #141416;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex !important;
  flex-direction: row !important;
  overflow: hidden !important;
}

body.theme-warm-light[data-layout-mode="chat"] #threads-sidebar {
  background: #f3f1ea;
  border-right: 1px solid #e2e8f0;
  color: #0f172a;
}

body[data-layout-mode="chat"] > main.sidebar-collapsed #threads-sidebar,
body[data-layout-mode="chat"] #threads-sidebar.sidebar-collapsed {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  overflow: hidden !important;
  border-right: 0 !important;
}

body[data-layout-mode="chat"] #workbench-sidebar-content {
  width: 260px !important;
  min-width: 260px !important;
  max-width: 260px !important;
  flex: 0 0 260px !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

body[data-layout-mode="chat"] #workbench-sidebar-content > .sidebar-top {
  display: flex !important;
  align-items: center !important;
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  padding: 0 0.85rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07) !important;
  flex-shrink: 0 !important;
}

body.theme-warm-light[data-layout-mode="chat"] #workbench-sidebar-content > .sidebar-top {
  border-bottom-color: #e2e8f0 !important;
}

body[data-layout-mode="chat"] #workbench-sidebar-content .brand-text strong {
  font-size: 0.82rem;
  color: #f4f4f5;
}

body.theme-warm-light[data-layout-mode="chat"] #workbench-sidebar-content .brand-text strong {
  color: #0f172a;
}

body[data-layout-mode="chat"] #workbench-sidebar-content .brand-text span {
  display: block !important;
  font-size: 0.66rem;
  color: #94a3b8;
  margin-top: 1px;
}

body.theme-warm-light[data-layout-mode="chat"] #workbench-sidebar-content .brand-text span {
  color: #64748b;
}

body[data-layout-mode="chat"] #workbench-sidebar-content > #sidebar-view-history {
  display: block !important;
  flex: 0 0 auto !important;
  padding: 0.75rem 0.75rem 0.25rem !important;
  overflow: visible !important;
}

body[data-layout-mode="chat"] #workbench-sidebar-content #chat-clear-btn {
  width: 100%;
  justify-content: center;
  display: inline-flex;
  align-items: center;
}

body.theme-warm-light[data-layout-mode="chat"] #workbench-sidebar-content #chat-clear-btn {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

body[data-layout-mode="chat"] #workbench-sidebar-content > #sidebar-panel-history:not([hidden]) {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.85rem !important;
  padding: 0.5rem 0.75rem 0.75rem !important;
  overflow-y: auto !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
}

body[data-layout-mode="chat"] #workbench-sidebar-content > #sidebar-panel-history {
  flex-direction: column;
}

body[data-layout-mode="chat"] #sidebar-panel-history > details.sidebar-collapsible:first-of-type {
  display: none !important;
}

body[data-layout-mode="chat"] #chat-thread-list {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}

body[data-layout-mode="chat"] #chat-thread-list .thread-list-item {
  margin: 0;
  padding: 0;
}

body[data-layout-mode="chat"] #chat-thread-list .thread-item-btn {
  width: 100%;
  display: block;
  padding: 0.42rem 0.55rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #d4d4d8;
}

body[data-layout-mode="chat"] #chat-thread-list .thread-item-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

body[data-layout-mode="chat"] #chat-thread-list .thread-item-btn.thread-item-btn-active {
  background: #27272a;
  color: #ffffff;
  font-weight: 600;
}

body.theme-warm-light[data-layout-mode="chat"] #chat-thread-list .thread-item-btn {
  color: #334155;
}

body.theme-warm-light[data-layout-mode="chat"] #chat-thread-list .thread-item-btn:hover {
  background: rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

body.theme-warm-light[data-layout-mode="chat"] #chat-thread-list .thread-item-btn.thread-item-btn-active {
  background: #e2e8f0;
  color: #0f172a;
}

body[data-layout-mode="chat"] #workbench-sidebar-content > .sidebar-footer {
  display: flex !important;
  align-items: center !important;
  flex: 0 0 auto !important;
  padding: 0.65rem 0.85rem !important;
  border-top: 1px solid rgba(255, 255, 255, 0.07) !important;
  font-size: 0.72rem;
  color: #94a3b8;
}

body.theme-warm-light[data-layout-mode="chat"] #workbench-sidebar-content > .sidebar-footer {
  border-top-color: #e2e8f0 !important;
  color: #475569;
}

body[data-layout-mode="chat"] #claude-code-desktop #toggle-sidebar-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

body[data-layout-mode="chat"] #claude-code-desktop {
  grid-column: 2 !important;
  grid-row: 1 !important;
  width: 100% !important;
  max-width: none !important;
  border-left: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}

body[data-layout-mode="chat"] #claude-code-desktop .gpt-topbar {
  height: 52px !important;
  min-height: 52px !important;
  max-height: 52px !important;
  padding: 0 1.25rem !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

body.theme-warm-light[data-layout-mode="chat"] #claude-code-desktop .gpt-topbar {
  border-bottom-color: #e2e8f0;
}

body[data-layout-mode="chat"] #claude-code-desktop .model-selector h1 {
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

body[data-layout-mode="chat"] #claude-code-desktop #weight-cache-badge {
  display: inline-flex !important;
  font-size: 0.68rem;
  padding: 0.14rem 0.5rem;
  border-radius: 999px;
}

body[data-layout-mode="chat"] #claude-code-desktop .chat-transcript {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1rem;
  gap: 1.15rem;
}

body[data-layout-mode="chat"] #claude-code-desktop .gpt-composer-dock {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 0.5rem 1.25rem 1.35rem;
  background: transparent;
  border-top: 0;
}

body[data-layout-mode="chat"] #claude-code-desktop .starter-chips {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

body[data-layout-mode="chat"] #claude-code-desktop .gpt-composer-form {
  border-radius: 14px !important;
  padding: 0.65rem 0.85rem !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.24);
}

body.theme-warm-light[data-layout-mode="chat"] #claude-code-desktop .gpt-composer-form {
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

/* 2. Studio IDE Mode: Clean Bottom Linux Terminal Drawer */
.terminal-drawer-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

body #dockable-canvas-pane.cursor-center-workbench #terminal-topbar {
  display: none !important;
}

body #dockable-canvas-pane.cursor-center-workbench #canvas-panel-terminal.active {
  display: flex !important;
  flex-direction: column;
  min-height: 190px;
  max-height: 36vh;
  background: #0b0e14;
}

body.theme-warm-light #dockable-canvas-pane.cursor-center-workbench #canvas-panel-terminal.active {
  background: #f8fafc;
}

body #dockable-canvas-pane.cursor-center-workbench #terminal-output {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.48;
  padding: 0.55rem 0.85rem;
}

body #dockable-canvas-pane.cursor-center-workbench .terminal-prompt {
  color: #34d399;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-weight: 600;
  font-size: 0.78rem;
}

body.theme-warm-light #dockable-canvas-pane.cursor-center-workbench .terminal-prompt {
  color: #047857;
}

/* 3. Spacious Full-Height Inspectors Modal (85vh) & GitHub Vault Modal */
.inspectors-modal[hidden],
.github-connect-modal[hidden] {
  display: none !important;
}

.inspectors-modal,
.github-connect-modal {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5vh 2vw;
}

.inspectors-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(5px);
}

.inspectors-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(1240px, 94vw);
  height: 86vh;
  max-height: 920px;
  background: var(--bg-surface, #111318);
  color: var(--text-primary, #f4f4f5);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.theme-warm-light .inspectors-modal-dialog,
body.theme-warm-light .github-connect-dialog {
  background: #ffffff;
  color: #111827;
  border-color: #cbd5e1;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.inspectors-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 18, 26, 0.95);
  flex-shrink: 0;
}

body.theme-warm-light .inspectors-modal-header {
  background: #f8fafc;
  border-bottom-color: #e2e8f0;
}

.inspectors-modal-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
  font-size: 0.85rem;
}

.inspectors-tabs-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  overflow-x: auto;
  scrollbar-width: thin;
  flex: 1;
}

.inspectors-tabs-nav .canvas-tab-btn {
  padding: 0.35rem 0.7rem;
  border-radius: 7px;
  font-size: 0.76rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.inspectors-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.inspectors-modal-body > .canvas-panel[hidden] {
  display: none !important;
}

.inspectors-modal-body > .canvas-panel.active {
  display: block !important;
}

.inspectors-modal-body #neural-3d-canvas {
  width: 100%;
  height: 460px;
  min-height: 320px;
}

.github-connect-dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 92vw);
  background: var(--bg-surface, #111318);
  color: var(--text-primary, #f4f4f5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  overflow: hidden;
}

.github-connect-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-warm-light .github-connect-header {
  border-bottom-color: #e2e8f0;
}

.github-connect-subtitle {
  font-size: 0.74rem;
  color: var(--text-muted, #94a3b8);
  margin-top: 0.2rem;
}

body.theme-warm-light .github-connect-subtitle {
  color: #475569;
}

.github-connect-body {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  padding: 1.1rem 1.2rem;
}

.github-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.github-input-row input {
  flex: 1;
}

.chat-bridge-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #38bdf8;
  margin-bottom: 0.35rem;
}

body.theme-warm-light .chat-bridge-pill {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e40af;
}

.studio-update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.45rem 0.85rem;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.2));
  border-bottom: 1px solid rgba(16, 185, 129, 0.55);
  color: #ecfdf5;
  font-size: 0.78rem;
}

.studio-update-banner[hidden] {
  display: none !important;
}

.studio-update-reload-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #10b981;
  background: #059669;
  color: #ffffff;
  font-weight: 600;
  cursor: pointer;
}

.scm-workflow-card {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
  padding: 0.45rem;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.scm-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.scm-branch-select {
  min-width: 92px;
  max-width: 130px;
}

.scm-lazy-status {
  font-size: 0.68rem;
  color: #94a3b8;
}

.scm-diff-preview {
  max-height: 150px;
  overflow: auto;
  margin: 0.25rem 0;
  padding: 0.4rem;
  border-radius: 6px;
  background: #0b0f19;
  border: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 0.68rem;
  line-height: 1.35;
  white-space: pre-wrap;
}

.scm-ci-chip {
  flex: 1;
  font-size: 0.68rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #e0f2fe;
}

.stitch-health-card {
  margin-top: 0.4rem;
  padding: 0.45rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.32);
  font-size: 0.7rem;
  line-height: 1.4;
}

/* afflom/me compact embed mode (?embed=me) */
body.embed-me-compact > main,
body[data-embed="me"] > main {
  grid-template-columns: minmax(0, 1fr) !important;
}

body.embed-me-compact #threads-sidebar,
body[data-embed="me"] #threads-sidebar,
body.embed-me-compact #cowork-agent-status-bar,
body[data-embed="me"] #cowork-agent-status-bar {
  display: none !important;
}

body.embed-me-compact .gpt-topbar,
body[data-embed="me"] .gpt-topbar {
  height: 44px !important;
  min-height: 44px !important;
  padding: 0 0.5rem !important;
}






