:root {
  color-scheme: dark;
  --bg: #0b0f16;
  --bg-elevated: #0f151f;
  --panel: #141c27;
  --panel2: #101720;
  --panel3: #182230;
  --line: #273241;
  --line-strong: #415266;
  --text: #f4f7fb;
  --muted: #95a4b7;
  --soft: #c2ccda;
  --accent: #4c9aff;
  --accent-strong: #2f82f6;
  --accent-soft: rgb(76 154 255 / 14%);
  --cyan: #35d2b4;
  --success: #43cf9f;
  --warning: #e9bd65;
  --danger: #ff6d7d;
  --danger-soft: rgb(255 109 125 / 12%);
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 18px 55px rgb(0 0 0 / 28%);
  --focus: 0 0 0 3px rgb(76 154 255 / 22%);
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 3%), transparent 240px),
    var(--bg);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

button,
input,
textarea,
select { font: inherit; }

button {
  cursor: pointer;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease, opacity .16s ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--panel2);
  color: var(--text);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

input:hover,
textarea:hover,
select:hover { border-color: var(--line-strong); }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  background: #0d141e;
}

input::placeholder,
textarea::placeholder { color: #6f8094; }

label {
  display: block;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.62;
}

a { color: #9fc2ff; }

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--cyan);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 0, rgb(76 154 255 / 24%), transparent 420px),
    var(--bg);
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgb(20 28 39 / 92%);
  box-shadow: var(--shadow);
}

.login-card h1 { margin: 0 0 8px; }

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 218px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 13px;
  border-right: 1px solid var(--line);
  background: #0d131d;
}

.brand {
  padding: 0 11px 22px;
  font-size: 22px;
  letter-spacing: .02em;
}

.brand strong { color: var(--accent); }

.nav,
.secondary,
.link-button {
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.nav {
  min-height: 42px;
  padding: 0 12px;
}

.nav:hover,
.nav.active {
  color: var(--text);
  background: var(--accent-soft);
}

.sidebar-foot {
  margin-top: auto;
  padding: 13px 12px 4px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.sidebar-foot strong { color: var(--text); }
.sidebar-foot span { color: var(--muted); }

.link-button {
  padding: 0;
  color: #9fc2ff;
}

.link-button:hover { color: #fff; }

main {
  width: min(1600px, 100%);
  margin: 0 auto;
  padding: 30px 40px 60px;
}

header,
.section-bar,
.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

header {
  align-items: flex-end;
  margin-bottom: 24px;
}

.section-bar,
.panel-title { align-items: baseline; }

.section-bar {
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-bar > div {
  min-width: 0;
}

#tasks .section-bar {
  align-items: flex-start;
  flex-wrap: wrap;
}

#tasks .section-bar > div:first-child {
  flex: 1 1 260px;
}

#tasks .section-bar .toolbar-actions {
  flex: 1 1 360px;
  justify-content: flex-end;
  min-width: min(100%, 360px);
}

#tasks .section-bar .secondary {
  white-space: nowrap;
}

.view { display: none; }
.view.active { display: block; }

.workbench-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

.model-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.model-panel {
  padding: 14px;
  position: static;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.model-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 360px) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.model-toolbar .muted { justify-self: end; }

.model-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.model-row {
  min-height: 108px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px;
  background: var(--panel2);
  color: var(--text);
  text-align: left;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.model-row:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--panel3);
}

.model-row.selected {
  border-color: rgb(76 154 255 / 72%);
  background: linear-gradient(180deg, rgb(76 154 255 / 15%), rgb(76 154 255 / 7%));
  box-shadow: inset 0 0 0 1px rgb(76 154 255 / 16%);
}

.model-row strong,
.model-row span,
.model-row small { display: block; }

.model-row span {
  margin-bottom: 7px;
  color: var(--cyan);
  font-size: 11px;
  line-height: 1.35;
}

.model-row strong {
  margin-bottom: 5px;
  font-size: 15px;
}

.model-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, .72fr);
  gap: 16px;
  align-items: start;
}

.panel {
  padding: 20px;
  box-shadow: none;
}

