:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #c9d1d9;
  background: #1f2229;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 7px 8px;
  color: #dfe5ed;
  background: #171a21;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #a66cff;
  box-shadow: 0 0 0 2px rgba(166, 108, 255, 0.22);
}

pre {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ide-shell {
  height: 100vh;
  min-height: 620px;
  display: grid;
  grid-template-rows: 38px minmax(0, 1fr) 24px;
  background: #1f2229;
}

.ide-titlebar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-bottom: 1px solid #333844;
  color: #e3e8ef;
  background: #252934;
}

.project-mark {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  background: #fc6d26;
  font-weight: 700;
  font-size: 11px;
}

.project-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.project-meta strong {
  font-size: 13px;
}

.project-meta span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-select {
  width: auto;
  max-width: 260px;
  min-height: 26px;
  padding: 3px 7px;
  color: #dfe5ed;
  background: #1b1e26;
  font-size: 12px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  color: #dfe5ed;
  background: #1f2229;
}

.auth-card {
  width: min(420px, 100%);
  display: grid;
  gap: 12px;
  border: 1px solid #333844;
  border-radius: 8px;
  padding: 22px;
  background: #252934;
}

.project-mark.large {
  width: 40px;
  height: 40px;
}

.auth-card h1 {
  margin: 0;
  font-size: 22px;
}

.auth-card p {
  margin: 0 0 4px;
  color: #9da7b4;
  line-height: 1.5;
}

.auth-card label {
  display: grid;
  gap: 6px;
  color: #b7c0cc;
  font-size: 12px;
}

.auth-error {
  border: 1px solid #7b3329;
  border-radius: 4px;
  padding: 8px 9px;
  color: #ffd2c8;
  background: #3b1d1a;
  font-size: 12px;
}

.project-screen {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 46px minmax(0, 1fr);
  color: #dfe5ed;
  background: #1f2229;
}

.project-topbar {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-bottom: 1px solid #333844;
  background: #252934;
}

.project-topbar strong {
  display: block;
  font-size: 13px;
}

.project-topbar span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.project-topbar-actions button,
.project-list-header button {
  min-height: 28px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 9px;
  color: #d6dce5;
  background: #2b303c;
  font-size: 12px;
}

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

.project-list-panel,
.project-create-panel {
  min-width: 0;
  min-height: 0;
  overflow: auto;
}

.project-list-panel {
  border-right: 1px solid #333844;
}

.project-list-header {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #333844;
}

.project-list-header h1,
.project-create-panel h2,
.runtime-panel h2 {
  margin: 0;
  color: #e3e8ef;
  font-size: 16px;
}

.project-list-header p {
  margin: 4px 0 0;
  color: #9da7b4;
  font-size: 12px;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
  padding: 16px;
}

.project-card {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(54px, auto) auto auto;
  gap: 12px;
  border: 1px solid #333844;
  border-radius: 6px;
  padding: 14px;
  background: #252934;
}

.project-card.selected {
  border-color: #fc6d26;
}

.project-card h2 {
  margin: 0 0 4px;
  color: #ffffff;
  font-size: 15px;
}

.project-card span {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.project-card-meta small,
.runtime-chip {
  min-height: 22px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a404d;
  border-radius: 999px;
  padding: 0 8px;
  color: #d6dce5;
  background: #1b1e26;
  font-size: 11px;
}

.runtime-chip.ok,
.runtime-summary .ok {
  color: #c8f6dd;
  border-color: #2d6848;
  background: #193426;
}

.runtime-chip.warn,
.runtime-summary .warn {
  color: #ffe9a3;
  border-color: #7b6429;
  background: #302a18;
}

.project-create-panel {
  display: grid;
  align-content: start;
  gap: 0;
  background: #222631;
}

.project-create-panel form,
.runtime-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid #333844;
}

.project-create-panel label {
  display: grid;
  gap: 6px;
  color: #b7c0cc;
  font-size: 12px;
}

.runtime-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #9da7b4;
  font-size: 12px;
}

.runtime-row strong {
  color: #dfe5ed;
}

.project-error {
  grid-column: 1 / -1;
  border: 1px solid #7b3329;
  border-radius: 4px;
  padding: 8px 9px;
  color: #ffd2c8;
  background: #3b1d1a;
  font-size: 12px;
}

.menubar {
  display: flex;
  align-items: center;
  gap: 2px;
}

.menubar button,
.titlebar-actions button {
  min-height: 28px;
  border-radius: 4px;
  padding: 0 9px;
  color: #c9d1d9;
  font-size: 12px;
}

