:root {
  color-scheme: dark;
  --bg: #17191c;
  --surface: #1f2226;
  --surface-2: #252a30;
  --surface-3: #2c323a;
  --text: #e7eaee;
  --muted: #9aa6b2;
  --line: #3a414a;
  --accent: #2f7dd1;
  --accent-2: #1d4f85;
  --danger: #d96b6b;
  --warning: #d4a84f;
  --ok: #66b889;
  --focus: #8ec5ff;
}

body[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5f7;
  --surface: #ffffff;
  --surface-2: #eef2f5;
  --surface-3: #e4e9ef;
  --text: #1f252c;
  --muted: #647384;
  --line: #d3dbe4;
  --accent: #1267b3;
  --accent-2: #dcecfb;
  --danger: #b64242;
  --warning: #8b6422;
  --ok: #247548;
  --focus: #1267b3;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  min-width: 360px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font: 13px "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.workbench {
  height: 100vh;
  display: grid;
  grid-template-columns: 48px 300px minmax(0, 1fr);
  grid-template-rows: 42px minmax(0, 1fr) 190px 24px;
  grid-template-areas:
    "activity title title"
    "activity side editor"
    "activity side panel"
    "status status status";
}

.activity-bar {
  grid-area: activity;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-right: 1px solid var(--line);
  background: #15171a;
}

body[data-theme="light"] .activity-bar {
  background: #e8edf2;
}

.activity-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
}

.activity-button:hover,
.activity-button.active {
  background: var(--surface-2);
  color: var(--text);
}

.activity-button.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.title-bar {
  grid-area: title;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.brand,
.title-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-2);
  font-weight: 750;
}

.brand-name {
  font-size: 13px;
  font-weight: 700;
}

.brand-subtitle {
  max-width: 56vw;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-button,
.icon-button {
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.command-button {
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
}

.icon-button {
  width: 30px;
  font-weight: 700;
}

.side-bar {
  grid-area: side;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.pane-header {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 11px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.tree {
  padding: 8px;
}

.tree-section {
  margin-bottom: 12px;
}

.tree-section-title {
  padding: 7px 6px 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.tree-item {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 7px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.tree-item:hover,
.tree-item.active {
  background: var(--surface-2);
}

.tree-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tree-badge {
  color: var(--muted);
  font-size: 11px;
}

.editor-area {
  grid-area: editor;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 36px minmax(0, 1fr);
  background: var(--bg);
}

.editor-area.dragging {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.tab-strip {
  min-width: 0;
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.editor-tab {
  height: 35px;
  min-width: 118px;
  max-width: 220px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.editor-tab.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 2px 0 var(--accent);
}

.editor-tab span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-close {
  color: var(--muted);
  font-size: 13px;
}

.editor-surface {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--surface);
}

.empty-state {
  height: 100%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.empty-title {
  color: var(--text);
  font-size: 24px;
  font-weight: 750;
}

.view {
  min-width: 0;
  height: 100%;
  overflow: auto;
  padding: 14px;
}

