:root {
  color-scheme: light;
  --paper: #f3f6f5;
  --paper-raised: #fafcfb;
  --ink: #14211f;
  --ink-soft: #42534f;
  --ink-faint: #71817d;
  --line: #cbd7d3;
  --line-strong: #9eb0ab;
  --teal: #096c5c;
  --teal-dark: #075548;
  --teal-pale: #dcece6;
  --amber: #a76016;
  --amber-pale: #f6ead8;
  --red: #a53d33;
  --red-pale: #f6e2df;
  --blue: #315f84;
  --blue-pale: #e1eaf1;
  --shadow: 0 18px 48px rgba(20, 33, 31, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  font-family:
    "Avenir Next", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

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

button,
a,
summary,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--teal);
  text-underline-offset: 3px;
}

[hidden] {
  display: none !important;
}

::selection {
  color: var(--paper-raised);
  background: var(--teal);
}

:focus-visible {
  outline: 3px solid rgba(9, 108, 92, 0.28);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(243, 246, 245, 0.96);
  backdrop-filter: blur(14px);
}

.topbar__inner {
  display: flex;
  width: min(1440px, calc(100% - 48px));
  min-height: 66px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 4px;
  color: #bcebdc;
  background: var(--ink);
  font-size: 17px;
  font-weight: 700;
}

.brand__copy {
  display: grid;
  line-height: 1.2;
}

.brand__copy strong {
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand__copy small {
  margin-top: 3px;
  color: var(--ink-faint);
  font-size: 11px;
}

.topbar__status {
  display: flex;
  align-items: center;
  gap: 18px;
}

.connection {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 13px;
  white-space: nowrap;
}

.connection__dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(158, 176, 171, 0.14);
}

.connection__dot.is-online {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(9, 108, 92, 0.13);
}

.connection__dot.is-offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(165, 61, 51, 0.12);
}

.quiet-button,
.danger-button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.quiet-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  color: var(--ink-soft);
  font-size: 12px;
  text-decoration: none;
  white-space: nowrap;
}

.quiet-button:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-pale);
}

.danger-button {
  padding: 7px 12px;
  border-color: rgba(165, 61, 51, 0.45);
  color: var(--red);
  font-size: 12px;
}

.danger-button:hover {
  border-color: var(--red);
  background: var(--red-pale);
}

.page {
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 34px 0 28px;
}

.situation {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(560px, 1.18fr);
  gap: 56px;
  align-items: end;
  padding: 20px 0 30px;
}