.menubar button:hover,
.titlebar-actions button:hover {
  background: #343946;
}

.titlebar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
}

.connection.ok {
  color: #c8f6dd;
  border-color: #2d6848;
  background: #193426;
}

.connection.bad {
  color: #ffd2c8;
  border-color: #7b3329;
  background: #3b1d1a;
}

.titlebar-actions .runtime-chip,
.statusbar .runtime-chip {
  white-space: nowrap;
}

.ide-body {
  min-height: 0;
  display: grid;
  grid-template-columns: 48px minmax(250px, 320px) minmax(0, 1fr);
}

.activitybar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  border-right: 1px solid #333844;
  background: #1b1e26;
}

.activity-button {
  position: relative;
  height: 52px;
  display: grid;
  place-items: center;
  border-left: 3px solid transparent;
  color: #8f9aaa;
  font-size: 10px;
  font-weight: 700;
}

.activity-button:hover,
.activity-button.active {
  color: #ffffff;
  background: #252934;
}

.activity-button.active {
  border-left-color: #fc6d26;
}

.activity-button small {
  position: absolute;
  top: 6px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: #db3b21;
  font-size: 10px;
}

.sidebar {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #333844;
  background: #222631;
}

.side-header {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid #333844;
}

.side-header h2 {
  margin: 0;
  color: #e3e8ef;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.side-header button,
.path-tools button,
.run-card button {
  min-height: 28px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 8px;
  color: #d6dce5;
  background: #2b303c;
  font-size: 12px;
}

.side-header button:hover,
.path-tools button:hover,
.run-card button:hover {
  background: #363c49;
}

.workspace-title {
  padding: 10px 12px 6px;
  color: #dfe5ed;
  font-size: 12px;
  font-weight: 700;
}

.path-tools {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 6px 10px 8px;
}

.path-tools span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-list,
.change-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 4px 6px 10px;
}

.file-row,
.change-row {
  width: 100%;
  min-height: 28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  border-radius: 4px;
  padding: 4px 6px;
  color: #d6dce5;
  text-align: left;
}

.change-row {
  grid-template-columns: auto minmax(0, 1fr);
}

.file-row:hover,
.file-row.selected,
.change-row:hover {
  background: #303644;
}

.file-icon {
  color: #9da7b4;
  font-size: 11px;
}

.file-row span:nth-child(2),
.change-row span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row small {
  color: #7f8998;
  font-size: 11px;
}

.workbench {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 36px 32px minmax(0, 1fr) 260px;
  background: #1f2229;
}

.tabs {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  border-bottom: 1px solid #333844;
  background: #252934;
}

.tab {
  min-width: 128px;
  max-width: 240px;
  display: flex;
  align-items: center;
  border-right: 1px solid #333844;
  padding: 0 12px;
  color: #aeb7c5;
  font-size: 12px;
  text-align: left;
}

.tab.active {
  color: #ffffff;
  background: #1f2229;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 0 12px;
  border-bottom: 1px solid #333844;
  color: #9da7b4;
  background: #1f2229;
  font-size: 12px;
}

.breadcrumbs strong {
  color: #dfe5ed;
}

.dirty-dot {
  border: 1px solid #8c6d1f;
  border-radius: 999px;
  padding: 2px 7px;
  color: #ffe9a3;
  background: #302a18;
  font-size: 11px;
}

.editor-area {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-toolbar {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #333844;
  background: #1f2229;
}

.editor-toolbar strong {
  display: block;
  color: #e3e8ef;
  font-size: 13px;
}

.editor-toolbar span {
  color: #8f9aaa;
  font-size: 12px;
}

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

.toolbar-actions button,
.primary {
  min-height: 30px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 10px;
  color: #dfe5ed;
  background: #2b303c;
  font-size: 12px;
}

.toolbar-actions button:hover {
  background: #363c49;
}

.primary {
  border-color: #7b4ee2;
  color: #ffffff;
  background: #6f42c1;
}

.primary:hover {
  background: #7b4ee2;
}

.notice {
  margin: 10px 12px 0;
  border: 1px solid #3b5563;
  border-radius: 4px;
  padding: 8px 9px;
  color: #c8eef8;
  background: #1b3139;
  font-size: 12px;
}

.notice.compact {
  margin: 0 12px 8px;
}

.editor {
  flex: 1;
  min-height: 0;
  border: 0;
  border-radius: 0;
  padding: 14px 16px;
  resize: none;
  color: #dfe5ed;
  background: #1f2229;
  box-shadow: none;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.58;
}

.welcome-pane {
  max-width: 680px;
  margin: 72px auto 0;
  padding: 0 28px;
}

.welcome-pane h2 {
  margin: 0 0 10px;
  color: #e3e8ef;
  font-size: 20px;
}

.welcome-pane p {
  margin: 0 0 18px;
  color: #9da7b4;
  line-height: 1.55;
}

.welcome-pane button {
  min-height: 34px;
  border: 1px solid #3a404d;
  border-radius: 4px;
  padding: 0 12px;
  color: #ffffff;
  background: #2b303c;
}

.runtime-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
}

