:root {
  --bg: #081018;
  --panel: rgba(13, 24, 35, 0.88);
  --panel-strong: #101d2a;
  --panel-soft: rgba(19, 35, 50, 0.7);
  --line: rgba(139, 173, 204, 0.18);
  --line-strong: rgba(139, 173, 204, 0.34);
  --text: #edf6ff;
  --muted: #91a9bf;
  --brand: #55e6c2;
  --brand-strong: #20caa2;
  --blue: #67b8ff;
  --warn: #ffc96a;
  --danger: #ff7f8d;
  --success: #77efc7;
  --radius: 18px;
  --shadow: 0 22px 65px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 5%, rgba(35, 120, 135, 0.24), transparent 28rem),
    radial-gradient(circle at 90% 12%, rgba(34, 92, 150, 0.22), transparent 32rem),
    linear-gradient(160deg, #09121b 0%, #070d14 54%, #08111a 100%);
  font-family: "Manrope", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

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

button,
a,
select,
label[for] {
  -webkit-tap-highlight-color: transparent;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.2;
}

.ambient-a {
  width: 28rem;
  height: 28rem;
  top: 22rem;
  left: -18rem;
  background: #26d5ae;
}

.ambient-b {
  width: 34rem;
  height: 34rem;
  right: -22rem;
  top: 4rem;
  background: #2c85d7;
}

.workspace {
  width: min(1500px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 10px 0 40px;
}

.topbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
  padding: 0 2px 9px;
  border-bottom: 1px solid var(--line);
}

.topbar-main,
.product-title {
  display: flex;
  align-items: center;
}


.topbar-main {
  min-width: 0;
  gap: 14px;
}

.product-title {
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
}

.product-title h1 {
  margin: 0;
  color: #f2f8ff;
  font-size: 18px;
  line-height: 1;
  letter-spacing: -.025em;
}

.product-title span {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #dcecff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.back-link span {
  color: var(--brand);
  font-size: 19px;
  line-height: 1;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}


.topbar-status span:last-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.service-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(255, 201, 106, 0.08);
}

.service-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(119, 239, 199, 0.1), 0 0 18px rgba(119, 239, 199, 0.45);
}

.service-dot.offline {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 127, 141, 0.1);
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  padding: 14px 4px 12px;
}

.eyebrow,
.section-index {
  margin: 0;
  color: var(--brand);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-index {
  display: none;
}

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

h1 {
  margin: 2px 0 7px;
  font-size: clamp(29px, 3.2vw, 42px);
  line-height: 1;
  letter-spacing: -0.045em;
}

h2 {
  margin: 4px 0 0;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.hero-copy {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 430px;
}

.hero-tags span {
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #bcd0e3;
  background: rgba(11, 22, 32, 0.58);
  font-size: 11px;
  white-space: nowrap;
}

.layout {
  display: grid;
  grid-template-columns: minmax(600px, 1.5fr) minmax(390px, .9fr);
  gap: 10px;
  align-items: start;
}

.editor-column,
.side-column {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.setup-grid > .panel {
  height: auto;
}

#modelAvailability {
  display: none !important;
}

.panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(18, 32, 45, 0.9), rgba(10, 20, 30, 0.88));
  box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
  backdrop-filter: blur(14px);
}

