/* Shared final layer: legibility, focus and responsive operational controls. */
:root{--ux-muted:#52685d;--ux-focus:#21684f}
.ux-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.ux-table-scroll{overflow-x:auto;max-width:100%;scrollbar-width:thin}
.ux-table-scroll table{min-width:620px}
html[data-theme=dark]{--ux-muted:#b6c9bc;--ux-focus:#b5e2c2}
main,section,article,.panel,.columns>*,.grid>*,.automation-grid>*{min-width:0}
main p,main label,.help,.muted,.row small,.card-body p,.automation-run,.inspiration-card-body p{font-size:max(12px,1em);line-height:1.65}
.help,.muted,.page-description,.card-body p,.inspiration-card-body p{color:var(--ux-muted)}
main button,main select,main input,main textarea{font-size:14px}
button,a,summary,input,select,textarea{touch-action:manipulation}
button,.mobile-menu-toggle,summary{min-height:44px}
button{white-space:normal;overflow-wrap:anywhere}
.badge{font-size:12px;line-height:1.45;white-space:normal}
main input:not([type=checkbox]):not([type=radio]),main select,main textarea{max-width:100%;box-sizing:border-box}
input[type=checkbox],input[type=radio]{accent-color:var(--ux-focus)}
:where(button,a,summary,input,textarea,select,[tabindex]):focus-visible{outline:3px solid var(--ux-focus)!important;outline-offset:3px}
button:disabled{cursor:not-allowed}
.actions{flex-wrap:wrap}.actions>*{max-width:100%}
.panel p,.card h3,.row p,.error,[role=status],.activity li{overflow-wrap:anywhere}
[role=status]{line-height:1.6;scroll-margin-top:100px}
#chatgpt-send-status{min-height:3.2em}
.error:not(:empty){padding:12px 14px;border:1px solid #ba7964;border-radius:10px;background:#fff4ed;color:#833d29}
html[data-theme=dark] .error:not(:empty){background:#37251f;color:#ffc8ad;border-color:#865f4d}
.toolbar{align-items:center}.toolbar input{min-width:140px}
.toolbar button{flex-shrink:0}
.discovery-table-wrap,.calendar-scroll{max-width:100%;overscroll-behavior-inline:contain}
.ux-scroll-hint{font-size:12px;color:var(--ux-muted);margin:8px 0}
.calendar-post-copy small{font-size:11px}.calendar-post-copy strong{font-size:12px}
.calendar-toolbar{flex-wrap:wrap}
dialog{max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);overflow:auto;overscroll-behavior:contain}
dialog::backdrop{background:#101e18a8;backdrop-filter:blur(3px)}
.dialog-head{gap:16px}.dialog-head>div{min-width:0}.dialog-head button{flex-shrink:0}
.editor-grid .tabs{scrollbar-width:thin}.editor-grid .tabs button{min-height:44px;font-size:13px}
.editor-publish-actions{gap:10px}.editor-publish-actions button{min-height:46px}
.inspiration-card-body h3,.card h3{font-size:14px;line-height:1.5}
.inspiration-card-actions button,.card-body button{font-size:13px;min-height:44px}
.atelier-recovery summary,.atelier-job-history>summary,.atelier-history-grid>.panel .help{font-size:12px}
.atelier-theme-toggle{min-height:40px;font-size:12px}
html:not([data-theme=dark]) aside nav button:not(.active),html:not([data-theme=dark]) aside nav a:not([aria-current=page]){color:#50685d!important}
html:not([data-theme=dark]) .workspace-quick-actions a{color:#325b45;background:#fff;border-color:#b5cbb8;font-size:13px;min-height:44px}
html[data-theme=dark] .workspace-quick-actions a{color:#d4ecd8;background:#22382a;border-color:#57745e;font-size:13px;min-height:44px}
html:not([data-theme=dark]) button.primary{background:#285e46!important;color:#fff!important;border-color:#285e46!important}
html[data-theme=dark] button.primary{background:#a4d1af!important;color:#142e20!important;border-color:#a4d1af!important}
html:not([data-theme=dark]) #upload-dialog #drop-zone{background:#f3f7ee!important}
#upload-dialog .home-upload-copy strong{color:var(--text)!important}
#upload-dialog .home-upload-copy span,#upload-dialog .home-upload-copy small{font-size:12px!important;color:var(--ux-muted)!important}
.login input,.login button{min-height:46px}
/* Run history must use the selected theme, including its expanded receipt. */
html:not([data-theme=dark]) .automation-run{background:#f7faf5!important;color:#203c35;border:1px solid #cfddce!important}
html[data-theme=dark] .automation-run{background:#1b2d23!important;color:#e5eee7;border:1px solid #405b48!important}
.automation-history .automation-run{padding:0!important;margin:12px 0;border-radius:14px;overflow:hidden}
.automation-history .automation-run>summary{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:18px;padding:18px 20px!important;min-height:88px;margin:0!important}
.automation-history .automation-run>summary>div{min-width:0}
.automation-run strong{font-size:15px!important;line-height:1.5;color:inherit!important}
.automation-run small{font-size:13px!important;line-height:1.6;color:var(--ux-muted)!important;margin-top:5px}
.automation-run summary::after{font-size:13px!important;color:var(--ux-muted)!important;white-space:nowrap}
.automation-run .outcome{font-size:12px!important;padding:7px 11px;white-space:nowrap}
html:not([data-theme=dark]) .automation-run .outcome.attention{background:#fff0d6;color:#795010;border:1px solid #e3c68d}
html[data-theme=dark] .automation-run .outcome.attention{background:#49391d;color:#ffdfa1;border:1px solid #836b3a}
.automation-run[open]>summary{border-bottom:1px solid var(--line)}
.automation-run .automation-run-body{padding:16px 20px!important;font-size:14px;line-height:1.7;background:transparent}
.automation-run .automation-run-body p{font-size:14px!important;color:inherit!important;margin:0 0 12px}
.automation-run .automation-run-body strong{font-size:14px!important}
.automation-results-filters{flex-wrap:wrap;margin-bottom:16px}
.automation-results-filters label{flex:1;min-width:160px;margin:0}
.automation-results-filters select{width:100%;margin-top:6px}
.automation-results-filters p{flex-basis:100%;margin:0;font-size:13px;color:var(--ux-muted)}
#results-more{margin-top:16px}
#video-preview-dialog{width:min(960px,calc(100vw - 24px));padding:20px;background:var(--panel);color:var(--text)}
#video-preview-player{display:block;width:100%;max-height:70dvh;min-height:180px;background:#080d0a;object-fit:contain;margin:16px 0}
#video-preview-dialog .dialog-head{position:relative;top:auto;padding:0 0 14px;background:transparent}
#video-preview-dialog a{display:inline-block;min-height:44px;padding:10px 0}
.preview video{display:block;width:100%;height:100%;object-fit:contain;pointer-events:auto;background:#080d0a}
.automation-run-body a{display:inline-block;margin:4px 0;text-decoration:underline;text-underline-offset:3px}
@media(max-width:760px){
 .automation-history .automation-run>summary{grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:16px!important}
 .automation-run summary::after{grid-column:1/-1;justify-self:start}
 .automation-run .automation-run-body{padding:16px!important}
 main,.creative-page main{padding:20px 16px}
 .mobile-menu-toggle{min-height:44px;min-width:68px;font-size:14px}
 aside nav button,aside nav a{min-height:46px!important;font-size:14px!important}
 .atelier-workspace-label{gap:10px;flex-wrap:wrap}
 main>header{align-items:flex-start;flex-wrap:wrap}main>header h1{font-size:28px}
 main>header>.primary{min-height:44px;font-size:13px}
 main input:not([type=checkbox]):not([type=radio]),main select,main textarea{font-size:16px!important;min-height:44px}
 dialog input:not([type=checkbox]):not([type=radio]),dialog select,dialog textarea{font-size:16px!important;min-height:44px}
 dialog label,dialog p{font-size:13px}
 main p,main label,.help,.row small,.page-description{font-size:13px!important}
 .columns,.editor-grid,.connection-grid,.automation-grid,.atelier-history-grid{grid-template-columns:minmax(0,1fr)!important}
 .grid,.inspiration-grid{grid-template-columns:minmax(0,1fr)!important}
 .panel{padding:20px 16px}.toolbar{gap:10px}.toolbar input{min-width:0}
 .toolbar .muted{width:100%;margin-left:0;font-size:12px}
 .calendar{min-width:760px}.calendar-scroll{overflow-x:auto!important;padding:0}
 .calendar-day{height:165px}.workspace-legend{font-size:12px;line-height:1.5}
 .editor-grid .tabs{top:0;position:relative}.editor-publish-actions{position:relative;bottom:auto}
 dialog#editor-dialog{width:calc(100vw - 20px);max-height:calc(100dvh - 20px)}
 #editor-body{padding:16px}.dialog-head{padding:16px}.dialog-head h2{font-size:18px}
 .stat{min-height:130px}.stat small{font-size:12px!important}.stat strong{font-size:34px}
 .creative-steps{flex-wrap:wrap;font-size:12px}.creative-steps li{font-size:12px}
 .inspiration-preview,.preview{height:290px}
 .worker-check-bar>div{min-width:0}.worker-check-bar button{width:100%}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