.panel-title {
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.panel-title h2 { margin: 0; }
.panel-title span { color: var(--muted); font-size: 12px; }

#model-hint {
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid rgb(76 154 255 / 25%);
  border-radius: var(--radius-sm);
  background: rgb(76 154 255 / 8%);
}

.prompt-panel textarea { margin-top: 0; }
#prompt { min-height: 210px; }
#batch-prompts { min-height: 116px; }

.settings-panel {
  position: sticky;
  top: 22px;
}

.parameter-form,
.stack-form {
  display: grid;
  gap: 2px;
}

.parameter-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 12px;
}

.parameter-form label { margin-bottom: 13px; }

.asset-selection,
.asset-library {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.reference-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.reference-actions label {
  margin-bottom: 0;
}

.reference-actions .secondary {
  min-height: 40px;
  margin-bottom: 0;
  white-space: nowrap;
}

.asset-selection {
  min-height: 46px;
  align-items: center;
  padding: 9px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
}

.asset-selection-summary {
  flex: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.asset-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel3);
  color: var(--soft);
  font-size: 12px;
}

.asset-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-chip img,
.asset-tile img {
  width: 42px;
  height: 42px;
  object-fit: cover;
  border-radius: 5px;
  background: #050812;
}

.asset-chip button {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.asset-chip button:hover { color: var(--danger); }

.primary {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 750;
  text-align: center;
  box-shadow: 0 12px 26px rgb(76 154 255 / 20%);
}

.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.primary:active { transform: translateY(0); }

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--line);
  padding: 8px 11px;
  color: var(--soft);
  background: var(--panel2);
}

.secondary:hover {
  border-color: var(--line-strong);
  background: var(--panel3);
  color: var(--text);
}

button:disabled,
.secondary:disabled,
.primary:disabled {
  cursor: not-allowed;
  opacity: .48;
  transform: none;
  filter: none;
}

.message {
  min-height: 20px;
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message.ok { color: var(--success); }
.message.error { color: var(--danger); }
.task-submit-success { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.task-submit-success button { flex: none; padding: 6px 9px; font-size: 12px; }

.creative-output {
  display: grid;
  gap: 12px;
  margin-top: 8px;
}

.creative-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.creative-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgb(76 154 255 / 24%);
  border-radius: var(--radius);
  background: rgb(76 154 255 / 8%);
}

.creative-result-head strong,
.creative-result-head small {
  display: block;
}

.creative-result-head small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.creative-block {
  display: grid;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
}

.creative-block h4 {
  margin: 0;
  color: var(--soft);
  font-size: 13px;
}

.creative-block pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #0c131c;
  color: #eef3ff;
  white-space: pre-wrap;
  line-height: 1.65;
}

.creative-block ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.65;
}

.creative-block li.ok { color: var(--success); }
.creative-block li.error { color: var(--danger); }

.creative-shot-list {
  display: grid;
  gap: 10px;
}

.creative-shot {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 3%);
}

.creative-shot-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.creative-shot-head strong {
  color: var(--text);
  font-size: 13px;
}

.creative-shot-head span {
  flex: none;
  color: var(--cyan);
  font-size: 12px;
}

.creative-shot p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.production-view {
  display: none;
  gap: 16px;
}

.production-view.active {
  display: grid;
}

.production-readiness {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) 1fr;
  gap: 10px;
}

.readiness-meter {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid rgb(76 154 255 / 28%);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgb(76 154 255 / 16%), rgb(67 207 159 / 9%));
}

.readiness-meter strong,
.readiness-meter span {
  display: block;
  position: relative;
  z-index: 1;
}

.readiness-meter strong {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.readiness-meter span {
  margin-top: 3px;
  color: var(--muted);
}

.readiness-meter i {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--cyan), var(--success));
}

.production-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.production-kpis span,
.pipeline-step,
.production-module {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
}

.production-kpis span {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  color: var(--soft);
  font-size: 13px;
}