.sticky-panel {
  position: sticky;
  top: 12px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.section-head.compact {
  margin-bottom: 9px;
}

.section-note {
  max-width: 700px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.counter,
.mono {
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
}

textarea,
select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  outline: none;
  color: var(--text);
  background: rgba(5, 13, 20, 0.72);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea {
  padding: 13px 14px;
  line-height: 1.62;
  resize: vertical;
}

select {
  min-height: 40px;
  padding: 0 38px 0 12px;
  cursor: pointer;
}

textarea:focus,
select:focus {
  border-color: rgba(85, 230, 194, 0.72);
  background: rgba(7, 17, 25, 0.9);
  box-shadow: 0 0 0 3px rgba(85, 230, 194, 0.08);
}

#prompt {
  min-height: 210px;
  font-size: 14px;
}

.prompt-compose {
  position: relative;
}

.prompt-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.prompt-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.mention-strip {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
}

.mention-label {
  flex: 0 0 auto;
  color: var(--brand);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  font-weight: 700;
}

.mention-chips {
  min-width: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.mention-empty {
  color: #647e94;
  font-size: 10px;
  white-space: nowrap;
}

.mention-chip {
  flex: 0 0 auto;
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid rgba(85, 230, 194, .25);
  border-radius: 7px;
  color: #b9e6dc;
  background: rgba(42, 177, 150, .08);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
}

.mention-chip:hover,
.mention-chip:focus-within {
  border-color: rgba(85, 230, 194, .7);
  color: var(--brand);
  outline: none;
}

.mention-chip-main,
.mention-chip-remove {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.mention-chip-main {
  gap: 5px;
  padding: 2px 5px;
  font-family: inherit;
  font-size: inherit;
}

.mention-chip-thumb {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 4px;
  object-fit: cover;
  background: #061019;
}

.mention-chip-remove {
  padding: 0 6px;
  border-left: 1px solid rgba(85, 230, 194, .18);
  color: #739487;
  font-size: 13px;
}

.mention-chip-remove:hover,
.mention-chip-remove:focus-visible {
  color: var(--danger);
  background: rgba(255, 127, 141, .08);
  outline: none;
}

.mention-menu {
  position: absolute;
  z-index: 10;
  right: 8px;
  bottom: 8px;
  width: min(330px, calc(100% - 16px));
  max-height: 170px;
  padding: 5px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: rgba(8, 18, 27, .98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
}

.mention-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 9px;
  border: 0;
  border-radius: 7px;
  color: #d8e8f5;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font-size: 10px;
}

.mention-option small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-option.active,
.mention-option:hover {
  color: var(--brand);
  background: rgba(85, 230, 194, .08);
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
}

.text-button:hover {
  color: var(--brand);
}

.field-grid {
  display: grid;
  gap: 8px;
}

.field-grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.output-panel .field-grid.four {
  grid-template-columns: 1.45fr .7fr 1fr .8fr;
}

.output-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px 66px;
  gap: 6px;
  align-items: stretch;
  padding: 7px 8px;
}

.output-panel .field {
  min-height: 50px;
  align-content: center;
  gap: 1px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 13, 20, 0.42);
}

.output-panel .field > span {
  color: #849bad;
  font-size: 8px;
}

.output-panel .field select {
  min-height: 24px;
  padding: 0 24px 0 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 11px;
}

.output-panel .field select:focus {
  color: var(--brand);
  background: transparent;
  box-shadow: none;
}

.field {
  display: grid;
  gap: 5px;
  color: #c8daeb;
  font-size: 12px;
}

.field > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}

.field em {
  color: #6e879e;
  font-size: 10px;
  font-style: normal;
  font-weight: 500;
}

.full-field {
  margin-top: 16px;
}

.output-options {
  display: grid;
  grid-template-columns: minmax(145px, .8fr) minmax(0, 1.2fr);
  gap: 8px;
  align-items: start;
}

.output-panel .output-options {
  grid-template-columns: 1fr;
  gap: 6px;
}

.output-options .advanced-row,
.output-options .full-field {
  margin-top: 8px;
}

.output-panel .advanced-row,
.output-panel .advanced-details {
  margin-top: 0;
}

.output-options .switch-field {
  min-height: 45px;
}

.output-panel .switch-field {
  min-height: 50px;
  justify-content: center;
  flex-direction: column-reverse;
  gap: 2px;
  padding: 4px;
}

.output-panel .switch-ui {
  flex: 0 0 16px;
  width: 30px;
  height: 16px;
  transform: none;
}

