:root {
  color-scheme: dark;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #edf0ec;
  background: #0e1111;
  --card: #171b1a;
  --line: #303735;
  --soft: #a7b4ae;
  --accent: #d7f576;
  --accent-text: #182000;
}
* {box-sizing: border-box}
body {margin: 0; min-width: 300px}
button, input, textarea, select {font: inherit}
button, a, input, textarea, select {outline-offset: 4px}
:focus-visible {outline: 2px solid var(--accent)}
[hidden] {display: none !important}
.shell {max-width: 1360px; margin: auto; padding-inline: clamp(20px, 5vw, 70px)}
.masthead {border-bottom: 1px solid #252c28; background: #121615}
.top {height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px}
.brand {display: flex; align-items: center; gap: 11px; font-weight: 750; white-space: nowrap}
.brand > span:last-child > span {color: #c2cfc8; font-weight: 550; margin-left: 5px}
.brand-mark {display: grid; place-items: center; width: 28px; height: 28px; background: var(--accent); color: var(--accent-text); border-radius: 8px; font-size: 18px}
.connection {font-size: 12px; color: var(--soft); white-space: nowrap}
.connection > span {display: inline-block; width: 7px; height: 7px; background: #7c8983; border-radius: 50%; margin-right: 6px}
.connection.online > span {background: var(--accent); box-shadow: 0 0 12px #d7f57688}
.intro {padding-block: 42px 26px}
h1, h2, p {margin: 0}
.intro h1 {font-size: clamp(33px, 5vw, 49px); letter-spacing: -.065em; line-height: 1.12}
.intro p {margin-top: 13px; color: var(--soft); line-height: 1.55; font-size: 14px}
.workspace {display: grid; grid-template-columns: minmax(305px, 380px) minmax(0, 1fr); align-items: start; gap: 19px; padding-bottom: 35px}
.controls {display: grid; gap: 13px}
.card {border: 1px solid var(--line); border-radius: 17px; background: var(--card)}
.connection-card {padding: 17px 19px}
.connection-card label {display: block; margin-bottom: 9px}
.connected-fields {display: flex; gap: 8px}
.connected-fields input {min-width: 0; flex: 1}
.job-form {padding: 20px; display: grid; gap: 17px}
.field {border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 8px}
.field label, legend, .connection-card label {font-weight: 650; font-size: 14px}
.field label small {color: var(--soft); font-size: 11px; margin-left: 4px; font-weight: 450}
legend {margin: 0 0 8px; padding: 0}
.field-top {display: flex; align-items: center; justify-content: space-between; gap: 8px}
.note {color: var(--soft); font-size: 12px; line-height: 1.55}
.note:empty {display: none}
.error {color: #ffb5a6}
input, textarea, select {border: 1px solid var(--line); background: #101413; color: #edf0ec; border-radius: 8px; padding: 9px 10px}
input::placeholder, textarea::placeholder {color: #8e9c96}
textarea {width: 100%; resize: vertical; font-size: 13px; line-height: 1.48}
textarea:disabled {opacity: .73}
.dropzone {cursor: pointer; border: 1px dashed #596650; border-radius: 10px; background: #1b231a; display: grid; place-items: center; align-content: center; min-height: 106px; padding: 11px; gap: 6px; text-align: center}
.dropzone:hover, .dropzone.dragging, #reference:focus-visible + .dropzone {border-color: var(--accent)}
.dropzone.has-image {grid-template-columns: 62px minmax(0,1fr); justify-items: start; padding: 9px 14px; text-align: left; gap: 11px; min-height: 82px}
.upload-icon {display: grid; place-items: center; height: 27px; width: 27px; color: var(--accent); border-radius: 7px; background: #2e3b22}
.dropzone img {width: 62px; height: 62px; object-fit: contain; border-radius: 7px; background: #101413}
#upload-text {min-width: 0; max-width: 100%}
#upload-text strong, #upload-text small {display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap}
#upload-text strong {font-size: 13px}
#upload-text small {margin: 3px 0 0; font-size: 11px}
.choice {display: flex; gap: 6px; padding: 4px; background: #0e1311; border: 1px solid var(--line); border-radius: 9px}
.choice label {flex: 1; position: relative; text-align: center; cursor: pointer}
.choice input, .visually-hidden {position: absolute; width: 1px; height: 1px; margin: -1px; clip: rect(0,0,0,0); clip-path: inset(50%); overflow: hidden}
.choice span {display: block; padding: 8px; border-radius: 6px; color: #b7c5bd}
.choice input:checked + span {background: #2c3728; color: var(--accent)}
.choice input:focus-visible + span {outline: 2px solid var(--accent)}
.count-input {display: flex; gap: 6px; align-items: center; color: var(--soft); font-size: 12px}
.count-input input {width: 72px; padding: 6px 8px; color: #edf0ec}
.presets {display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px}
.presets button, .button, .text-button {cursor: pointer}
.presets button {background: #171e1b; color: var(--soft); border: 1px solid var(--line); border-radius: 7px; padding: 6px 0; font-size: 12px}
.presets button[aria-pressed="true"] {color: var(--accent); border-color: #64734a; background: #283224}
.button {display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 12px; min-height: 36px; font-size: 13px; border-radius: 8px; font-weight: 700; white-space: nowrap; text-decoration: none}
.secondary {background: #232d27; border: 1px solid #3b4a40; color: #e6f1e9}
.primary {background: var(--accent); color: var(--accent-text); border: 1px solid transparent; justify-content: space-between; padding-inline: 13px; min-height: 45px}
.primary:not(:disabled):hover {background: #e5ffa3}
.button:disabled, .text-button:disabled {opacity: .48; cursor: default}
.text-button {border: 0; padding: 2px; color: var(--accent); background: transparent; font-size: 12px; white-space: nowrap}
.results {min-height: 628px; position: sticky; top: 14px; padding: 19px; background: #141917}
.results-head {min-height: 53px; display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; margin-bottom: 13px}
.results-head h2 {font-size: 19px; font-weight: 710}
.results-head p, .stage p {color: var(--soft); font-size: 13px; line-height: 1.45; margin-top: 5px}
.stage {min-height: 490px; color: #d6e0d9; border: 1px solid #303b33; border-radius: 12px; display: grid; place-items: center; align-content: center; gap: 4px; text-align: center; padding: 18px;
  background-color: #131b17; background-image: radial-gradient(#25362b 1px, transparent 1px); background-size: 18px 18px}
.empty-frames {width: 130px; height: 116px; position: relative; margin-bottom: 15px}
.empty-frames i {position: absolute; display: block; top: 13px; width: 60px; height: 82px; border-radius: 8px; border: 1px solid #546f52; background: #25352a}
.empty-frames i:first-child {transform: rotate(-17deg); left: 13px}
.empty-frames i:nth-child(2) {transform: rotate(16deg); right: 13px}
.empty-frames i:last-child {left: 35px; top: 10px; background: #344739; border-color: #7e9e6f; box-shadow: 0 5px 15px #10151077; overflow: hidden}
.empty-frames i:last-child::before {content: ""; position: absolute; width: 11px; height: 11px; border-radius: 50%; background: var(--accent); top: 16px; right: 12px; opacity: .8}
.empty-frames i:last-child::after {content: ""; position: absolute; width: 76px; height: 62px; left: 0; top: 38px; transform: rotate(33deg); border-radius: 12px; background: #536f4c}
.history {display: flex; align-items: center; justify-content: space-between; gap: 9px; color: var(--soft); font-size: 12px; margin-bottom: 10px}
.history select {max-width: 75%; padding: 6px 9px}
.progress-bar {display: flex; justify-content: space-between; gap: 8px; margin-block: 13px 4px}
.progress-bar strong {font-size: 14px}
progress {width: 100%; accent-color: var(--accent); display: block; height: 7px; margin: 0 0 16px}
.result-grid {display: grid; grid-template-columns: repeat(auto-fill, minmax(min(140px, 100%), 1fr)); gap: 12px}
.result {margin: 0; min-width: 0; border-radius: 9px; overflow: hidden; background: #101612; border: 1px solid #344137; display: block; text-decoration: none; color: #edf0ec}
.result img {width: 100%; aspect-ratio: 3 / 4; object-fit: contain; display: block}
.result span {display: block; padding: 8px; text-align: center; font-size: 12px}
.result:hover span {color: var(--accent)}
@media (max-width: 740px) {
  .workspace {grid-template-columns: 1fr}
  .results {min-height: 0; position: static; padding: 15px}
  .stage {min-height: 260px}
  .intro {padding-block: 28px 19px}
  .job-form {padding: 15px}
}