.kicker {
  margin: 0 0 8px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.situation h1 {
  max-width: 680px;
  margin: 0;
  font-size: clamp(30px, 3.2vw, 50px);
  font-weight: 620;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.situation__heading > p:last-child {
  max-width: 640px;
  margin: 16px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.metric {
  min-width: 0;
  padding: 15px 16px 13px;
  border-left: 1px solid var(--line);
}

.metric:first-child {
  border-left: 0;
}

.metric dt {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 560;
}

.metric dd {
  margin: 7px 0 0;
  font-size: 27px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.metric span {
  display: block;
  margin-top: 7px;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 1.35;
}

.metric--policy dd {
  color: var(--teal);
  font-size: 22px;
}

.workflow-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-strong);
}

.workflow-tab {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 82px;
  padding: 15px 18px 14px;
  border: 0;
  border-left: 1px solid var(--line);
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.workflow-tab:first-child {
  border-left: 0;
}

.workflow-tab::after {
  position: absolute;
  right: 18px;
  bottom: -1px;
  left: 18px;
  height: 3px;
  background: transparent;
  content: "";
}

.workflow-tab:hover {
  color: var(--ink);
  background: rgba(220, 236, 230, 0.62);
}

.workflow-tab.is-active {
  color: var(--ink);
  background: var(--paper-raised);
}

.workflow-tab.is-active::after {
  background: var(--teal);
}

.workflow-tab__identity {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.workflow-tab__identity strong {
  color: var(--teal);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.workflow-tab__identity span {
  color: var(--ink-faint);
  font-size: 11px;
}

.workflow-tab__name {
  margin-top: 4px;
  overflow: hidden;
  font-size: 15px;
  font-weight: 610;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-tab__queue {
  margin-top: 5px;
  color: var(--ink-faint);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.slot-board {
  padding: 19px 18px 20px;
  border-bottom: 1px solid var(--line-strong);
  background: var(--paper-raised);
}

.slot-board__heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.slot-board__heading h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  line-height: 1.25;
}

.slot-board__heading p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
}

.slot-board__heading > p {
  flex: 0 0 auto;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.slot-board__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px;
  margin-top: 15px;
  border: 1px solid var(--line);
  background: var(--line);
}

.slot {
  min-width: 0;
  padding: 13px 14px 12px;
  background: var(--paper);
}

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

.slot__heading strong {
  font-size: 12px;
  font-weight: 680;
}

.slot__state {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--paper-raised);
  font-size: 10px;
  font-weight: 650;
}

.slot__state[data-state="busy"],
.slot__state[data-state="waiting"],
.slot__state[data-state="recycling"],
.slot__state[data-state="reserved"] {
  border-color: #d0a66a;
  color: var(--amber);
  background: var(--amber-pale);
}

.slot__state[data-state="available"] {
  border-color: #77a99d;
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.slot__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  margin: 8px 0 0;
  color: var(--ink-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.slot__reason {
  min-height: 30px;
  margin: 9px 0 0;
  overflow-wrap: anywhere;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(390px, 0.84fr);
  border: 1px solid var(--line-strong);
  border-top: 0;
  background: var(--paper-raised);
  box-shadow: var(--shadow);
}

.composer {
  min-width: 0;
  padding: 28px 30px 30px;
  border-right: 1px solid var(--line);
}

.monitor {
  min-width: 0;
  padding: 28px 30px 30px;
  background:
    linear-gradient(rgba(20, 33, 31, 0.025) 1px, transparent 1px) 0 0 / 100%
      32px,
    var(--paper);
}

.section-heading,
.monitor__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.section-heading h2,
.monitor__heading h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.section-heading > div > p:last-child {
  max-width: 620px;
  margin: 9px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.hardware-label {
  flex: 0 0 auto;
  max-width: 190px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.35;
  text-align: right;
}

.workflow-panel {
  margin-top: 26px;
}

.form-body {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  min-width: 0;
  gap: 7px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 580;
}

.field > span,
.field > output {
  min-height: 18px;
}

.field output {
  justify-self: start;
  color: var(--teal);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink);
  background: #fff;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.field input,
.field select {
  min-height: 42px;
  padding: 8px 10px;
}

.field textarea {
  min-height: 92px;
  padding: 11px 12px;
  line-height: 1.6;
  resize: vertical;
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--teal);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--teal);
  outline: none;
  box-shadow: 0 0 0 3px rgba(9, 108, 92, 0.11);
}

.field input[type="range"] {
  min-height: 22px;
  padding: 0;
  border: 0;
  accent-color: var(--teal);
  background: transparent;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field--wide {
  grid-column: 1 / -1;
}

.dimension-preview {
  display: block;
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  color: var(--teal-dark);
  background: var(--teal-pale);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}

.advanced {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.advanced summary {
  padding: 12px 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  list-style-position: inside;
}

.advanced[open] summary {
  color: var(--teal);
}

.advanced .form-grid {
  padding: 4px 0 16px;
}

.segmented {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin: 0;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
}

.segmented legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.segmented label {
  position: relative;
  min-width: 104px;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented span {
  display: block;
  padding: 8px 13px;
  border-radius: 2px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.segmented--hardware {
  display: grid;
  width: min(100%, 286px);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.segmented--hardware label {
  min-width: 0;
}

.segmented input:checked + span {
  color: #fff;
  background: var(--teal);
}

.segmented input:disabled + span,
.segmented label.is-disabled span {
  color: var(--ink-faint);
  background: transparent;
  cursor: not-allowed;
  opacity: 0.55;
}

.segmented input:focus-visible + span {
  outline: 3px solid rgba(9, 108, 92, 0.24);
  outline-offset: 1px;
}

.fixed-hardware {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--teal);
  border-radius: 4px;
  background: var(--paper-raised);
}

.fixed-hardware span {
  color: var(--ink-faint);
  font-size: 10px;
}

.fixed-hardware strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 16px;
  align-items: center;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.upload-row > div strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.upload-row > div p {
  margin: 3px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.comfy-link {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid var(--teal);
  border-radius: 4px;
  color: var(--teal);
  background: var(--teal-pale);
  font-size: 11px;
  text-decoration: none;
}

.comfy-link:hover {
  color: var(--paper-raised);
  background: var(--teal);
}

.comfy-link.is-disabled {
  border-color: var(--line);
  color: var(--ink-faint);
  background: transparent;
  pointer-events: none;
}

.comfy-start {
  width: min(760px, 100%);
  margin: clamp(64px, 12vh, 150px) auto 0;
  padding: 34px 0 28px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.comfy-start h1 {
  max-width: 680px;
  margin: 10px 0 0;
  color: var(--ink);
  font-size: 48px;
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: 0;
}

.comfy-start__workflow {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 12px;
}

.comfy-start__status {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 6px 12px;
  align-items: center;
  margin-top: 40px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.comfy-start__status strong {
  color: var(--ink);
  font-size: 16px;
  font-weight: 650;
}

.comfy-start__status span:last-child {
  grid-column: 2;
  color: var(--ink-faint);
  font-size: 12px;
}

.comfy-start__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 5px var(--teal-pale);
  animation: comfy-pulse 1.8s ease-in-out infinite;
}

.comfy-start__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

@keyframes comfy-pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.82);
  }
}

@media (max-width: 680px) {
  .comfy-start {
    margin-top: 38px;
  }

  .comfy-start h1 {
    font-size: 36px;
  }
}

.file-picker {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--ink-soft);
  background: var(--paper-raised);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease;
}

.file-picker:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-pale);
}

.file-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-picker:focus-within {
  outline: 3px solid rgba(9, 108, 92, 0.24);
  outline-offset: 2px;
}

.file-selection {
  grid-column: 1 / -1;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink-faint);
  font-size: 10px;
}

.reference-stack {
  display: grid;
}

.form-footer {
  display: flex;
  margin-top: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line-strong);
}

.form-footer p {
  max-width: 460px;
  margin: 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.primary-action {
  min-width: 168px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 1px solid var(--teal);
  border-radius: 3px;
  color: #fff;
  background: var(--teal);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.primary-action:hover {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
}

.primary-action:active {
  transform: translateY(1px);
}

.primary-action:disabled,
.danger-button:disabled,
.quiet-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.monitor__heading {
  min-height: 54px;
}

.monitor__heading h2 {
  overflow-wrap: anywhere;
}

.job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 21px;
}

.status-badge {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--paper-raised);
  font-size: 11px;
  font-weight: 650;
}

.status-badge[data-status="queued"] {
  border-color: #c8b27f;
  color: #745b1f;
  background: #f7f1df;
}

.status-badge[data-status="starting"],
.status-badge[data-status="running"],
.status-badge[data-status="downloading"] {
  border-color: #77a99d;
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.status-badge[data-status="succeeded"],
.status-badge[data-status="zero_confirmed"] {
  border-color: #6f9c8d;
  color: var(--teal-dark);
  background: #e4f1eb;
}

.status-badge[data-status="failed"],
.status-badge[data-status="timed_out"] {
  border-color: #c78983;
  color: var(--red);
  background: var(--red-pale);
}

.status-badge[data-status="canceled"] {
  color: var(--ink-soft);
  background: #e9edec;
}

.status-badge[data-status="scaling_down"],
.status-badge[data-status="pending"] {
  border-color: #d0a66a;
  color: var(--amber);
  background: var(--amber-pale);
}

.job-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 20px 0 0;
  border-top: 1px solid var(--line);
}

.job-facts > div {
  min-width: 0;
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--line);
}

.job-facts > div:nth-child(even) {
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.job-facts > div:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  padding-left: 0;
  border-left: 0;
}

.job-facts dt {
  color: var(--ink-faint);
  font-size: 10px;
}

.job-facts dd {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lifecycle {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.lifecycle li {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 8px;
  color: var(--ink-faint);
  font-size: 9px;
  text-align: center;
}

.lifecycle li::before {
  position: absolute;
  z-index: 0;
  top: 10px;
  right: 50%;
  left: -50%;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.lifecycle li:first-child::before {
  display: none;
}

.lifecycle__marker {
  position: relative;
  z-index: 1;
  display: grid;
  width: 21px;
  height: 21px;
  margin: 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--ink-faint);
  background: var(--paper);
  font-size: 9px;
  font-weight: 700;
}

.lifecycle li.is-done {
  color: var(--ink-soft);
}

.lifecycle li.is-done::before,
.lifecycle li.is-current::before {
  background: var(--teal);
}

.lifecycle li.is-done .lifecycle__marker {
  border-color: var(--teal);
  color: #fff;
  background: var(--teal);
}

.lifecycle li.is-current {
  color: var(--teal);
  font-weight: 650;
}

.lifecycle li.is-current .lifecycle__marker {
  border: 2px solid var(--teal);
  color: var(--teal);
  background: var(--paper-raised);
  box-shadow: 0 0 0 4px rgba(9, 108, 92, 0.11);
}

.lifecycle li.is-error {
  color: var(--red);
}

.lifecycle li.is-error::before {
  background: var(--red);
}

.lifecycle li.is-error .lifecycle__marker {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-pale);
}

.job-message {
  min-height: 69px;
  margin-top: 23px;
  padding: 13px 14px;
  border-left: 3px solid var(--line-strong);
  color: var(--ink-soft);
  background: var(--paper-raised);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.job-message.is-error {
  border-left-color: var(--red);
  color: var(--red);
  background: var(--red-pale);
}

.job-message.is-success {
  border-left-color: var(--teal);
  color: var(--teal-dark);
  background: var(--teal-pale);
}

.outputs {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.output {
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
}

.output img,
.output video {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #0d1513;
}

.output audio {
  display: block;
  width: calc(100% - 24px);
  margin: 20px 12px;
}

.output__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 11px;
  border-top: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 10px;
}

.output__meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.output__meta a {
  flex: 0 0 auto;
  font-weight: 650;
}

.media-board {
  margin-top: 26px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.media-board__heading {
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 20px 0;
}

.media-board__heading h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.media-board__heading > p {
  max-width: 460px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  text-align: right;
}

.media-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
}

.media-lane {
  min-width: 0;
  padding: 0 22px 22px;
}

.media-lane + .media-lane {
  border-left: 1px solid var(--line);
}

.media-lane__header {
  display: grid;
  min-height: 190px;
  align-content: space-between;
  gap: 20px;
  padding: 22px 0 18px;
}

.media-lane__workflows {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 650;
}

.media-lane__header h3 {
  margin: 0;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.media-lane__header > div > p:last-child {
  margin: 7px 0 0;
  color: var(--ink-faint);
  font-size: 11px;
}

.media-lane__counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.media-lane__counts > div {
  min-width: 0;
  padding: 10px 8px 9px 0;
}

.media-lane__counts > div + div {
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.media-lane__counts dt {
  color: var(--ink-faint);
  font-size: 9px;
  white-space: nowrap;
}

.media-lane__counts dd {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 650;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.media-lane__block {
  padding: 17px 0 5px;
  border-top: 1px solid var(--line);
}

.media-lane__block + .media-lane__block {
  margin-top: 8px;
}

.media-lane__section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.media-lane__section-heading h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

.media-lane__section-heading span {
  display: grid;
  min-width: 25px;
  height: 21px;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 9px;
  font-variant-numeric: tabular-nums;
}

.media-lane .job-list {
  margin-top: 10px;
}

.media-results {
  display: grid;
  margin: 10px 0 0;
  padding: 0;
  gap: 10px;
  list-style: none;
}

.media-result {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--paper-raised);
}

.media-result__preview {
  display: grid;
  min-height: 128px;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  color: var(--ink-faint);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.035), transparent),
    #14211f;
  font-size: 11px;
}

.media-result__preview img,
.media-result__preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-result__preview audio {
  width: calc(100% - 20px);
}

.media-result__placeholder {
  padding: 12px;
  text-align: center;
}

.media-result__body {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 11px;
}

.media-result__body strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-result__body > span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--ink-faint);
  font-size: 10px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.media-result__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 3px;
}

.media-result__shutdown {
  color: var(--teal-dark);
  font-size: 9px;
  font-weight: 650;
}

.media-result__shutdown:not([data-status="zero_confirmed"]) {
  color: var(--amber);
}

.media-result__open {
  min-height: 27px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 9px;
  cursor: pointer;
}

.media-result__open:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.job-list {
  margin: 15px 0 0;
  padding: 0;
  list-style: none;
}

.job-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--line);
}

