.script-import,.script-rewrite{border:1px solid #dfe7df;background:#f7faf6;border-radius:16px;padding:20px;margin-bottom:22px;min-width:0}
.script-rewrite{background:#fff}
.script-tool>summary{cursor:pointer;font-size:17px;font-weight:650;line-height:1.4}
.script-tool>summary:focus-visible{outline:2px solid #55b81f;outline-offset:5px;border-radius:4px}
.script-tool-content{margin-top:18px}
#script-workflow h3{margin:0;font-size:18px}
#script-workflow input:not([type=file]),#script-workflow select{width:100%;min-width:0;padding:12px;border:1px solid #d9e1d7;border-radius:10px;background:#fff;color:inherit;font:inherit}
#script-workflow textarea{resize:vertical;font:inherit;line-height:1.55}
.script-import-options{display:flex;align-items:flex-end;flex-wrap:wrap;gap:14px;margin-bottom:12px}
.script-import-options>div:first-child{flex:1;min-width:190px;max-width:280px}
.script-buttons{display:flex;align-items:center;flex-wrap:wrap;gap:8px;margin:12px 0}
.script-buttons a{text-decoration:none;font-size:14px}
.script-source-preview{margin-top:16px}
.script-source-preview video{max-width:100%;width:420px;max-height:300px;background:#101810;border-radius:12px}
.script-source-preview audio{max-width:100%}
.script-section-heading,.script-history-row{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px}
.script-history{margin:18px 0}
.script-saved-prompts{margin:18px 0;padding:16px;border:1px solid #dfe7df;border-radius:12px;background:#f7faf6;min-width:0;scroll-margin-top:90px}
.script-saved-prompts>summary{cursor:pointer;font-weight:650;line-height:1.5}
.script-saved-prompts>summary:focus-visible{outline:2px solid #55b81f;outline-offset:4px;border-radius:4px}
.script-saved-preview{background:#fff;color:#435443;max-height:360px}
.script-saved-form{margin-top:18px;padding-top:16px;border-top:1px solid #dfe7df}
@media(max-width:700px){.script-saved-prompts{scroll-margin-top:205px}}
.script-history-row{padding:10px 0;border-bottom:1px solid var(--line);font-size:13px}
.job-card progress{display:block;width:100%;height:8px;accent-color:#59cc00;margin:12px 0}
.token-breakdown{margin:8px 0 14px;padding-top:8px;border-top:1px solid var(--line)}
.token-breakdown summary{cursor:pointer;color:#416b38;font-weight:650}
.token-breakdown-table{display:grid;gap:6px;margin-top:8px}
.token-breakdown-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:7px 0;border-bottom:1px solid #edf1ec;font-size:12px}
.token-breakdown-row span{min-width:0}.token-breakdown-row strong,.token-breakdown-row small{display:block;overflow-wrap:anywhere}.token-breakdown-row small{color:#718071;margin-top:2px}.token-breakdown-row b{white-space:nowrap;font-weight:650}
@media(max-width:650px){.script-import,.script-rewrite{padding:14px}.script-import-options>div:first-child{max-width:none;flex-basis:100%}.script-buttons{width:100%}.script-buttons button{flex:1 1 150px}.script-section-heading button{width:100%}}
.stage-request-help{padding:14px 16px;border:1px solid #e2e8ef;border-radius:12px;background:#f7f9fc;line-height:1.6;margin-bottom:12px}
.stage-request-help p{margin:0}
.stage-request-help ul{margin:8px 0;padding-left:20px}
.stage-request-help li+li{margin-top:4px}
.script-review-report{margin:16px 0;padding:16px;border:1px solid #e2e8ef;border-radius:12px;background:#f7f9fc;overflow-wrap:anywhere;line-height:1.5}
.script-review-report ul{padding-left:20px}
.script-review-report li+li{margin-top:8px}
#script-review-options{margin:16px 0}
#script-review-options summary{cursor:pointer;margin-bottom:12px}
.grid,
.card,
.card-head,
.card-head > div,
.meta {
  min-width: 0;
}
.card h3 {
  overflow-wrap: anywhere;
}
.edit-hint {
  white-space: normal;
  text-align: right;
}
.release-order {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
}
.release-order li {
  min-height: 68px;
  border: 1px solid #e6e9ec;
  border-radius: 14px;
  background: #fff;
}
.release-order button{display:flex;gap:10px;align-items:flex-start;width:100%;height:100%;padding:12px;border:0;border-radius:14px;background:transparent;text-align:left;color:inherit;font:inherit}
.release-order button:disabled{cursor:not-allowed;opacity:.65}
.release-order button:focus-visible{outline:3px solid #319f04;outline-offset:3px}
.release-order .is-selected{border-color:#55b81f;box-shadow:0 0 0 2px #55b81f}
.release-order .is-last-unlocked{border-color:#319f04;background:#f8fff3;box-shadow:0 0 0 3px #dff3d1,0 4px 12px #319f0426}
.release-order .release-detail{flex:1;min-width:0}
.release-order progress{display:block;width:100%;height:5px;margin-top:10px;accent-color:#55b81f}
#pipeline-progress{display:flex;gap:18px;align-items:center;margin-bottom:18px;color:#617080;font-size:13px}
#pipeline-progress progress{flex:1;max-width:320px;height:8px;accent-color:#55b81f}
.stage-results{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin:20px 0}
.stage-results article{min-width:0;padding:18px;border:1px solid var(--line);border-radius:16px;background:white}
.stage-results audio,.stage-results video{max-width:100%;width:100%}
.stage-results video{max-height:360px}
.stage-results pre,.stage-report{white-space:pre-wrap;overflow-wrap:anywhere;max-height:340px;overflow:auto;font-size:12px}
.stage-artifacts{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr));gap:12px}
.stage-artifacts figure{margin:0;min-width:0}.stage-artifacts img,.stage-artifacts video{width:100%;max-height:300px;object-fit:contain}.stage-artifacts figcaption{font-size:11px;overflow-wrap:anywhere}
@media(max-width:680px){.stage-results{grid-template-columns:1fr}}
.release-order .release-number {
  display: grid;
  place-items: center;
  flex: 0 0 25px;
  height: 25px;
  border-radius: 50%;
  background: #edf0f3;
  color: #617080;
  font-size: 12px;
  font-weight: 750;
}
.release-order strong,.release-order small {display:block}
.release-order strong {font-size:12px;line-height:1.35}
.release-order small {margin-top:4px;color:#7c8995;font-size:10px;line-height:1.35}
.release-order .is-ready {border-color:#9bd875;background:#f7fff3}
.release-order .is-ready .release-number {background:#55c900;color:#173408}
.release-order .is-manual {border-style:dashed}
.pipeline-card {
  background: white;
  border: 1px solid #e6e9ec;
  border-radius: 24px;
  padding: 26px;
  box-shadow: 0 1px 2px #192b4410;
}
.stage-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.stage-heading h2 {
  margin: 0;
  font-size: 21px;
}
.pipeline-card label {
  display: block;
  font-weight: 650;
  margin: 10px 0;
}
.pipeline-card textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid #e7e9ec;
  border-radius: 16px;
  line-height: 1.75;
  resize: vertical;
}
.stage-content {
  min-height: 295px;
  font-size: 15px;
}
.stage-tools,
.agent-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.green-action {
  background: #54c900;
  color: #183806;
  border-radius: 999px;
  padding: 14px 20px;
}
.green-action:hover {
  background: #48b900;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}
.stage-condition {
  font-size: 12px;
  color: #5a6875;
  margin: 14px 0;
}
.stage-condition.stale {
  color: #9d6300;
}
.stage-console {
  border-radius: 12px;
  background: #1c1f23;
  color: #e4f1d0;
  padding: 14px;
  font:
    12px/1.55 ui-monospace,
    monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 12px 0 0;
}
.word-table-wrap {
  max-height: 330px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}
.word-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
.word-table th {
  position: sticky;
  top: 0;
  background: #f8f9fb;
  text-align: left;
  padding: 12px;
}
.word-table td {
  padding: 3px 8px;
}
.word-table td:first-child {
  color: var(--muted);
}
.word-table input {
  width: 100%;
  min-width: 55px;
  border: 1px solid #e6e9ed;
  padding: 6px 8px;
  border-radius: 5px;
}
.word-table td:nth-child(2) {
  width: 55%;
}
.word-table input[type="number"] {
  max-width: 100px;
}
.stage-audio {
  width: 100%;
  margin: 16px 0;
}
.stage-video {
  width: 100%;
  max-height: 350px;
  background: #171b20;
  border-radius: 16px;
}
.render-gate {
  margin: 16px 0;
  padding: 22px;
  border: 1px solid #b8dec8;
  border-radius: 12px;
  background: #f2fbf5;
}
.render-gate strong {
  display: block;
  color: #19683b;
  font-size: 18px;
}
.render-gate p { margin: 8px 0 0; }
.acceptance-skip {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #e2d5ad;
  border-radius: 12px;
  background: #fffaf0;
}
.acceptance-skip p { margin: 8px 0 0; }
.acceptance-actions {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid #b8dec8;
  border-radius: 12px;
  background: #f2fbf5;
}
.acceptance-actions p { margin: 8px 0 0; }
.scene-job-status { display: block; font-size: 12px; line-height: 1.5; margin-top: 8px; overflow-wrap: anywhere; }
.job-card {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}
.job-card.is-restored {
  border-color: #5c83d6;
  box-shadow: 0 0 0 2px #e8efff;
}
.job-title {
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.job-title:hover strong,
.job-title:focus-visible strong {
  color: var(--blue);
  text-decoration: underline;
}
.job-title:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
  border-radius: 3px;
}
.job-restore-note {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  margin-top: 18px;
  border: 1px solid #c9d8f7;
  border-radius: 12px;
  background: #f2f6ff;
  color: #36578f;
  font-size: 12px;
}
.job-restore-note strong { white-space: nowrap; }
.job-restore-note span { flex: 1; }
.job-restore-note .text-button { color: #36578f; white-space: nowrap; }
@media (max-width: 640px) {
  .job-restore-note { align-items: flex-start; flex-wrap: wrap; }
  .job-restore-note span { flex-basis: 100%; order: 3; }
}
.job-card pre {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #1c1f23;
  color: #e4f1d0;
  padding: 14px;
  font-size: 12px;
  border-radius: 8px;
  line-height: 1.55;
  margin: 12px 0 0;
}
.job-card details {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.job-card details summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 650;
}
.job-request {
  margin-top: 12px;
  padding: 10px 12px;
  border-left: 3px solid #b8c9e8;
  background: #f6f8fc;
}
.job-request p { margin: 5px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.job-log-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.job-card + .job-card { margin-top: 14px; }
}
.setting-state {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}
.remove-secret {
  display: flex !important;
  align-items: center;
}
.remove-secret input {
  width: auto !important;
}
.settings-editor p {
  max-width: 540px;
}
.settings-editor {width: min(820px, 100%)}
.settings-models {padding-bottom: 18px; border-bottom: 1px solid var(--line)}
.model-group {margin: 24px 0 12px; font-size: 16px}
.model-setting-row {padding: 12px 0; border-bottom: 1px solid var(--line)}
.model-setting-controls {display: grid; grid-template-columns: minmax(0, 1fr) minmax(155px, .55fr); gap: 12px; align-items: start}
.model-setting-controls > .model-picker {padding-top: 24px}
.model-setting-controls .model-effort-label {font-size: 12px; color: var(--muted); margin: 0}
.model-picker {min-width: 0}
.model-picker select, .model-setting-controls select {width: 100%; min-width: 0}
.settings-editor select {padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: inherit; font: inherit}
.model-picker .custom-model {margin-top: 8px}
.model-picker .custom-model[hidden] {display: none}
#reset-models {margin-top: 16px}
@media(max-width: 540px) {
  .model-setting-controls {grid-template-columns: minmax(0, 1fr)}
  .model-setting-controls > .model-picker {padding-top: 0}
  .settings-editor .editor-foot {flex-wrap: wrap}
}
.provider-summary {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.provider-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}
.editable-card video{pointer-events:none}
.editor label,.editor input,.editor textarea{min-width:0;overflow-wrap:anywhere}
.modal-backdrop{overflow:auto}
.editor-head h2{overflow-wrap:anywhere}
.toast {
  z-index: 40;
}
@media (max-width: 680px) {
  .release-order {grid-template-columns: repeat(2, minmax(0, 1fr));}
  .pipeline-card {
    padding: 18px;
    border-radius: 18px;
  }
  .stage-heading {
    align-items: start;
  }
  .stage-heading h2 {
    font-size: 19px;
  }
  .stage-heading span {
    white-space: nowrap;
  }
  .stage-content {
    min-height: 230px;
  }
  .word-table td {
    padding: 3px;
  }
  .word-table input {
    font-size: 12px;
    padding: 5px;
  }
  .top-title {
    display: none;
  }
  .top-actions {
    width: 100%;
    justify-content: flex-end;
  }
}
@media (max-width: 900px) {
  .side,
  .main,
  .nav {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .nav {
    overflow-x: auto;
  }
  .nav button {
    flex: 0 0 auto;
  }
}
.boot-error{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;min-height:70vh;text-align:center;padding:24px}
