* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f4f6fa;
  color: #1b283a;
  font:
    14px/1.55 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
  background: white;
  border: 1px solid #d8dfeb;
  border-radius: 8px;
  padding: 8px 14px;
  color: #27364b;
  transition: 0.15s;
}
button:hover {
  border-color: #7f93b0;
  background: #f7f9fe;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button.primary {
  background: #173b72;
  color: white;
  border-color: #173b72;
}
button.primary:hover {
  background: #22528f;
}
input,
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #d5deeb;
  border-radius: 8px;
  padding: 10px;
  background: white;
  color: #17253a;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: #4f78ad;
  box-shadow: 0 0 0 3px #386eb417;
}
label {
  display: block;
  font-size: 13px;
  color: #58677d;
  margin-bottom: 16px;
}
label input,
label select,
label textarea {
  margin-top: 6px;
}
textarea {
  resize: vertical;
}
aside {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 230px;
  background: #111f35;
  color: #d9e2f0;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
}
.brand {
  font-size: 25px;
  font-weight: 750;
  letter-spacing: -1px;
}
.brand span {
  color: #8daeff;
}
aside small {
  color: #91a3bd;
}
nav {
  display: grid;
  gap: 8px;
  margin-top: 38px;
}
nav button {
  text-align: left;
  border: 0;
  background: transparent;
  color: #b1c0d5;
  padding: 13px 16px;
}
nav button.active,
nav button:hover {
  color: white;
  background: #253a5d;
}
.side-foot {
  margin-top: auto;
  display: grid;
  gap: 12px;
  color: #97abc6;
}
.side-foot button {
  background: transparent;
  color: #becce0;
  border-color: #394c67;
}
main {
  margin-left: 230px;
  padding: 30px 40px;
  max-width: 1700px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
h1 {
  font-size: 28px;
  margin: 0;
  letter-spacing: -0.6px;
}
h2 {
  font-size: 17px;
  margin: 0 0 15px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.7px;
  color: #6a7c96;
  margin: 0 0 5px;
}
.panel {
  background: white;
  padding: 23px 25px;
  border: 1px solid #e0e6ef;
  border-radius: 13px;
  margin-bottom: 22px;
  box-shadow: 0 3px 15px #1c365204;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 23px;
}
.metric {
  padding: 21px;
  background: white;
  border: 1px solid #e0e6ef;
  border-radius: 12px;
}
.metric span {
  color: #6d7c92;
  display: block;
}
.metric strong {
  font-size: 32px;
  display: block;
  margin-top: 5px;
  font-weight: 650;
}
.muted {
  color: #7b8799;
  font-size: 13px;
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.row h2 {
  margin-right: auto;
}
.row label {
  margin: 0;
  min-width: 170px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 16px;
}
.scroll {
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  font-size: 11px;
  color: #7d8ba0;
  padding: 10px;
  border-bottom: 1px solid #e0e5ee;
  font-weight: 500;
}
td {
  padding: 13px 10px;
  border-bottom: 1px solid #edf0f6;
  vertical-align: top;
  font-size: 12px;
}
td small {
  display: block;
  max-width: 340px;
  color: #8090a3;
  margin-top: 5px;
}
.badge {
  display: inline-block;
  padding: 4px 8px;
  background: #edf1f8;
  border-radius: 6px;
  color: #6a7890;
}
.badge.succeeded,
.badge.active,
.badge.ready {
  background: #e5f5ec;
  color: #237251;
}
.badge.failed,
.badge.expired,
.badge.invalid,
.badge.quota,
.badge.disabled {
  background: #fbeaea;
  color: #b23d3d;
}
.badge.processing,
.badge.submitting,
.badge.preparing {
  background: #eaf0ff;
  color: #4164b0;
}
.thumb {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 7px;
  background: #f1f3f8;
}
.results {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}
.results article {
  max-width: 450px;
}
.results img {
  max-width: 100%;
  max-height: 450px;
  border-radius: 10px;
  display: block;
}
.results a {
  display: block;
  margin-top: 8px;
  color: #24528c;
}
code {
  background: #f1f4f8;
  padding: 3px 5px;
  border-radius: 4px;
  font-size: 12px;
}
.login {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.login .panel {
  width: min(420px, 90vw);
  padding: 35px;
}
.login h1 {
  margin-bottom: 8px;
}
.login button {
  width: 100%;
}
.error {
  color: #b74848;
  min-height: 20px;
}
#toast {
  position: fixed;
  right: 26px;
  bottom: 24px;
  background: #1e304b;
  color: white;
  padding: 12px 20px;
  border-radius: 9px;
  display: none;
  max-width: 550px;
  z-index: 50;
}
#toast.show {
  display: block;
}
.log {
  padding: 12px 0;
  border-bottom: 1px solid #edf0f5;
  display: grid;
  grid-template-columns: 150px 55px 1fr;
  gap: 12px;
  font-size: 12px;
}
pre {
  white-space: pre-wrap;
  word-break: break-all;
}
dialog {
  border: 1px solid #d4deed;
  border-radius: 15px;
  max-width: 900px;
  width: 90vw;
  max-height: 85vh;
}
dialog::backdrop {
  background: #14203988;
}
[hidden] {
  display: none !important;
}
@media (max-width: 1000px) {
  aside {
    width: 180px;
  }
  main {
    margin-left: 180px;
    padding: 25px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  aside {
    position: static;
    width: auto;
    padding: 16px;
  }
  nav {
    display: flex;
    overflow: auto;
    margin: 16px 0 0;
  }
  nav button {
    white-space: nowrap;
    padding: 8px;
  }
  .side-foot {
    display: none;
  }
  main {
    margin: 0;
    padding: 18px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 18px;
  }
  .log {
    grid-template-columns: 100px 1fr;
  }
  .log span:nth-child(2) {
    display: none;
  }
}
.section-head {
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-head > div {
  margin-right: auto;
}
.section-head h2 {
  margin-bottom: 5px;
}
.section-head p {
  margin: 0;
}
.network-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid #edf0f6;
}
.network-header small {
  display: block;
  margin-top: 4px;
}
.switch,
.check {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  white-space: nowrap;
}
input[type="checkbox"] {
  display: inline-block;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: #173b72;
}
.fold {
  border-top: 1px solid #edf0f6;
  margin-top: 18px;
  padding-top: 16px;
}
summary {
  cursor: pointer;
  font-weight: 600;
  color: #344863;
  padding: 7px 0;
}
details[open] > summary {
  margin-bottom: 16px;
}
.inner-fold {
  margin: 16px 0;
}
.node-scroll {
  max-height: 440px;
  margin-top: 20px;
}
.task-metrics {
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  overflow-x: auto;
}
.metric small {
  display: block;
  color: #8793a3;
  margin-top: 5px;
  font-size: 11px;
}
.metric strong {
  font-size: 27px;
}
.stat-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px solid #edf0f6;
  font-size: 12px;
}
.stats-groups {
  margin-top: 20px;
}
.danger {
  color: #b13e3e;
  border-color: #e5bebe;
}
.import-help {
  margin-top: 25px;
  padding-top: 15px;
  border-top: 1px solid #e0e6ef;
}
.import-help li {
  margin-bottom: 12px;
}
.import-help pre {
  background: #f3f5fa;
  padding: 16px;
  border-radius: 8px;
}
#import-dialog {
  max-width: 740px;
  padding: 28px;
}
#reset-dialog {
  max-width: 560px;
  padding: 28px;
}
.badge.cooling {
  background: #fff1d9;
  color: #92600d;
}
.badge.content_rejected {
  background: #f9e5ed;
  color: #aa4273;
}
@media (max-width: 650px) {
  .network-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }
  .section-head > div {
    flex-basis: 100%;
  }
  .metric {
    padding: 15px;
  }
  .metric strong {
    font-size: 23px;
  }
}

.task-prompt {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: min(340px, 38vw);
}

.task-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 58px);
  gap: 7px;
}
.task-thumbs a {
  position: relative;
  display: block;
  width: 58px;
  height: 58px;
}
.task-thumbs .thumb {
  width: 58px;
  height: 58px;
}
.task-thumbs span {
  position: absolute;
  right: 2px;
  bottom: 2px;
  background: #17253ac9;
  color: white;
  border-radius: 3px;
  padding: 0 3px;
  font-size: 10px;
}
.detail-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 20px;
}
.detail-images article {
  min-width: 0;
}
.detail-images img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  background: #f1f3f8;
}
@media (max-width: 650px) {
  .detail-images {
    grid-template-columns: 1fr;
  }
}