.output-panel .switch-ui::after {
  top: 3px;
  left: 3px;
  width: 10px;
  height: 10px;
}

.output-panel .switch-field input:checked + .switch-ui::after {
  transform: translateX(14px);
}

.output-panel .switch-field strong {
  color: #849bad;
  font-size: 8px;
}

.output-options textarea {
  min-height: 48px;
  padding-block: 9px;
}

.advanced-row {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.advanced-details {
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 13, 20, .42);
}

.advanced-details summary {
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: #c8daeb;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  list-style: none;
}

.output-panel .advanced-details summary {
  min-height: 50px;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 5px;
  color: #849bad;
  font-size: 8px;
  text-align: center;
}

.output-panel .advanced-details summary span {
  margin-left: 0;
  color: #c8daeb;
  font-size: 9px;
}

.output-panel .advanced-details summary::after {
  display: none;
}

.output-panel .advanced-details {
  position: static;
}

.output-panel .advanced-details textarea {
  position: static;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: rgba(7, 17, 25, .98);
  box-shadow: none;
}

.output-panel > .advanced-details[open] {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 6px;
  padding: 6px;
}

.output-panel > .advanced-details[open] summary {
  min-height: 46px;
  padding: 5px;
}

.output-panel > .advanced-details[open] textarea {
  min-height: 46px;
}

.advanced-details summary::-webkit-details-marker {
  display: none;
}

.advanced-details summary::after {
  content: "+";
  color: var(--muted);
  font-size: 15px;
}

.advanced-details[open] summary::after {
  content: "−";
}

.advanced-details summary span {
  margin-left: auto;
  color: #6e879e;
  font-size: 9px;
  font-weight: 500;
}

.advanced-details textarea {
  min-height: 54px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
}

.switch-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(5, 13, 20, 0.42);
  cursor: pointer;
}

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

.switch-ui {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #334757;
  transition: background .16s ease;
}

.switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #eef7ff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.35);
  transition: transform .16s ease;
}

.switch-field input:checked + .switch-ui {
  background: var(--brand-strong);
}

.switch-field input:checked + .switch-ui::after {
  transform: translateX(18px);
}

.switch-field strong,
.switch-field small {
  display: block;
}

.switch-field strong {
  font-size: 12px;
}

.switch-field small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.media-hub {
  min-width: 0;
  padding: 8px;
}

.media-hub-head {
  align-items: center;
}

.media-head-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 9px;
}

.mixed-dropzone {
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border: 1px dashed rgba(117, 159, 191, 0.42);
  border-radius: 12px;
  color: #cfe0ef;
  background: rgba(5, 13, 20, 0.4);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.mixed-dropzone:hover,
.mixed-dropzone.dragging,
.mixed-dropzone:focus-visible {
  border-color: rgba(85, 230, 194, 0.78);
  background: rgba(44, 199, 170, 0.07);
  transform: translateY(-1px);
  outline: none;
}

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

.drop-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(85, 230, 194, 0.35);
  border-radius: 9px;
  color: var(--brand);
  font-size: 17px;
}

.mixed-drop-copy {
  min-width: 0;
  flex: 1;
}

.mixed-drop-copy strong,
.mixed-drop-copy small {
  display: block;
}

.mixed-drop-copy strong {
  font-size: 12px;
}

.mixed-drop-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.auto-route {
  flex: 0 0 auto;
  padding: 4px 8px;
  border: 1px solid rgba(85, 230, 194, .25);
  border-radius: 999px;
  color: var(--brand);
  font-size: 9px;
}

.media-lanes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.media-manager {
  margin-top: 5px;
}

.media-manager > summary {
  padding: 5px 4px 1px;
  color: #6f879c;
  cursor: pointer;
  font-size: 9px;
  text-align: right;
}

.media-manager[open] > summary {
  color: var(--brand);
}

.media-lane {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(5, 13, 20, .32);
}

