:root{font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;color:var(--ink);background:var(--bg);font-size:14px}body{margin:0;display:flex;min-height:100vh}button{border:1px solid var(--line);background:var(--paper);color:var(--ink);padding:9px 13px;border-radius:5px;display:inline-flex;align-items:center;justify-content:center;gap:7px;cursor:pointer;font-weight:500;white-space:nowrap}button:hover{border-color:#a3b3ad;background:#f7faf8}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,a:focus-visible{outline:3px solid #75b79e;outline-offset:3px}a{color:var(--green);text-decoration:none}a:hover{text-decoration:underline}svg{width:17px;height:17px;stroke-width:1.7;flex-shrink:0}.sidebar{width:220px;flex:0 0 220px;background:#fff;border-right:1px solid var(--line);padding:30px 17px 18px;position:sticky;top:0;height:100vh;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:10px;color:var(--ink);font-size:17px;font-weight:650;letter-spacing:0;padding:0 8px}.brand:hover{text-decoration:none}.brand-mark{display:grid;place-items:center;color:white;background:var(--green);width:33px;height:37px;border-radius:7px}.brand-mark svg{width:23px;height:23px}.brand small{display:block;font-size:8px;letter-spacing:0;color:var(--muted);margin-top:5px;font-weight:500}nav{margin-top:43px;display:grid;gap:7px}.nav{border-color:transparent;background:transparent;padding:12px;justify-content:flex-start;color:#65717a;font-size:14px}.nav svg{margin-right:6px}.nav.active{background:var(--green-light);color:var(--green);font-weight:650}.count{font-size:11px;border-radius:4px;background:#e9eef0;padding:1px 6px;margin-left:auto;color:#5b6a70}.library-heading{display:flex;justify-content:space-between;align-items:center;font-size:11px;color:var(--muted);letter-spacing:0;margin:32px 9px 12px}.icon{width:31px;height:31px;padding:5px;background:transparent;border-color:transparent}.icon:hover{background:#edf1ef}.saved-list{overflow:auto;flex:1}.saved-item{display:flex;align-items:center;margin:3px 0}.saved-item>button:first-child{overflow:hidden;display:block;text-overflow:ellipsis;flex:1;text-align:left;font-size:12px;border:0;background:transparent;padding:10px}.saved-item.active>button:first-child{color:var(--green);font-weight:650}.saved-item .icon{opacity:0}.saved-item:hover .icon,.saved-item:focus-within .icon{opacity:1}.saved-empty{padding:4px 10px;font-size:12px;line-height:1.8;color:#8a949b}.sidebar-bottom{border-top:1px solid var(--line);padding:20px 9px 0;font-size:11px;color:var(--muted)}.status-dot{width:6px;height:6px;background:var(--green);border-radius:50%}.version{margin-left:auto;font-family:monospace}main{flex:1;min-width:0}.topbar{height:100px;padding:24px 34px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;background:#fff}.eyebrow{font-size:10px;letter-spacing:0;color:var(--muted)}h1{font-size:21px;font-weight:600;margin:7px 0 0;letter-spacing:0}.top-actions{display:flex;align-items:center;gap:9px}.badge{font-size:10px;font-weight:500;border-radius:4px;padding:5px 8px;background:#edf0f2;color:#53616c;display:inline-block;white-space:nowrap}.badge.demo{background:var(--orange-light);color:var(--orange)}.badge.success{background:var(--green-light);color:var(--green)}.badge.error{background:#fbecea;color:#b34232}.badge.running{background:#eaf0f9;color:#3e6391}.view{padding:28px 34px;max-width:1550px;margin:auto}.workflow-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:25px}.name-label{margin:0;flex:1;max-width:420px}.name-label input{font-size:18px;font-weight:600;border:1px solid transparent;background:transparent;padding:5px 0;margin:0;height:36px}.name-label input:hover,.name-label input:focus{border-color:var(--line);background:white;padding-left:8px}.meta{color:var(--muted);font-size:11px}.pipeline{list-style:none;padding:0;margin:0 0 27px;display:flex;border:1px solid var(--line);background:#fff;border-radius:var(--radius);overflow:hidden}.pipeline li{position:relative;flex:1;display:flex;align-items:center;gap:9px;padding:16px 20px;color:#6f7d83;font-size:12px}.pipeline li:not(:last-child){border-right:1px solid var(--line)}.pipeline li span{font-family:monospace;font-size:10px;color:#98a39f;margin-right:3px}.pipeline li.current{background:#f0f6f3;color:var(--green)}.work-area{background:#fff;border:1px solid var(--line);border-radius:var(--radius);display:grid;grid-template-columns:1.05fr 1fr;overflow:hidden}.material-column,.parameter-column{padding:25px}.material-column{border-right:1px solid var(--line)}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}h2{font-size:14px;margin:0;font-weight:650}h3{font-size:12px;font-weight:600;margin:0}.text-button{border:0;background:transparent;color:var(--green);padding:0;font-size:11px}.text-button:hover{background:none;border:0;color:#0a4535}.text-button svg{width:14px;height:14px}.media-pair{display:grid;grid-template-columns:1fr 1fr;gap:15px}.media-tool{min-width:0}.tool-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px}.preview{height:230px;border:1px solid #e0e4e6;border-radius:5px;overflow:hidden;display:grid;place-items:center;background:#f5f6f5;position:relative}.preview video,.preview img{width:100%;height:100%;max-height:230px;object-fit:contain;background:#e9ecea}.empty-media{display:flex;flex-direction:column;align-items:center;gap:12px;color:#94a29a;font-size:11px}.empty-media svg{width:30px;height:30px;stroke-width:1}.media-meta{font-size:10px;color:var(--muted);margin-top:8px;min-height:14px;font-variant-numeric:tabular-nums}.media-tool select{margin-top:9px;font-size:11px;height:34px}.provenance{border-left:2px solid #ddcdb3;font-size:10px;color:#82725b;line-height:1.7;margin-top:14px;padding-left:9px}.url-inputs{font-size:11px;margin-top:16px}.url-inputs summary{cursor:pointer;color:var(--muted);padding:3px 0}.url-inputs label{margin-top:12px}.prep-heading{border-top:1px solid var(--line);padding-top:19px;margin-top:20px;margin-bottom:12px}label{display:block;font-size:11px;color:#55636d}input,select,textarea{display:block;width:100%;border:1px solid #d9dfe1;color:var(--ink);background:white;border-radius:4px;padding:10px 12px;outline:none;margin-top:8px;min-width:0;height:38px;transition:border-color .15s}textarea{height:auto;resize:vertical;line-height:1.7;font-size:12px;padding:12px 14px}input:focus,select:focus,textarea:focus{border-color:var(--green);box-shadow:0 0 0 2px #176b5510}input[type=color]{padding:3px;width:90px}fieldset{border:0;padding:0;margin:0}legend{font-size:11px;color:#55636d;margin-bottom:8px;padding:0}.segmented{display:flex;background:#f3f5f5;border-radius:5px;padding:4px;gap:3px}.segmented button{flex:1;border:1px solid transparent;background:transparent;font-size:12px;padding:8px 5px;color:#77818a}.segmented button.active{border-color:#cfded6;background:white;color:var(--green);box-shadow:0 1px 3px #00000006}.provider-label{margin-top:21px}.provider-label select{font-weight:600}.provider-detail{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin:12px 0 19px}#key-state{font-size:10px;color:var(--muted)}.provider-detail p{width:100%;font-size:11px;color:var(--muted);line-height:1.8;margin:0}.form-grid{display:grid;gap:12px}.form-grid.two{grid-template-columns:1fr 1fr;margin-top:15px}.form-grid.three{grid-template-columns:1fr 1fr 1.25fr}.duration-row{margin-top:14px;display:flex;align-items:center;justify-content:space-between;font-size:10px;color:var(--muted);gap:12px}.duration-row>span:first-child{display:flex;gap:6px;align-items:center}.duration-row strong{font-family:monospace;color:var(--ink);font-weight:500}.duration-row svg{width:13px;height:13px}.notice{font-size:11px;line-height:1.8;padding:12px 13px;background:var(--orange-light);color:#9a6a43;border-radius:4px;margin-top:19px}#transfer-note{background:#edf3f1;color:#567669}#viggle-fields label+label{margin-top:15px}.run-bar{margin-top:23px;border-top:1px solid var(--line);padding-top:20px;display:flex;justify-content:space-between;align-items:center;gap:10px}.estimate span{font-size:10px;color:var(--muted);display:block}.estimate strong{display:block;font-size:22px;font-weight:550;font-variant-numeric:tabular-nums;margin-top:5px;letter-spacing:0}.primary{background:var(--green);border-color:var(--green);color:white;padding:11px 16px}.primary:hover{background:#105641;color:white;border-color:#105641}.recent-section{margin-top:29px}.recent-section .section-heading{margin-bottom:14px}.job-row{display:grid;grid-template-columns:1.6fr 1fr .8fr .6fr 24px;gap:12px;align-items:center;background:white;border-bottom:1px solid var(--line);padding:16px 18px;font-size:12px;cursor:pointer;min-height:67px}.job-row:first-child{border-radius:5px 5px 0 0}.job-row:hover{background:#f9fbfa}.job-row small{display:block;color:var(--muted);font-size:10px;margin-top:4px}.job-row>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.job-row .badge{justify-self:start}.job-row svg{color:#89948e}.empty-list{padding:27px;border:1px dashed #cfd7d4;border-radius:6px;text-align:center;color:var(--muted);font-size:12px;line-height:1.9}.results-layout{display:grid;grid-template-columns:245px 1fr;gap:26px;align-items:start}.experiment-list{min-width:0}.experiment-list>select{margin-bottom:15px}.experiment-item{display:block;width:100%;text-align:left;border:1px solid var(--line);border-radius:5px;padding:14px;margin-bottom:9px;white-space:normal;line-height:1.6}.experiment-item.active{border-color:var(--green);box-shadow:inset 3px 0 var(--green)}.experiment-item strong{font-size:12px;font-weight:600;display:block;margin-bottom:8px}.experiment-item .experiment-info{display:flex;gap:8px;justify-content:space-between;align-items:center}.experiment-item small{font-size:10px;color:var(--muted)}.comparison{min-width:0}.comparison-empty{padding:100px 20px;text-align:center;color:var(--muted);border:1px dashed var(--line);border-radius:7px}.comparison-empty svg{width:32px;height:32px;margin-bottom:15px}.comparison-title{display:flex;align-items:center;gap:14px;justify-content:space-between;margin-bottom:16px}.comparison-title h2{font-size:17px}.comparison-title p{font-size:11px;color:var(--muted);margin:7px 0 0}.compare-grid{display:grid;grid-template-columns:1fr 1fr;gap:13px}.compare-cell{min-width:0;background:white;border:1px solid var(--line);border-radius:6px;overflow:hidden}.compare-label{display:flex;justify-content:space-between;align-items:center;font-size:11px;padding:12px 14px}.compare-cell video{display:block;width:100%;height:360px;background:#e7ebe9;object-fit:contain}.pending-output{height:360px;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);font-size:12px;gap:14px;background:#edf0ee}.pending-output svg{width:31px;height:31px;stroke-width:1}.compare-controls{display:flex;justify-content:space-between;align-items:center;margin:14px 0;gap:10px}.compare-controls>div{display:flex;gap:8px;flex-wrap:wrap}.compare-controls button,.compare-controls a{font-size:11px}.result-meta{font-size:11px;line-height:1.8;color:var(--muted);margin:12px 0}.job-error{background:var(--orange-light);border-left:2px solid var(--orange);padding:13px;color:#905638;font-size:12px;line-height:1.8;margin:13px 0}.review-panel{background:#fff;border:1px solid var(--line);border-radius:6px;padding:20px;margin-top:20px}.score-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;margin:15px 0}.review-footer{display:flex;gap:15px;justify-content:space-between;margin-top:13px;align-items:end}.review-footer label{max-width:180px;flex:1}.review-footer button{font-size:12px}.job-events{margin-top:17px;color:var(--muted);font-size:11px}.job-events summary{cursor:pointer;margin-bottom:12px}.event{display:flex;gap:12px;border-left:1px solid var(--line);padding:6px 12px;font-size:10px}.event time{color:#98a29f;white-space:nowrap}.provider-table{width:100%;border-collapse:collapse;background:white;border:1px solid var(--line);font-size:12px}.provider-table th{text-align:left;color:var(--muted);font-weight:500;background:#f8faf9;padding:14px 18px;font-size:11px;border-bottom:1px solid var(--line)}.provider-table td{padding:20px 18px;border-bottom:1px solid var(--line);vertical-align:top;line-height:1.8}.provider-table strong{display:block;font-size:14px}.provider-table small{display:block;color:var(--muted);font-size:11px}.provider-table a{display:block;font-size:11px}.connection-details{margin-top:28px;padding:22px;background:white;border:1px solid var(--line);border-radius:6px}.connection-details p{font-size:12px;color:var(--muted);line-height:1.9}.connection-details code{font-size:11px;color:var(--green);word-break:break-all}dl{display:grid;grid-template-columns:120px 1fr;gap:13px;font-size:12px;margin:20px 0 0}dt{color:var(--muted)}dd{margin:0;word-break:break-all}dialog{width:min(630px,92vw);padding:25px;border:1px solid var(--line);border-radius:9px;color:var(--ink);box-shadow:0 25px 100px #17212b30;max-height:88vh}dialog::backdrop{background:#19251f55;backdrop-filter:blur(3px)}.dialog-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.dialog-header h2{font-size:18px}.dialog-footer{display:flex;gap:10px;justify-content:flex-end;border-top:1px solid var(--line);padding-top:18px;margin-top:20px}#preflight-content{font-size:12px;line-height:1.8}#preflight-content ul{padding-left:21px}#preflight-content li{margin-bottom:7px}.errors{color:#b14431}.warnings{color:#7a735d}.preflight-summary{display:flex;gap:20px;background:#f2f6f4;border-radius:5px;padding:15px;font-size:12px}.preflight-summary strong{font-size:18px;margin-left:5px}pre{font-size:10px;white-space:pre-wrap;word-break:break-all;background:#f3f5f4;padding:15px;border-radius:4px;max-height:240px;overflow:auto;color:#51645b}#preflight-content details summary{cursor:pointer;margin:15px 0}.price-note{font-size:10px;color:var(--muted)}#toast{position:fixed;bottom:25px;left:calc(50% + 80px);transform:translateX(-50%);max-width:620px;padding:13px 20px;background:#193e30;color:white;font-size:12px;border-radius:5px;box-shadow:0 4px 25px #0002;z-index:20;line-height:1.7}.resume-box{display:flex;gap:8px;align-items:end;margin:15px 0}.resume-box input{max-width:320px;margin:0}.resume-box button{font-size:12px}.duration-warning{color:var(--orange)}@media(min-width:1550px){.preview{height:280px}.preview video,.preview img{max-height:280px}.material-column,.parameter-column{padding:30px}}@media(max-width:1150px){.sidebar{width:185px;flex-basis:185px;padding-inline:12px}.topbar{padding-inline:24px}.view{padding:24px}.material-column,.parameter-column{padding:19px}.preview{height:200px}.preview video,.preview img{max-height:200px}.pipeline li{padding:15px 12px;font-size:11px}.pipeline li svg{display:none}.results-layout{grid-template-columns:205px 1fr;gap:18px}.compare-cell video,.pending-output{height:300px}.top-actions{gap:5px}.top-actions>button{font-size:12px}}@media(max-width:900px){.sidebar{width:74px;flex-basis:74px;padding-inline:10px}.brand{padding:0 8px}.brand>span:last-child,.nav:not(.active) .count,.library-heading,.saved-list,.sidebar-bottom,.nav .count{display:none}.nav{font-size:0;justify-content:center;gap:0}.nav svg{margin:0;width:20px;height:20px}.work-area{grid-template-columns:1fr}.material-column{border-right:0;border-bottom:1px solid var(--line)}.preview{height:260px}.preview video,.preview img{max-height:260px}.workflow-heading .meta{display:none}.parameter-column{padding:24px}.results-layout{grid-template-columns:1fr}.experiment-list{max-height:270px;overflow:auto}.score-grid{grid-template-columns:repeat(3,1fr)}.provider-table td,.provider-table th{padding:12px}.provider-table td:nth-child(3),.provider-table th:nth-child(3){display:none}#toast{left:50%}}@media(max-width:560px){.sidebar{display:none}.topbar{height:88px;padding:18px}.top-actions .badge,.top-actions>.icon{display:none}.view{padding:19px 14px}.pipeline li{padding:14px 6px;gap:4px;font-size:10px}.pipeline li span{display:none}.preview{height:190px}.preview video,.preview img{max-height:190px}.material-column{padding:17px}.parameter-column{padding:20px 17px}.job-row{grid-template-columns:1fr auto 20px}.job-row>span:nth-child(2),.job-row>span:nth-child(4){display:none}.compare-cell video,.pending-output{height:230px}.compare-label{font-size:10px;padding:10px}.compare-controls{align-items:flex-start;flex-direction:column}.comparison-title h2{font-size:14px}.comparison-title>button{font-size:10px}.score-grid{grid-template-columns:repeat(2,1fr)}.provider-table td:last-child,.provider-table th:last-child{display:none}.top-actions>button{padding:9px}.workflow-heading{margin-bottom:18px}.dialog-footer button{font-size:12px}}
.mobile-nav{display:none}
dialog:not([open]){display:none}
.prompt-studio-view{padding:0;max-width:none;height:calc(100dvh - 100px);overflow:hidden;background:var(--ui-bg)}
.prompt-studio-frame{display:block;width:100%;height:100%;min-height:0;border:0;background:var(--ui-bg)}
.product-reference{display:block;width:100%;height:160px;object-fit:contain;margin:10px 0;background:#f5f6f5}#garment-assets{margin-top:18px;font-size:12px}#garment-assets summary{cursor:pointer}#extract-frame{margin-top:15px}#phase-label{margin-top:15px}.compare-cell img{display:block;width:100%;height:360px;object-fit:contain;background:#e7ebe9}.frame-model-note{color:var(--green)}
@media(max-width:560px){body{padding-bottom:63px}.mobile-nav{display:flex;position:fixed;bottom:0;left:0;right:0;z-index:15;justify-content:space-around;background:white;border-top:1px solid var(--line);margin:0;padding:10px}.mobile-nav button{border:0;width:48px;height:36px}.mobile-nav button.active{background:var(--green-light);color:var(--green)}#toast{bottom:78px;width:calc(100% - 30px)}}
@media(max-width:560px){.prompt-studio-view{height:calc(100dvh - 88px - 63px)}}
.batch-preflight-list{margin:14px 0;padding:0;list-style:none;border-top:1px solid var(--line)}.batch-preflight-item{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 14px;padding:12px 4px;border-bottom:1px solid var(--line)}.batch-preflight-item>span:first-child{min-width:0}.batch-preflight-item strong,.batch-preflight-item small{display:block}.batch-preflight-item strong{overflow:hidden;font-size:11px;text-overflow:ellipsis;white-space:nowrap}.batch-preflight-item small{margin-top:3px;color:var(--muted);font-size:9px}.batch-preflight-item>ul{grid-column:1/-1;margin:0}.batch-ok{color:var(--green);font-weight:650;font-variant-numeric:tabular-nums}.batch-error{color:#b14431;font-weight:650}
@media(max-width:560px){dialog{max-height:calc(100vh - 24px);overflow:hidden;display:flex;flex-direction:column}#preflight-content{min-height:0;overflow:auto;flex:1 1 auto}.dialog-footer{flex-direction:column;flex:0 0 auto}.dialog-footer button{width:100%;white-space:normal}}
#auth-gate{position:fixed;inset:0;z-index:40;display:grid;place-items:center;background:var(--bg);padding:24px}
#auth-gate[hidden]{display:none}
#auth-gate
.auth-card{width:min(400px,100%);background:var(--paper);border:1px solid var(--line);border-radius:9px;padding:32px 28px 28px;box-shadow:0 18px 60px #17212b14}
.auth-card .brand{margin:0 0 22px;padding:0}
.auth-card h1{font-size:20px;margin:0 0 8px}
.auth-copy{color:var(--muted);font-size:12px;margin:0 0 18px;line-height:1.7}
.auth-card .segmented{margin-bottom:16px}
.auth-card label{margin-top:12px}
.auth-card .primary{width:100%;margin-top:18px}
.auth-error{color:#b14431;font-size:12px;margin:12px 0 0;line-height:1.7}
#account-chip{display:flex;align-items:center;gap:10px;font-size:12px;color:var(--muted)}
#account-chip span{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#account-balance{max-width:none;font-variant-numeric:tabular-nums}
#account-balance.is-empty{color:#b14431}
.user-actions{display:flex;gap:12px;flex-wrap:wrap}
#password-dialog label{margin-bottom:8px}
@media(max-width:560px){#account-chip span{max-width:88px}}

body {
  color: var(--ink-strong);
  background: var(--surface-subtle);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  min-height: 40px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus-ring) 72%, transparent);
  outline-offset: 3px;
}

button:not(:disabled),
a {
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}

.sidebar {
  background: var(--ui-surface-sidebar);
  border-right: 1px solid var(--ui-sidebar-line);
  box-shadow: none;
}

.topbar {
  background: rgb(255 255 255 / 86%);
  border-bottom-color: var(--line-soft);
  box-shadow: 0 1px 0 rgb(31 28 69 / 3%);
  backdrop-filter: blur(14px);
}

.view {
  color: var(--ink-strong);
}

.work-area,
.connection-details,
.review-panel,
.provider-table,
.compare-cell {
  border-color: var(--line-soft);
  box-shadow: var(--shadow-card);
}

.pipeline,
.job-row,
.experiment-item,
.empty-list,
.comparison-empty {
  border-color: var(--line-soft);
}

.pipeline li.current,
.segmented button.active,
.mobile-nav button.active {
  background: var(--accent-violet-soft);
  color: var(--accent-violet-strong);
}

.primary,
button.primary {
  background: linear-gradient(180deg, var(--accent-violet) 0%, var(--accent-violet-strong) 100%);
  border-color: var(--accent-violet-strong);
  box-shadow: 0 6px 16px rgb(91 78 199 / 22%);
}

.primary:hover,
button.primary:hover {
  background: linear-gradient(180deg, #7165e9 0%, #594bc9 100%);
  border-color: #594bc9;
  box-shadow: 0 8px 20px rgb(91 78 199 / 28%);
}

dialog {
  border-color: var(--line-soft);
  box-shadow: var(--shadow-float);
}

dialog::backdrop {
  background: rgb(17 16 36 / 54%);
  backdrop-filter: blur(8px);
}

#toast {
  background: #28263c;
  border: 1px solid #4e4969;
  box-shadow: 0 12px 32px rgb(24 20 57 / 24%);
}

/* Sidebar content scrolls as one column; brand and status remain outside it. */
.sidebar-library-section{margin-top:24px;padding:0 3px 10px}
.sidebar{overflow:hidden}
.sidebar-navigation-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;margin-top:24px;padding-right:2px;scrollbar-gutter:stable}
.sidebar-navigation-scroll nav{margin-top:0}
.sidebar-library-scroll{margin-top:24px;padding-right:0}
.sidebar-library-scroll .sidebar-library-section{margin-top:0}
.sidebar-library-scroll .sidebar-library-section+.sidebar-library-section{margin-top:8px}
.sidebar-library-section{flex:0 0 auto}
.sidebar-library-section+.sidebar-library-section{margin-top:8px;padding-top:14px;border-top:1px solid var(--ui-line)}
.sidebar-library-section .library-heading{margin:0;padding:0 6px 8px;color:var(--ui-muted);font-weight:650}
.sidebar-library-toggle{border:0;background:transparent;padding:0;color:inherit;font-size:inherit;font-weight:inherit;justify-content:flex-start;flex:1}
.sidebar-library-toggle::before{content:'⌄';display:inline-block;width:16px;color:var(--ui-accent);transition:transform .15s ease}
.sidebar-library-section.is-collapsed .sidebar-library-toggle::before{transform:rotate(-90deg)}
.sidebar-library-section.is-collapsed .project-list,.sidebar-library-section.is-collapsed .saved-list{display:none}
.sidebar-library-section .project-list,.sidebar-library-section .saved-list{padding-top:5px}
.sidebar-navigation-scroll .project-list,.sidebar-navigation-scroll .saved-list{max-height:none;overflow:visible;flex:none}
.sidebar-library-section .saved-list{flex:initial}
.sidebar-library-section .project-item,.sidebar-library-section .saved-item{margin:1px 0}
.sidebar-library-section .project-item,
.sidebar-library-section .saved-item>button:first-child{padding:9px 10px 9px 12px;min-height:36px;line-height:1.5}

/* Keep the application shell full width while centering the active page stage. */
main{width:100%;max-width:none}
.view:not(.intent-view):not(.prompt-studio-view){width:min(1280px,calc(100vw - 48px));margin-inline:auto}
@media(max-width:900px){.view:not(.intent-view):not(.prompt-studio-view){width:calc(100vw - 32px)}}

/* Token boundary for shell presentation. Keep older selectors above intact
   while new visual refinements consume the shared theme values. */
.sidebar{background:linear-gradient(180deg,var(--ui-surface-sidebar) 0%,var(--ui-surface-sidebar-raised) 100%);border-right-color:var(--ui-sidebar-line);box-shadow:var(--ui-shadow-card)}
.topbar{background:var(--ui-surface-overlay);box-shadow:var(--ui-shadow-subtle)}
button:focus-visible,a:focus-visible{outline-color:var(--ui-focus)}
.primary,button.primary{background:var(--ui-action-primary);border-color:var(--ui-action-primary);color:var(--ui-action-on-primary);box-shadow:var(--ui-shadow-card)}
.primary:hover,button.primary:hover{background:var(--ui-action-primary-hover);border-color:var(--ui-action-primary-hover)}
.pipeline,.work-area,.auth-card{border-radius:var(--ui-radius-md)}
#toast{background:var(--ui-ink);border-color:var(--ui-line-strong);box-shadow:var(--ui-shadow-float);border-radius:var(--ui-radius-sm)}

/* Final presentation pass: quiet Apple-like chrome with content-led spacing. */
html,body{overflow-x:hidden}
body{background:var(--ui-bg);color:var(--ui-ink);line-height:1.5;-webkit-font-smoothing:antialiased}
button{min-height:var(--ui-control-height);border:1px solid var(--ui-line);border-radius:var(--ui-radius-sm);background:var(--ui-surface);color:var(--ui-ink);box-shadow:none;transition:background-color var(--ui-duration-fast) var(--ui-ease-standard),border-color var(--ui-duration-fast) var(--ui-ease-standard),box-shadow var(--ui-duration-fast) var(--ui-ease-standard),color var(--ui-duration-fast) var(--ui-ease-standard)}
button:hover:not(:disabled){border-color:var(--ui-line-strong);background:var(--ui-surface-subtle);color:var(--ui-ink-strong)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid var(--ui-focus-ring);outline-offset:2px}
input,select,textarea{border-color:var(--ui-line);border-radius:var(--ui-radius-sm);background:var(--ui-surface);color:var(--ui-ink);min-height:var(--ui-control-height);transition:border-color var(--ui-duration-fast) var(--ui-ease-standard),box-shadow var(--ui-duration-fast) var(--ui-ease-standard)}
input:focus,select:focus,textarea:focus{border-color:var(--ui-focus);box-shadow:var(--ui-shadow-focus)}
.sidebar{background:var(--ui-surface-sidebar);border-right:1px solid var(--ui-sidebar-line);box-shadow:none;padding:var(--ui-space-8) var(--ui-space-4) var(--ui-space-5)}
.sidebar .brand{color:var(--ui-ink);padding:0 var(--ui-space-2);gap:var(--ui-space-3)}
.brand-mark{background:var(--ui-accent);border-radius:var(--ui-radius-sm)}
.sidebar .nav{color:var(--ui-muted);border-radius:var(--ui-radius-sm);min-height:var(--ui-touch-target)}
.sidebar .nav:hover{background:var(--ui-surface-subtle);color:var(--ui-ink)}
.sidebar .nav.active{background:var(--ui-accent-soft);color:var(--ui-accent-strong);box-shadow:inset 2px 0 var(--ui-accent)}
.sidebar-bottom{border-top-color:var(--ui-sidebar-line);color:var(--ui-ink-soft)}
.topbar{background:var(--ui-surface-overlay);border-bottom-color:var(--ui-line);box-shadow:var(--ui-shadow-subtle);backdrop-filter:blur(18px)}
.view{padding:var(--ui-space-8) var(--ui-space-7)}
.workflow-heading{margin-bottom:var(--ui-space-6)}
.pipeline,.work-area,.experiment-list,.comparison,.connection-details{border-color:var(--ui-line);border-radius:var(--ui-radius-md);box-shadow:none}
.pipeline{margin-bottom:var(--ui-space-7)}
.pipeline li{padding:var(--ui-space-5) var(--ui-space-6);color:var(--ui-muted)}
.pipeline li.current{background:var(--ui-accent-soft);color:var(--ui-accent-strong)}
.material-column,.parameter-column{padding:var(--ui-space-7)}
.material-column{border-right-color:var(--ui-line)}
.section-heading{margin-bottom:var(--ui-space-5)}
.preview{border-color:var(--ui-line);border-radius:var(--ui-radius-sm);background:var(--ui-surface-subtle)}
.segmented{background:var(--ui-surface-subtle);border-radius:var(--ui-radius-sm);padding:var(--ui-space-1)}
.segmented button.active{border-color:var(--ui-line);background:var(--ui-surface);color:var(--ui-accent-strong);box-shadow:var(--ui-shadow-subtle)}
.notice{background:var(--ui-warning-soft);border:1px solid var(--ui-line);color:var(--ui-warning);border-radius:var(--ui-radius-sm)}
.run-bar{border-color:var(--ui-line);background:var(--ui-surface-subtle);border-radius:var(--ui-radius-sm)}
.primary,button.primary{background:var(--ui-action-primary);border-color:var(--ui-action-primary);color:var(--ui-action-on-primary);box-shadow:none}
.primary:hover,button.primary:hover{background:var(--ui-action-primary-hover);border-color:var(--ui-action-primary-hover);color:var(--ui-action-on-primary)}
.job-row{border-color:var(--ui-line);background:var(--ui-surface);padding:var(--ui-space-5) var(--ui-space-6)}
.job-row:hover{background:var(--ui-surface-subtle)}
.empty-list,.comparison-empty{border-color:var(--ui-line-strong);background:var(--ui-surface-subtle)}
.provider-table{border-color:var(--ui-line);border-radius:var(--ui-radius-md)}
.provider-table th{background:var(--ui-surface-subtle);border-color:var(--ui-line);color:var(--ui-muted)}
.provider-table td{border-color:var(--ui-line)}
dialog{border-color:var(--ui-line);border-radius:var(--ui-radius-lg);box-shadow:var(--ui-shadow-float)}
dialog::backdrop{background:rgb(18 15 35 / 48%);backdrop-filter:blur(8px)}
#toast{background:var(--ui-ink);border-color:var(--ui-line-strong);border-radius:var(--ui-radius-sm);box-shadow:var(--ui-shadow-float)}
@media(max-width:900px){.view{padding:var(--ui-space-6)}.material-column,.parameter-column{padding:var(--ui-space-6)}}
@media(max-width:560px){.view{width:100%!important;padding:var(--ui-space-5) var(--ui-space-4)}.topbar{padding-inline:var(--ui-space-4)}.pipeline li{padding-inline:var(--ui-space-2)}.material-column,.parameter-column{padding:var(--ui-space-5)}.work-area{border-radius:var(--ui-radius-md)}}

/* Shared topbar geometry keeps every workbench page aligned. */
.topbar{height:var(--ui-topbar-height);min-height:var(--ui-topbar-height);padding-block:0}
@media(max-width:560px){.topbar{height:var(--ui-topbar-height-compact);min-height:var(--ui-topbar-height-compact)}}

/* Floating windows keep a stable shell; only their content areas scroll. */
dialog[open]{display:flex;flex-direction:column;min-width:0;width:min(630px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:hidden}
dialog[open] > :is(.dialog-body,#preflight-content,#config-content,.library-grid,.preview-dialog #preview-media){min-height:0}
.dialog-header,.dialog-heading{flex:0 0 auto}
.dialog-footer{flex:0 0 auto}
#preflight-content,#config-content,.library-grid{overscroll-behavior:contain}
.library-grid{grid-template-columns:repeat(auto-fill,minmax(144px,1fr));align-content:start}
.library-card,.scene-asset-card{min-width:144px}
.library-card>img,.library-card>video{height:152px;min-height:152px}
@media(max-width:560px){dialog[open]{width:calc(100vw - 24px);max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}.library-grid{grid-template-columns:repeat(2,minmax(144px,1fr));overflow:auto}.library-card,.scene-asset-card{min-width:0}}

/* A library grid must keep its rows at content size inside a flex dialog. */
#library-grid{flex:1 1 auto;min-height:300px;grid-auto-rows:max-content;align-content:start}
@media(max-width:560px){#library-grid{min-height:260px}}
/* Resource section headings use the same compact control language as primary actions. */
.sidebar-library-toggle::before{display:none}
.sidebar-library-toggle{gap:7px}
.sidebar-library-section .project-item[data-child="true"],.sidebar-library-section .saved-item[data-child="true"]>button:first-child{color:var(--ui-muted);background:var(--ui-surface-subtle);padding-left:22px;font-size:11px}
