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

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

button,
input,
select {
  font: inherit;
}

button {
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 10px 24px;
  background: #ffffff;
  border-bottom: 1px solid #d8dde3;
}

.brand {
  min-height: 64px;
  display: flex;
  align-items: center;
  padding: 10px 18px;
  border-bottom: 1px solid #3a424b;
  color: #ffffff;
  font-size: 20px;
  font-weight: 750;
  text-decoration: none;
}

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

.topbar-actions form {
  margin: 0;
}

.meta,
.secondary-line {
  color: #66707c;
  font-size: 13px;
}

.view-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 20px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-shell {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #242a31;
}

.app-content {
  min-width: 0;
  min-height: 100vh;
}

.main-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 20px 12px;
}

.main-nav a {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #dce2e8;
  cursor: pointer;
  text-decoration: none;
  text-align: left;
}

.main-nav a:hover {
  background: #323a43;
}

.main-nav a.active {
  background: #ffffff;
  color: #20242a;
  font-weight: 700;
}

.workspace {
  min-width: 0;
  padding: 24px clamp(18px, 3vw, 44px) 48px;
}

.view {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}

.runtime-issues {
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid #d9a4a4;
  border-radius: 6px;
  background: #fff8f8;
}

.runtime-issues-title {
  margin: 0;
  padding: 11px 14px;
  border-bottom: 1px solid #e4bcbc;
  color: #8b2020;
  font-size: 14px;
}

.runtime-issue {
  display: grid;
  gap: 4px;
  padding: 11px 14px;
}

.runtime-issue + .runtime-issue {
  border-top: 1px solid #efd1d1;
}

.runtime-issue strong {
  font-size: 13px;
}