.lane-head,
.lane-actions {
  display: flex;
  align-items: center;
}

.lane-head {
  justify-content: space-between;
  gap: 8px;
}

.lane-head > div:first-child {
  min-width: 0;
}

.lane-head strong,
.lane-head small {
  display: block;
}

.lane-head strong {
  font-size: 12px;
}

.lane-head small {
  margin-top: 2px;
  overflow: hidden;
  color: var(--muted);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lane-actions {
  flex: 0 0 auto;
  gap: 5px;
}

.lane-actions label {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: #b9cfe1;
  background: rgba(18, 35, 50, .7);
  cursor: pointer;
  font-size: 9px;
  font-weight: 700;
}

.lane-actions label:hover,
.lane-actions label:focus-visible {
  border-color: rgba(85, 230, 194, .55);
  color: var(--brand);
  outline: none;
}

.file-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  margin-top: 6px;
}

.file-list.empty::before {
  content: attr(data-empty);
  grid-column: 1 / -1;
  padding: 5px 1px 0;
  color: #61798e;
  font-size: 10px;
}

.file-item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(5, 13, 20, 0.48);
}

.file-thumb,
.file-symbol {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  background: #162535;
}

.file-symbol {
  display: grid;
  place-items: center;
  color: var(--blue);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  font-weight: 600;
}

.file-copy {
  min-width: 0;
  flex: 1;
}

.file-copy strong,
.file-copy small {
  display: block;
}

.file-copy strong {
  overflow: hidden;
  color: #dbeaf7;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.file-remove {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: #8299ad;
  background: transparent;
  cursor: pointer;
}

.file-remove:hover {
  color: var(--danger);
  background: rgba(255, 127, 141, 0.08);
}

.url-details {
  margin-top: 7px;
  border-top: 1px solid var(--line);
}

.url-details summary {
  padding: 7px 1px 0;
  color: #8da7bd;
  cursor: pointer;
  font-size: 10px;
  font-weight: 700;
  list-style-position: inside;
}

.url-details[open] summary {
  color: var(--brand);
}

.url-field {
  margin-top: 9px;
}

.url-field textarea {
  min-height: 76px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
}

.count-badge,
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 27px;
  padding: 4px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  line-height: 1;
  white-space: nowrap;
}

.count-badge {
  color: #b8cce0;
  background: rgba(8, 17, 25, 0.65);
}

.count-badge.over {
  color: var(--danger);
  border-color: rgba(255, 127, 141, 0.45);
  background: rgba(255, 127, 141, 0.08);
}

.pill.neutral {
  color: #a9bfd2;
  background: rgba(85, 111, 134, 0.13);
}

.pill.success {
  color: var(--success);
  border-color: rgba(119, 239, 199, 0.42);
  background: rgba(119, 239, 199, 0.08);
}

.pill.warning {
  color: var(--warn);
  border-color: rgba(255, 201, 106, 0.42);
  background: rgba(255, 201, 106, 0.08);
}

.pill.danger {
  color: var(--danger);
  border-color: rgba(255, 127, 141, 0.45);
  background: rgba(255, 127, 141, 0.08);
}

.preview-submit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: stretch;
  gap: 8px;
  margin-top: 10px;
}

