:root {
  color-scheme: light;
  --ink: #14181f;
  --muted: #667085;
  --subtle: #8a94a6;
  --line: #d8dee8;
  --line-strong: #c4ccd8;
  --surface: #ffffff;
  --surface-soft: #f7f9fc;
  --page: #eef2f6;
  --navy: #162235;
  --teal: #0f766e;
  --teal-dark: #0b5f59;
  --amber: #b66a00;
  --red: #b42318;
  --blue: #315a96;
  --shadow: 0 18px 50px rgba(20, 24, 31, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, #f7f9fb 0, var(--page) 380px),
    var(--page);
  color: var(--ink);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1440px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  min-height: 70px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--navy);
  color: #ffffff;
  font-weight: 900;
}

.eyebrow,
.section-kicker {
  margin: 0 0 4px;
  color: var(--teal-dark);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
}

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

h1 {
  margin-bottom: 0;
  font-size: clamp(1.65rem, 4vw, 2.4rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 12px;
  font-size: 0.92rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.environment-badge,
.repo-link,
.step-pill,
.monitor-state,
.status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 800;
}

.environment-badge,
.repo-link {
  padding: 9px 12px;
}

.environment-badge {
  background: #e9f5f3;
  border-color: #b9d9d3;
  color: var(--teal-dark);
}

.repo-link {
  text-decoration: none;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 32px;
  align-items: end;
  padding: 38px 0 28px;
}

.overview h2 {
  max-width: 860px;
  margin-bottom: 12px;
  font-size: clamp(2rem, 4.5vw, 4.4rem);
  line-height: 1.02;
}

.overview p {
  max-width: 760px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.06rem;
  line-height: 1.65;
}

.overview-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.overview-stats div,
.metric-grid div,
.link-tile,
.event-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.overview-stats div {
  min-width: 0;
  padding: 13px;
}

.overview-stats span,
.metric-grid span,
.link-tile span {
  display: block;
  color: var(--subtle);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.overview-stats strong,
.metric-grid strong,
.link-tile strong {
  display: block;
  margin-top: 6px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.workspace-grid {
  display: grid;
  grid-template-columns: 440px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.surface {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.launch-surface,
.status-surface,
.monitor-surface,
.logs-surface {
  padding: 22px;
}

.stack {
  display: grid;
  gap: 18px;
}

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

.step-pill {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 34px;
  background: var(--navy);
  color: #ffffff;
}

.field-group {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.field-group:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 4px 0 18px;
}

label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

label:last-child {
  margin-bottom: 0;
}

label span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
}

input,
select {
  width: 100%;
  min-height: 43px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fbfcfe;
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.primary-action {
  width: 100%;
  min-height: 48px;
  border: 0;
  border-radius: 7px;
  background: var(--teal);
  color: #ffffff;
  font-weight: 900;
  cursor: pointer;
}

.primary-action:hover {
  background: var(--teal-dark);
}

.status {
  max-width: 320px;
  padding: 9px 12px;
  background: #f7f9fc;
  color: var(--muted);
  text-align: right;
  overflow-wrap: anywhere;
}

.status[data-state="queued"],
.status[data-state="provisioning"],
.status[data-state="installing"],
.status[data-state="starting"] {
  background: #fff7e8;
  border-color: #e6c37a;
  color: var(--amber);
}

.status[data-state="ready"] {
  background: #e8f5f3;
  border-color: #b9d9d3;
  color: var(--teal-dark);
}

.status[data-state="failed"] {
  background: #fff0ee;
  border-color: #f0b8b2;
  color: var(--red);
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 2px 0 18px;
}

.timeline-step {
  position: relative;
  min-width: 0;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
}

.timeline-step span {
  display: block;
  width: 10px;
  height: 10px;
  margin-bottom: 9px;
  border-radius: 999px;
  background: var(--line-strong);
}

.timeline-step strong {
  display: block;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.timeline-step.is-active {
  border-color: #e0b45b;
  background: #fff8eb;
  color: var(--amber);
}

.timeline-step.is-complete {
  border-color: #b9d9d3;
  background: #edf8f6;
  color: var(--teal-dark);
}

.timeline-step.is-complete span,
.timeline-step.is-active span {
  background: currentColor;
}

.timeline-step.is-failed {
  border-color: #efb1aa;
  background: #fff0ee;
  color: var(--red);
}

.link-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 10px;
}

.link-tile {
  min-width: 0;
  min-height: 78px;
  padding: 13px;
  text-decoration: none;
}

a.link-tile:hover {
  border-color: var(--teal);
  background: #eef8f6;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.metric-grid div {
  min-width: 0;
  padding: 13px;
}

.monitor-state {
  padding: 9px 12px;
  background: #f7f9fc;
}

.monitor-state[data-state="ready"] {
  background: #e8f5f3;
  border-color: #b9d9d3;
  color: var(--teal-dark);
}

.monitor-state[data-state="failed"] {
  background: #fff0ee;
  border-color: #f0b8b2;
  color: var(--red);
}

.monitor-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 18px;
}

.event-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.event-list li {
  padding: 10px 12px;
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.event-list li strong {
  color: var(--ink);
  font-size: 0.84rem;
}

.logs {
  min-height: 300px;
  max-height: 440px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  border: 1px solid #1c2939;
  border-radius: 8px;
  background: #111927;
  color: #d7e2ef;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

@media (max-width: 1180px) {
  .overview,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .overview-stats {
    max-width: 620px;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 24px, 1440px);
    padding-top: 16px;
  }

  .topbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .overview-stats,
  .field-row,
  .timeline,
  .link-grid,
  .metric-grid,
  .monitor-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    display: grid;
  }

  .overview {
    padding-top: 28px;
  }

  .overview h2 {
    font-size: 2rem;
  }

  .status {
    max-width: none;
    text-align: left;
  }
}
