:root {
  --ink: #172033;
  --muted: #6d7586;
  --line: #e4e7ee;
  --paper: #ffffff;
  --canvas: #f5f4f0;
  --soft: #f8f8fb;
  --navy: #243a68;
  --accent: #ff6849;
  --accent-dark: #e64d31;
  --accent-soft: #fff0eb;
  --indigo: #6759d8;
  --green: #218a63;
  --amber: #b56a16;
  --red: #bf3e46;
  --shadow: 0 14px 36px rgba(35, 44, 68, 0.08);
  --sidebar: 272px;
  --review: 350px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(circle at 80% -10%, rgba(103, 89, 216, .1), transparent 30%),
    var(--canvas);
}

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

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

.topbar {
  height: 78px;
  padding: 0 22px;
  display: grid;
  grid-template-columns: var(--sidebar) 1fr auto;
  align-items: center;
  gap: 24px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand-block, .project-title-row, .topbar-actions, .stage-actions,
.action-cluster, .step-title-row, .review-title-row, .card-header,
.card-tools, .asset-card-head, .asset-actions { display: flex; align-items: center; }

.brand-block { gap: 11px; }
.brand-mark { width: 40px; height: 40px; color: var(--accent); }
.brand-mark svg { width: 100%; height: 100%; }
.brand-name { font-size: 17px; font-weight: 800; letter-spacing: .06em; }
.brand-subtitle { margin-top: 2px; font-size: 9px; color: var(--muted); letter-spacing: .17em; }
.mobile-menu { display: none !important; }

.project-heading { min-width: 0; }
.project-title-row { gap: 12px; }
.project-title-input {
  width: min(430px, 48vw);
  border: 0;
  padding: 2px 4px;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 720;
  border-bottom: 1px solid transparent;
}
.project-title-input:focus { outline: none; border-color: var(--accent); }
.project-meta { margin: 5px 0 0 4px; font-size: 12px; color: var(--muted); }
.save-state { font-size: 11px; color: var(--green); white-space: nowrap; }
.save-state i { display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.save-state.saving { color: var(--amber); }

.topbar-actions { justify-content: flex-end; gap: 9px; }
.mode-badge {
  padding: 6px 9px;
  border: 1px solid #d7daf2;
  background: #f5f4ff;
  color: #5549b8;
  border-radius: 6px;
  font-size: 11px;
  white-space: nowrap;
}
.mode-badge.live { color: var(--green); background: #ecf8f2; border-color: #cce9dc; }

.ghost-button, .primary-button, .ai-button, .text-button, .icon-button {
  border: 0;
  transition: transform .16s ease, background .16s ease, border-color .16s ease, opacity .16s ease;
}
.ghost-button, .primary-button, .ai-button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 680;
}
.ghost-button { color: var(--ink); background: var(--paper); border: 1px solid var(--line); }
.ghost-button:hover { border-color: #c8cdd9; background: #fafafd; }
.primary-button { color: #fff; background: var(--accent); box-shadow: 0 7px 18px rgba(255, 104, 73, .2); }
.primary-button:hover { background: var(--accent-dark); transform: translateY(-1px); }
.primary-button.compact { min-height: 34px; padding: 0 13px; }
.ai-button { display: inline-flex; align-items: center; gap: 7px; color: #fff; background: var(--indigo); }
.ai-button:hover { background: #5548c6; transform: translateY(-1px); }
.ai-button svg { width: 16px; fill: currentColor; }
.ai-button.loading { opacity: .72; pointer-events: none; }
.text-button { padding: 4px; color: var(--navy); background: transparent; font-size: 12px; }
.text-button:hover { color: var(--accent); }
.text-button.small { font-size: 11px; }
.icon-button { display: inline-grid; place-items: center; background: transparent; }
button:disabled { cursor: not-allowed; opacity: .48; transform: none !important; }

.workspace-grid {
  display: grid;
  grid-template-columns: var(--sidebar) minmax(540px, 1fr) var(--review);
  min-height: calc(100vh - 78px);
}

.workflow-sidebar {
  padding: 24px 18px 20px;
  background: #fafaf9;
  border-right: 1px solid var(--line);
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  overflow-y: auto;
  z-index: 10;
}

.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 7px 17px; }
.eyebrow, .step-kicker, .card-index { text-transform: uppercase; letter-spacing: .12em; }
.eyebrow { font-size: 9px; font-weight: 800; color: var(--accent); }
.sidebar-head h2 { margin: 5px 0 0; font-size: 17px; }
.progress-ring {
  --progress: 0deg;
  width: 45px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress), #e6e7eb 0);
  position: relative;
}
.progress-ring::before { content: ""; position: absolute; inset: 4px; border-radius: inherit; background: #fafaf9; }
.progress-ring span { position: relative; font-size: 10px; font-weight: 800; }

.step-list { display: grid; gap: 2px; }
.phase-label { padding: 13px 10px 5px; color: #9499a5; font-size: 9px; font-weight: 800; letter-spacing: .13em; }
.step-item {
  width: 100%;
  min-height: 49px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 27px 1fr 14px;
  align-items: center;
  gap: 9px;
  text-align: left;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  border-radius: 4px;
}
.step-item:hover { color: var(--ink); background: #f1f1f0; }
.step-item.active { color: var(--ink); background: #fff; border-left-color: var(--accent); box-shadow: 0 5px 16px rgba(31, 39, 61, .06); }
.step-item .num {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe2e8;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  background: #fff;
}
.step-item.active .num { color: #fff; border-color: var(--accent); background: var(--accent); }
.step-item .label strong { display: block; font-size: 12px; font-weight: 680; color: inherit; }
.step-item .label small { display: block; margin-top: 2px; font-size: 9px; color: #9b9faa; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #d9dce2; }
.status-dot.draft { background: var(--amber); }
.status-dot.confirmed, .status-dot.locked { background: var(--green); }
.status-dot.stale { background: var(--red); }
.sidebar-note { display: flex; gap: 9px; margin: 18px 6px 0; padding: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.6; }
.sidebar-note p { margin: 0; }
.note-icon { flex: 0 0 auto; width: 17px; height: 17px; display: grid; place-items: center; color: #fff; background: var(--navy); border-radius: 50%; font-weight: 800; }

.main-stage { padding: 34px clamp(22px, 3vw, 52px) 40px; min-width: 0; }
.stage-header { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.step-kicker { margin-bottom: 7px; font-size: 9px; font-weight: 800; color: var(--indigo); }
.step-title-row { gap: 12px; }
.step-number { font-size: 26px; font-weight: 300; color: var(--accent); }
.step-title-row h1 { margin: 0; font-family: "STSong", "Songti SC", serif; font-size: 30px; letter-spacing: .02em; }
.stage-header p { max-width: 660px; margin: 8px 0 0 45px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.stage-status { align-self: flex-start; padding: 7px 10px; border: 1px solid var(--line); color: var(--muted); background: #fff; border-radius: 5px; font-size: 11px; }
.stage-status.confirmed, .stage-status.locked { color: var(--green); border-color: #cce9dc; background: #eff9f4; }
.stage-status.stale, .stage-status.failed { color: var(--red); border-color: #f0c9cd; background: #fff3f3; }

.custom-panel { margin-bottom: 16px; }
.custom-panel:empty { display: none; }
.settings-grid, .rights-grid, .asset-form { display: grid; gap: 12px; }
.settings-grid { grid-template-columns: repeat(4, minmax(110px, 1fr)); }
.rights-grid { grid-template-columns: repeat(2, minmax(180px, 1fr)); }
.asset-form { grid-template-columns: 1fr 1fr; }
.example-import-card {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 16px;
  border: 1px solid #dcd9f5;
  border-radius: 7px;
  background: linear-gradient(100deg, #f5f3ff, #fff);
}
.example-import-card strong { display: block; margin-top: 3px; color: #3e376c; font-size: 13px; }
.example-import-card p { margin: 4px 0 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.example-import-card button { flex: 0 0 auto; }
.field, .check-field { display: grid; gap: 6px; }
.field span, .check-field > span { color: var(--muted); font-size: 10px; font-weight: 680; }
.field input, .field select, .field textarea {
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--ink);
  background: #fff;
}
.field textarea { height: 104px; padding-top: 9px; resize: vertical; font: 11px/1.65 "PingFang SC", "Microsoft YaHei", sans-serif; }
.global-negative-field { grid-column: 1 / -1; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(103, 89, 216, .13); border-color: var(--indigo); }
.budget-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid #dfe1f2;
  background: linear-gradient(100deg, #f7f6ff, #fff);
  border-radius: 6px;
}
.budget-card strong { font-size: 20px; color: var(--indigo); }
.budget-card p { margin: 2px 0 0; font-size: 10px; color: var(--muted); }
.budget-meter { height: 5px; border-radius: 4px; background: #e9e8f4; overflow: hidden; }
.budget-meter i { display: block; height: 100%; width: 62%; background: var(--indigo); }

.rights-banner {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-left: 3px solid var(--amber);
  color: #715022;
  background: #fff9ed;
  font-size: 11px;
  line-height: 1.6;
}
.rights-checks { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rights-check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 5px;
  font-size: 10px;
  line-height: 1.5;
}
.rights-check input { accent-color: var(--green); }

.work-card { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card-header { justify-content: space-between; min-height: 53px; padding: 0 17px; border-bottom: 1px solid var(--line); }
.card-header h3 { display: inline; margin: 0 0 0 8px; font-size: 13px; }
.card-index { color: var(--muted); font-size: 8px; font-weight: 800; }
.card-index.accent { color: var(--accent); }
.card-tools { gap: 9px; }
.editor {
  display: block;
  width: 100%;
  padding: 18px;
  resize: vertical;
  border: 0;
  color: #2f3747;
  background: #fff;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.8;
}
.editor:focus { outline: 2px solid rgba(103, 89, 216, .12); outline-offset: -2px; }
.input-editor { min-height: 150px; }
.result-editor { min-height: 260px; }
.editor-footer { display: flex; justify-content: space-between; gap: 14px; padding: 8px 17px; color: #9297a2; background: #fafafa; border-top: 1px solid #efeff2; font-size: 9px; }
.process-divider { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 15px 0; color: #959aa6; }
.process-divider span { height: 1px; background: #dddee3; }
.process-divider b { font-size: 9px; letter-spacing: .11em; }
.stage-actions { justify-content: space-between; gap: 16px; margin-top: 19px; }
.action-cluster { justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

.upload-button { position: relative; overflow: hidden; }
.upload-button input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.asset-source-required, .asset-blueprint-summary {
  padding: 14px 16px;
  border: 1px solid #dddfee;
  border-radius: 7px;
  background: linear-gradient(100deg, #f7f6ff, #fff);
}
.asset-source-required strong, .asset-blueprint-summary strong { display: block; margin: 3px 0 0; color: #40396e; font-size: 12px; }
.asset-source-required p, .asset-blueprint-summary p { margin: 5px 0 0; color: var(--muted); font-size: 10px; line-height: 1.6; }
.asset-blueprint-summary { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, .7fr); align-items: center; gap: 18px; margin-bottom: 10px; }
.character-batch-guide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: 10px; overflow: hidden; border: 1px solid #dddfee; border-radius: 7px; background: #dddfee; }
.character-batch-guide > div { padding: 13px 15px; background: #fff; }
.character-batch-guide > div:first-child { background: linear-gradient(110deg, #f3f1ff, #fff); }
.character-batch-guide strong { display: block; margin-top: 4px; color: #40396e; font-size: 11px; line-height: 1.5; }
.character-batch-guide p { margin: 5px 0 0; color: var(--muted); font-size: 9px; line-height: 1.6; }
.inherited-negative { margin-bottom: 10px; padding: 12px 15px; border-left: 3px solid #8174dd; background: #f7f6ff; }
.inherited-negative p { margin: 5px 0 3px; color: #4a456a; font-size: 10px; line-height: 1.65; }
.inherited-negative small { color: var(--muted); font-size: 9px; }
.asset-progress-track { height: 7px; overflow: hidden; border-radius: 10px; background: #e7e6f2; }
.asset-progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--indigo), var(--green)); }
.asset-blueprint-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 8px; margin-bottom: 12px; }
.asset-blueprint-item { min-width: 0; padding: 10px; display: grid; gap: 3px; text-align: left; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: #fff; }
.asset-blueprint-item:hover, .asset-blueprint-item.active { border-color: #aaa3e8; background: #f8f7ff; }
.asset-blueprint-item strong, .asset-blueprint-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-blueprint-item strong { font-size: 9px; }
.asset-blueprint-item span { color: var(--muted); font-size: 10px; }
.asset-blueprint-item i { justify-self: start; padding: 2px 5px; color: #9b6d22; background: #fff5dc; font-size: 8px; font-style: normal; }
.asset-blueprint-item i.created { color: var(--indigo); background: #efedff; }
.asset-blueprint-item i.locked { color: var(--green); background: #ebf7f1; }
.asset-prompt-field { grid-column: 1 / -1; }

.storyboard-guide { display: grid; gap: 10px; }
.storyboard-math { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; overflow: hidden; border: 1px solid #dedfed; border-radius: 7px; background: #dedfed; }
.storyboard-math > div { padding: 13px 15px; background: #fff; }
.storyboard-math span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; }
.storyboard-math strong { color: #3f376e; font-size: 17px; }
.storyboard-math label { display: flex; align-items: center; gap: 6px; color: var(--ink); font-size: 10px; }
.storyboard-math input { width: 70px; height: 30px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--ink); background: #fff; }
.storyboard-explainer { padding: 13px 15px; border-left: 3px solid var(--indigo); color: #4e5362; background: #f7f6ff; }
.storyboard-explainer strong { color: #40396e; font-size: 11px; }
.storyboard-explainer p { margin: 5px 0 0; font-size: 10px; line-height: 1.65; }
.storyboard-explainer b { color: var(--indigo); }

.asset-output { padding: 15px; border-bottom: 1px solid var(--line); background: #fafafe; }
.asset-output.hidden { display: none; }
.asset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.asset-card { border: 1px solid var(--line); background: #fff; }
.asset-preview { aspect-ratio: 16 / 10; display: grid; place-items: center; overflow: hidden; background: #ececf3; position: relative; }
.asset-preview img { width: 100%; height: 100%; object-fit: cover; }
.asset-preview .placeholder { padding: 20px; text-align: center; color: #858b99; font-size: 11px; line-height: 1.6; }
.asset-card-body { padding: 10px; }
.asset-card-head { justify-content: space-between; gap: 8px; }
.asset-card-head strong { font-size: 11px; }
.asset-card-head small { display: block; margin-top: 3px; color: #9297a2; font-size: 8px; }
.asset-card-body p { margin: 7px 0; min-height: 31px; color: var(--muted); font-size: 9px; line-height: 1.55; }
.asset-card-body .asset-negative { min-height: 0; padding-top: 7px; border-top: 1px dashed var(--line); color: #875b60; }
.asset-card-body .asset-negative strong { color: #71454b; }
.asset-state { padding: 3px 5px; background: #f2f2f5; color: var(--muted); font-size: 8px; }
.asset-state.locked { color: var(--green); background: #ebf7f1; }
.asset-actions { gap: 6px; flex-wrap: wrap; }
.asset-actions button { flex: 1; min-height: 28px; padding: 0 7px; border: 1px solid var(--line); color: var(--ink); background: #fff; font-size: 9px; }
.asset-actions button.danger-button { color: #a54852; border-color: #edced1; background: #fff8f8; }
.asset-actions button.danger-button:hover { color: #fff; border-color: #b84f59; background: #b84f59; }

.review-panel {
  padding: 24px 18px;
  border-left: 1px solid var(--line);
  background: rgba(252, 252, 253, .92);
  position: sticky;
  top: 78px;
  height: calc(100vh - 78px);
  overflow-y: auto;
}
.review-section { padding: 0 1px 19px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.review-section.grow { min-height: 150px; }
.review-title-row { justify-content: space-between; gap: 12px; }
.review-title-row h3 { margin: 0; font-size: 12px; }
.quality-score { color: var(--muted); font-size: 10px; }
.checklist { display: grid; gap: 8px; margin-top: 12px; }
.check-item { display: grid; grid-template-columns: 17px 1fr; gap: 8px; align-items: start; color: var(--muted); font-size: 10px; line-height: 1.45; }
.check-item button { width: 16px; height: 16px; padding: 0; border: 1px solid #d4d7de; color: transparent; background: #fff; }
.check-item.done { color: var(--ink); }
.check-item.done button { color: #fff; border-color: var(--green); background: var(--green); }
.context-list, .version-list { display: grid; gap: 7px; margin-top: 11px; }
.context-item, .version-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
}
.context-item strong, .version-item strong { display: block; font-size: 10px; }
.context-item p, .version-item p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.version-item { width: 100%; text-align: left; cursor: pointer; }
.version-item:hover { border-color: #c8cbd5; }
.version-meta { display: flex; justify-content: space-between; gap: 8px; color: #9a9faa; font-size: 8px; }
.muted { color: var(--muted); font-size: 9px; }
.empty-state { padding: 14px 4px; color: #a0a4ae; font-size: 10px; line-height: 1.6; }
.assistant-note { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 13px; color: #4b4674; background: #f2f0ff; border: 1px solid #dedafa; }
.assistant-avatar { width: 28px; height: 28px; display: grid; place-items: center; color: #fff; background: var(--indigo); font-size: 9px; font-weight: 800; }
.assistant-note strong { font-size: 10px; }
.assistant-note p { margin: 4px 0 0; font-size: 9px; line-height: 1.6; }

.toast-stack { position: fixed; right: 22px; bottom: 22px; z-index: 50; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 12px 15px; color: #fff; background: #25304a; box-shadow: 0 12px 28px rgba(22, 31, 51, .22); border-left: 3px solid var(--accent); font-size: 11px; line-height: 1.5; animation: toast-in .22s ease-out; }
.toast.success { border-left-color: #47c490; }
.toast.error { border-left-color: #ff5e68; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal { width: min(920px, calc(100vw - 40px)); padding: 0; border: 0; background: transparent; }
.modal::backdrop { background: rgba(18, 25, 42, .48); backdrop-filter: blur(3px); }
.modal-card { background: #fff; box-shadow: 0 24px 80px rgba(14, 22, 38, .28); }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-header h2 { margin: 5px 0 0; font-size: 18px; }
.close-button { width: 34px; height: 34px; color: var(--muted); font-size: 24px; }
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.compare-grid > div { min-width: 0; padding: 17px; background: #fff; }
.compare-grid h4 { margin: 0 0 9px; font-size: 11px; }
.compare-grid pre { min-height: 310px; max-height: 60vh; margin: 0; padding: 14px; overflow: auto; white-space: pre-wrap; word-break: break-word; color: #4c5363; background: #f7f7f9; font: 11px/1.7 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.small-modal { width: min(520px, calc(100vw - 40px)); }
.drop-zone { margin: 22px; min-height: 170px; display: grid; place-items: center; align-content: center; gap: 8px; border: 1px dashed #bdc1cd; color: var(--muted); background: #fafafd; cursor: pointer; }
.drop-zone strong { color: var(--ink); font-size: 13px; }
.drop-zone span { font-size: 10px; }
.drop-zone input { width: 180px; margin-top: 10px; font-size: 10px; }

@media (max-width: 1280px) {
  :root { --review: 300px; --sidebar: 248px; }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-actions .ghost-button { display: none; }
}

@media (max-width: 1050px) {
  .topbar { grid-template-columns: 218px 1fr auto; }
  .workspace-grid { grid-template-columns: 228px minmax(480px, 1fr); }
  .workflow-sidebar { width: 228px; }
  .review-panel { position: relative; top: auto; grid-column: 2; height: auto; border-left: 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .review-section { margin: 0; }
}

@media (max-width: 760px) {
  .topbar { height: 68px; padding: 0 13px; grid-template-columns: 1fr auto; }
  .mobile-menu { display: inline-grid !important; width: 30px; height: 30px; }
  .mobile-menu span { width: 17px; height: 1px; margin: 2px 0; background: var(--ink); }
  .brand-mark { display: none; }
  .brand-block { gap: 4px; }
  .brand-name { font-size: 14px; }
  .brand-subtitle { display: none; }
  .project-heading { display: none; }
  .topbar-actions .mode-badge, .topbar-actions .ghost-button { display: none; }
  .workspace-grid { display: block; min-height: calc(100vh - 68px); }
  .workflow-sidebar { position: fixed; top: 68px; left: 0; width: min(320px, 88vw); height: calc(100vh - 68px); transform: translateX(-102%); transition: transform .22s ease; box-shadow: 20px 0 45px rgba(16, 24, 43, .16); }
  .workflow-sidebar.open { transform: translateX(0); }
  .main-stage { padding: 24px 14px 28px; }
  .stage-header p { margin-left: 0; }
  .stage-status { display: none; }
  .settings-grid, .rights-grid, .asset-form, .rights-checks, .character-batch-guide { grid-template-columns: 1fr; }
  .example-import-card { align-items: flex-start; flex-direction: column; }
  .asset-blueprint-summary { grid-template-columns: 1fr; }
  .storyboard-math { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: 1fr; }
  .stage-actions { align-items: stretch; flex-direction: column; }
  .stage-actions > button { align-self: flex-start; }
  .action-cluster { display: grid; grid-template-columns: 1fr 1fr; }
  .action-cluster .primary-button { grid-column: 1 / -1; }
  .review-panel { display: block; padding: 22px 15px; }
  .review-section { margin-bottom: 18px; }
  .compare-grid { grid-template-columns: 1fr; }
  .compare-grid pre { min-height: 220px; }
}
