.script-gate{max-width:1300px;margin:0 auto;min-width:0}.script-gate *{box-sizing:border-box}.script-gate .pagehead{margin-bottom:24px}.script-gate h1{font-size:clamp(25px,3vw,38px);line-height:1.1}.script-gate h2{font-size:17px;letter-spacing:.06em;margin:0 0 16px}.script-gate h3{font-size:16px}.sg-panel{border:1px solid #343433;background:#141515;padding:24px;margin-bottom:18px;border-radius:6px;min-width:0}.sg-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin:16px 0}.script-gate label{display:flex;flex-direction:column;gap:8px;font-size:13px;min-width:0}.script-gate input,.script-gate select,.script-gate textarea{width:100%;min-width:0;max-width:100%}.script-gate input[type=file]{padding:12px}.script-gate p,.script-gate dd,.script-gate a,.script-gate blockquote{overflow-wrap:anywhere}.sg-meta,.sg-context-note{font-size:12px;color:#a8a8a2;line-height:1.6}.sg-quality{font-size:30px;color:#c9af75;font-variant-numeric:tabular-nums}.sg-quality span{font-size:17px;color:#a8a8a2}.sg-quality-label{font-size:12px;letter-spacing:.12em;margin-bottom:4px}.script-gate .sg-gate{font-size:clamp(27px,4vw,44px);line-height:1.15;letter-spacing:0;margin:12px 0}.sg-fail{color:#e8998d}.sg-pass{color:#9fcbb5}.sg-finding{border-top:1px solid #333;padding:16px 0}.sg-critical{border-left:3px solid #b9695f;padding-left:14px}.sg-finding p{font-size:14px;line-height:1.55}.script-gate blockquote{border-left:2px solid #806d42;margin:12px 0;padding:8px 14px;color:#bdbbb5;font-size:13px;white-space:pre-wrap}.sg-table-wrap{width:100%;min-width:0}.script-gate table{width:100%;table-layout:fixed;border-collapse:collapse;font-size:13px}.script-gate th,.script-gate td{text-align:left;border-bottom:1px solid #343434;padding:12px 8px;overflow-wrap:anywhere;white-space:normal}.script-gate table th:first-child{width:38%}.script-gate .sg-lowest{background:#2b251b;color:#e4cf9d}.sg-risk-map,.sg-tabs{display:flex;gap:8px;flex-wrap:wrap}.sg-risk{font-size:12px;padding:8px;border:1px solid #514c41}.sg-risk[data-severity=HIGH],.sg-risk[data-severity=CRITICAL]{border-color:#a3655d;color:#e8998d}.sg-tabs button[aria-pressed=true]{border-color:#d1b878;color:#e4cf9d}.script-gate summary{cursor:pointer;color:#c9af75}.script-gate dl{display:grid;grid-template-columns:minmax(80px,1fr) minmax(0,3fr);gap:8px;font-size:12px}.script-gate dd{margin:0}.script-gate [role=alert]{color:#e8998d}.sg-back{color:#d1b878}.script-gate small{font-size:11px}@media(max-width:600px){.sg-panel{padding:16px}.sg-grid{grid-template-columns:1fr}.script-gate table{font-size:11px}.script-gate th,.script-gate td{padding:9px 3px}.script-gate dl{grid-template-columns:1fr}.script-gate dd{margin-bottom:10px}.script-gate .pagehead{display:block}.script-gate h2{font-size:15px}}

/* Local form actions reuse the existing SCL buttons and native modal. */
.sg-project-field{display:flex;flex-direction:column;gap:8px;min-width:0}.script-gate .sg-local-action{display:inline-flex;align-items:center;justify-content:center;gap:7px;align-self:flex-start;color:#c9af75;border-color:rgba(201,175,117,.35);background:rgba(201,175,117,.035);font-size:12px;max-width:100%;white-space:normal}.script-gate .sg-local-action:hover{border-color:#c9af75;background:rgba(201,175,117,.09)}.script-gate :is(button,input,select):focus-visible{outline:2px solid #c9af75;outline-offset:3px}.sg-file-selection{display:flex;gap:10px;align-items:center;flex-wrap:wrap;min-width:0}.sg-file-selection[hidden]{display:none}#sg-filename{overflow-wrap:anywhere;min-width:0}.script-gate .sg-project-dialog{width:min(480px,calc(100vw - 32px));max-width:calc(100vw - 32px);padding:0;color:var(--text);border-radius:10px}.sg-project-dialog .modal-foot{flex-wrap:wrap}.script-gate button:disabled{cursor:not-allowed}

.script-gate .sg-inline{display:flex;flex-direction:row;align-items:flex-start;gap:10px;line-height:1.5}.script-gate .sg-inline input[type=checkbox]{width:auto;flex:0 0 auto;margin-top:4px}.sg-context-generator{border-block:1px solid #343433;padding:18px 0;margin:18px 0;display:grid;gap:12px}.sg-context-generator button{justify-self:start;max-width:100%;white-space:normal}#sg-context-choice{font-size:12px;line-height:1.6}#sg-context-choice[hidden]{display:none}.sg-context-generator [role=status]{color:#c9af75} .script-gate pre{white-space:pre-wrap;overflow-wrap:anywhere}

/* Script Gate V2: compact human-readable history, existing dark/gold system. */
.sg-history-v2 th,.sg-history-v2 td{font-size:.78rem;vertical-align:top}.sg-history-v2 details{margin-top:.35rem}.script-gate blockquote{white-space:pre-wrap;overflow-wrap:anywhere}.script-gate .sg-result p{overflow-wrap:anywhere}

/* Keep nine history fields readable without compressing them to character columns. */
.script-gate .sg-history-v2 th:first-child{width:18%}.sg-history-v2 td::before{display:none}
@media(max-width:1000px){.sg-history-v2,.sg-history-v2 tbody{display:block}.sg-history-v2 thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.sg-history-v2 tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;border-top:1px solid #343434;padding:16px 0}.script-gate .sg-history-v2 td{display:block;border:0;padding:0;font-size:12px;min-width:0;overflow-wrap:break-word}.sg-history-v2 td::before{display:block;content:attr(data-label);font-size:11px;color:#a8a8a2;letter-spacing:.035em;margin-bottom:5px}.sg-history-v2 td:first-child,.sg-history-v2 td:last-child{grid-column:1/-1}.sg-history-v2 td:first-child a{font-size:14px}.sg-history-v2 summary{font-size:11px;overflow-wrap:normal}.sg-history-v2 td details{margin-top:8px}}

/* Script iteration: clear recovery and new-version entry, same dark/gold controls. */
.sg-action-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap}.script-gate .sg-iteration-link{display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:11px 15px;border:1px solid #806d42;border-radius:4px;background:rgba(201,175,117,.055);color:#d1b878;font-size:12px;font-weight:650;line-height:1.4;text-decoration:none;white-space:normal;max-width:100%}.sg-iteration-link:hover{background:rgba(201,175,117,.12);border-color:#c9af75}.sg-iteration-link:focus-visible{outline:2px solid #c9af75;outline-offset:3px}.sg-action-row button{white-space:normal;max-width:100%;min-height:42px}.sg-revision-gaps{padding-left:20px;line-height:1.65}.sg-revision-item{border-top:1px solid #343434;padding:14px 0}.sg-revision-item summary{font-weight:600;line-height:1.5;overflow-wrap:anywhere}.sg-revision-item p{line-height:1.6;font-size:14px}.sg-preserve{margin-top:14px}.sg-iteration-note a{color:#d1b878}@media(max-width:600px){.sg-action-row{align-items:stretch;flex-direction:column}.sg-iteration-actions p{font-size:13px;line-height:1.6}}

.script-gate .sg-open-review{display:block;color:inherit;font-size:inherit;line-height:1.5;text-decoration:none}.script-gate .sg-open-label{display:block;color:#c9af75;font-size:11px;margin-top:8px;text-decoration:underline;text-underline-offset:3px}.sg-open-review:focus-visible{outline:2px solid #c9af75;outline-offset:3px}

/* Compact Script Gate progress; percentage changes only with confirmed workflow stages. */
.sg-progress{margin:16px 0;padding:20px;border:1px solid #c6a15b40;border-radius:12px;background:linear-gradient(120deg,#c6a15b0b,#111313);min-width:0;overflow-wrap:anywhere}.sg-progress-head{display:flex;justify-content:space-between;gap:16px;align-items:center}.sg-progress-head strong{font-size:12px;letter-spacing:.07em;color:#d3bb81}.sg-progress-current{margin:6px 0 0;font-size:14px;color:#e7e3d9}.sg-progress-percent{flex-shrink:0;font-size:30px;font-weight:600;color:#d3bb81;font-variant-numeric:tabular-nums}.sg-progress-percent small{font-size:15px}.sg-progress-line{position:relative;height:6px;margin:18px 0;overflow:hidden;border-radius:6px;background:#32332f}.sg-progress-line progress{display:block;width:100%;height:6px;border:0;appearance:none;background:#32332f}.sg-progress-line progress::-webkit-progress-bar{background:#32332f}.sg-progress-line progress::-webkit-progress-value{background:#c7aa68;transition:width .4s ease}.sg-progress-line progress::-moz-progress-bar{background:#c7aa68}.sg-progress.is-active .sg-progress-line:after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,#eee2bd35,transparent);transform:translateX(-100%);animation:sg-progress-light 2.4s ease-in-out infinite;pointer-events:none}.sg-progress-timeline{display:flex;justify-content:space-between;gap:6px}.sg-progress-phase{display:flex;align-items:center;gap:7px;font-size:11px;color:#858983;min-width:0}.sg-progress-phase i{width:7px;height:7px;flex:0 0 7px;border:1px solid #686b63;border-radius:50%;font-size:9px;line-height:7px;font-style:normal}.sg-progress-phase.is-current{color:#eddbaf}.sg-progress-phase.is-current i{background:#c7aa68;border-color:#c7aa68;box-shadow:0 0 8px #c7aa6855}.sg-progress-phase.is-done{color:#c1c7ba}.sg-progress-phase.is-done i{border-color:transparent}.sg-progress.is-failed .sg-progress-head strong,.sg-progress-error{color:#ec9a88}.sg-progress.is-failed .sg-progress-line progress::-webkit-progress-value{background:#bc7f6d}.sg-progress-error{margin:16px 0 7px;font-size:13px;line-height:1.5}.sg-progress-next,.sg-progress-detail{font-size:12px;line-height:1.5;color:#c7c5be}.sg-progress-footer{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:16px;color:#969b92;font-size:11px;font-variant-numeric:tabular-nums}.sg-progress-details{margin-top:12px;font-size:11px;color:#9c9c92}.sg-progress-details summary{cursor:pointer;padding:0!important;font-size:10px}.sg-progress-details ol{padding-left:18px;line-height:1.7}.sg-progress-details code{overflow-wrap:anywhere}@keyframes sg-progress-light{to{transform:translateX(100%)}}@media(max-width:480px){.sg-progress{padding:15px}.sg-progress-phase{flex-direction:column;gap:8px;font-size:10px}.sg-progress-current{font-size:12px}.sg-progress-percent{font-size:26px}.sg-progress-head strong{font-size:10px}.sg-progress-footer>span:last-child{flex-basis:100%}}@media(prefers-reduced-motion:reduce){.sg-progress.is-active .sg-progress-line:after{animation:none;display:none}.sg-progress-line progress::-webkit-progress-value{transition:none}}
