/* NMS Studio layout. All color values resolve through brand/tokens.css.
   Mobile-first; native controls; upstream 9px buttons / 16px cards. */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--surface-light); color: var(--foreground); font: 14px/1.6 var(--font-sans); }
button, input, textarea, select { font: inherit; }
button { appearance: none; cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: not-allowed; opacity: .55; }
a { color: inherit; text-decoration: none; }
svg { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4 { color: var(--titel); font-family: var(--font-heading); font-weight: var(--titel-staerke); line-height: 1.25; margin: 0 0 1rem; }
h1 { font-size: var(--titel-h1); letter-spacing: -.045em; }
h2 { font-size: var(--titel-h2); letter-spacing: -.03em; }
h3 { font-size: var(--titel-h3); }
p { margin: 0 0 1rem; }
code { font-family: var(--font-mono); overflow-wrap: anywhere; }
:focus-visible { outline: 3px solid var(--studio-focus); outline-offset: 4px; }
.hidden { display: none !important; }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 50; padding: .8rem 1rem; background: var(--highlight); color: var(--highlight-foreground); border-radius: var(--studio-radius-button); }
.skip-link:focus { top: 1rem; }
.sidebar { position: sticky; top: 0; z-index: 20; background: var(--studio-navy); color: var(--kopf-text); padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--studio-canvas-line); }
.sidebar :focus-visible { outline-color: var(--highlight); }
.brand { display: flex; flex-direction: column; align-items: flex-start; flex-shrink: 0; }
.brand-logo { width: 68px; height: auto; display: block; }
.brand-sub { display: none; font-family: var(--font-heading); letter-spacing: .16em; font-size: 10px; font-weight: 600; }
.workspace, .nav-label, .sidebar-bottom { display: none; }
.sidebar nav { display: flex; gap: 3px; }
.nav-item { width: 38px; height: 42px; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: var(--studio-radius-button); color: var(--kopf-text-leise); font-size: 0; transition: background .18s, color .18s; }
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item.active { background: var(--studio-blue); color: var(--titel-invers); }
.nav-item.active svg { color: var(--highlight); }
.nav-item:hover { background: var(--studio-blue); color: var(--titel-invers); }
.nav-shortcut, .count { display: none; }
main { min-width: 0; }
.topbar { min-height: 64px; padding: 12px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--studio-card); }
.breadcrumb { font-size: 0; color: var(--muted-foreground); }
.breadcrumb strong { font-size: 12px; font-weight: 600; color: var(--titel); }
.topbar-right { display: flex; gap: 8px; align-items: center; }
.environment { font-size: 10px; font-weight: 600; display: flex; align-items: center; gap: 6px; color: var(--teal); background: var(--surface-light); border: 1px solid var(--border); padding: 5px 8px; border-radius: 6px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; background: var(--teal); flex-shrink: 0; }
.status-dot.muted { background: var(--muted-foreground); }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; min-height: 32px; border: 1px solid var(--border); border-radius: var(--studio-radius-button); font-size: 13px; color: var(--muted-foreground); }
.theme-toggle { font-size: 18px; }
.page-content { padding: 28px 18px 0; max-width: var(--studio-content-width); margin: 0 auto; }
.headline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 30px; }
.eyebrow { font-family: var(--font-heading); color: var(--teal); font-size: 10px; font-weight: 700; letter-spacing: .14em; margin-bottom: 12px; }
.headline h1 { max-width: 35rem; margin-bottom: 12px; }
.headline h1 span { color: var(--titel); }
.subtitle { color: var(--muted-foreground); font-size: 13px; line-height: 1.8; margin: 0; max-width: 43rem; }
.version { display: none; color: var(--muted-foreground); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; }
.mode-tabs { display: flex; align-items: center; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.mode-tab { display: flex; align-items: center; gap: 8px; position: relative; padding: 0 0 15px; color: var(--muted-foreground); font-size: 13px; font-weight: 600; }
.mode-tab svg { width: 18px; height: 18px; }
.mode-tab.active { color: var(--titel); }
.mode-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 3px; background: var(--teal); border-radius: 3px; }
.mode-caption { display: none; margin-left: auto; font-family: var(--font-mono); color: var(--muted-foreground); font-size: 9px; letter-spacing: .1em; }
.studio-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 24px; align-items: start; }
.panel { background: var(--studio-card); border: 1px solid var(--border); border-radius: var(--studio-radius-card); box-shadow: var(--studio-shadow); min-width: 0; }
.composer { padding: 22px; }
.panel-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.panel-heading h2 { margin: 0; font-size: 16px; }
.step-number { border: 1px solid var(--border); background: var(--surface-light); color: var(--teal); font-family: var(--font-mono); font-size: 10px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 6px; flex-shrink: 0; }
.quiet-badge { display: inline-block; color: var(--teal); background: var(--surface-light); padding: 4px 7px; font-size: 9px; font-weight: 600; border: 1px solid var(--border); border-radius: 5px; letter-spacing: .03em; }
.panel-heading .quiet-badge { margin-left: auto; }
.input-tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--studio-radius-input); background: var(--surface-light); border: 1px solid var(--border); margin-bottom: 23px; }
.input-tabs button { flex: 1; font-size: 12px; color: var(--muted-foreground); padding: 7px 5px; border-radius: 6px; }
.input-tabs button.active { background: var(--studio-card); color: var(--titel); box-shadow: var(--studio-shadow); font-weight: 600; }
.field-label { color: var(--muted-foreground); font-family: var(--font-heading); font-size: 10px; font-weight: 600; letter-spacing: .055em; display: flex; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.field-label span { font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 0; }
textarea, input, select { background: var(--background); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--studio-radius-input); min-width: 0; }
textarea { width: 100%; padding: 13px; resize: vertical; min-height: 136px; max-height: 350px; line-height: 1.8; display: block; font-size: 13px; }
textarea::placeholder, input::placeholder { color: var(--muted-foreground); opacity: .85; }
textarea:focus, input:focus, select:focus { border-color: var(--studio-focus); }
.field-hint { font-size: 11px; color: var(--muted-foreground); margin: 9px 0 20px; line-height: 1.7; }
.preset-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; justify-content: space-between; margin-top: 20px; }
.preset-heading>span { color: var(--muted-foreground); font-size: 9px; margin-bottom: 10px; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 11px; color: var(--muted-foreground); }
.chip.selected { color: var(--teal); background: var(--surface-light); border-color: var(--teal); font-weight: 600; }
.form-divider { height: 1px; background: var(--border); margin: 24px 0; }
.form-row { display: flex; gap: 12px; margin-bottom: 18px; }
.form-field { flex: 1; min-width: 90px; }
.form-field.grow { flex: 1.85; }
.form-field select { width: 100%; padding: 11px 8px; font-size: 12px; }
.advanced { border-bottom: 1px solid var(--border); padding-bottom: 17px; font-size: 12px; color: var(--muted-foreground); margin-top: 8px; }
.advanced summary { list-style: none; display: flex; justify-content: space-between; cursor: pointer; }
.advanced summary::-webkit-details-marker { display: none; }
.advanced[open] summary { margin-bottom: 20px; }
.advanced input { width: 100%; margin-bottom: 14px; padding: 10px; font-size: 12px; }
.generation-bottom { margin-top: 22px; }
.compute-line { display: flex; gap: 7px; flex-wrap: wrap; justify-content: space-between; color: var(--muted-foreground); font-size: 10px; margin-bottom: 14px; }
.compute-line .status-dot { margin-right: 5px; }
.compute-line>span:last-child { font-family: var(--font-mono); font-size: 9px; }
.primary-button, .btn.solid { display: flex; justify-content: center; align-items: center; gap: 9px; background: var(--highlight); color: var(--highlight-foreground); border: 1px solid var(--kopf-knopf-rand); padding: 13px; font-family: var(--font-heading); font-size: 12px; font-weight: 700; border-radius: var(--studio-radius-button); width: 100%; transition: transform .16s; }
.primary-button:hover { transform: translateY(-1px); }
.primary-button svg { width: 18px; height: 18px; }
.primary-button .arrow { margin-left: auto; }
.secondary-button, .btn.ghost { border: 1px solid var(--border); border-radius: var(--studio-radius-button); padding: 10px 13px; font-size: 12px; font-weight: 600; color: var(--titel); background: transparent; }
.secondary-button:hover { background: var(--surface-light); }
.demo-button { color: var(--teal); display: flex; gap: 8px; justify-content: center; width: 100%; font-size: 12px; padding: 15px 0 0; }
.cost-note { color: var(--muted-foreground); text-align: center; font-size: 10px; margin: 9px 0 0; }
.preview { padding: 22px 22px 0; overflow: hidden; }
.preview-state { font-family: var(--font-mono); color: var(--muted-foreground); font-size: 8px; margin-left: auto; text-align: right; }
.preview-canvas { aspect-ratio: .97; background: radial-gradient(ellipse at 75% 20%,var(--studio-canvas-glow),transparent 60%),var(--studio-navy); border: 1px solid var(--studio-canvas-line); border-radius: 12px; position: relative; display: flex; align-items: center; flex-direction: column; justify-content: center; overflow: hidden; color: var(--kopf-text); }
.preview-canvas::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(var(--studio-canvas-line) 1px,transparent 1px),linear-gradient(90deg,var(--studio-canvas-line) 1px,transparent 1px); background-size: 50px 50px; opacity: .25; }
.viewfinder { position: absolute; width: 14px; height: 14px; border: 0 solid var(--acc2); opacity: .55; z-index: 2; }
.top-left { top: 16px; left: 16px; border-top-width: 1px; border-left-width: 1px; }
.top-right { top: 16px; right: 16px; border-top-width: 1px; border-right-width: 1px; }
.bottom-left { bottom: 16px; left: 16px; border-bottom-width: 1px; border-left-width: 1px; }
.bottom-right { bottom: 16px; right: 16px; border-bottom-width: 1px; border-right-width: 1px; }
.canvas-meta { position: absolute; top: 27px; left: 29px; font: 9px var(--font-mono); letter-spacing: .09em; color: var(--kopf-text-leise); }
.canvas-ratio { position: absolute; bottom: 22px; right: 29px; font: 10px var(--font-mono); color: var(--kopf-text-leise); }
.brand-stage { position: relative; width: 76%; display: flex; flex-direction: column; align-items: center; padding: 30px 0 23px; }
.brand-stage img { width: min(68%,205px); height: auto; position: relative; z-index: 1; }
.stage-label { font-family: var(--font-heading); color: var(--acc2); letter-spacing: .32em; font-size: 9px; margin-top: 20px; }
.stage-ring { position: absolute; width: 230px; height: 230px; top: 50%; left: 50%; border: 1px solid var(--studio-canvas-line); border-radius: 50%; transform: translate(-50%,-50%); }
.stage-ring::after { content: ''; position: absolute; inset: -30px; border: 1px solid var(--studio-canvas-line); border-radius: inherit; }
.preview-copy { z-index: 2; text-align: center; padding: 14px 18px 30px; }
.preview-label { font-size: 8px; letter-spacing: .12em; color: var(--highlight); display: block; margin-bottom: 12px; font-weight: 600; }
.preview-copy h3 { color: var(--titel-invers); font-size: 18px; margin-bottom: 12px; }
.preview-copy p { color: var(--kopf-text-leise); font-size: 10px; line-height: 1.85; margin: 0; }
.preview-footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 21px 0; border-bottom: 1px solid var(--border); }
.preview-footer>div { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--titel); font-weight: 600; }
.preview-footer small { display: block; font-size: 10px; color: var(--muted-foreground); font-weight: 400; }
.tiny-icon { font-size: 28px; color: var(--teal); }
.preview-footer-right { display: none; color: var(--muted-foreground); font: 8px var(--font-mono); }
.preview-note { display: flex; gap: 13px; padding: 23px 0; }
.preview-note>span { font-size: 22px; color: var(--teal); }
.preview-note p { color: var(--muted-foreground); font-size: 12px; line-height: 1.8; margin: 0; }
.preview-note strong { display: block; font-weight: 600; color: var(--titel); margin-bottom: 4px; }
.section-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 30px 0 16px; }
.section-title h2 { font-size: 17px; margin: 0; }
.section-title>span { font-size: 10px; color: var(--muted-foreground); text-align: right; max-width: 165px; }
.inspiration-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
.idea-card { text-align: left; position: relative; overflow: hidden; background: var(--studio-card); border: 1px solid var(--border); border-radius: var(--studio-radius-card); padding: 21px; min-height: 132px; transition: border-color .2s; }
.idea-card::after { content: ''; position: absolute; width: 94px; height: 108px; right: -18px; top: -40px; background: var(--surface-gray); clip-path: polygon(0 50%,100% 0,100% 100%); pointer-events: none; opacity: .65; }
.idea-card:hover { border-color: var(--teal); }
.idea-number { display: block; color: var(--teal); font: 9px var(--font-mono); letter-spacing: .06em; margin-bottom: 19px; position: relative; z-index: 1; }
.idea-card strong { display: block; color: var(--titel); font: 700 14px var(--font-heading); margin-bottom: 8px; }
.idea-card>span:last-child { display: block; font-size: 10px; color: var(--muted-foreground); }
.idea-card b { float: right; font-weight: 400; font-size: 17px; color: var(--teal); }
.page-footer { max-width: var(--studio-content-width); margin: 0 auto; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding: 28px 18px; font: 9px var(--font-mono); color: var(--muted-foreground); letter-spacing: .02em; }
.upload-zone { border: 1px dashed var(--teal); background: var(--surface-light); border-radius: var(--studio-radius-input); min-height: 125px; cursor: pointer; position: relative; margin-bottom: 20px; overflow: hidden; }
.upload-zone.dragover { outline: 2px solid var(--teal); }
#upload-empty { padding: 15px 12px; display: grid; text-align: center; gap: 5px; font-size: 10px; color: var(--muted-foreground); }
#upload-empty strong { font-size: 13px; color: var(--titel); }
.upload-icon { font-size: 24px; color: var(--teal); }
#upload-preview { width: 100%; height: 160px; object-fit: contain; display: block; }
#remove-upload { position: absolute; right: 8px; top: 8px; background: var(--studio-navy); color: var(--titel-invers); width: 30px; height: 30px; border-radius: 50%; }
.active-job { padding: 17px; border: 1px solid var(--border); border-radius: var(--studio-radius-input); margin-top: 20px; background: var(--surface-light); color: var(--titel); font-size: 12px; }
.active-job small { display: block; color: var(--muted-foreground); margin-top: 6px; font-size: 11px; }
.status-bar { height: 3px; background: var(--border); margin-top: 14px; overflow: hidden; }
.status-bar::after { content: ''; display: block; height: 100%; width: 30%; background: var(--teal); animation: progress 2s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(400%); } }
.simulated-badge { color: var(--teal); font-size: 10px; }
.library-toolbar { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.library-toolbar input { flex: 1; padding: 12px; min-width: 160px; }
.library-toolbar select { padding: 10px; font-size: 12px; }
.jobs-list, .workflow-grid, .connection-grid, .lab-grid { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; }
.empty-library { grid-column: 1/-1; text-align: center; padding: 60px 20px; border: 1px dashed var(--border); border-radius: var(--studio-radius-card); color: var(--muted-foreground); }
.empty-library h2 { font-size: 21px; }
.empty-library p { font-size: 13px; }
.job-card { text-align: left; padding: 18px; border: 1px solid var(--border); background: var(--studio-card); border-radius: var(--studio-radius-card); overflow: hidden; }
.job-card:hover { border-color: var(--teal); }
.job-art { display: grid; place-items: center; height: 132px; background: var(--studio-navy); color: var(--acc2); border-radius: var(--studio-radius-input); font-size: 32px; margin-bottom: 18px; }
.job-card h3 { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.job-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 10px; color: var(--muted-foreground); }
.job-status { color: var(--teal); display: block; font-size: 10px; margin-bottom: 10px; }
.flow-diagram { display: flex; flex-direction: column; background: var(--studio-navy); color: var(--kopf-text); border-radius: var(--studio-radius-card); padding: 25px; gap: 12px; margin-bottom: 24px; }
.flow-diagram>div { flex: 1; }
.flow-diagram small { color: var(--acc2); font: 10px var(--font-mono); }
.flow-diagram strong { display: block; color: var(--titel-invers); font: 600 14px var(--font-heading); margin: 12px 0 8px; }
.flow-diagram p { color: var(--kopf-text-leise); font-size: 11px; margin: 0; }
.flow-diagram>span { color: var(--highlight); transform: rotate(90deg); align-self: center; }
.workflow-card { padding: 25px; }
.workflow-card>.quiet-badge { margin-bottom: 22px; }
.workflow-card h2 { font-size: 23px; }
.workflow-card p { color: var(--muted-foreground); font-size: 13px; line-height: 1.9; }
.workflow-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.workflow-tags span { padding: 4px 7px; border-radius: 5px; border: 1px solid var(--border); font-size: 10px; color: var(--muted-foreground); }
.workflow-card .warning-text { color: var(--studio-warning); font-size: 11px; margin-top: 22px; }
.roadmap-card { background: var(--surface-gray); }
.connection-grid { margin-bottom: 25px; }
.connection-card { padding: 24px; border: 1px solid var(--border); background: var(--studio-card); border-radius: var(--studio-radius-card); }
.connection-icon { color: var(--teal); font-size: 25px; }
.connection-state { float: right; border: 1px solid var(--border); color: var(--studio-warning); background: var(--studio-warning-bg); border-radius: 5px; padding: 4px 7px; font-size: 9px; }
.connection-state.ok { color: var(--teal); background: var(--surface-light); }
.connection-card h3 { font-size: 17px; margin: 14px 0 7px; }
.connection-card p { font-size: 12px; color: var(--muted-foreground); margin: 0; }
.setup-panel { padding: 26px; }
.setup-panel h2 { font-size: 23px; }
.setup-panel h3 { font-size: 18px; margin-top: 28px; }
.setup-panel ol { font-size: 13px; color: var(--muted-foreground); line-height: 2; padding-left: 20px; }
.setup-panel li { margin-bottom: 12px; }
.setup-panel p { font-size: 12px; line-height: 1.9; color: var(--muted-foreground); }
.setup-panel code { color: var(--teal); font-size: 11px; }
.notice { padding: 20px; background: var(--studio-warning-bg); color: var(--studio-warning); border-radius: var(--studio-radius-input); font-size: 12px; line-height: 1.85; margin: 24px 0; }
.notice p { color: inherit; font-size: 12px; margin: 5px 0 0; }
.copy-field { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--studio-radius-input); background: var(--surface-light); }
.copy-field code { overflow-wrap: anywhere; word-break: break-word; }
.lab-intro { background: var(--studio-navy); padding: 30px; color: var(--kopf-text); position: relative; overflow: hidden; margin-bottom: 24px; }
.lab-intro h2 { color: var(--titel-invers); font-size: var(--titel-h2); margin: 22px 0 18px; }
.lab-intro p { font-size: 14px; line-height: 1.9; max-width: 50rem; margin: 0; }
.lab-number { color: var(--highlight); font: 10px var(--font-mono); letter-spacing: .15em; }
.lab-grid .eyebrow { color: var(--teal); font-size: 10px; }
.lab-grid h2 { font-size: 21px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); padding: 14px 20px; max-width: min(600px,92vw); width: max-content; border: 1px solid var(--border); background: var(--studio-card); color: var(--titel); border-radius: var(--studio-radius-input); box-shadow: var(--studio-shadow); z-index: 50; font-size: 13px; }
.toast.error { color: var(--studio-danger); background: var(--studio-danger-bg); }
dialog { width: calc(100% - 32px); max-width: 610px; border-radius: var(--studio-radius-card); border: 1px solid var(--border); background: var(--studio-card); color: var(--foreground); padding: 28px; }
dialog::backdrop { background: var(--studio-backdrop); backdrop-filter: blur(4px); }
.modal-close { position: absolute; right: 12px; top: 9px; color: var(--muted-foreground); font-size: 25px; }
dialog h2 { padding-right: 20px; font-size: 25px; }
dialog p { color: var(--muted-foreground); font-size: 13px; line-height: 1.85; }
dialog input { width: 100%; padding: 12px; margin: 9px 0 18px; }
dialog label { font-size: 12px; color: var(--muted-foreground); }
dialog .primary-button { margin: 14px 0; }
dialog .secondary-button { margin: 5px 6px 0 0; }
.modal-actions { display: flex; gap: 10px; align-items: center; }
.modal-details { padding: 16px; font-size: 12px; line-height: 2; background: var(--surface-light); border-radius: var(--studio-radius-input); color: var(--muted-foreground); overflow-wrap: anywhere; }
.dialog-error { color: var(--studio-danger); font-size: 12px; line-height: 1.8; }
.result-video, .result-image { width: 100%; max-height: 390px; object-fit: contain; background: var(--studio-navy-deep); border-radius: var(--studio-radius-input); }
.full-result { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--studio-navy-deep); z-index: 3; }
@media (min-width: 480px) {
  .brand-logo { width: 82px; }
  .sidebar { padding-inline: 22px; }
  .sidebar nav { gap: 8px; }
  .topbar { padding-inline: 24px; }
  .breadcrumb { font-size: 11px; }
  .breadcrumb span { padding: 0 10px; }
  .page-content { padding: 32px 24px 0; }
  .preview-canvas { aspect-ratio: 1.25; }
  .preview-footer-right { display: block; }
  .page-footer { padding-inline: 24px; }
}
@media (min-width: 760px) {
  .page-content { padding: 36px 30px 0; }
  .topbar { padding-inline: 30px; }
  .mode-caption { display: block; }
  .studio-grid { grid-template-columns: minmax(310px,.95fr) minmax(320px,1.05fr); gap: 20px; }
  .composer, .preview { padding: 24px; }
  .preview { padding-bottom: 0; }
  .preview-canvas { aspect-ratio: .77; }
  .preview-footer-right { display: none; }
  .inspiration-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .jobs-list, .workflow-grid, .lab-grid, .connection-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .roadmap-card { grid-column: 1/-1; }
  .page-footer { padding-inline: 30px; }
  .section-title>span { max-width: none; }
}
@media (min-width: 1080px) {
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--studio-sidebar-width); padding: 27px 16px 20px; display: flex; flex-direction: column; justify-content: flex-start; align-items: stretch; border-right: 1px solid var(--studio-canvas-line); border-bottom: 0; }
  .brand { padding: 0 12px 26px; align-items: flex-start; }
  .brand-logo { width: 110px; }
  .brand-sub { display: block; margin-top: 9px; color: var(--kopf-text-leise); }
  .workspace { display: flex; gap: 9px; align-items: center; border: 1px solid var(--studio-canvas-line); border-radius: var(--studio-radius-input); padding: 11px 9px; font-size: 11px; }
  .workspace small { display: block; color: var(--kopf-text-leise); font-size: 9px; margin-top: 3px; }
  .workspace-avatar, .avatar { display: grid; place-items: center; flex-shrink: 0; width: 28px; height: 28px; background: var(--studio-blue); color: var(--acc2); font: 700 12px var(--font-heading); border-radius: 7px; }
  .workspace-arrow { margin-left: auto; color: var(--kopf-text-leise); }
  .nav-label { display: block; color: var(--kopf-text-leise); font: 9px var(--font-heading); font-weight: 600; letter-spacing: .14em; margin: 29px 11px 12px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 6px; }
  .nav-item { width: 100%; height: 44px; padding: 11px 12px; justify-content: flex-start; gap: 10px; font-size: 12px; }
  .nav-item svg { width: 18px; height: 18px; }
  .nav-shortcut, .count { display: block; margin-left: auto; font: 9px var(--font-mono); color: var(--kopf-text-leise); }
  .nav-item.active .nav-shortcut { color: var(--acc2); }
  .sidebar-bottom { display: block; margin-top: auto; padding-top: 28px; }
  .compute-mini { background: var(--studio-navy-deep); border: 1px solid var(--studio-canvas-line); padding: 16px; border-radius: var(--studio-radius-card); }
  .compute-mini .status-dot { background: var(--highlight); margin-right: 6px; }
  .compute-mini strong { font-size: 12px; color: var(--titel-invers); }
  .compute-mini p { font-size: 11px; color: var(--kopf-text-leise); margin: 12px 0; line-height: 1.8; }
  .text-button { padding: 0; font-size: 10px; color: var(--acc2); text-align: left; }
  .text-button span { margin-left: 6px; }
  .account { display: flex; align-items: center; gap: 9px; padding: 20px 3px 0; text-align: left; width: 100%; font-size: 11px; color: var(--kopf-text); }
  .account small { display: block; font-size: 9px; color: var(--kopf-text-leise); margin-top: 3px; }
  .account>span:last-child { margin-left: auto; }
  main { margin-left: var(--studio-sidebar-width); }
  .mobile-account { display: none; }
  .topbar { min-height: 73px; padding-inline: 34px; }
  .topbar-right { gap: 10px; }
  .environment { font-size: 11px; padding: 5px 10px; }
  .page-content { padding: 36px 34px 0; }
  .page-footer { padding-inline: 34px; }
  .studio-grid { grid-template-columns: minmax(345px,.9fr) minmax(355px,1.1fr); gap: 24px; }
  .preview-canvas { aspect-ratio: .92; }
  .flow-diagram { flex-direction: row; align-items: center; }
  .flow-diagram>span { transform: none; }
  .connection-grid, .jobs-list { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (min-width: 1320px) {
  .version { display: inline-block; }
  .page-content { padding-top: 40px; }
  .studio-grid { grid-template-columns: minmax(370px,.88fr) minmax(450px,1.12fr); }
  .preview-canvas { aspect-ratio: 1.08; }
  .brand-stage { padding-bottom: 34px; }
  .brand-stage img { width: 220px; }
  .preview-copy h3 { font-size: 23px; }
  .preview-copy p { font-size: 11px; }
  .preview-footer-right { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* 0.4.1: the preview frame follows the chosen format (not only its label). Mobile-first. */
.preview-canvas[data-aspect="16:9"] { aspect-ratio: 16 / 9; }
.preview-canvas[data-aspect="1:1"] { aspect-ratio: 1 / 1; }
.preview-canvas[data-aspect="9:16"] { aspect-ratio: 9 / 16; max-height: 78vh; width: auto; margin-inline: auto; }
.preview-canvas[data-aspect="16:9"] .preview-copy p, .preview-canvas[data-aspect="16:9"] .stage-ring,
.preview-canvas[data-aspect="16:9"] .canvas-meta, .preview-canvas[data-aspect="16:9"] .stage-label, .preview-canvas[data-aspect="16:9"] .preview-label { display: none; }
.preview-canvas[data-aspect="16:9"] .brand-stage { padding: 8px 0; }
.preview-canvas[data-aspect="16:9"] .brand-stage img { width: min(34%, 120px); }
.preview-canvas[data-aspect="16:9"] .preview-copy { padding: 4px 16px 16px; }
.preview-canvas[data-aspect="16:9"] .preview-copy h3 { font-size: 15px; margin-bottom: 0; }
.export-note { font-size: 10px; color: var(--muted-foreground); margin: -6px 0 12px; }
.job-art { overflow: hidden; }
.job-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.job-meta { row-gap: 2px; }
.load-more { grid-column: 1 / -1; justify-self: center; }
/* Phones: render action pinned, job status pinned in the top bar below the sticky navigation. */
.generation-bottom { position: sticky; bottom: 0; z-index: 5; background: var(--studio-card); margin: 22px -22px -22px; padding: 14px 22px 18px; border-top: 1px solid var(--border); border-radius: 0 0 var(--studio-radius-card) var(--studio-radius-card); }
.topbar { position: sticky; top: 66px; z-index: 15; }
.mobile-job { display: inline-flex; align-items: center; max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 600; color: var(--highlight-foreground); background: var(--highlight); border: 1px solid var(--kopf-knopf-rand); border-radius: 6px; padding: 5px 8px; }
.environment { display: none; }
@media (min-width: 760px) {
  .generation-bottom { position: static; margin: 22px 0 0; padding: 0; border-top: 0; background: none; border-radius: 0; }
  .topbar { position: static; }
  .mobile-job, .mobile-job:not(.hidden) { display: none; }
  .environment { display: flex; }
  .preview-canvas[data-aspect="16:9"] .canvas-meta, .preview-canvas[data-aspect="16:9"] .stage-label, .preview-canvas[data-aspect="16:9"] .preview-label { display: block; }
  .preview-canvas[data-aspect="16:9"] .brand-stage img { width: min(40%, 150px); }
}

/* 0.5.0 user management (mobile-first) */
.admin-kpis { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px; }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.kpi span:first-child { font-family: var(--font-heading); font-size: 11px; letter-spacing: .12em; color: var(--muted-foreground); }
.kpi strong { font-family: var(--font-heading); font-size: 22px; color: var(--titel); }
.kpi small, .admin-table small { color: var(--muted-foreground); font-size: 12px; display: block; margin-top: 4px; }
.admin-invite, .admin-list { padding: 18px; margin-bottom: 16px; }
.admin-invite h2, .admin-list h2 { font-family: var(--font-heading); font-size: 18px; margin: 0 0 6px; color: var(--titel); }
.admin-hint { color: var(--muted-foreground); font-size: 13px; margin: 0 0 12px; }
.admin-form { display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end; }
.admin-form label { font-family: var(--font-heading); font-size: 11px; letter-spacing: .1em; color: var(--muted-foreground); display: flex; flex-direction: column; gap: 6px; }
.admin-form input, .admin-form select, .admin-table input, .admin-table select { font: inherit; font-size: 14px; color: var(--titel); background: var(--surface-light); border: 1px solid var(--border); border-radius: var(--studio-radius-button); padding: 9px 10px; min-width: 0; }
.admin-list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 860px; font-size: 14px; }
.admin-table th { text-align: left; font-family: var(--font-heading); font-size: 11px; letter-spacing: .1em; color: var(--muted-foreground); padding: 8px; border-bottom: 1px solid var(--border); }
.admin-table td { padding: 10px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
.admin-table input { width: 110px; }
.usage-text { display: block; font-weight: 600; color: var(--titel); }
.usage-bar { display: block; height: 6px; border-radius: 3px; background: var(--surface-light); margin-top: 6px; overflow: hidden; }
.usage-bar span { display: block; height: 100%; background: var(--highlight); }
.usage-bar.warn span { background: var(--studio-danger); }
@media (min-width: 720px) { .admin-kpis { grid-template-columns: repeat(2, 1fr); } .admin-form { grid-template-columns: 2fr 1fr 1fr 1fr auto; } .admin-form .primary-button { width: auto; padding: 11px 18px; } }
@media (min-width: 1100px) { .admin-kpis { grid-template-columns: repeat(4, 1fr); } }
