:root {
  color-scheme: dark;
  --bg: #111111;
  --panel: #181818;
  --panel-2: #1e1e1e;
  --panel-3: #252526;
  --border: #2d2d30;
  --text: #d4d4d4;
  --muted: #9da1a6;
  --accent: #0e639c;
  --accent-2: #3794ff;
  --danger: #c74e39;
  --good: #4ec9b0;
  --tab-height: 28px;
  --header-height: 54px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}

body { min-height: 100vh; }

body.dialog-open {
  overflow: hidden;
}

body.embed-mode {
  --header-height: 46px;
}

.hidden { display: none !important; }

.app-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: var(--header-height) 1fr;
  position: relative;
}

.startup-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(17, 17, 17, 0.72);
  backdrop-filter: blur(2px);
}

.startup-card {
  min-width: 280px;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 0;
}

.startup-logo {
  display: block;
  width: auto;
  height: 56px;
  max-width: 440px;
}

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}

.startup-message {
  color: var(--text);
  font-size: 13px;
}

.app-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 16px;
  padding: 0 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.app-header-brand {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 0;
}

.app-logo {
  display: block;
  height: 24px;
  width: auto;
  max-width: 100%;
}

.app-header p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.embed-mode .app-header {
  gap: 10px;
  padding: 0 10px;
}

.embed-mode .app-header-brand,
.embed-mode .pill {
  display: none;
}

.app-header-controls {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.pill,
.tab,
button,
textarea {
  font: inherit;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  justify-self: end;
  align-self: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  color: var(--muted);
  background: var(--panel-2);
  font-size: 12px;
}

.user-pill-id {
  color: var(--text);
  white-space: nowrap;
}

.user-pill-roles {
  font-size: 10px;
  line-height: 1;
  opacity: 0.8;
  white-space: nowrap;
  text-align: right;
}

.mode-shell {
  min-height: 0;
  display: grid;
}

.tabs-bar {
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  align-self: stretch;
  justify-content: flex-start;
  gap: 8px;
  overflow: hidden;
}

.tabs {
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  justify-content: flex-start;
}

.new-project-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.new-project-form input {
  width: 180px;
  height: var(--tab-height);
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--panel-3);
  color: var(--text);
}

.new-project-form button {
  height: var(--tab-height);
  padding-top: 0;
  padding-bottom: 0;
}

.tab {
  height: var(--tab-height);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: var(--panel-2);
  cursor: pointer;
}

.tab-new {
  width: var(--tab-height);
  justify-content: center;
  padding: 0;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.tab.active {
  color: var(--text);
  background: var(--panel-3);
  border-color: var(--border);
}

.tab-indicator {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--good);
}

.tab-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.tab-status-dot.running {
  background: #60a5fa;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

.tab-status-dot.awaiting {
  background: #fbbf24;
}

.tab-status-dot.error {
  background: #f87171;
}

button {
  color: var(--text);
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  cursor: pointer;
}

button:hover {
  border-color: #3e3e42;
}

button.danger {
  border-color: var(--danger);
}

.empty-state {
  margin: 14px;
  padding: 24px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.project-layout {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 8px minmax(320px, 34%);
}

.workspace-panel,
.chat-panel {
  min-height: 0;
  background: var(--panel-2);
}

.workspace-panel {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border-right: 1px solid var(--border);
}

.header-actions {
  display: flex;
  gap: 8px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

.workspace-footer {
  display: grid;
  gap: 2px;
  padding: 6px 10px 7px;
  border-top: 1px solid var(--border);
  background: #171717;
}

.workspace-footer-title {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-footer-meta {
  font-size: 10px;
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-status-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.project-status-chip.ready {
  color: #a7f3d0;
  border-color: rgba(78, 201, 176, 0.35);
  background: rgba(78, 201, 176, 0.12);
}

.project-status-chip.running {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.35);
  background: rgba(96, 165, 250, 0.12);
}

.project-status-chip.awaiting {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.35);
  background: rgba(251, 191, 36, 0.12);
}

.project-status-chip.error {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.12);
}

.workspace-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.explorer-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  border-right: 1px solid var(--border);
  background: #181818;
}

.explorer-header {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  color: var(--muted);
}

.file-tree {
  overflow: auto;
  padding: 4px 0;
}

.file-tree-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  border: 0;
  border-radius: 0;
  min-height: 24px;
  padding: 3px 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12px;
}

.file-tree-item:hover,
.file-tree-item.active {
  background: rgba(255, 255, 255, 0.06);
}

.file-tree-item.cut-marked {
  opacity: 0.55;
}

.file-tree-item.dir {
  color: var(--muted);
}

.tree-chevron {
  flex: 0 0 10px;
  color: var(--muted);
  transition: transform 0.12s ease;
  font-size: 10px;
}