.runtime-issue code {
  color: #5d3434;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

h1 {
  margin-bottom: 4px;
  font-size: 25px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 4px;
  font-size: 18px;
  line-height: 1.35;
}

.button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.button-primary {
  background: #1268a5;
  color: #ffffff;
}

.button-primary:hover:not(:disabled) {
  background: #0d578b;
}

.button-secondary {
  background: #ffffff;
  border-color: #c8ced6;
  color: #303741;
}

.button-secondary:hover {
  background: #f0f2f4;
}

.button-link {
  min-height: 30px;
  padding: 4px 8px;
  background: transparent;
  color: #1268a5;
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.host-card {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d8dde3;
  border-radius: 6px;
}

.host-card-title {
  min-height: 58px;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 14px 16px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid #e3e6ea;
  font-size: 15px;
  line-height: 1.35;
}

.host-solution-list {
  display: grid;
}

.host-solution {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 11px 16px;
  color: #20242a;
  text-decoration: none;
}

.host-solution + .host-solution {
  border-top: 1px solid #e6e9ec;
}

.host-solution-deployed:hover {
  background: #f3f8fb;
}

.host-solution-marker {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #258348;
}

.host-solution-content {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.host-solution-content strong,
.host-solution-content small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.host-solution-content small,
.host-solution-action {
  color: #66707c;
  font-size: 11px;
}

.host-solution-action {
  white-space: nowrap;
}

.host-solution-unavailable {
  background: #f7f8f9;
  color: #8a929b;
}

.host-solution-unavailable .host-solution-marker {
  background: #aeb5bc;
}

.host-solution-unavailable .host-solution-content small,
.host-solution-unavailable .host-solution-action {
  color: #9299a1;
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 16px;
}

.definition-card {
  padding: 18px;
  background: #ffffff;
  border: 1px solid #d8dde3;
  border-radius: 6px;
}

.definition-card-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.definition-card-header p {
  margin-bottom: 10px;
  color: #58626d;
}

.definition-id {
  color: #66707c;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.definition-card-output-list {
  margin: 0 0 18px;
  padding: 10px 0 10px 20px;
  border-top: 1px solid #e3e6ea;
  border-bottom: 1px solid #e3e6ea;
  color: #4d5661;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.definition-card-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.form-field {
  display: grid;
  gap: 5px;
  color: #4d5661;
  font-size: 12px;
  font-weight: 650;
}

.form-field input {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #bec6cf;
  border-radius: 4px;
  background: #ffffff;
  color: #20242a;
}

.checkbox-field {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.checkbox-field input,
.follow-control input {
  width: 16px;
  height: 16px;
}

.table-frame {
  overflow: auto;
  background: #ffffff;
  border: 1px solid #d8dde3;
  border-radius: 6px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 14px;
  border-bottom: 1px solid #e4e7eb;
  text-align: left;
  vertical-align: middle;
}

th {
  background: #f8f9fa;
  color: #5b6570;
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr.selected {
  background: #edf6fc;
}

.command-column {
  width: 1%;
  text-align: right;
}

.secondary-line {
  display: block;
  margin-top: 3px;
}

.mono {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.version-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.version-list span {
  display: inline-grid;
  gap: 1px;
  min-width: 112px;
  padding: 5px 7px;
  background: #eef1f4;
  border-radius: 4px;
}

.version-list small {
  color: #66707c;
  font-size: 9px;
}

.version-list strong {
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
}

.execution-list {
  max-height: calc(100vh - 112px);
}

.log-panel {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #d8dde3;
  border-radius: 6px;
}

.log-toolbar {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #d8dde3;
}

.log-toolbar > div {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.log-toolbar strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.follow-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}

.job-metadata {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 4px 10px;
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #d8dde3;
  font-size: 11px;
}

.job-metadata dt {
  color: #66707c;
  font-weight: 650;
}

.job-metadata dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-log {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  overflow: auto;
  padding: 14px;
  background: #171a1f;
  color: #e7ebef;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.status {
  display: inline-block;
  min-width: 76px;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.status-queued {
  background: #e9edf1;
  color: #4d5661;
}

.status-running {
  background: #fff0c2;
  color: #6e4f00;
}

.status-succeeded {
  background: #d8f0df;
  color: #176231;
}

.status-failed,
.status-cancelled {
  background: #f8dcdc;
  color: #8a2020;
}

.notice {
  max-width: 1480px;
  margin: 0 auto 16px;
  padding: 10px 13px;
  border: 1px solid;
  border-radius: 5px;
}

.notice-warning {
  background: #fff6d8;
  border-color: #e4c661;
  color: #6e4f00;
}

.notice-error {
  background: #fbe5e5;
  border-color: #dc8f8f;
  color: #7d2020;
}

.log-page {
  height: 100vh;
  overflow: hidden;
  background: #171a1f;
}

.log-page-panel {
  width: 100%;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  border: 0;
  border-radius: 0;
}

.log-notice {
  position: fixed;
  top: 12px;
  left: 50%;
  z-index: 30;
  width: min(760px, calc(100% - 24px));
  margin: 0;
  transform: translateX(-50%);
}

.empty-state {
  margin: 0;
  padding: 28px;
  color: #66707c;
  text-align: center;
}

body:not(.log-page) > main {
  width: min(440px, calc(100% - 32px));
  margin: 10vh auto 0;
  padding: 24px;
  background: #ffffff;
  border: 1px solid #d8dde3;
  border-radius: 6px;
}

body:not(.log-page) > main input {
  width: 100%;
  min-height: 38px;
  margin-top: 5px;
  padding: 7px 9px;
  border: 1px solid #bec6cf;
  border-radius: 4px;
}

body:not(.log-page) > main pre:empty {
  display: none;
}

@media (max-width: 760px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: sticky;
    z-index: 25;
    height: auto;
  }

  .brand {
    min-height: 52px;
    padding: 8px 14px;
  }

  .main-nav {
    flex-direction: row;
    padding: 7px 10px;
    overflow-x: auto;
  }

  .main-nav a {
    width: auto;
    min-width: 96px;
    justify-content: center;
    text-align: center;
  }

  .topbar {
    position: static;
    gap: 10px;
    padding: 10px 14px;
  }

  .topbar-actions {
    flex-shrink: 0;
  }

  .workspace {
    padding: 20px 12px 36px;
  }

  .execution-list {
    max-height: none;
  }

  .definition-card-form {
    grid-template-columns: 1fr;
  }

  .job-metadata {
    grid-template-columns: auto 1fr;
  }
}
