/* G01.4 production tokens and component states */
:root{--ink:#253044;--muted:#5e6c80;--accent:#2865d5;--line:#e4e8ee}
body{color:var(--ink)}button:disabled{opacity:1;color:#788391;background:#eef0f3;border-color:#e4e8ee}button:active{transform:none!important}.sidebar{background:#f7f8fa}.nav-item,.new-chat{height:44px;border:0;border-radius:12px;background:transparent;gap:10px;align-items:center;color:#344154}.nav-item.active{background:#e9edf2;color:#253044}.nav-item .icon{width:18px;height:18px}.new-chat{margin:15px 0 24px}.new-chat:hover,.nav-item:hover,.history-item:hover{background:#edf0f4}.history-item{width:100%;text-align:left;height:38px;color:#526075}.history-heading,.history-empty,.g-hint,.input-caption{color:#647184}.history-item span{display:block}.brand strong{letter-spacing:0;font-weight:550}.g-account{width:100%;border:0;background:transparent;border-radius:12px;padding:12px;align-items:center;text-align:left;color:#536074;font-size:13px}.g-account:hover{background:#edf0f4}.topbar{height:52px;min-height:52px}.g-creation{max-width:1104px;padding:0 32px 32px}.g-tabs{margin:0 auto 20px;height:44px;width:200px;position:relative;padding:4px;background:#f2f4f7;isolation:isolate}.g-tabs button{width:96px;min-width:0;padding:0;border:0;background:transparent;color:#526075;z-index:1;font-weight:500}.g-tab-indicator{position:absolute;top:4px;bottom:4px;left:4px;width:calc((100% - 8px)/2);border-radius:20px;background:white;box-shadow:0 1px 4px #17284912;transition:transform 160ms ease;pointer-events:none}.g-tabs[data-selected="1"]>.g-tab-indicator,.g-reference-mode[data-selected="1"]>.g-tab-indicator{transform:translateX(100%)}[role=tab][aria-selected=true]{color:#26364a}.g-preview{height:clamp(245px,35vh,340px);border:0;background:#f5f6f8;border-radius:20px}.g-preview img,.g-preview video{animation:appear 180ms ease}.g-result-bar{height:34px;min-height:34px;margin:10px 0}.g-result-bar .primary-btn{min-height:34px;padding:7px 16px}.g-result-bar .icon-btn{width:34px;height:34px;min-width:34px;min-height:34px}.g-edit-grid{display:grid;grid-template-columns:320px minmax(0,1fr);gap:24px}.g-controls{padding-top:10px}.g-controls:disabled{opacity:1}.g-material-head{display:flex;align-items:center;justify-content:space-between;height:36px}.g-material-head>span{font-size:12px;color:#647184}.g-reference-mode{display:flex;flex-wrap:nowrap;gap:0;position:relative;width:168px;height:36px;border-radius:18px;background:#f2f4f7;padding:4px;isolation:isolate}.g-reference-mode button{z-index:1;flex:1;white-space:nowrap;font-size:13px;padding:0;border:0;border-radius:14px;background:transparent;color:#5e6c80}.g-reference-mode button:hover{background:#e8ebef80}.g-reference-mode button[aria-selected=true]:hover{background:transparent}.g-references{display:flex;flex-wrap:wrap;gap:10px;margin-top:12px}.g-reference{width:96px;position:relative}.g-thumb{padding:0;border:0;border-radius:12px;background:#f4f6f8;width:96px;height:76px;overflow:hidden;display:block}.g-reference .g-thumb img{width:96px;height:76px;object-fit:contain;border:0;border-radius:12px}.g-tile-actions{display:flex;justify-content:space-between;margin-top:3px}.g-reference .g-tile-actions button{height:32px;min-width:32px;padding:0 5px;border-radius:8px;color:#536074;background:transparent;margin:0;font-size:12px}.g-reference .g-tile-actions button:hover{background:#edf1f6}.g-add{width:96px;min-width:96px;height:76px;border:1px dashed #bbc6d5;border-radius:12px;background:#fafbfc;display:flex;flex-direction:column;justify-content:center;color:#5e6c80;gap:4px;font-size:12px}.g-hint{font-size:12px;line-height:1.5;margin:6px 0}.g-prompt>label{height:36px;display:flex;align-items:center;font-size:14px}.g-controls #prompt{margin:12px 0 0;min-height:100px;max-height:160px;resize:none;line-height:1.6;border-radius:16px;border:1px solid #dce2ea;background:#fff;padding:12px 14px;color:#344154;box-shadow:none;overflow-y:auto}.g-controls #prompt:focus{border-color:#6e98df;outline:2px solid #2865d522;outline-offset:0}textarea::placeholder{color:#647184}.g-params{margin-top:14px;gap:12px;align-items:center}.g-choice{display:flex;align-items:center;gap:12px;padding:0 12px;height:36px;border:1px solid #dfe5ec;border-radius:18px;color:#43536a;background:#fff;font-size:13px}.g-choice .icon{width:14px}.g-params>span{padding:0 0 0 6px;color:#526075}.g-params .g-audio{padding:0;gap:6px;color:#526075}.g-number{display:flex;gap:3px;background:#f2f4f7;border-radius:18px;padding:3px}.g-number button{width:32px;height:32px;border:0;border-radius:15px;color:#5e6c80;background:transparent;font-size:13px}.g-number button[aria-pressed=true]{background:white;color:#243b5e;box-shadow:0 1px 3px #17284912}.g-charge{margin-top:18px;color:#536074}.g-charge .primary-btn{width:132px;min-width:132px;background:var(--accent);border-color:var(--accent)}.g-charge .primary-btn:disabled{background:#edf0f4;border-color:#edf0f4;color:#758195}.g-error{color:#a22d37;font-size:13px;margin:6px 0;line-height:1.5}.g-error:empty{display:none}.g-play{position:absolute;left:calc(50% - 24px);top:calc(50% - 24px);width:48px;height:48px;border:0;border-radius:50%;background:#fffffff0;color:#2865d5}.g-history-section{border-top:1px solid #e4e8ee;padding:16px 0}.g-history-section summary{cursor:pointer;color:#43536a}.g-history-section h1,.g-history-section>p{display:none}.g-task-state{color:#536074}.input-caption{display:none}.control-popover,.reference-manager{position:fixed;inset:auto;margin:0;max-height:calc(100vh - 24px);overflow:auto;border:1px solid #e2e6ed;box-shadow:0 12px 36px #1c2d491c;border-radius:18px;padding:14px;animation:popover 160ms ease;min-width:180px}.control-popover::backdrop,.reference-manager::backdrop{background:transparent}.control-popover>button{display:block;width:100%;text-align:left}.control-popover button,.reference-manager button[data-control]{min-height:32px;min-width:32px;border:0;border-radius:10px;background:white;color:#43536a;padding:8px 12px}.control-popover button:hover{background:#eef2f8}.control-popover button[aria-pressed=true]{color:#235bbd;background:#edf3ff}.g-option-row{display:flex;gap:8px;margin:10px 0 16px}.g-option-row button{display:flex;flex-direction:column;align-items:center;gap:8px;font-size:13px}.ratio-icon{display:block;max-width:28px;max-height:25px;width:28px;border:1px solid currentColor;border-radius:3px}.control-popover>label{font-size:12px;color:#647184}.reference-manager{width:370px}.g-manager-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.g-manager-grid{display:grid;grid-template-columns:repeat(3,96px);gap:14px}.g-manager-grid .g-add{height:76px}.g-reference[draggable=true]{cursor:grab}.g-reference[draggable=true]:active{cursor:grabbing}#asset-viewer{padding:20px;width:min(900px,90vw);background:white}#asset-viewer>button{display:block;margin-left:auto;border:0;background:transparent;width:32px;height:32px;padding:6px}#asset-viewer img,#asset-viewer video{display:block;max-width:100%;max-height:75vh;margin:auto;object-fit:contain}#undo-notice{position:fixed;z-index:100;bottom:24px;left:calc(50% - 70px);padding:12px 18px;border-radius:16px;background:#26374b;color:white;font-size:13px}#undo-notice button{border:0;color:#d8e7ff;background:transparent;margin-left:12px;min-height:32px}button{transition:background-color 120ms ease,color 120ms ease}button:focus-visible,a:focus-visible{outline:2px solid #2865d5;outline-offset:2px}.g-account .icon{width:16px}.history-item:focus-visible span{overflow:visible;white-space:normal;background:#f7f8fa;position:relative;z-index:2}.collection-page .task-card{margin:12px 0}.primary-btn{background:#2865d5;border-color:#2865d5}.copy-btn{color:#58667a}@keyframes appear{from{opacity:.5}to{opacity:1}}@keyframes popover{from{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}@media(max-width:850px){.g-edit-grid{grid-template-columns:1fr}.g-params{flex-wrap:wrap}.g-creation{padding:0 20px 30px}}

.session-row{position:relative;display:flex;align-items:center;min-width:0}.session-row>.history-item{flex:1;min-width:0;padding-right:32px;display:block;height:auto;min-height:38px}.sidebar .session-row time{display:none}.session-more{position:absolute;right:4px;top:5px;min-width:32px;height:32px;border:0;border-radius:8px;background:#f1f3f6;color:#526075;opacity:0;pointer-events:none}.session-row:hover .session-more,.session-row:focus-within .session-more{opacity:1;pointer-events:auto}.g-history-results .session-more{width:32px;padding:0;border:0}.g-history-results .history-item small{display:block;font-size:12px;line-height:1.6;color:#647184;margin:6px 0}.history-item time{font-size:11px;color:#647184}.history-title{display:flex;align-items:center;justify-content:space-between}.history-pagination,.history-filters{display:flex;gap:8px;margin:12px 0;align-items:center}.history-pagination button,.history-filters button{min-height:32px;background:#f3f5f8;border:0;border-radius:14px;color:#526075;padding:6px 12px}.history-filters [aria-pressed=true]{background:#e8effb;color:#245cbd}.rename-input{width:calc(100% - 44px);border:1px solid #7ca2df;border-radius:8px;padding:8px;color:#253044}.session-row>button[data-action=rename-save]{width:44px;padding:0;background:transparent;border:0;font-size:12px;color:#2865d5}#history-menu{position:fixed;inset:auto;margin:0;min-width:170px;padding:8px;border:1px solid #e2e6ed;border-radius:14px;box-shadow:0 12px 32px #1c2d491c}#history-menu::backdrop{background:transparent}#history-menu button{display:block;width:100%;text-align:left;min-height:36px;padding:8px 12px;border:0;background:white;color:#344154;border-radius:8px}#history-menu button:hover{background:#eff3f9}.danger-btn{border:0;background:#a83240;color:white;border-radius:20px;padding:10px 18px;margin-left:8px}.deleted-notice{padding:14px 28px;background:#f6f7fa;color:#5e6c80;font-size:13px}#draft-undo{position:fixed;bottom:24px;left:50%;z-index:100;background:#26374b;color:white;padding:12px 18px;border-radius:14px}#draft-undo button{border:0;background:transparent;color:#d8e7ff;padding:8px}.task-copy{display:flex;gap:12px}.g-history-results .session-row{margin:4px 0}.g-history-results .history-item{border-radius:12px}.g-history-results .history-item span{white-space:normal}.g-history-section .text-btn[data-action=delete-draft]{font-size:12px;margin-bottom:10px}

.history-empty-state{padding:12px 0;color:#647184;font-size:13px}

/* Compact parameter picker; the diagram's explicit dimensions match its ratio. */
#control-panel.control-popover{width:max-content;min-width:180px;max-width:calc(100vw - 24px)}
#control-panel.format-panel{width:344px;padding:18px;border-radius:18px;box-sizing:border-box}
.format-panel .g-option-row:first-of-type{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:10px 0 18px}
.format-panel .g-option-row:first-of-type button{height:72px;min-width:0;padding:7px 4px;gap:4px;justify-content:center;border:1px solid transparent;border-radius:12px;font-size:13px}
.format-panel .g-option-row:first-of-type button[aria-pressed=true]{border-color:#bfd1f3}
.ratio-stage{height:34px;display:flex;align-items:center;justify-content:center;width:100%}
.format-panel .ratio-icon{display:block;max-width:none;max-height:none;flex:none;border:1.5px solid currentColor;border-radius:3px}
.format-panel .g-option-row:last-child{margin:10px 0 0;gap:8px}
.format-panel .g-option-row:last-child button{height:34px;min-width:64px;padding:6px 12px;font-size:13px;justify-content:center}
.g-preview{background:transparent;border-radius:0;overflow:hidden}
.g-preview img,.g-preview video{width:auto;height:auto;max-width:100%;max-height:100%;border-radius:16px;object-fit:contain}
.g-preview.is-example{width:min(100%,604px);max-width:604px;margin-inline:auto;background:#f5f6f8;border-radius:18px;height:auto;aspect-ratio:16/9;max-height:340px}
.g-preview.is-example img{width:100%;height:100%;object-fit:contain;border-radius:18px}
.g-preview-label{left:50%;transform:translateX(-50%);bottom:10px;font-size:11px;padding:4px 9px}
.g-result-bar:empty{height:12px;min-height:12px;margin:0}

#control-panel::backdrop{backdrop-filter:none;background:transparent}