.tree-chevron.collapsed {
  transform: rotate(-90deg);
}

.tree-chevron.spacer {
  visibility: hidden;
}

.tree-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.git-status-badge {
  margin-left: auto;
  flex: 0 0 auto;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 9px;
  line-height: 16px;
  text-align: center;
  background: #2c2c2c;
  color: var(--muted);
}

.git-modified {
  background: rgba(55, 148, 255, 0.18);
  color: #80bdff;
}

.git-added {
  background: rgba(78, 201, 176, 0.18);
  color: #7fdcc9;
}

.git-untracked {
  background: rgba(199, 78, 57, 0.18);
  color: #f49b8a;
}

.git-deleted,
.git-renamed {
  background: rgba(255, 200, 87, 0.18);
  color: #ffd26f;
}

.editor-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--panel-3);
}

.editor-surface {
  min-width: 0;
  min-height: 0;
  position: relative;
  background: #1e1e1e;
}

.editor-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: #181818;
}

.editor-current-file {
  min-width: 0;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.editor-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.secondary-toggle {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  background: #202020;
}

.secondary-toggle[aria-pressed="true"] {
  border-color: var(--accent-2);
  color: #ffffff;
}

.editor-status {
  font-size: 12px;
  color: var(--muted);
}

.editor-host {
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: #1e1e1e;
}

.markdown-preview-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 6;
}

.markdown-preview-toggle {
  height: 26px;
  padding: 0 10px;
  background: rgba(24, 24, 24, 0.94);
  backdrop-filter: blur(4px);
}

.markdown-preview {
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 44px 18px 18px;
  background: #1e1e1e;
}

.editor-changed-line {
  background: rgba(251, 191, 36, 0.16);
}

.editor-changed-line-glyph {
  border-left: 3px solid #fbbf24;
  margin-left: 2px;
}

.chat-resizer {
  cursor: col-resize;
  background: var(--border);
}

.chat-panel {
  display: grid;
}

.chat-panel {
  grid-template-rows: 1fr auto auto;
}

.chat-log {
  overflow: auto;
  padding: 12px;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 10px;
  background: var(--panel-2);
}

.chat-token-counter {
  padding: 8px 14px 0;
  font-size: 12px;
}

.message {
  display: grid;
  gap: 8px;
  background: #171717;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.45;
}

.message.user {
  border-color: var(--accent-2);
  background: #151d24;
}

.message.event {
  color: var(--muted);
}

.message.pending {
  border-style: dashed;
}

.history-window-banner {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
}

.history-window-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.history-window-banner-button {
  padding: 6px 10px;
  font-size: 12px;
}

.history-window-banner-hint {
  color: var(--muted);
  font-size: 11px;
}

.message-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.message-body,
.assistant-summary {
  min-width: 0;
}

.assistant-summary {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: 0;
}

.assistant-summary-fallback {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.activity-bundle {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #161616;
  overflow: hidden;
}

.activity-bundle-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
}

.activity-bundle-summary::-webkit-details-marker {
  display: none;
}

.activity-bundle-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.activity-bundle-meta {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.activity-feed {
  display: grid;
  gap: 6px;
  padding: 0 8px 8px;
  position: relative;
}

.activity-feed::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 6px;
  bottom: 12px;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.activity-card {
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #1a1a1a;
  overflow: hidden;
  margin-left: 20px;
  position: relative;
}

.activity-card::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #3b3b3b;
  box-shadow: 0 0 0 4px #161616;
}

.activity-card.command::before,
.activity-card.output::before {
  background: #60a5fa;
}

.activity-card.status::before {
  background: #fbbf24;
}

.activity-card.changed_files::before {
  background: #4ade80;
}

.activity-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
}

.activity-summary::-webkit-details-marker {
  display: none;
}

.activity-title {
  min-width: 0;
  font-size: 11px;
  color: var(--text);
}

.activity-title-wrap {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 1px;
}

