:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7f8;
  color: #1d252c;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #d9e0e5;
  display: flex;
  justify-content: space-between;
  min-height: 76px;
  padding: 14px 24px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 700;
}

h2 {
  font-size: 17px;
}

#suite-count {
  color: #66727d;
  font-size: 13px;
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 8px;
}

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

.code-editor {
  height: 420px;
  min-height: 280px;
}

.userbar {
  align-items: center;
  display: flex;
  gap: 10px;
}

#current-user {
  color: #44515c;
  font-size: 13px;
  font-weight: 650;
}

button {
  border: 1px solid #bdc8d0;
  border-radius: 6px;
  cursor: pointer;
  min-height: 36px;
  padding: 0 12px;
}

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

.tab {
  background: #f7f9fa;
  color: #30404d;
}

.tab.active,
.primary {
  background: #214e6f;
  border-color: #214e6f;
  color: #ffffff;
}

.ghost {
  background: #ffffff;
  color: #214e6f;
}

main {
  padding: 20px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}

.panel {
  background: #ffffff;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  min-width: 0;
}

.controls {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 16px;
}

label {
  color: #44515c;
  display: grid;
  font-size: 13px;
  font-weight: 650;
  gap: 6px;
}

select,
input {
  background: #ffffff;
  border: 1px solid #b8c3cb;
  border-radius: 6px;
  min-height: 38px;
  padding: 0 10px;
}

.form-panel {
  align-self: start;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.manage-stack {
  align-self: start;
  display: grid;
  gap: 16px;
}

.manage-list {
  display: grid;
  gap: 8px;
}

.manage-item {
  align-items: center;
  background: #f7f9fa;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px;
}

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

.manage-item strong,
.manage-item code,
.manage-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manage-item code {
  color: #6c7882;
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.danger {
  background: #ffffff;
  border-color: #d39a91;
  color: #9b281b;
}

.check-label {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.check-label input {
  min-height: 16px;
  width: 16px;
}

.form-result {
  color: #586773;
  font-size: 13px;
  min-height: 18px;
}

.test-heading,
.section-title {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.test-heading span {
  color: #44515c;
  font-size: 13px;
  font-weight: 650;
}

.test-list {
  border: 1px solid #dce3e8;
  border-radius: 6px;
  max-height: 44vh;
  overflow: auto;
}

.test-row {
  align-items: center;
  border-bottom: 1px solid #edf1f3;
  display: grid;
  gap: 10px;
  grid-template-columns: 18px minmax(0, 1fr);
  padding: 10px;
}

.test-row:last-child {
  border-bottom: 0;
}

.test-row input {
  height: 16px;
  margin: 0;
  width: 16px;
}

.test-name {
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.test-id {
  color: #6c7882;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live,
.validator,
#history-view .panel {
  padding: 16px;
}

.status {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  gap: 5px;
  line-height: 1;
  padding: 6px 9px;
  text-transform: uppercase;
}

.mark {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-weight: 900;
  height: 18px;
  justify-content: center;
  width: 18px;
}

.mark.passed {
  background: #16824e;
  color: #ffffff;
}

.mark.failed {
  background: #b92d1f;
  color: #ffffff;
}

.mark.running {
  background: #d99b00;
  color: #ffffff;
}

.mark.queued,
.mark.muted {
  background: #d4dde3;
  color: #586773;
}

.muted {
  background: #e9eef1;
  color: #586773;
}

.running {
  background: #fff0ca;
  color: #775500;
}

.passed {
  background: #dff4e7;
  color: #15633b;
}

.failed {
  background: #ffe4e0;
  color: #9b281b;
}

.summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  margin: 16px 0;
}

.metric {
  background: #f6f8f9;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  padding: 10px;
}

.metric strong {
  display: block;
  font-size: 22px;
}

.metric span {
  color: #697681;
  font-size: 12px;
}

.results {
  display: grid;
  gap: 10px;
}

.result {
  border: 1px solid #dce3e8;
  border-radius: 6px;
  padding: 12px;
}

.result-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.steps {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.step {
  align-items: center;
  background: #f7f9fa;
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: 22px 22px minmax(0, 140px) minmax(0, 1fr);
  padding: 7px 9px;
}

.step-index {
  color: #697681;
  font-size: 12px;
}

.step-action {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-message {
  color: #586773;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-link {
  background: transparent;
  border: 0;
  color: #214e6f;
  font-size: 12px;
  font-weight: 750;
  min-height: auto;
  padding: 0;
  text-align: left;
}

.event-log {
  background: #111820;
  border-radius: 6px;
  color: #dbe7ef;
  font-size: 12px;
  margin: 16px 0 0;
  max-height: 170px;
  overflow: auto;
  padding: 12px;
  white-space: pre-wrap;
}

textarea {
  border: 1px solid #b8c3cb;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  height: calc(100vh - 220px);
  margin-top: 14px;
  min-height: 360px;
  padding: 12px;
  resize: vertical;
  width: 100%;
}

.validation-result,
.history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.issue,
.history-item {
  background: #f7f9fa;
  border: 1px solid #dce3e8;
  border-radius: 6px;
  padding: 10px;
}

.history-item {
  color: inherit;
  display: grid;
  gap: 6px;
  text-align: left;
  width: 100%;
}

.user-item {
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
}

.issue code,
.history-item code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.auth-screen {
  align-items: center;
  background: rgba(245, 247, 248, 0.96);
  display: none;
  inset: 0;
  justify-content: center;
  padding: 20px;
  position: fixed;
  z-index: 20;
}

.auth-screen.active {
  display: flex;
}

.auth-card {
  background: #ffffff;
  border: 1px solid #d9e0e5;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  max-width: 380px;
  padding: 20px;
  width: 100%;
}

.modal {
  align-items: center;
  background: rgba(17, 24, 32, 0.78);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: fixed;
  z-index: 30;
}

.modal[hidden] {
  display: none;
}

.modal-shell {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 48px);
  max-width: min(1100px, calc(100vw - 48px));
}

.modal-shell button {
  justify-self: end;
}

.modal-shell img {
  background: #ffffff;
  border-radius: 6px;
  max-height: calc(100vh - 110px);
  max-width: 100%;
  object-fit: contain;
}

@media (max-width: 800px) {
  .topbar,
  nav,
  .userbar,
  .workspace {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  main {
    padding: 12px;
  }

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