:root {
  --ink: #17211b;
  --muted: #68736d;
  --paper: #f5f3ed;
  --surface: #fffdf8;
  --line: #dedbd1;
  --accent: #1d6b4f;
  --accent-dark: #13513b;
  --accent-soft: #dcebe3;
  --warning: #ad6726;
  --danger: #a13e36;
  --shadow: 0 18px 45px rgb(35 46 39 / 8%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(circle at 10% -10%, rgb(71 139 107 / 14%), transparent 34rem),
    var(--paper);
}

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

button {
  cursor: pointer;
}

.topbar,
main {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 58px 0 32px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.subtitle,
.muted,
.form-hint {
  color: var(--muted);
}

.subtitle {
  margin-bottom: 0;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}

.metric {
  display: flex;
  min-height: 104px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgb(255 253 248 / 76%);
}

.metric span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2rem;
  font-weight: 500;
}

.metric-accent {
  border-color: var(--accent);
  color: white;
  background: var(--accent);
}

.metric-accent span {
  color: rgb(255 255 255 / 70%);
}

.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.runtime-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  margin-bottom: 20px;
}

.section-description {
  margin: -12px 0 0;
  color: var(--muted);
}

.runtime-form {
  display: grid;
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.runtime-form > label {
  max-width: 380px;
}

.upload-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.upload-heading div {
  display: grid;
  gap: 3px;
}

.upload-heading span {
  color: var(--muted);
  font-size: 0.78rem;
}

.upload-list,
.artifact-list {
  display: grid;
  gap: 9px;
}

.upload-row,
.artifact-item {
  display: grid;
  align-items: end;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8f6f0;
}

.upload-row {
  grid-template-columns: minmax(140px, 0.7fr) minmax(220px, 1.3fr) auto;
}

.runtime-submit {
  justify-self: start;
}

.artifact-item {
  grid-template-columns: minmax(150px, 0.8fr) minmax(220px, 1.4fr) auto;
  align-items: center;
}

.artifact-identity,
.artifact-details {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.artifact-identity span,
.artifact-details span {
  color: var(--muted);
  font-size: 0.78rem;
}

.artifact-hash {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-download {
  text-decoration: none;
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.section-heading .muted {
  margin-bottom: 0;
  font-size: 0.82rem;
}

.stack-form,
.dialog-form {
  display: grid;
  gap: 14px;
}

.stack-form {
  padding: 18px;
  border-radius: 16px;
  background: #f1efe8;
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #cbc8bf;
  border-radius: 10px;
  outline: none;
  color: var(--ink);
  background: white;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(29 107 79 / 12%);
}

.button,
.icon-button {
  border: 0;
  transition: transform 130ms ease, background 130ms ease, opacity 130ms ease;
}

.button {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 10px;
  color: white;
  font-weight: 750;
  background: var(--accent);
}

.button:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

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

.button-secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface);
}

.button-secondary:hover:not(:disabled) {
  background: #ebe8de;
}

.card-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.resource-card,
.empty-state {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.resource-card {
  background: white;
}

.resource-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.resource-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.resource-card .description,
.resource-id {
  color: var(--muted);
  font-size: 0.78rem;
}

.resource-id {
  overflow-wrap: anywhere;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.pill {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  background: #eeece5;
}

.pill.ready,
.pill.online,
.pill.running {
  color: var(--accent-dark);
  background: var(--accent-soft);
}

.pill.error,
.pill.versionmismatch {
  color: var(--danger);
  background: #f6dedb;
}

.pill.connecting,
.pill.starting,
.pill.initializing,
.pill.grace {
  color: var(--warning);
  background: #f6e9d8;
}

.card-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #ece9e1;
  font-size: 0.75rem;
}

.card-meta span {
  color: var(--muted);
}

.link-button {
  padding: 4px;
  border: 0;
  color: var(--accent);
  font-weight: 750;
  background: transparent;
}

.empty-state {
  color: var(--muted);
  text-align: center;
  background: #faf8f3;
}

.form-hint {
  margin: 0;
  font-size: 0.78rem;
}

dialog {
  width: min(480px, calc(100% - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 30px 90px rgb(21 33 26 / 28%);
}

dialog::backdrop {
  background: rgb(20 29 24 / 45%);
  backdrop-filter: blur(3px);
}

.dialog-form {
  padding: 24px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 1.4rem;
  background: #efede6;
}

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

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100% - 48px));
  padding: 13px 16px;
  border-radius: 12px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--danger);
}

@media (max-width: 780px) {
  .topbar {
    align-items: start;
    flex-direction: column;
    padding-top: 38px;
  }

  .summary,
  .content-grid,
  .runtime-panel {
    grid-template-columns: 1fr;
  }

  .upload-row,
  .artifact-item {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .upload-remove,
  .artifact-download {
    justify-self: start;
  }

  .summary {
    grid-template-columns: repeat(2, 1fr);
  }

  .metric-accent {
    grid-column: 1 / -1;
  }
}

@media (max-width: 480px) {
  .topbar,
  main {
    width: min(100% - 24px, 1180px);
  }

  .inline-form,
  .card-meta {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
    border-radius: 17px;
  }
}
.workspace-actions {
  display: flex;
  gap: .55rem;
  margin-top: .8rem;
}

.workspace-actions .button { padding: .55rem .8rem; }

.init-command {
  display: block;
  padding: .7rem;
  border-radius: .55rem;
  background: #f4f2ed;
  overflow-wrap: anywhere;
}

.command-block { margin-top: .8rem; }
.command-label {
  display: block;
  margin-bottom: .3rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.system-service-command {
  display: inline-block;
  margin-top: .75rem;
  padding: .45rem .65rem;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: .5rem;
  color: inherit;
  background: rgba(255, 255, 255, .08);
}

.logs-dialog { width: min(900px, calc(100vw - 2rem)); }
.logs-output {
  min-height: 20rem;
  max-height: 65vh;
  overflow: auto;
  padding: 1rem;
  color: #d9eee4;
  background: #10251e;
  border-radius: .7rem;
  white-space: pre-wrap;
}