.job-row:last-child {
  border-bottom: 1px solid var(--line);
}

.job-row__select {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.job-row__select:hover .job-row__name {
  color: var(--teal);
}

.job-row__service {
  min-width: 38px;
  color: var(--teal);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.04em;
}

.job-row__copy {
  display: grid;
  min-width: 0;
}

.job-row__name {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 160ms ease;
}

.job-row__phase {
  overflow: hidden;
  margin-top: 2px;
  color: var(--ink-faint);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-row__age {
  color: var(--ink-faint);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.job-row__cancel {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-faint);
  background: transparent;
  font-size: 10px;
  cursor: pointer;
}

.job-row__cancel:hover {
  border-color: var(--red);
  color: var(--red);
}

.empty-row {
  padding: 25px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink-faint);
  font-size: 12px;
}

.page-footer {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink-faint);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 50;
  right: 22px;
  bottom: 22px;
  max-width: min(420px, calc(100vw - 44px));
  padding: 11px 14px;
  border: 1px solid var(--ink);
  border-radius: 3px;
  color: var(--paper-raised);
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1120px) {
  .situation {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

  .composer {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .monitor {
    min-height: 540px;
  }
}

@media (max-width: 820px) {
  .topbar__inner,
  .page {
    width: min(100% - 30px, 720px);
  }

  .topbar__inner {
    min-height: 62px;
  }

  .topbar__status {
    gap: 10px;
  }

  .connection {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page {
    padding-top: 22px;
  }

  .situation {
    padding-top: 12px;
  }

  .situation h1 {
    font-size: clamp(29px, 8vw, 42px);
  }

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

  .workflow-tab {
    border-top: 1px solid var(--line);
  }

  .workflow-tab:nth-child(odd) {
    border-left: 0;
  }

  .slot-board__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .slot-board__heading > p {
    flex: initial;
  }

  .workspace {
    box-shadow: none;
  }

  .composer,
  .monitor {
    padding: 24px 20px;
  }

  .form-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-action {
    width: 100%;
  }

  .media-board__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .media-board__heading > p {
    max-width: 620px;
    text-align: left;
  }

  .media-lanes {
    grid-template-columns: minmax(0, 1fr);
  }

  .media-lane {
    padding-right: 18px;
    padding-left: 18px;
  }

  .media-lane + .media-lane {
    border-top: 1px solid var(--line-strong);
    border-left: 0;
  }

  .media-lane__header {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 14px;
  }

  .topbar__inner,
  .page {
    width: calc(100% - 20px);
  }

  .topbar__inner,
  .topbar__status {
    gap: 8px;
  }

  .brand__copy small {
    display: none;
  }

  .connection {
    min-width: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
  }

  .quiet-button {
    padding-right: 9px;
    padding-left: 9px;
  }

  .situation {
    gap: 22px;
    padding-bottom: 22px;
  }

  .situation h1 {
    letter-spacing: -0.03em;
  }

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

  .metric {
    border-top: 1px solid var(--line);
  }

  .metric:nth-child(odd) {
    border-left: 0;
  }

  .metric:nth-child(-n + 2) {
    border-top: 0;
  }

  .workflow-tab {
    min-height: 75px;
    padding: 12px 13px;
  }

  .workflow-tab::after {
    right: 13px;
    left: 13px;
  }

  .workflow-tab__name {
    font-size: 14px;
  }

  .slot-board {
    padding-right: 13px;
    padding-left: 13px;
  }

  .slot-board__list {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer,
  .monitor {
    padding: 22px 15px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hardware-label {
    max-width: none;
    text-align: left;
  }

  .segmented--hardware {
    width: 100%;
  }

  .form-grid,
  .job-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-facts > div:last-child:nth-child(odd) {
    grid-column: auto;
  }

  .job-facts > div:nth-child(even) {
    padding-left: 0;
    border-left: 0;
  }

  .upload-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .file-picker {
    width: max-content;
  }

  .file-selection {
    grid-column: 1;
  }

  .lifecycle {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 19px;
  }

  .lifecycle li:nth-child(4)::before {
    display: none;
  }

  .media-lane {
    padding-right: 12px;
    padding-left: 12px;
  }

  .media-board__heading {
    padding: 18px 0;
  }

  .media-board__heading h2 {
    font-size: 20px;
  }

  .job-row {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 8px;
  }

  .job-row__cancel {
    width: max-content;
    margin: 0 0 8px 48px;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
