:root {
  color-scheme: dark;
  --background: #09090b;
  --foreground: #fafafa;
  --card: #0c0c0f;
  --muted: #18181b;
  --muted-foreground: #a1a1aa;
  --accent: #27272a;
  --border: #27272a;
  --input: #27272a;
  --ring: #71717a;
  --primary: #fafafa;
  --primary-foreground: #18181b;
  --destructive: #dc2626;
  --destructive-muted: rgba(220, 38, 38, 0.12);
  --success: #22c55e;
  --warning: #f59e0b;
  --info: #3b82f6;
  --radius: 0.5rem;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { background: var(--background); }

body {
  margin: 0;
  color: var(--foreground);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 12.5px; }
.muted { color: var(--muted-foreground); }
.small { font-size: 12.5px; }

/* --- Header & tabs ------------------------------------------------------ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(8px);
}

.header-inner, .tabs-bar-inner, .container {
  max-width: 1200px;
  margin: 0 auto;
  padding-inline: 24px;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--primary);
  color: var(--primary-foreground);
  font-size: 13px;
  font-weight: 700;
}

.brand-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.header-actions { display: flex; align-items: center; gap: 8px; min-width: 0; }
.header-actions select { width: 240px; }

.tabs-bar { border-bottom: 1px solid var(--border); }
.tabs-bar-inner { padding-block: 10px; overflow-x: auto; }

.tabs-list {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: var(--radius);
  background: var(--muted);
}

.tab-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--muted-foreground);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tab-trigger:hover { color: var(--foreground); }

.tab-trigger.active {
  background: var(--background);
  color: var(--foreground);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 0 1px var(--border);
}

.tab-trigger.step-done::before,
.tab-trigger.step-next::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.tab-trigger.step-done::before { background: var(--success); }
.tab-trigger.step-next::before { background: var(--warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.tab-trigger.step-done:not(.active) { color: #86efac; }
.tab-trigger.step-next:not(.active) { color: #fcd34d; }

.tab-count {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--foreground);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
}

.container { padding-block: 28px 80px; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-title { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.page-description { margin-top: 4px; color: var(--muted-foreground); }

/* --- Cards -------------------------------------------------------------- */

.card {
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--card);
}

.card + .card { margin-top: 16px; }
.card-header { padding: 20px 20px 0; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.card-description { margin-top: 4px; color: var(--muted-foreground); font-size: 13px; }
.card-content { padding: 20px; }
.card-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border); }
.card-footer .spacer { flex: 1; }
.card.danger { border-color: rgba(220, 38, 38, 0.35); }

/* --- Forms -------------------------------------------------------------- */

.field { display: grid; gap: 6px; }
.field + .field, .field + .grid-2, .grid-2 + .field, .grid-2 + .grid-2 { margin-top: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

label, .label { font-size: 13px; font-weight: 500; color: var(--foreground); }
.hint { color: var(--muted-foreground); font-size: 12.5px; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--input);
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%), linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--muted); color: var(--foreground); }
textarea { resize: vertical; line-height: 1.55; }
textarea.mono { font-size: 12.5px; }
input::placeholder, textarea::placeholder { color: #71717a; }

input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(113, 113, 122, 0.35);
}

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }

