:root {
  color-scheme: dark;
  --bg: #050506;
  --bg-soft: #090a0d;
  --panel: #0d0f13;
  --panel-2: #12151a;
  --panel-3: rgba(255, 255, 255, 0.045);
  --field: #07080a;
  --text: #f4f0df;
  --text-strong: #fff7d1;
  --muted: #a8afba;
  --quiet: #767e8b;
  --line: rgba(235, 210, 126, 0.16);
  --line-strong: rgba(246, 214, 107, 0.44);
  --gold: #f6d66b;
  --gold-2: #d4af37;
  --gold-soft: rgba(246, 214, 107, 0.1);
  --ok: #8be6b2;
  --ok-soft: rgba(139, 230, 178, 0.13);
  --warn: #ffd08a;
  --warn-soft: rgba(255, 208, 138, 0.12);
  --bad: #ff8c8c;
  --bad-soft: rgba(255, 140, 140, 0.13);
  --info: #9dd9ff;
  --info-soft: rgba(157, 217, 255, 0.11);
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.48);
  --font: Inter, "Avenir Next", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    linear-gradient(180deg, #0a0c10 0%, #050506 50%, #020203 100%);
}

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

button {
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: 0.48;
}

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

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

html,
body,
.workspace-panel,
.rail,
.stepper,
.timing-table-shell,
.subtitle-table-shell,
.prompt-preview-text {
  scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.workspace-panel::-webkit-scrollbar,
.rail::-webkit-scrollbar,
.stepper::-webkit-scrollbar,
.timing-table-shell::-webkit-scrollbar,
.subtitle-table-shell::-webkit-scrollbar,
.prompt-preview-text::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.app-page,
.login-page {
  height: 100dvh;
  min-height: 0;
  padding: max(10px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.app-page {
  overflow: hidden;
}

.login-page {
  display: grid;
  place-items: center;
  overflow: auto;
}

.app-shell {
  width: min(1380px, 100%);
  height: 100%;
  min-height: 0;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: 8px;
}

.app-header {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 0 2px;
}

.app-brand,
.app-title-row {
  min-width: 0;
}

.app-title-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.app-title-row h1,
.login-card h1 {
  color: var(--text-strong);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}

.app-title-row h1::before,
.login-card h1::before {
  content: "F";
  display: inline-grid;
  width: 24px;
  height: 24px;
  margin-right: 8px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: linear-gradient(135deg, #fff4ad, var(--gold) 50%, var(--gold-2));
  color: #090806;
  font: 800 12px/1 var(--font);
  vertical-align: 4px;
}

.subcopy {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.app-header .ghost-button {
  min-height: 32px;
  padding: 7px 10px;
}

.global-error {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 140, 140, 0.28);
  border-radius: var(--radius);
  background: var(--bad-soft);
  color: #ffc3c3;
}

.stepper {
  height: 36px;
  min-height: 36px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.step-item {
  appearance: none;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  background: rgba(14, 17, 22, 0.94);
  color: var(--quiet);
  text-align: center;
  transition: background 120ms ease, color 120ms ease;
}

.step-index {
  display: inline-grid;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(246, 214, 107, 0.65);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.step-label {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-status {
  display: none !important;
}

.step-item.is-current,
.step-item.status-active {
  background: linear-gradient(180deg, rgba(38, 43, 48, 0.98), rgba(18, 22, 27, 0.98));
  color: var(--text-strong);
}

.step-item.is-current .step-index,
.step-item.status-active .step-index {
  background: linear-gradient(135deg, #fff4ad, var(--gold) 52%, var(--gold-2));
  color: #090806;
}

.step-item.status-complete:not(.is-current) .step-index {
  background: var(--ok-soft);
  color: var(--ok);
}

.step-item:not(:disabled):hover {
  background: rgba(28, 32, 39, 0.98);
  color: var(--text);
}

.step-item:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.route-card:focus-visible,
.timing-line-select:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(246, 214, 107, 0.45);
  outline-offset: 2px;
}

.shell-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 8px;
  overflow: hidden;
}

.shell-grid.has-no-rail {
  grid-template-columns: minmax(0, 1fr);
}

.panel {
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.workspace-panel {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 2px;
}

.rail {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(246, 214, 107, 0.05), transparent 28%),
    rgba(8, 9, 12, 0.98);
}

.step-action-rail {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 0 0;
}

.step-next-button {
  min-width: 168px;
  min-height: 34px;
}

.rail-section {
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(235, 210, 126, 0.1);
}

.rail-section:first-child,
.rail-section-head {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.rail .panel-title,
.rail .panel-title-small {
  color: var(--text-strong);
}

.rail .microcopy,
.rail .empty-state,
.rail .panel-body {
  color: var(--muted);
}

.rail-metrics {
  display: none;
}

.rail-metric,
.job-card {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(235, 210, 126, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.editor-card {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.editor-card.is-disabled {
  opacity: 0.62;
}

.section-head,
.line-row-head,
.asset-version-head,
.scene-map-card-head,
.job-head,
.render-version-head {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

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

.section-head.compact {
  margin-bottom: 6px;
}

.section-head .panel-body {
  margin-top: 3px;
}

.eyebrow {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1.1;
  text-transform: uppercase;
}

.panel-title {
  color: var(--text-strong);
  font-size: 17px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: 0;
}

.panel-title-small {
  font-size: 14px;
}

.panel-body,
.microcopy,
.empty-state,
.field,
.route-card span,
.line-source,
.timing-meta-row,
.subtitle-placement-meta {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.microcopy,
.warning-copy,
.empty-state {
  margin-top: 6px;
}

.warning-copy {
  color: var(--warn);
  font-size: 11px;
  line-height: 1.35;
}

.success-state {
  color: var(--ok);
  font-weight: 800;
}

.error-text {
  margin-top: 8px;
  color: var(--bad);
}

.inline-blocker,
.scene-blocker-list {
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 208, 138, 0.24);
  border-radius: var(--radius);
  background: var(--warn-soft);
  color: var(--warn);
}

.inline-blocker {
  display: grid;
  gap: 3px;
}

.inline-blocker span {
  color: var(--muted);
}

.dependency-details {
  margin-top: 5px;
}

.dependency-details summary,
.fallback-panel summary {
  cursor: pointer;
  color: var(--gold);
  font-size: 11px;
  font-weight: 850;
}

.capability-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
}

.field-stack {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.field {
  display: grid;
  gap: 5px;
  font-weight: 750;
}

.field input,
.field textarea,
.field select,
.line-text-input,
.timing-input,
.subtitle-input,
.login-card input,
textarea,
input,
select {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(235, 210, 126, 0.16);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--text);
}

.field textarea,
.text-area-input {
  min-height: 78px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(168, 175, 186, 0.54);
}

.primary-button,
.ghost-button,
.login-card button {
  display: inline-flex;
  min-height: 34px;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid rgba(235, 210, 126, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  font-weight: 850;
  line-height: 1.1;
  text-decoration: none;
}

.primary-button,
.login-card button[type="submit"] {
  border-color: rgba(246, 214, 107, 0.62);
  background: linear-gradient(135deg, #fff2a3, var(--gold) 54%, var(--gold-2));
  color: #080806;
}

.ghost-button:hover,
.primary-button:hover,
.login-card button:hover {
  border-color: rgba(246, 214, 107, 0.55);
}

.button-row {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.button-row.tight {
  margin-top: 6px;
  gap: 5px;
}

.icon-only-button {
  width: 31px;
  min-width: 31px;
  height: 31px;
  min-height: 31px;
  padding: 0;
  flex: 0 0 31px;
  font-size: 13px;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.upload-row input[type="file"] {
  min-width: 0;
  min-height: 34px;
  padding: 6px;
  border-style: dashed;
  background: rgba(0, 0, 0, 0.24);
}

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

.route-card,
.line-row,
.scene-map-card,
.scene-runtime-card,
.asset-version-card,
.render-version-card,
.placeholder-card,
.meta-card,
.assist-suggestion-card {
  min-width: 0;
  border: 1px solid rgba(235, 210, 126, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.route-card {
  min-height: 54px;
  display: grid;
  gap: 3px;
  padding: 10px;
  color: var(--text);
  text-align: left;
}

.route-card strong {
  color: var(--text-strong);
  font-size: 13px;
  line-height: 1.15;
}

.route-card.is-selected {
  border-color: rgba(246, 214, 107, 0.58);
  background: var(--gold-soft);
}

.preview-shell,
.scene-preview-shell,
.subtitle-placement-preview {
  margin-top: 8px;
}

.video-stage,
.slot-crop-frame,
.asset-version-preview,
.subtitle-placement-frame {
  overflow: hidden;
  border: 1px solid rgba(235, 210, 126, 0.14);
  border-radius: var(--radius);
  background: #020203;
}

.preview-video {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: contain;
  background: #020203;
}

.scene-preview-video {
  max-height: 360px;
}

.slot-crop-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 11px;
}

.slot-crop-editor-root {
  margin-top: 8px;
  display: flex;
  justify-content: center;
}

.slot-crop-frame {
  position: relative;
  width: min(100%, 420px);
  touch-action: none;
  user-select: none;
}

.slot-crop-frame-image {
  display: block;
  width: 100%;
  height: auto;
}

.slot-crop-selection {
  position: absolute;
  border: 2px solid #fff4ad;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.58),
    0 18px 36px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.slot-crop-selection:active {
  cursor: grabbing;
}

.slot-crop-handle {
  position: absolute;
  right: -10px;
  bottom: -10px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff4ad, var(--gold));
  cursor: nwse-resize;
}

.line-editor-list,
.scene-map-list,
.job-stack,
.render-version-list {
  margin-top: 8px;
  display: grid;
  gap: 7px;
}

.job-stack,
.render-version-list {
  padding: 0;
  list-style: none;
}

.line-row,
.scene-map-card,
.job-card,
.render-version-card {
  padding: 9px;
}

.line-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
}

.line-row-head {
  grid-column: 1 / -1;
}

.line-text-input {
  margin: 0;
}

.line-badge,
.line-source,
.meta-label,
.assist-provider,
.timing-table thead th,
.subtitle-table thead th {
  color: var(--quiet);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.line-badge {
  color: var(--gold);
}

.card-subtle,
.editor-card-nested,
.assist-panel,
.generation-panel,
.fallback-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.waveform-shell,
.timing-table-shell,
.subtitle-table-shell {
  border: 1px solid rgba(235, 210, 126, 0.11);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.032);
}

.card-subtle,
.editor-card-nested,
.assist-panel,
.generation-panel,
.fallback-panel {
  margin-top: 8px;
  padding: 0;
}

.scene-runtime-card {
  padding: 10px;
  box-shadow: inset 2px 0 0 rgba(246, 214, 107, 0.42);
}

.scene-subcard {
  margin-top: 8px;
}

.scene-map-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.scene-map-fields .field:last-of-type,
.scene-map-fields .assist-panel {
  grid-column: 1 / -1;
}

.scene-readiness-row {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.scene-readiness-badge,
.assist-provider-status,
.timing-status-badge,
.subtitle-source-badge,
.render-state-badge,
.job-status-pill,
.status-chip {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  border: 1px solid rgba(235, 210, 126, 0.14);
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
}

.scene-readiness-badge.is-complete,
.render-state-badge.is-current,
.timing-status-badge.status-timed,
.subtitle-source-badge.kind-auto,
.assist-provider-status.status-ready,
.job-status-pill.is-idle {
  border-color: rgba(139, 230, 178, 0.22);
  background: var(--ok-soft);
  color: var(--ok);
}

.scene-readiness-badge.is-blocked,
.render-state-badge.is-stale,
.render-state-badge.is-empty,
.timing-status-badge.status-untimed,
.subtitle-source-badge.kind-manual,
.assist-provider-status.status-not_configured {
  border-color: rgba(255, 140, 140, 0.22);
  background: var(--bad-soft);
  color: #ffb7b7;
}

.job-status-pill.is-running,
.job-card.status-running,
.job-card.status-queued {
  border-color: rgba(255, 208, 138, 0.32);
  background: var(--warn-soft);
  color: var(--warn);
}

.assist-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.assist-suggestion-card {
  margin-top: 8px;
  padding: 9px;
  background: rgba(157, 217, 255, 0.06);
}

.assist-suggestion-text,
.prompt-preview-text {
  margin-top: 6px;
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.prompt-preview-text {
  max-height: 260px;
  overflow: auto;
}

.asset-version-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 7px;
}

.asset-version-card {
  overflow: hidden;
}

.asset-version-card.is-active,
.render-version-card.is-current {
  border-color: rgba(246, 214, 107, 0.48);
  box-shadow: inset 0 0 0 1px rgba(246, 214, 107, 0.16);
}

.asset-version-preview {
  aspect-ratio: 9 / 12;
}

.asset-version-preview-video {
  aspect-ratio: 9 / 16;
}

.asset-version-preview img,
.asset-version-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #020203;
}

.asset-version-body {
  padding: 8px;
}

.asset-version-head {
  align-items: center;
}

.asset-version-head strong,
.job-card strong,
.route-card strong,
.render-version-head strong {
  color: var(--text-strong);
}

.asset-version-head span,
.job-card span,
.render-version-head span {
  color: var(--muted);
  font-size: 10px;
}

.meta-grid,
.render-summary-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(106px, 1fr));
  gap: 6px;
}

.meta-card {
  padding: 8px;
}

.meta-value {
  margin-top: 3px;
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 850;
  word-break: break-word;
}

.timing-progress-row,
.timing-meta-row,
.inline-action-row,
.subtitle-placement-meta {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 7px;
  align-items: center;
}

.waveform-shell {
  margin-top: 8px;
  padding: 8px;
  overflow: hidden;
}

.waveform-canvas {
  min-height: 124px;
}

.waveform-canvas-segment {
  min-height: 152px;
}

.timing-table-shell,
.subtitle-table-shell {
  margin-top: 8px;
  overflow: auto;
}

.timing-table,
.subtitle-table {
  width: 100%;
  border-collapse: collapse;
}

.timing-table {
  min-width: 680px;
}

.subtitle-table {
  min-width: 880px;
}

.timing-table th,
.timing-table td,
.subtitle-table th,
.subtitle-table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(235, 210, 126, 0.08);
  text-align: left;
  vertical-align: top;
}

.timing-table tbody tr:last-child td,
.subtitle-table tbody tr:last-child td {
  border-bottom: 0;
}

.timing-table tr.is-selected {
  background: rgba(246, 214, 107, 0.075);
}

.timing-line-select {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-weight: 900;
}

.timing-text-cell {
  min-width: 220px;
}

.subtitle-placement-frame {
  position: relative;
  width: min(100%, 230px);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  background:
    linear-gradient(180deg, rgba(246, 214, 107, 0.08), rgba(255, 255, 255, 0.03)),
    #08090c;
}

.subtitle-placement-seam {
  position: absolute;
  inset: calc(50% - 26px) 0 auto;
  height: 52px;
  background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.12), transparent);
}

.subtitle-placement-anchor {
  position: absolute;
  left: 50%;
  width: 84%;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.82);
  color: var(--text-strong);
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subtitle-placement-anchor.seam {
  top: 50%;
  transform: translate(-50%, -50%);
}

.subtitle-placement-anchor.lower {
  transform: translateX(-50%);
}

.subtitle-line-cell {
  min-width: 190px;
}

.subtitle-line-cell span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.subtitle-input-text {
  min-width: 190px;
}

.subtitle-action-grid {
  display: grid;
  min-width: 96px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.render-version-list {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.login-card {
  width: min(100%, 420px);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.014)),
    var(--panel);
  box-shadow: var(--shadow);
}

.login-card form {
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.login-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1180px) {
  .shell-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-page,
  .login-page {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .app-shell {
    gap: 7px;
  }

  .app-header {
    min-height: 40px;
  }

  .app-title-row h1 {
    font-size: 20px;
  }

  .app-title-row h1::before,
  .login-card h1::before {
    width: 21px;
    height: 21px;
    margin-right: 7px;
    font-size: 11px;
    vertical-align: 3px;
  }

  .subcopy {
    font-size: 10px;
  }

  .app-header .ghost-button {
    min-height: 30px;
    padding: 6px 8px;
    font-size: 11px;
  }

  .stepper {
    display: flex;
    gap: 5px;
    height: 32px;
    min-height: 32px;
    overflow-x: auto;
    border: 0;
    background: transparent;
    scroll-snap-type: x proximity;
  }

  .step-item {
    min-width: 88px;
    border: 1px solid var(--line);
    border-radius: 16px;
    scroll-snap-align: center;
  }

  .step-index {
    display: none;
  }

  .step-label {
    font-size: 10px;
  }

  .workspace-panel {
    padding: 3px 0 2px;
  }

  .step-action-rail {
    min-height: 42px;
    padding-top: 1px;
  }

  .step-next-button {
    width: 100%;
    min-height: 36px;
  }

  .panel-title {
    font-size: 16px;
  }

  .panel-title-small {
    font-size: 13px;
  }

  .route-grid,
  .scene-map-fields,
  .upload-row {
    grid-template-columns: 1fr;
  }

  .line-row {
    grid-template-columns: 1fr;
  }

  .button-row {
    align-items: center;
  }

  .button-row .primary-button,
  .button-row .ghost-button {
    flex: 0 1 auto;
  }

  .upload-row .primary-button,
  .upload-row .ghost-button {
    width: fit-content;
  }

  .preview-video {
    max-height: 330px;
  }

  .asset-version-grid {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  }

  .section-head,
  .scene-map-card-head,
  .job-head,
  .render-version-head,
  .timing-progress-row,
  .timing-meta-row,
  .inline-action-row,
  .subtitle-placement-meta {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
}