.activity-preview {
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.activity-step-index {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #252526;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}

.activity-label {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.activity-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 1px 6px;
  font-size: 10px;
  text-transform: lowercase;
  background: #2a2a2a;
  color: var(--muted);
}

.activity-badge.running {
  color: #ffffff;
  background: var(--accent);
}

.activity-body {
  padding: 0 8px 8px;
}

.activity-body .activity-pre,
.activity-body .code-block {
  padding: 8px 10px;
}

.activity-pre,
.code-block {
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid #303031;
  background: #111111;
  font: 12px/1.5 Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
}

.code-block code {
  display: block;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: inherit;
  font: inherit;
  white-space: pre;
  tab-size: 2;
}

.changed-files-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.changed-files-summary {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #171717;
  border: 1px solid var(--border);
}

.changed-files-summary-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.changed-file-link {
  width: auto;
  max-width: 100%;
  text-align: left;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid #315b96;
  background: #12233b;
  color: #d7e7ff;
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease, transform 120ms ease;
}

.changed-file-link:hover {
  background: #183154;
  border-color: #4d7ec4;
  color: #f4f8ff;
}

.changed-file-link:focus-visible {
  outline: none;
  background: #1b3559;
  border-color: #77a6ec;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(90, 150, 255, 0.18);
}

.changed-file-link:active {
  transform: translateY(1px);
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body p,
.markdown-body ul,
.markdown-body ol,
.markdown-body pre,
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 0 0 10px;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  color: #ffffff;
  font-weight: 600;
}

.markdown-body h1 {
  font-size: 28px;
}

.markdown-body h2 {
  font-size: 24px;
}

.markdown-body h3 {
  font-size: 20px;
}

.markdown-body h4 {
  font-size: 17px;
}

.markdown-body h5 {
  font-size: 15px;
}

.markdown-body h6 {
  font-size: 13px;
  color: #ffffff;
}

.markdown-body code:not([data-highlight-source]) {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  font: 12px Consolas, "SFMono-Regular", Menlo, Monaco, monospace;
}

.chat-form {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.chat-queue {
  display: grid;
  gap: 6px;
}

.queue-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #171717;
}

.queue-card.sending {
  border-style: dashed;
}

.queue-card-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.queue-card-meta {
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.queue-card-remove {
  border: 0;
  background: transparent;
  padding: 0 4px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.confirmation-card {
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(96, 165, 250, 0.08);
}

.queue-card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.queue-card-action {
  min-width: 96px;
}

.queue-card-action.primary {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(96, 165, 250, 0.18);
}

.queue-card-action.danger {
  border-color: rgba(248, 113, 113, 0.65);
  color: #fecaca;
}

.confirmation-preview {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  overflow: hidden;
}

.confirmation-preview summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
}

.confirmation-preview summary::-webkit-details-marker {
  display: none;
}

.confirmation-preview-code {
  margin: 0;
  padding: 0 12px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: #d6e9ff;
}

.run-state-card {
  grid-template-columns: minmax(0, 1fr) auto;
  border-style: dashed;
}

.run-state-card.running {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(96, 165, 250, 0.08);
}

.run-state-card.awaiting {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.08);
}

.run-state-card.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.chat-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.chat-composer-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-form textarea {
  min-height: 36px;
  max-height: 148px;
  resize: none;
  color: var(--text);
  background: var(--panel-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  overflow-y: auto;
  line-height: 1.4;
}

.icon-button {
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border-radius: 8px;
}

.icon-button.danger {
  border-color: var(--danger);
  color: #ffb1a5;
}

.icon-button:disabled {
  opacity: 0.45;
  cursor: default;
}


.dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.dialog-card {
  width: min(560px, 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel-2);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.dialog-header,
.dialog-body,
.dialog-actions {
  padding: 18px 20px;
}

.dialog-header {
  padding-bottom: 6px;
}

.dialog-title {
  margin: 0;
  font-size: 18px;
}

.dialog-body {
  display: grid;
  gap: 12px;
  color: var(--text);
}

.dialog-body p {
  margin: 0;
  line-height: 1.5;
}

.dialog-details {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.dialog-details summary {
  cursor: pointer;
  padding: 10px 12px;
  color: var(--muted);
}

.dialog-details pre {
  margin: 0;
  padding: 0 12px 12px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 0;
}

.dialog-button {
  min-width: 110px;
}

.dialog-button.primary {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(96, 165, 250, 0.18);
}

.dialog-button.danger {
  border-color: rgba(248, 113, 113, 0.65);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  display: grid;
  gap: 10px;
  max-width: min(420px, calc(100vw - 36px));
}

.toast {
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 14px;
  background: rgba(20, 20, 22, 0.96);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
}

.toast.error {
  border-left-color: rgba(248, 113, 113, 0.95);
}

.toast.success {
  border-left-color: rgba(74, 222, 128, 0.95);
}

.toast.info {
  border-left-color: rgba(96, 165, 250, 0.95);
}

.explorer-context-menu {
  position: fixed;
  z-index: 40;
  width: 196px;
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #181818;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.42);
}

.explorer-context-menu button {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
  padding: 8px 10px;
  font-size: 12px;
}

.explorer-context-menu button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
}

.explorer-context-menu button:disabled {
  color: #666a70;
  cursor: default;
}

@media (max-width: 1200px) {
  .workspace-body {
    grid-template-columns: 200px minmax(0, 1fr);
  }
}

@media (max-width: 980px) {
  .project-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(320px, 40%);
  }

  .chat-resizer {
    display: none;
  }

  .workspace-body {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.25);
    opacity: 0.7;
  }
}
