:root {
  font:
    14px -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    sans-serif;
  color: #dce5f4;
  background: #0d111b;
  --muted: #8394ad;
  --border: #263044;
  --panel: #141b29;
  --blue: #87b7ff;
  --green: #85dbb8;
  --orange: #e8b566;
  --red: #f3a6a6;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
input,
select,
textarea {
  color: inherit;
  background: #0d1421;
  border: 1px solid #35425a;
  border-radius: 8px;
  padding: 10px 11px;
  min-width: 0;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #638fc5;
  outline-offset: 1px;
}
input[type="checkbox"] {
  accent-color: #71a8fd;
}
textarea {
  resize: vertical;
  line-height: 1.6;
}
label {
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: #b5c2d6;
  margin: 14px 0;
}
label small,
small,
.muted {
  color: var(--muted);
  line-height: 1.6;
}
small {
  font-size: 12px;
}
a {
  color: var(--blue);
}
code {
  font-family: ui-monospace, SFMono-Regular, monospace;
  word-break: break-all;
}
h1 {
  font-size: 28px;
  letter-spacing: -0.7px;
  margin: 0 0 8px;
}
h2 {
  font-size: 18px;
  margin: 0 0 14px;
  font-weight: 600;
}
p {
  line-height: 1.7;
  margin: 8px 0 16px;
}
.eyebrow {
  font-size: 10px;
  color: #7fa2d5;
  letter-spacing: 2px;
  margin: 0 0 9px;
}
.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 224px;
  border-right: 1px solid var(--border);
  padding: 30px 18px;
  background: #101622;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 12px 40px;
}
.brand strong {
  font-size: 21px;
  letter-spacing: -0.6px;
}
.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: 1.2px;
}
.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid #5189d5;
  background: #203b60;
  color: #bcdbff;
  font-weight: 700;
  border-radius: 10px;
  font-size: 21px;
}
nav {
  display: grid;
  gap: 7px;
}
.nav-item {
  border: 0;
  background: transparent;
  color: #94a6c1;
  text-align: left;
  border-radius: 9px;
  padding: 13px 15px;
  display: flex;
  gap: 13px;
  font-size: 17px;
}
.nav-item span {
  font-size: 14px;
}
.nav-item:hover {
  background: #1c2739;
}
.nav-item.active {
  color: #c4ddff;
  background: #21334f;
}
.sidebar-foot {
  margin-top: auto;
  padding: 20px 12px;
  color: #a9b9d0;
  font-size: 12px;
}
.sidebar-foot small {
  display: block;
  font-size: 10px;
  margin-top: 10px;
}
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: #88dabb;
  border-radius: 100%;
  margin-right: 8px;
}
main {
  grid-column: 2;
  min-width: 0;
  padding: 34px 36px 70px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
header .muted {
  margin-bottom: 0;
  font-size: 12px;
}
.button,
.mini-button,
.icon-button {
  border: 1px solid #34445e;
  background: #202d43;
  color: #dce8fb;
  border-radius: 7px;
  padding: 9px 14px;
  white-space: nowrap;
}
.button:hover,
.mini-button:hover {
  background: #2e4262;
}
.primary {
  background: #386fc5;
  border-color: #568ade;
  color: white;
}
.primary:hover {
  background: #4c84dc;
}
.ghost {
  background: transparent;
}
.mini-button {
  font-size: 12px;
  padding: 6px 10px;
}
.icon-button {
  font-size: 23px;
  background: transparent;
  padding: 0 8px;
  border: 0;
}
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 18px 20px;
}
.metric strong {
  display: block;
  font-size: 29px;
  letter-spacing: -0.6px;
  line-height: 1.3;
  margin: 7px 0;
}
.metric span {
  color: #9fb0c8;
  font-size: 12px;
}
.metric small {
  font-size: 10px;
}
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 12px;
  margin-bottom: 22px;
  min-width: 0;
}
.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}
.panel-head h2 {
  margin-bottom: 5px;
}
.panel-head p {
  font-size: 12px;
  margin-bottom: 0;
}
.copy-row {
  display: flex;
  gap: 10px;
  padding: 13px;
  background: #0d1420;
  border-radius: 8px;
  align-items: center;
}
.copy-row code {
  flex: 1;
  line-height: 1.7;
  font-size: 12px;
  color: #a9ceff;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}
.tags span {
  background: #202b3e;
  border: 1px solid #2c3b54;
  padding: 6px 8px;
  border-radius: 5px;
  font-size: 10px;
  color: #a5b8d5;
}
.badge {
  display: inline-block;
  border-radius: 20px;
  padding: 5px 9px;
  background: #263044;
  color: #a4b8d8;
  font-size: 11px;
  white-space: nowrap;
}
.ready,
.succeeded {
  background: #1a3b33;
  color: var(--green);
}
.invalid,
.failed {
  background: #432c33;
  color: var(--red);
}
.cooling,
.quota,
.uncertain,
.pending {
  background: #403625;
  color: var(--orange);
}
.busy,
.running,
.submitting,
.queued {
  background: #233e60;
  color: #a9d1ff;
}
.disabled {
  background: #2c2e37;
  color: #a5a8b3;
}
.state-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}
.state-grid > div {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: #95a8c6;
}
.state-grid strong {
  font-size: 23px;
  color: #dbe6f8;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
}
.form-grid label small {
  font-size: 10px;
}
.checkbox-label {
  flex-direction: row;
  align-items: center;
  margin: 20px 0;
}
.form-footer {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}
.form-footer .muted {
  font-size: 11px;
}
details {
  margin: 15px 0;
}
summary {
  cursor: pointer;
  color: #9ebbe3;
  font-size: 12px;
  padding: 5px 0;
}
.table-panel {
  padding: 0;
}
.table-panel > .panel-head,
.table-toolbar,
.pagination,
.progress-panel {
  padding: 20px 24px;
}
.table-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.table-toolbar input {
  max-width: 250px;
}
.table-toolbar select,
.table-toolbar input {
  font-size: 12px;
  padding: 8px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
}
th {
  font-size: 10px;
  font-weight: 500;
  color: #8da0bc;
  white-space: nowrap;
  background: #172033;
}
td,
th {
  padding: 15px 17px;
  border-bottom: 1px solid #222e42;
  vertical-align: top;
}
td {
  font-size: 12px;
}
td small {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  max-width: 250px;
  overflow-wrap: anywhere;
}
td .mini-button {
  margin: 2px;
}
.prompt-cell {
  max-width: 240px;
  min-width: 130px;
  white-space: normal;
  line-height: 1.7;
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 25px;
}
.progress-panel {
  border-top: 1px solid var(--border);
  background: #192b42;
}
.progress-panel p {
  margin: 8px 0 0;
  font-size: 12px;
}
.progress-panel progress {
  width: 100%;
  height: 7px;
  margin-top: 12px;
}
.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 38px 15px;
  line-height: 1.8;
}
.json-view {
  max-height: 430px;
  overflow: auto;
  font:
    11px/1.7 ui-monospace,
    SFMono-Regular,
    monospace;
  background: #0c121d;
  border: 1px solid #27354a;
  border-radius: 8px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 16px;
  color: #afc4e2;
}
.playground {
  align-items: start;
}
.image-results {
  display: grid;
  gap: 16px;
}
.result-card {
  padding: 12px;
  background: #0f1725;
  border: 1px solid #2b3b54;
  border-radius: 9px;
}
.result-card img {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
  border-radius: 5px;
  background: #0b1019;
}
.result-card small {
  display: block;
  margin: 10px 0;
}
.result-card a {
  font-size: 12px;
}
.reference-files {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.reference-file {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 12px;
}
.usage-box {
  margin-top: 18px;
  border: 1px solid #31445d;
  padding: 16px;
  border-radius: 8px;
  line-height: 1.9;
  color: #b5c9e5;
  font-size: 12px;
}
.daily-chart {
  height: 220px;
  display: flex;
  align-items: end;
  gap: 6px;
  padding: 20px 0 30px;
  position: relative;
}
.bar-group {
  flex: 1;
  min-width: 12px;
  display: flex;
  align-items: end;
  gap: 2px;
  height: 100%;
  position: relative;
}
.bar {
  width: 50%;
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: #6da4ed;
}
.bar.failure {
  background: #c77c82;
}
.bar-group small {
  font-size: 8px;
  position: absolute;
  bottom: -20px;
  left: 0;
  white-space: nowrap;
}
.stats-line {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  padding: 12px 0;
  font-size: 12px;
  color: #94a9c6;
}
.stats-line strong {
  color: #d7e7ff;
}
.logs-list .log {
  display: grid;
  grid-template-columns: 125px 70px 110px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.log time,
.log .scope {
  color: var(--muted);
}
dialog {
  background: var(--panel);
  border: 1px solid #415678;
  border-radius: 13px;
  color: inherit;
  padding: 0;
  max-width: calc(100vw - 30px);
  max-height: 90vh;
}
dialog::backdrop {
  background: #030812bb;
  backdrop-filter: blur(3px);
}
.modal {
  padding: 28px;
  width: 640px;
  max-width: 100%;
  overflow: auto;
}
.modal.wide {
  width: 940px;
}
.tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}
.selected {
  background: #2d5183;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 700px;
  padding: 14px 22px;
  border: 1px solid #42627f;
  border-radius: 9px;
  color: #cde4f7;
  background: #1c3547;
  z-index: 500;
  box-shadow: 0 6px 30px #0005;
}
.toast.error {
  background: #452d35;
  border-color: #85515c;
  color: #ffd1d1;
}
.login-screen {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background: radial-gradient(ellipse at 50% 30%, #1b3050 0, transparent 55%);
}
.login-card {
  width: min(440px, calc(100vw - 40px));
  padding: 36px;
  border: 1px solid #34435d;
  background: #141d2d;
  border-radius: 16px;
}
.login-card .brand-mark {
  margin-bottom: 22px;
}
.login-card h1 {
  font-size: 25px;
}
.login-card .button {
  width: 100%;
  margin-top: 15px;
}
.login-card [role="alert"],
#import-error {
  color: #f5abab;
  font-size: 12px;
  min-height: 16px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1600px) {
  main {
    padding: 40px 50px 70px;
  }
}
@media (max-width: 1100px) {
  .shell {
    grid-template-columns: 190px minmax(0, 1fr);
  }
  .sidebar {
    width: 190px;
    padding: 24px 12px;
  }
  main {
    padding: 25px 22px;
  }
  .two-columns {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .panel-head {
    flex-wrap: wrap;
  }
}
@media (max-width: 700px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 16px;
    border: 0;
    border-bottom: 1px solid var(--border);
  }
  .brand {
    margin: 0 0 16px;
  }
  nav {
    display: flex;
    overflow: auto;
    gap: 5px;
  }
  .nav-item {
    padding: 9px;
  }
  .nav-item span {
    white-space: nowrap;
    font-size: 12px;
  }
  .sidebar-foot {
    display: none;
  }
  main {
    padding: 22px 14px;
  }
  header {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  header .row-actions {
    width: 100%;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .panel {
    padding: 18px;
  }
  .table-panel {
    padding: 0;
  }
  .panel-head {
    gap: 12px;
  }
  .metrics {
    gap: 9px;
  }
  .metric {
    padding: 14px;
  }
  .metric strong {
    font-size: 24px;
  }
  .logs-list .log {
    grid-template-columns: 1fr 1fr;
  }
  .form-footer {
    flex-wrap: wrap;
  }
  .modal {
    padding: 20px;
  }
}
.daily-chart svg {
  max-height: 220px;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, monospace;
  word-break: break-all;
}
.result-card img {
  cursor: zoom-in;
}

.prompt-ellipsis {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.task-thumbnails {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  min-width: 98px;
  max-width: 210px;
}
.task-thumbnail {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-decoration: none;
}
.task-thumbnail img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid #34445a;
  background: #0c1420;
}
.task-thumbnail:hover img {
  border-color: #89b8fd;
}
.task-thumbnail small {
  margin: 0;
  text-align: center;
  white-space: nowrap;
  color: #a2b7d4;
}
.prompt-cell {
  max-width: 220px;
}

.content_rejected {
  background: #49351f;
  color: #efc07c;
}
.danger {
  background: transparent;
  border-color: #8c535f;
  color: #efacb9;
}
#task-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 1100px) {
  #task-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