.mode-grid { display: grid; grid-template-columns: minmax(170px, max-content) minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.split-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.inline-actions { display: flex; align-items: center; gap: 8px; }
.inline-actions select { width: auto; }

.steps { display: grid; gap: 6px; margin: 0; padding-left: 20px; color: var(--muted-foreground); }
.steps strong { color: var(--foreground); font-weight: 500; }

details.editor { margin-top: 12px; }
details.editor > summary { color: var(--muted-foreground); font-size: 13px; cursor: pointer; }
details.editor > summary:hover { color: var(--foreground); }
details.editor[open] > summary { margin-bottom: 8px; }

.issues { display: grid; gap: 6px; margin: 0 0 16px; padding: 0; list-style: none; }
.issues:empty { display: none; }
.issues li { padding: 8px 12px; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); font-size: 13px; }
.issues li.error { border-color: rgba(220, 38, 38, 0.4); background: var(--destructive-muted); color: #fecaca; }
.issues li.warning { border-color: rgba(245, 158, 11, 0.35); background: rgba(245, 158, 11, 0.08); color: #fde68a; }

.segments { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.segment { display: grid; gap: 6px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); }
.segment-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.segment-text { font-size: 14.5px; line-height: 1.6; }
.segment-visual { color: var(--muted-foreground); font-size: 13px; }

.notes { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.notes li { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.notes li strong { display: block; margin-bottom: 2px; font-weight: 600; }
.table-static tbody tr { cursor: default; }
.table-static td { vertical-align: top; }
.table .text-cell { min-width: 260px; max-width: 460px; }
.table .text-cell p { margin: 0; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 16px; }
.image-card { display: grid; align-content: start; overflow: hidden; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); }
.image-card.flag-outdated { border-color: rgba(245, 158, 11, 0.45); }
.image-card.flag-failed { border-color: rgba(220, 38, 38, 0.45); }
.image-card.flag-current { border-color: rgba(34, 197, 94, 0.5); }
/* Fixed frame: a portrait or square result must not stretch the card and push the buttons out of view. */
.image-frame { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; background: var(--muted); color: var(--muted-foreground); font-size: 12.5px; text-align: center; }
.image-frame img, .image-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.image-frame .overlay { position: absolute; inset: auto 8px 8px 8px; }
.image-body { display: grid; gap: 6px; padding: 10px 12px 12px; }
.image-body .row-actions { justify-content: flex-start; }
.reference-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.reference-strip figure { width: 120px; margin: 0; }
.reference-strip img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); border-radius: 6px; }
.reference-strip figcaption { margin-top: 2px; color: var(--muted-foreground); font-size: 11.5px; }
.scene-strip { display: flex; gap: 2px; height: 28px; margin-top: 16px; overflow: hidden; border-radius: var(--radius); }
.scene-strip button { flex: none; min-width: 3px; height: 100%; padding: 0; border: 0; background: #3f3f46; cursor: pointer; }
.scene-strip button.chained { background: #52525b; box-shadow: inset 0 3px 0 #93c5fd; }
.scene-strip button.transition { background: repeating-linear-gradient(45deg, #27272a 0 4px, #3f3f46 4px 8px); }
.scene-strip button.has-error { background: #7f1d1d; }
.scene-strip button:hover { background: var(--primary); }
.scene-list { display: grid; gap: 10px; }
.scene-card { border: 1px solid var(--border); border-radius: var(--radius); }
.scene-card.has-error { border-color: rgba(220, 38, 38, 0.45); }
.scene-card > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; list-style: none; }
.scene-card > summary::-webkit-details-marker { display: none; }
.scene-card > summary .grow { flex: 1; min-width: 160px; overflow: hidden; color: var(--muted-foreground); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.scene-body { display: grid; gap: 14px; padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.scene-body .section-label { margin: 10px 0 4px; }
.scene-body .field + .field { margin-top: 10px; }
.shot-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; margin-top: 8px; }
.entity-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; }
@media (max-width: 640px) { .shot-row { grid-template-columns: minmax(0, 1fr); } }
.baseref-section + .baseref-section { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.baseref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.baseref-item { display: grid; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.baseref-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--muted); }
.baseref-item figcaption { display: flex; align-items: center; gap: 4px; padding: 4px 4px 4px 8px; }
.baseref-item figcaption .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.branding-slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.branding-slot { display: grid; align-content: start; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); }
.branding-slot .media { display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border-radius: calc(var(--radius) - 2px); background: var(--muted); }
.branding-slot .media img,
.branding-slot .media video { width: 100%; height: 100%; object-fit: contain; }
.branding-preview { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: linear-gradient(135deg, #1e293b, #0f172a 60%, #334155); }
.branding-preview img { position: absolute; height: auto; }
.reference-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.reference-grid:empty { display: none; }
.reference-card { display: grid; align-content: start; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); }
.reference-image { position: relative; display: grid; place-items: center; aspect-ratio: 1; overflow: hidden; padding: 12px; background: var(--muted); color: var(--muted-foreground); font-size: 12.5px; text-align: center; }
.reference-image img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.reference-image.has-image { padding: 0; }
.reference-body { display: grid; gap: 6px; padding: 10px 12px 12px; }
.reference-body .row-actions { justify-content: flex-start; }
.reference-preview { max-width: 340px; }
.reference-preview img { display: block; width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--muted); }
.suggestion-name { display: grid; gap: 6px; min-width: 180px; }
.table textarea.compact { min-height: 64px; font-size: 13px; }
.block-segments { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.block-segments li + li { padding-top: 8px; border-top: 1px dashed var(--border); }
.block-segments p { margin-top: 2px; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
audio { width: 100%; height: 40px; color-scheme: dark; }
audio.mini { width: 180px; height: 32px; }
.world-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 13px; }
.mode-grid label { font-weight: 400; color: var(--muted-foreground); }

.section-label {
  margin: 24px 0 12px;
  color: var(--muted-foreground);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-label:first-child { margin-top: 0; }

/* --- Buttons ------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) - 2px);
  background: var(--primary);
  color: var(--primary-foreground);
  font: inherit;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}

.btn:hover { background: #e4e4e7; }
.btn:disabled { opacity: 0.5; pointer-events: none; }
.btn-outline { border-color: var(--input); background: transparent; color: var(--foreground); }
.btn-outline:hover { background: var(--accent); }
.btn-secondary { background: var(--accent); color: var(--foreground); }
.btn-secondary:hover { background: #3f3f46; }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); }
.btn-destructive { background: var(--destructive); color: #fff; }
.btn-destructive:hover { background: #b91c1c; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* --- Lists (sidebar) ---------------------------------------------------- */

.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.sidebar { position: sticky; top: 136px; }
.split-detail { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; margin-top: 16px; }
.split-detail.has-detail { grid-template-columns: minmax(0, 1fr) 420px; }
.split-detail .sidebar { max-height: calc(100vh - 160px); overflow-y: auto; }
.split-detail > .card + .card { margin-top: 0; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.asset-grid a { display: grid; gap: 4px; padding: 6px; border: 1px solid var(--border); border-radius: var(--radius); color: var(--foreground); font-size: 12px; text-decoration: none; }
.asset-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; background: var(--muted); }
.sidebar .card-content { padding: 8px; }

.nav-list { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; max-height: 60vh; overflow-y: auto; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--foreground);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nav-item:hover { background: var(--muted); }
.nav-item.active { background: var(--accent); }
.nav-item .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-divider { padding: 12px 10px 4px; color: var(--muted-foreground); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.nav-empty { padding: 16px 10px; color: var(--muted-foreground); font-size: 13px; }
.sidebar-actions { padding: 8px; border-top: 1px solid var(--border); }

.empty-state {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 48px 24px;
  border: 1px dashed var(--border);
  border-radius: calc(var(--radius) + 4px);
  color: var(--muted-foreground);
  text-align: center;
}

.empty-state strong { color: var(--foreground); font-weight: 600; }

/* --- Badges & status ---------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  height: 22px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.character { color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
.badge.object { color: #fcd34d; border-color: rgba(245, 158, 11, 0.35); }
.status-queued, .status-cancelled { color: var(--muted-foreground); }
.status-retrying { color: var(--warning); border-color: rgba(245, 158, 11, 0.35); }
.status-running, .status-polling { color: #93c5fd; border-color: rgba(59, 130, 246, 0.35); }
.status-done { color: var(--success); border-color: rgba(34, 197, 94, 0.35); }
.status-failed { color: #f87171; border-color: rgba(220, 38, 38, 0.4); }

.progress { position: relative; height: 8px; overflow: hidden; border-radius: 999px; background: var(--accent); }
.progress-bar { height: 100%; border-radius: inherit; background: var(--primary); transition: width 0.4s ease; }
.progress.sm { height: 4px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-top: 16px; }
.stat { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); }
.stat-value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted-foreground); font-size: 12px; }

/* --- Table & log -------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { height: 40px; padding: 0 12px; border-bottom: 1px solid var(--border); color: var(--muted-foreground); font-size: 12.5px; font-weight: 500; text-align: left; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr { cursor: pointer; transition: background 0.1s; }
.table tbody tr:hover { background: rgba(39, 39, 42, 0.5); }
.table tbody tr.active { background: var(--muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .num { width: 1%; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .error-cell { max-width: 280px; overflow: hidden; color: #f87171; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }

.log { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.log li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.log li:last-child { border-bottom: 0; }
.log time { color: var(--muted-foreground); font-family: var(--mono); font-size: 12px; }
.log .warn { color: var(--warning); }
.log .error { color: #f87171; }
.log details { margin-top: 4px; }
.log summary { color: var(--muted-foreground); font-size: 12px; cursor: pointer; }

pre.code {
  max-height: 320px;
  margin: 6px 0 0;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  background: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

/* --- Toast -------------------------------------------------------------- */

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  font-size: 13.5px;
}

.toast.error { border-color: rgba(220, 38, 38, 0.5); background: #1c0b0b; color: #fecaca; }

/* --- Responsive --------------------------------------------------------- */

@media (max-width: 1100px) {
  .split-detail.has-detail { grid-template-columns: minmax(0, 1fr); }
  .split-detail .sidebar { position: static; max-height: none; }
}

@media (max-width: 860px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .header-inner, .tabs-bar-inner, .container { padding-inline: 16px; }
  .header-inner { height: auto; padding-block: 12px; flex-wrap: wrap; }
  .header-actions { width: 100%; }
  .header-actions select { flex: 1; width: auto; min-width: 0; }
  .grid-2, .mode-grid { grid-template-columns: minmax(0, 1fr); }
  .mode-grid label { margin-top: 10px; }
  .inline-actions { width: 100%; }
  .inline-actions select { flex: 1; }
}