.runtime-summary span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  border: 1px solid #3a404d;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
}

.bottom-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: 34px minmax(0, 1fr);
  border-top: 1px solid #333844;
  background: #1b1e26;
}

.bottom-tabs {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #333844;
}

.bottom-tabs button {
  min-width: 98px;
  padding: 0 12px;
  color: #9da7b4;
  border-right: 1px solid #333844;
  font-size: 12px;
  text-align: left;
}

.bottom-tabs button.active {
  color: #ffffff;
  background: #252934;
}

.terminal-form {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid #333844;
}

.command-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.terminal-output {
  height: 100%;
  overflow: auto;
  padding: 10px 12px;
  color: #d8edf0;
  background: #10141a;
}

.model-panel,
.problems-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
}

.model-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 12px;
}

.model-output {
  overflow: auto;
  padding: 10px 12px;
  color: #d6dce5;
  background: #171a21;
}

.empty-panel {
  padding: 14px 12px;
  color: #9da7b4;
  font-size: 12px;
}

.scm-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #333844;
  font-size: 12px;
}

.scm-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #dfe5ed;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scm-summary span {
  color: #9da7b4;
}

.commit-box,
.settings-stack label {
  display: grid;
  gap: 6px;
  color: #9da7b4;
  font-size: 12px;
}

.commit-box {
  padding: 10px 12px;
  border-bottom: 1px solid #333844;
}

.scm-section-title {
  padding: 9px 12px 4px;
  color: #dfe5ed;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.change-badge {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #ffffff;
  background: #6f42c1;
  font-size: 11px;
  font-weight: 700;
}

.run-card,
.settings-stack,
.member-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #333844;
}

.members-list,
.resource-list {
  display: grid;
  gap: 4px;
  padding: 6px;
  border-bottom: 1px solid #333844;
}

.member-row,
.resource-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  border-radius: 4px;
  padding: 7px 8px;
  background: #1f2229;
}

.member-row strong,
.resource-row strong {
  min-width: 0;
  overflow: hidden;
  color: #dfe5ed;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row span,
.resource-row span {
  min-width: 0;
  overflow: hidden;
  color: #9da7b4;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-row small,
.resource-row small {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  border: 1px solid #3a404d;
  border-radius: 999px;
  padding: 2px 7px;
  color: #d6dce5;
  font-size: 11px;
}

.run-card strong {
  color: #dfe5ed;
  font-size: 13px;
}

.run-card p {
  margin: 0;
  color: #9da7b4;
  font-size: 12px;
  line-height: 1.45;
}

.statusbar {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  color: #ffffff;
  background: #6f42c1;
  font-size: 12px;
}

.statusbar button {
  min-height: 22px;
  padding: 0 4px;
  color: #ffffff;
  font-size: 12px;
}

.statusbar button:hover {
  background: rgba(255, 255, 255, 0.13);
}

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

.status-spacer {
  flex: 1;
}

@media (max-width: 1040px) {
  .ide-body {
    grid-template-columns: 48px minmax(220px, 290px) minmax(0, 1fr);
  }

  .menubar {
    display: none;
  }

  .project-select-layout {
    grid-template-columns: 1fr;
  }

  .project-list-panel {
    border-right: 0;
  }
}

@media (max-width: 760px) {
  .ide-titlebar {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .titlebar-actions .connection {
    display: none;
  }

  .titlebar-actions .runtime-chip {
    display: none;
  }

  .project-topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .project-topbar-actions {
    grid-column: 1 / -1;
    padding-bottom: 8px;
  }

  .project-grid {
    grid-template-columns: 1fr;
    padding: 10px;
  }

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

  .sidebar {
    display: none;
  }

  .workbench {
    grid-template-rows: 36px 32px minmax(0, 1fr) 300px;
  }

  .terminal-form,
  .model-form {
    grid-template-columns: 1fr;
  }
}
