.aim .aim-download-dialog{box-sizing:border-box;width:min(520px,calc(100vw - 32px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);margin:auto;padding:0;overflow:hidden;border:1px solid #686e79;border-radius:10px;background:#303237;color:#edf0f5;color-scheme:dark;box-shadow:0 18px 70px #0009}
.aim .aim-download-dialog[open]{display:flex;flex-direction:column}
.aim .aim-download-dialog::backdrop{background:#080a0ebd}
.aim .aim-download-heading{display:flex;flex:none;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:14px 18px;border-bottom:1px solid #50555e}
.aim .aim-download-heading>h3{margin:0;font-size:18px;line-height:1.35;color:#f5f6fa}
.aim .aim-download-heading>.aim-download-close{width:32px;height:32px;min-width:32px;min-height:32px;padding:0;font-size:24px;line-height:1}
.aim .aim-download-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px 18px;scrollbar-gutter:stable}
.aim .aim-download-intro{margin:0 0 16px;font-size:12px;line-height:1.55;color:#d3d9e3!important}
.aim .aim-download-field{display:flex;flex-direction:column;gap:7px;margin:0 0 16px;font-size:12px;font-weight:600;line-height:1.4}
.aim .aim-download-field>select{width:100%;height:36px;min-height:36px;padding:6px 30px 6px 9px;font-size:13px}
.aim .aim-download-quality[hidden],.aim .aim-download-error[hidden],.aim .aim-download-retry[hidden]{display:none!important}
.aim .aim-download-quality-inputs{display:flex;align-items:center;gap:12px;min-width:0}
.aim .aim-download-quality-inputs>input[type=range]{flex:1 1 auto;width:0;min-width:0;height:32px;min-height:32px;margin:0;padding:0;accent-color:#b6adff}
.aim .aim-download-quality-inputs>input[type=number]{flex:0 0 74px;width:74px;height:34px;min-height:34px;padding:5px 8px;font-size:13px}
.aim .aim-download-format-note{margin:0 0 14px;padding:9px 11px;border-left:2px solid #a7a3f3;background:#3b394c;font-size:12px;line-height:1.55;color:#e4e1f6!important}
.aim .aim-download-info{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:9px 14px;padding:12px;border:1px solid #555c67;border-radius:6px;background:#282b30;font-size:12px;line-height:1.4}
.aim .aim-download-info>span{color:#c8cfdb}.aim .aim-download-info>strong{color:#f6f7fa;text-align:right;white-space:nowrap}
.aim .aim-download-estimate-note{margin:9px 0 0;font-size:10px;line-height:1.5;color:#c2cad7!important}
.aim .aim-download-progress{min-height:18px;margin:12px 0 0;font-size:12px;line-height:1.5;color:#d0dbe7!important}
.aim .aim-download-error{margin:10px 0 0;padding:9px 11px;border:1px solid #af775c;border-radius:5px;background:#49352d;font-size:12px;line-height:1.5;color:#ffe1ca!important;overflow-wrap:anywhere}
.aim .aim-download-retry{margin-top:9px;min-height:32px;padding:6px 10px;font-size:12px}
.aim .aim-download-footer{display:flex;flex:none;justify-content:flex-end;gap:9px;padding:12px 18px;border-top:1px solid #555b65;background:#2b2d32}
.aim .aim-download-footer>button{min-height:36px;padding:8px 14px;font-size:13px;line-height:1.3;white-space:nowrap}
.aim .aim-download-footer>.aim-download-submit{min-width:152px;border-color:#8ac0c5!important;background:#17666d!important;color:#fff!important;font-weight:700}
.aim .aim-download-footer>.aim-download-submit:hover:not(:disabled){background:#217b82!important}
.aim .aim-download-dialog button:focus-visible,.aim .aim-download-dialog input:focus-visible,.aim .aim-download-dialog select:focus-visible{outline:2px solid #c4bcff;outline-offset:2px}
@media(max-width:600px){
 .aim .aim-download-dialog{width:calc(100vw - 16px);max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);border-radius:8px}
 .aim .aim-download-heading{padding:10px 12px}.aim .aim-download-heading>.aim-download-close{height:40px;min-height:40px;width:40px;min-width:40px}
 .aim .aim-download-body{padding:13px 12px;scrollbar-gutter:auto}.aim .aim-download-field>select{font-size:16px;height:44px;min-height:44px}.aim .aim-download-quality-inputs>input[type=number]{font-size:16px;height:44px;min-height:44px}.aim .aim-download-quality-inputs>input[type=range]{height:44px;min-height:44px}
 .aim .aim-download-footer{padding:10px 12px max(10px,env(safe-area-inset-bottom));gap:8px}.aim .aim-download-footer>button{min-width:0;min-height:44px;padding:10px 12px}.aim .aim-download-footer>button:first-child{flex:1}.aim .aim-download-footer>.aim-download-submit{flex:2;min-width:0}
}

/* Download remains distinct from the violet AI tools in the compact app header. */
.aim.aim .aim-editor-delivery>button.aim-download-primary,.aim.aim .aim-download-footer>button.aim-download-submit{border-color:#ffda8b!important;background:linear-gradient(135deg,#ffdc91 0%,#ffbf4e 55%,#efa12a 100%)!important;color:#281b09!important;box-shadow:inset 0 1px 0 #fff5,0 0 0 1px #eeb45633;font-weight:800}
.aim.aim .aim-editor-delivery>button.aim-download-primary:hover:not(:disabled),.aim.aim .aim-download-footer>button.aim-download-submit:hover:not(:disabled){border-color:#ffe3a7!important;background:linear-gradient(135deg,#ffe6ad,#ffc75b)!important;color:#211608!important}
.aim.aim .aim-editor-delivery>button.aim-download-primary>span,.aim.aim .aim-editor-delivery>button.aim-download-primary>svg{color:inherit!important}
/* Pending preparation must look unavailable even under the gold button rules. */
.aim.aim .aim-download-footer>button.aim-download-submit{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.aim.aim .aim-download-footer>button.aim-download-submit:disabled{border-color:#78747b!important;background:#4a474d!important;color:#d7d2da!important;box-shadow:none!important;opacity:1;cursor:not-allowed}
.aim.aim .aim-download-footer>button.aim-download-submit[aria-busy=true]{cursor:wait}
.aim .aim-download-spinner{display:block;flex:none;width:14px;height:14px;box-sizing:border-box;border:2px solid currentColor;border-right-color:transparent;border-radius:50%;animation:aim-download-spin .8s linear infinite}
.aim .aim-download-spinner[hidden]{display:none!important}
.aim .aim-download-submit-label{min-width:0;white-space:normal;overflow-wrap:normal}
@keyframes aim-download-spin{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.aim .aim-download-spinner{animation:none}}
.aim .aim-heading-upload>svg{display:block;width:16px;height:16px;flex:none}
.aim.aim .aim-editor-delivery>.aim-restart-workspace{order:2;display:inline-flex;align-items:center;justify-content:center;gap:6px;min-width:128px;border-color:#ce8c6d!important;background:#49362e!important;color:#ffdac5!important;white-space:nowrap}
.aim.aim .aim-editor-delivery>.aim-restart-workspace:hover:not(:disabled){border-color:#ffc29b!important;background:#664536!important;color:#ffe9db!important}
.aim.aim .aim-editor-delivery>.aim-restart-workspace>svg{width:16px;height:16px;flex:none;color:inherit}
.aim.is-app-entry.has-desktop-workspace .aim-editor-delivery>[data-action=project-save]{order:1}
.aim.is-app-entry.has-desktop-workspace .aim-editor-delivery>.aim-download-primary{order:3}
.aim.is-app-entry.has-desktop-workspace .aim-editor-delivery>.aim-autosave-notice{order:0}
@media(min-width:1200px) and (max-width:1550px){
 .aim.is-app-entry.has-desktop-workspace .aim-editor-heading-actions>.aim-heading-upload,.aim.is-app-entry.has-desktop-workspace .aim-editor-heading-actions>[data-action=workspace-expand]{width:32px;min-width:32px;max-width:32px;flex:0 0 32px;padding:3px;justify-content:center}
 .aim.is-app-entry.has-desktop-workspace .aim-editor-heading-actions>.aim-heading-upload>span{display:none}
 .aim.is-app-entry.has-desktop-workspace .aim-editor-heading-actions>[data-action=workspace-expand]{font-size:0!important}
 .aim.is-app-entry.has-desktop-workspace .aim-editor-heading-actions>[data-action=workspace-expand]::before{content:'⛶';font-size:20px;line-height:1}
 .aim.is-app-entry.has-desktop-workspace .aim-editor-heading-actions>.aim-library-launch,.aim.is-app-entry.has-desktop-workspace .aim-editor-delivery>[data-action=project-save]{position:relative;width:32px;min-width:32px;max-width:32px;flex:0 0 32px;gap:0;padding:3px;font-size:0!important;justify-content:center}
 /* Visually clip the existing library caption so its accessible name remains. */
 .aim.is-app-entry.has-desktop-workspace .aim-editor-heading-actions>.aim-library-launch>span{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
 .aim.is-app-entry.has-desktop-workspace .aim-editor-delivery>[data-action=project-save]::before{content:'';display:block;width:16px;height:16px;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round' d='M4 3h13l4 4v14H3V3h1zm3 0v6h9V3M7 21v-8h10v8'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round' d='M4 3h13l4 4v14H3V3h1zm3 0v6h9V3M7 21v-8h10v8'/%3E%3C/svg%3E") center/contain no-repeat}
}
