:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #6f7c72;
  --line: #dce4dd;
  --paper: #fffef9;
  --canvas: #f4f6ef;
  --green: #1f6a4b;
  --green-dark: #145039;
  --lime: #dff26a;
  --amber: #ae6a00;
  --red: #b93f3f;
  --blue: #255da8;
  --shadow: 0 16px 45px rgba(33, 52, 38, 0.09);
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(
      circle at 10% -10%,
      rgba(223, 242, 106, 0.28),
      transparent 30rem
    ),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px max(24px, calc((100vw - 1440px) / 2));
  color: #fafff8;
  background: var(--ink);
  border-bottom: 4px solid var(--lime);
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: var(--ink);
  font-size: 23px;
  font-weight: 900;
  background: var(--lime);
  border-radius: 13px;
  transform: rotate(-3deg);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}
.topbar h1 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.01em;
}
.topbar p {
  margin: 3px 0 0;
  color: #aebbb1;
  font-size: 13px;
}
.health {
  margin-left: auto;
  color: #cbd5cd;
  font-size: 13px;
}
.health::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  background: #879189;
  border-radius: 50%;
}
.health.online::before {
  background: #8ee596;
  box-shadow: 0 0 0 4px rgba(142, 229, 150, 0.12);
}

main {
  width: min(1440px, calc(100% - 48px));
  margin: 28px auto 80px;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.auth-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
}
.auth-card h2,
.section-heading h2,
.build-form-card h2 {
  margin: 3px 0 0;
  font-size: 20px;
}
.eyebrow {
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.auth-form {
  display: flex;
  align-items: end;
  gap: 10px;
  width: min(520px, 100%);
}
.auth-form label {
  flex: 1;
}
label {
  display: grid;
  gap: 7px;
  color: #465149;
  font-size: 13px;
  font-weight: 650;
}
input,
select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5cd;
  border-radius: 10px;
  outline: none;
}
input:focus,
select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 106, 75, 0.12);
}

.button {
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 10px;
  font-weight: 750;
  cursor: pointer;
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.button.primary {
  color: white;
  background: var(--green);
}
.button.primary:hover {
  background: var(--green-dark);
}
.button.secondary {
  color: var(--ink);
  background: var(--lime);
}
.button.ghost {
  color: var(--green);
  background: #eaf1eb;
}
.button.danger {
  color: #fff;
  background: var(--red);
}

.notice {
  margin-top: 18px;
  padding: 13px 16px;
  color: #5d3e00;
  background: #fff1ca;
  border: 1px solid #ebcf82;
  border-radius: 12px;
  font-size: 13px;
}
.notice.error {
  color: #7b2424;
  background: #ffe7e4;
  border-color: #e9a7a0;
}
.hidden {
  display: none !important;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  margin-top: 20px;
  align-items: start;
}
.build-form-card {
  padding: 24px;
}
.build-form {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.build-form .primary {
  width: 100%;
  margin-top: 4px;
}
.repository-info {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 7px 12px;
  margin: 24px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.repository-info dt {
  color: var(--muted);
}
.repository-info dd {
  margin: 0;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.builds-card {
  min-width: 0;
  padding: 24px;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.table-scroll {
  margin-top: 18px;
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th {
  padding: 11px 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
td {
  padding: 13px 12px;
  border-bottom: 1px solid #e9eee9;
}
tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}
tbody tr:hover,
tbody tr.selected {
  background: #f0f5e9;
}
.target {
  font-weight: 750;
  text-transform: uppercase;
}
.subtle {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  text-transform: none;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: currentColor;
  border-radius: 50%;
}
.status.queued {
  color: var(--amber);
  background: #fff0c6;
}
.status.running {
  color: var(--blue);
  background: #e4efff;
}
.status.cancelling {
  color: var(--amber);
  background: #fff0c6;
}
.status.succeeded {
  color: var(--green);
  background: #dff2e6;
}
.status.failed,
.status.cancelled {
  color: var(--red);
  background: #ffe7e4;
}
.empty {
  padding: 56px 20px;
  color: var(--muted);
  text-align: center;
}

.detail-card {
  margin-top: 20px;
  padding: 24px;
}
.actions {
  display: flex;
  gap: 8px;
}
.detail-meta {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}
.meta-item {
  padding: 13px;
  background: #f1f4ef;
  border-radius: 10px;
}
.meta-item span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.meta-item strong {
  display: block;
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifacts {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}
.artifact {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  background: #eef5e8;
  border: 1px solid #d4e1cb;
  border-radius: 11px;
}
.artifact-info {
  min-width: 0;
  flex: 1;
}
.artifact-name {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-hash {
  margin-top: 4px;
  overflow: hidden;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.log-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}
.log-heading h3 {
  margin: 0;
  font-size: 15px;
}
.build-log {
  height: 410px;
  margin: 10px 0 0;
  padding: 18px;
  overflow: auto;
  color: #dbe9de;
  background: #111914;
  border: 1px solid #28382d;
  border-radius: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }
  .detail-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 24px, 1440px);
    margin-top: 14px;
  }
  .topbar {
    padding: 18px 14px;
  }
  .topbar p {
    display: none;
  }
  .auth-card,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }
  .auth-form {
    align-items: stretch;
    flex-direction: column;
  }
  .field-row {
    grid-template-columns: 1fr;
  }
  .detail-meta {
    grid-template-columns: 1fr;
  }
  .actions {
    flex-wrap: wrap;
  }
}