.production-modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.production-module {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.production-module.compact {
  min-height: 0;
  padding: 12px;
}

.production-module small {
  color: var(--cyan);
  font-size: 12px;
}

.production-module h3 {
  margin: 5px 0 8px;
  color: var(--text);
  font-size: 16px;
}

.production-module p,
.production-module strong,
.pipeline-step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.production-module strong {
  color: var(--soft);
  font-weight: 600;
}

.production-pipeline {
  display: grid;
  gap: 12px;
}

.production-automation {
  display: grid;
  gap: 14px;
}

#production-pipeline {
  display: grid;
  gap: 10px;
}

.pipeline-step {
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px;
}

.pipeline-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #061018;
  background: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--soft);
  background: var(--panel2);
  font-size: 12px;
  white-space: nowrap;
}

.status.succeeded {
  border-color: rgb(67 207 159 / 32%);
  color: var(--success);
  background: rgb(67 207 159 / 10%);
}

.status.failed,
.status.dead_letter,
.status.cancelled {
  border-color: rgb(255 109 125 / 32%);
  color: var(--danger);
  background: var(--danger-soft);
}

.status.queued {
  border-color: rgb(233 189 101 / 32%);
  color: var(--warning);
  background: rgb(233 189 101 / 10%);
}

.status.submitting,
.status.running {
  border-color: rgb(76 154 255 / 32%);
  color: #9fc2ff;
  background: rgb(76 154 255 / 10%);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.export-link {
  display: inline-flex;
  text-decoration: none;
}

.task-list,
.data-list {
  display: grid;
  gap: 10px;
}

.task,
.data-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--panel);
}

.task:hover,
.data-row:hover { border-color: var(--line-strong); }

.task p {
  margin: 7px 0;
  color: var(--muted);
  white-space: pre-wrap;
}

.task a { color: #9fc2ff; }

.asset-library {
  align-items: stretch;
}

.asset-tile {
  position: relative;
  width: 172px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--panel);
}

.asset-tile:hover { border-color: var(--line-strong); }

.asset-tile img {
  width: 100%;
  height: 112px;
}

.asset-audio-preview {
  width: 100%;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: #0b1119;
  color: var(--cyan);
  font-size: 34px;
}

.asset-tile small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-grid,
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

#admin section.panel.admin-panel-collapsed > :not(.admin-collapse-toggle) { display: none; }
.admin-collapse-toggle {
  width: 100%; min-height: 42px; padding: 0; border: 0; background: transparent; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font: inherit; text-align: left; cursor: pointer;
}
.admin-collapse-toggle span { font-size: 18px; font-weight: 700; }
.admin-collapse-toggle i { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform 160ms ease; }
.admin-collapse-toggle[aria-expanded="true"] i { transform: rotate(225deg); }
.admin-collapse-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .admin-collapse-toggle i { transition: none; } }

.summary-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px;
  background: var(--panel);
}

.data-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.data-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

details { margin-top: 16px; }

summary {
  margin-bottom: 12px;
  color: #9fc2ff;
  cursor: pointer;
}

.provider-profile-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 20px 0 10px;
}

.provider-profile-heading h3,
.provider-editor-title {
  margin: 0 0 5px;
  font-size: 15px;
}

.provider-profiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.provider-profile {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 86px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel2);
  color: var(--text);
  text-align: left;
}

.provider-profile:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.provider-profile.selected {
  border-color: rgb(76 154 255 / 72%);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px rgb(76 154 255 / 16%);
}

.provider-profile-icon {
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--panel3);
  color: #cfe0ff;
  font-weight: 750;
}

.provider-profile-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.provider-profile-copy strong,
.provider-profile-copy small,
.provider-profile-copy em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.provider-profile-copy small,
.provider-profile-copy em,
.provider-profile-add small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.provider-profile-copy em { color: #9fc2ff; }

.provider-profile-add {
  justify-content: center;
  flex-direction: column;
  border-style: dashed;
  color: var(--soft);
  text-align: center;
}

.provider-profile-add span {
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}

.provider-editor-title { margin-top: 2px; }
.provider-account-select { margin-top: 2px; }
.provider-action-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }

.asset-picker-dialog {
  width: min(900px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 24px 80px rgb(0 0 0 / 60%);
}

.asset-picker-dialog::backdrop {
  background: rgb(3 7 13 / 72%);
  backdrop-filter: blur(4px);
}

.asset-picker-head,
.asset-picker-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.asset-picker-head {
  border-bottom: 1px solid var(--line);
}

.asset-picker-head h3 {
  margin: 0 0 5px;
  font-size: 18px;
}

.asset-picker-head p {
  margin: 0;
}

.asset-picker-close {
  flex: none;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel2);
  color: var(--muted);
  font-size: 22px;
}

.asset-picker-close:hover {
  color: var(--text);
  background: var(--panel3);
}

.asset-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 16px 20px 0;
}

.asset-picker-grid {
  max-height: min(540px, 58vh);
  overflow: auto;
  padding: 16px 20px 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.asset-picker-tile {
  position: relative;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  background: var(--panel2);
  color: var(--text);
  text-align: left;
}

.asset-picker-tile:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: var(--panel3);
}

.asset-picker-tile.selected {
  border-color: rgb(53 210 180 / 58%);
  background: rgb(53 210 180 / 10%);
  box-shadow: inset 0 0 0 1px rgb(53 210 180 / 16%);
}

.asset-picker-tile:disabled {
  cursor: not-allowed;
  opacity: .52;
  transform: none;
}

.asset-picker-tile img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  background: #050812;
}

.asset-picker-tile strong,
.asset-picker-tile small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-picker-tile strong {
  margin-top: 8px;
  font-size: 13px;
}

.asset-picker-tile small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.asset-picker-check {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  border: 1px solid rgb(255 255 255 / 14%);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgb(5 8 18 / 72%);
  color: #fff;
  font-size: 11px;
}

.asset-picker-tile.selected .asset-picker-check {
  border-color: rgb(53 210 180 / 48%);
  background: rgb(53 210 180 / 82%);
}

.asset-picker-foot {
  align-items: center;
  border-top: 1px solid var(--line);
}

.asset-picker-foot .primary {
  width: auto;
  min-width: 116px;
}

@media (max-width: 1100px) {
  main { padding: 24px 22px 48px; }
  .studio-grid { grid-template-columns: 1fr; }
  .settings-panel { position: static; }
}

@media (max-width: 720px) {
  .app-shell { display: block; }
  .sidebar {
    width: 100%;
    padding: 10px;
    flex-direction: row;
    align-items: center;
    overflow: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    flex: none;
    padding: 0 10px 0 2px;
    font-size: 18px;
    white-space: nowrap;
  }
  .nav {
    flex: none;
    min-height: 36px;
    padding: 0 10px;
    white-space: nowrap;
  }
  .sidebar-foot {
    margin: 0 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    border-top: 0;
    padding: 0 2px;
    white-space: nowrap;
  }
  .sidebar-foot span { display: none; }
  main { padding: 20px 14px 42px; }
  header,
  .section-bar,
  .panel-title {
    align-items: flex-start;
    flex-direction: column;
  }
  #tasks .section-bar .toolbar-actions {
    width: 100%;
    min-width: 0;
    justify-content: stretch;
  }
  #tasks .section-bar .secondary {
    flex: 1 1 100%;
    width: 100%;
  }
  .model-toolbar { grid-template-columns: 1fr; }
  .model-toolbar .muted { justify-self: start; }
  .model-list { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .parameter-form { grid-template-columns: 1fr; }
  .task-submit-success { align-items: stretch; flex-direction: column; }
  .task-submit-success button { width: 100%; }
  .creative-grid,
  .production-readiness,
  .production-kpis,
  .production-modules {
    grid-template-columns: 1fr;
  }
  .reference-actions,
  .asset-picker-toolbar {
    grid-template-columns: 1fr;
  }
  .reference-actions .secondary {
    width: 100%;
  }
  .task,
  .data-row { grid-template-columns: 1fr; }
  .asset-tile { width: calc(50% - 5px); }
  .asset-picker-head,
  .asset-picker-foot {
    display: grid;
  }
  .asset-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .provider-profile-heading { display: block; }
  .provider-profile-heading .muted {
    display: block;
    margin-top: 8px;
  }
}