.preview-brief {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-brief > span:not(.sr-only) {
  min-width: 0;
  padding: 5px 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #8fa8bc;
  background: rgba(5, 13, 20, .3);
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-compact {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.summary-compact > span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 13, 20, .34);
}

.summary-compact small {
  flex: 0 0 auto;
  color: #728ba0;
  font-size: 8px;
}

.summary-compact b {
  min-width: 0;
  overflow: hidden;
  color: #c9dbe9;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.submit-actions {
  width: 150px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 5px;
}

.submit-actions .pill {
  justify-self: end;
}

.submit-actions .primary-button {
  min-height: 42px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 9px;
}

.compact-validation {
  margin: 6px 0 0;
}

.compact-validation .validation-item {
  padding: 4px 7px;
  border-radius: 7px;
  background: rgba(255, 127, 141, .04);
}

.compact-validation .validation-item.ok {
  background: rgba(119, 239, 199, .04);
}

.submit-dock {
  position: sticky;
  z-index: 8;
  bottom: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(180px, 220px);
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-color: rgba(85, 230, 194, .24);
  background: rgba(11, 22, 32, .96);
  box-shadow: 0 16px 42px rgba(0, 0, 0, .4);
}

.submit-dock .primary-button {
  min-height: 44px;
  margin: 0;
  padding: 7px 12px;
  border-radius: 9px;
}

.submit-dock .validation-list,
.submit-dock .form-message,
.submit-dock .submit-request-details {
  grid-column: 1 / -1;
}

.submit-dock .validation-list:empty,
.submit-dock .form-message:empty {
  display: none;
}

.submit-request-details {
  border: 0;
  background: transparent;
}

.submit-request-details summary {
  padding: 2px 4px;
  color: #647d91;
  font-size: 8px;
  text-align: right;
}

.submit-request-details[open] {
  border: 1px solid var(--line);
  background: rgba(5, 13, 20, .6);
}

.submit-dock:has(.submit-request-details[open]) {
  position: relative;
  bottom: auto;
}

.submit-request-details[open] pre {
  max-height: 260px;
}

.queue-panel {
  min-height: calc(100vh - 64px);
  max-height: calc(100vh - 24px);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 10px;
}

.queue-head h2 {
  margin: 3px 0 0;
  font-size: 18px;
}

.queue-kicker {
  color: var(--warn);
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .18em;
}

.queue-filters {
  display: flex;
  gap: 4px;
  padding: 0 16px 10px;
  border-bottom: 1px solid var(--line);
}

.queue-filters button {
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  color: #6f879c;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
}

.queue-filters button.active,
.queue-filters button:hover {
  color: #e5f0f8;
  background: rgba(119, 143, 164, .14);
}

.job-queue {
  min-height: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.queue-empty {
  flex: 1 0 320px;
  min-height: 320px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  color: #688196;
  text-align: center;
}

.queue-empty > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.queue-empty strong {
  color: #94aabd;
  font-size: 12px;
}

.queue-empty small {
  max-width: 280px;
  font-size: 9px;
  line-height: 1.5;
}

.job-card {
  flex: 0 0 auto;
  align-self: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(7, 15, 23, .76);
}

.job-preview {
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  color: #71889b;
  background:
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    #050b11;
  background-size: 28px 28px;
}

.job-preview.portrait {
  max-width: calc(100% - 20px);
  margin: 10px auto 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.job-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.job-preview > small {
  max-width: 82%;
  color: #7f94a6;
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.job-preview-state {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}

.job-preview-state.working {
  color: var(--brand);
  animation: jobPulse 1.4s ease-in-out infinite;
}

.job-preview-state.failed {
  color: var(--danger);
  border-color: rgba(255, 127, 141, .35);
}

@keyframes jobPulse {
  50% { opacity: .45; transform: scale(.94); }
}

.job-card-body {
  padding: 10px 11px 11px;
  border-top: 1px solid var(--line);
}

.job-card-head,
.job-progress-meta,
.job-card-footer,
.job-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.job-card-head strong {
  min-width: 0;
  overflow: hidden;
  color: #dce9f3;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-status {
  flex: 0 0 auto;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 8px;
}

.job-status.success { color: var(--success); border-color: rgba(119,239,199,.3); }
.job-status.danger { color: var(--danger); border-color: rgba(255,127,141,.3); }
.job-status.warning { color: var(--warn); border-color: rgba(255,201,106,.3); }

.job-prompt {
  display: -webkit-box;
  margin: 7px 0;
  overflow: hidden;
  color: #8299ad;
  font-size: 9px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.job-specs {
  margin: -2px 0 7px;
  color: #5f788e;
  font-family: "IBM Plex Mono", monospace;
  font-size: 8px;
}

.job-progress-track {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(93, 119, 141, .18);
}

.job-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--warn), var(--brand));
  transition: width .25s ease;
}

.job-progress-fill.indeterminate {
  width: 32% !important;
  animation: indeterminate 1.4s ease-in-out infinite;
}

.job-progress-meta {
  margin-top: 5px;
  color: #6f879c;
  font-size: 8px;
}

.job-card-footer {
  margin-top: 8px;
}

.job-card-footer code {
  min-width: 0;
  overflow: hidden;
  color: #627a8f;
  font-size: 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-card-actions {
  justify-content: flex-end;
  gap: 5px;
}

.job-card-actions button,
.job-card-actions a {
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: #b6cada;
  background: rgba(18, 35, 50, .55);
  cursor: pointer;
  font-size: 8px;
  text-decoration: none;
}

.job-card-actions .danger-action {
  color: var(--danger);
}

.job-response {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.job-response summary {
  padding-top: 7px;
  color: #6f879c;
  cursor: pointer;
  font-size: 8px;
}

.job-response pre {
  max-height: 220px;
  padding: 8px;
  overflow: auto;
  border-radius: 7px;
  color: #9ab4c9;
  background: #040a0f;
  font-family: "IBM Plex Mono", monospace;
  font-size: 7px;
  white-space: pre-wrap;
  word-break: break-word;
}

.summary-list {
  margin: 0;
}

.summary-list > div {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.summary-list dt {
  color: var(--muted);
  font-size: 10px;
}

.summary-list dd {
  min-width: 0;
  margin: 0;
  color: #dbeaf7;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.validation-list {
  display: grid;
  gap: 7px;
  margin: 11px 0;
}

.validation-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.validation-item.error {
  color: var(--danger);
}

.validation-item.ok {
  color: #9fc4b8;
}

.validation-icon {
  flex: 0 0 14px;
  text-align: center;
}

.request-details,
.response-details {
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(5, 13, 20, 0.4);
}

.request-details summary,
.response-details summary {
  padding: 8px 10px;
  color: #b8ccdd;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.request-details pre,
.response-details pre {
  max-height: 330px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border-top: 1px solid var(--line);
  color: #a9c7df;
  background: rgba(2, 8, 13, 0.56);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.primary-button,
.secondary-button {
  width: 100%;
  border-radius: 12px;
  cursor: pointer;
  transition: opacity .16s ease, transform .16s ease, border-color .16s ease, background .16s ease;
}

.primary-button {
  min-height: 50px;
  display: grid;
  place-items: center;
  gap: 1px;
  margin-top: 12px;
  padding: 10px 14px;
  border: 0;
  color: #041d17;
  background: linear-gradient(125deg, #66efd0, #28d2aa 54%, #57c9ef);
  box-shadow: 0 14px 30px rgba(38, 211, 169, 0.22);
  font-weight: 800;
}

.primary-button small {
  color: rgba(4, 29, 23, 0.66);
  font-size: 9px;
  font-weight: 700;
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.secondary-button {
  min-height: 42px;
  margin-top: 9px;
  padding: 9px 12px;
  border: 1px solid var(--line-strong);
  color: #c5d8e8;
  background: rgba(18, 35, 50, 0.55);
  font-size: 11px;
  font-weight: 700;
}

.secondary-button:hover:not(:disabled) {
  border-color: rgba(85, 230, 194, 0.48);
  background: rgba(31, 58, 78, 0.65);
}

.compact-button {
  width: auto;
  min-height: 30px;
  margin: 9px 10px 10px;
  padding: 5px 9px;
  font-size: 9px;
}

.form-message {
  min-height: 0;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.form-message.error {
  color: var(--danger);
}

.form-message.success {
  color: var(--success);
}

.result-panel {
  margin-top: 0;
}

.preview-panel {
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
}

.debug-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 7px;
}

.debug-details:has(.response-details.hidden) .request-details {
  grid-column: 1 / -1;
}

.result-head,
.result-status-wrap,
.progress-meta,
.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.result-status-wrap {
  justify-content: flex-end;
}

.progress-track {
  width: 100%;
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(90, 121, 148, 0.18);
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--brand));
  transition: width .3s ease;
}

.progress-bar.indeterminate {
  width: 32%;
  animation: indeterminate 1.4s ease-in-out infinite;
}

@keyframes indeterminate {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(320%); }
}

.progress-meta {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
}

.result-body {
  min-height: 380px;
  flex: 1;
  display: grid;
  place-items: center;
  margin-top: 9px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.012) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.012) 75%),
    #050d14;
  background-size: 28px 28px;
}

.empty-result {
  align-content: center;
  gap: 12px;
  color: #6f879c;
  text-align: center;
  font-size: 12px;
}

.empty-visual {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #7891a7;
  background: rgba(18, 35, 50, 0.55);
}

.result-video {
  width: 100%;
  max-height: 78vh;
  display: block;
  background: #000;
}

.result-error {
  max-width: 780px;
  padding: 28px;
  color: #ffd1d6;
  text-align: left;
}

.result-error strong,
.result-error span {
  display: block;
}

.result-error strong {
  margin-bottom: 8px;
  font-size: 15px;
}

.result-error span {
  color: #c8a6aa;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.result-actions {
  justify-content: flex-start;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: rgba(8, 17, 25, 0.8);
}

.result-actions a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: #cde0ef;
  background: rgba(20, 39, 55, 0.64);
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
}

.result-actions a:hover {
  border-color: rgba(85, 230, 194, 0.5);
  color: var(--brand);
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1080px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }

  .queue-panel {
    min-height: 560px;
    max-height: none;
  }

  .job-queue {
    max-height: none;
    overflow-y: visible;
  }

  .preview-panel {
    min-height: 620px;
  }

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

@media (max-width: 820px) {
  .setup-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .workspace {
    width: min(100% - 22px, 1500px);
    padding-top: 12px;
  }

  .topbar {
    align-items: flex-start;
  }

  .product-title span,
  .topbar-status span:last-child {
    display: none;
  }

  .hero {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 24px 2px 18px;
  }

  .hero-tags {
    justify-content: flex-start;
  }

  .panel {
    padding: 16px;
    border-radius: 15px;
  }

  .field-grid.four,
  .output-panel .field-grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .output-panel > .field-grid {
    grid-column: 1 / -1;
  }

  .output-panel .output-options {
    grid-template-columns: 1fr;
  }

  .output-panel > .advanced-details[open] {
    grid-column: 1 / -1;
  }

  .media-lanes {
    grid-template-columns: 1fr;
  }

  .media-head-meta > span:first-child,
  .auto-route {
    display: none;
  }

  .mixed-dropzone {
    align-items: flex-start;
  }

  .prompt-meta {
    align-items: flex-start;
  }

  .mention-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .output-options {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .output-options .switch-field {
    min-height: 58px;
  }

  #prompt {
    min-height: 164px;
  }

  .preview-submit,
  .debug-details {
    grid-template-columns: 1fr;
  }

  .submit-dock {
    bottom: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 8px;
  }

  .submit-dock .primary-button {
    grid-column: 1 / -1;
  }

  .queue-panel {
    min-height: 500px;
  }

  .submit-actions {
    width: 100%;
    grid-template-columns: auto minmax(150px, 1fr);
    grid-template-rows: 1fr;
    align-items: center;
  }

  .submit-actions .pill {
    justify-self: start;
  }

  .preview-panel {
    min-height: auto;
  }

  .section-head {
    gap: 10px;
  }

  .result-body {
    min-height: 260px;
  }
}
