:root {
  --ink: #151b1f;
  --muted: #6d747c;
  --soft: #eef1f3;
  --paper: #fafafa;
  --panel: #ffffff;
  --line: #dfe4e8;
  --line-strong: #cbd3d9;
  --sidebar: #111b20;
  --sidebar-2: #1b2a31;
  --cyan: #1977d2;
  --cyan-soft: #e7f2ff;
  --green: #238a53;
  --green-soft: #e7f5ed;
  --amber: #c77b13;
  --amber-soft: #fff0d9;
  --danger: #b85a4a;
  --shadow: 0 14px 38px rgba(31, 38, 45, 0.08);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #e9edf1;
  color: var(--ink);
}

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

button {
  cursor: pointer;
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  min-height: 1px !important;
  height: 1px;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(37, 55, 63, 0.58), rgba(11, 18, 22, 0.4)),
    var(--sidebar);
  color: #f4f7f8;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(116, 196, 255, 0.85);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #99d5ff;
  font-weight: 700;
  position: relative;
}

.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  width: 28px;
  border-top: 1px solid #7bc9ff;
  transform: rotate(-42deg);
}

.brand-mark::after {
  transform: rotate(42deg);
  opacity: 0.55;
}

.brand strong,
.brand span {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 15px;
}

.brand span {
  margin-top: 3px;
  color: #a9b5bb;
  font-size: 12px;
}

.nav-label {
  margin: 0 0 10px;
  color: #9aa7ad;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 700;
}

.workflow {
  position: relative;
}

.workflow::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 54px;
  bottom: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.24);
}

.workflow-step {
  width: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 8px;
  padding: 10px 9px 10px 5px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  min-height: 64px;
}

.workflow-step.active {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset -3px 0 0 #32a8ff;
}

.step-number {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: #15262d;
  color: #f6fafb;
  font-size: 13px;
  font-weight: 700;
}

.workflow-step.complete .step-number {
  background: #43a969;
  border-color: #43a969;
}

.workflow-step.active .step-number {
  background: #1d8fe7;
  border-color: #1d8fe7;
}

.workflow-step strong,
.workflow-step small {
  display: block;
}

.workflow-step strong {
  font-size: 13px;
  line-height: 1.2;
}

.workflow-step small {
  margin-top: 5px;
  color: #adb8bd;
  font-size: 12px;
  line-height: 1.2;
}

.step-check {
  color: #62d58e;
  font-weight: 800;
}

.project-nav {
  margin-top: auto;
}

.project-nav button {
  width: 100%;
  border: 0;
  color: #d9e3e8;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 6px 4px;
  border-radius: 6px;
  font-size: 13px;
}

.project-nav button:hover {
  background: rgba(255, 255, 255, 0.08);
}

.project-nav button.selected {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 3px 0 0 #32a8ff;
}

.storage {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  padding: 12px;
  display: grid;
  gap: 8px;
  font-size: 12px;
  color: #c8d1d6;
}

.storage strong {
  color: #fff;
}

.meter {
  height: 6px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  overflow: hidden;
}

.meter span {
  display: block;
  width: 24%;
  height: 100%;
  border-radius: inherit;
  background: #eef6f9;
}

.workspace {
  padding: 8px;
  min-width: 0;
}

.topbar,
.active-stage,
.summary-strip,
.group,
.side-panel,
.storyboard-preview,
.upload-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
}

.topbar {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
}

.title-field {
  display: flex;
  align-items: center;
  gap: 7px;
}

.title-field input {
  min-width: 230px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  padding: 7px 0;
}

.top-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

select,
input:not(.title-field input) {
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fbfbfb;
  color: var(--ink);
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fbfbfb;
  color: var(--ink);
  padding: 10px;
  resize: vertical;
  font: inherit;
  line-height: 1.45;
}

.topbar select {
  min-width: 108px;
}

.save-state {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #697179;
  font-size: 13px;
}

.status-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  border: 1px solid currentColor;
}

.status-dot.ready {
  color: var(--green);
}

.status-dot.warn {
  color: var(--amber);
}

.status-dot.ready::before,
.status-dot.warn::before {
  content: "✓";
  font-size: 12px;
  font-weight: 800;
}

.status-dot.warn::before {
  content: "!";
}

.icon-button {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 0;
  color: var(--muted);
  background: transparent;
  display: inline-grid;
  place-items: center;
}

.icon-button:hover {
  background: var(--soft);
}

.active-stage {
  display: flex;
  margin-top: 8px;
  padding: 14px 16px;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.stage-copy {
  display: grid;
  gap: 4px;
}

#stagePill {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.stage-copy h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.18;
  letter-spacing: 0;
}

.stage-copy p {
  margin: 0;
  max-width: 740px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.stage-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.secondary-button,
.link-button,
.prompt-toggle {
  border-radius: 6px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  font-size: 13px;
  font-weight: 720;
}

.primary-button {
  border: 1px solid #0b67c5;
  color: #fff;
  background: linear-gradient(180deg, #197ddc, #1168c3);
  box-shadow: 0 8px 18px rgba(18, 107, 195, 0.2);
}

.primary-button:hover {
  filter: brightness(1.03);
}

button:disabled,
.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.58;
  filter: grayscale(0.18);
  box-shadow: none;
}

.is-analyzing .storyboard-builder,
.is-analyzing .provider-panel {
  opacity: 0.72;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: #2f3a42;
  background: #fff;
}

.secondary-button:hover {
  border-color: #aac2d7;
  background: #f9fcff;
}

.wide {
  width: 100%;
}

.wide small {
  display: block;
  font-size: 11px;
  font-weight: 650;
  opacity: 0.9;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  gap: 10px;
  margin-top: 8px;
  align-items: start;
}

.main-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.main-column > * {
  min-width: 0;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  gap: 9px;
  padding: 16px;
  align-items: start;
}

.summary-strip article {
  min-width: 0;
  min-height: 0;
  height: 94px;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fafb);
}

.summary-strip small,
.summary-strip em {
  display: block;
  font-style: normal;
}

.summary-strip small {
  color: var(--muted);
  font-size: 11px;
}

.summary-strip strong {
  display: block;
  margin: 2px 0;
  font-size: 22px;
  line-height: 1;
}

.summary-strip .icon {
  width: 22px;
  height: 22px;
}

.summary-strip em {
  color: var(--green);
  font-size: 12px;
}

.summary-strip .warn {
  color: var(--amber);
}

.upload-panel {
  padding: 14px;
}

.drop-zone {
  min-height: 120px;
  border: 1px dashed #b5c2cc;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: #f7fafc;
}

.drop-zone.live-intake {
  display: grid;
  align-items: stretch;
  gap: 14px;
}

.drop-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.drop-heading > div {
  flex: 1;
}

.script-input-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.script-file-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 12px;
}

.field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.script-file-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}

.choose-file-button {
  flex: 0 0 auto;
  min-width: 122px;
}

.file-name {
  flex: 1 1 140px;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.script-textarea {
  min-width: 0;
}

textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  font-size: 13px;
  line-height: 1.45;
}

.drop-zone p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.accordion {
  display: grid;
  gap: 8px;
}

.group {
  overflow: clip;
}

.group-header {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 28px minmax(120px, 1fr) auto auto 22px;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-align: left;
}

.group.collapsed .group-header {
  border-bottom: 0;
}

.group-header strong {
  font-size: 16px;
}

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

.tag {
  min-width: 78px;
  justify-self: start;
  text-align: center;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 750;
}

.tag.ready {
  background: var(--green-soft);
  color: var(--green);
}

.tag.warn {
  background: var(--amber-soft);
  color: var(--amber);
}

.chevron {
  color: #6e7780;
  font-size: 18px;
}

.group.collapsed .group-body {
  display: none;
}

.group-body {
  padding: 12px 14px 14px;
}

.count-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.count-row label {
  color: var(--muted);
  min-width: 190px;
}

.asset-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
  gap: 10px;
}

.asset-slot {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.asset-slot strong {
  font-size: 13px;
}

.asset-slot small {
  color: var(--muted);
  font-size: 12px;
}

.upload-box {
  min-height: 42px;
  border: 1px dashed #b7c2ca;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  color: #6d7880;
  background: #fff;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.upload-box.ready {
  border-style: solid;
  color: var(--green);
  border-color: #b7dec8;
  background: #f7fcf9;
}

.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.scene-table {
  display: grid;
}

.table-row {
  display: grid;
  grid-template-columns: 36px minmax(148px, 1.25fr) minmax(108px, 0.8fr) minmax(132px, 1fr) 72px 104px 24px;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  color: #4e5962;
  font-size: 13px;
}

.table-row:last-child {
  border-bottom: 0;
}

.table-head {
  min-height: 32px;
  color: #5e6870;
  font-size: 11px;
  font-weight: 780;
}

.heading-cell {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #69717a;
  display: grid;
  gap: 4px;
}

.scene-ai {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #4f6c74;
  line-height: 1.35;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  border: 1px solid var(--line);
  background: #f7f8f9;
  color: #5c646d;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 11px;
  white-space: nowrap;
}

.review {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 12px;
  font-weight: 690;
}

.review.warn {
  color: var(--amber);
}

.review::before {
  content: "✓";
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
}

.review.warn::before {
  content: "!";
}

.more {
  border: 0;
  background: transparent;
  color: #222;
  font-size: 18px;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.voice-card,
.shot-row {
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.voice-card header,
.shot-row header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.voice-card strong,
.shot-row strong {
  font-size: 13px;
}

.voice-card select {
  width: 100%;
}

.voice-direction {
  margin: 0;
  color: #5d6b73;
  font-size: 12px;
  line-height: 1.45;
}

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

.right-column {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.side-panel {
  padding: 13px;
}

.side-panel h2 {
  margin: 0 0 12px;
  color: #65707a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 820;
}

.ai-analysis-panel {
  display: grid;
  gap: 9px;
}

.utility-panel {
  display: grid;
  gap: 10px;
}

.utility-facts {
  display: grid;
  gap: 7px;
  margin: 0;
}

.utility-facts div,
.utility-list div {
  display: grid;
  gap: 3px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.utility-facts div:last-child,
.utility-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.utility-facts dt,
.utility-list strong {
  color: #3e4850;
  font-size: 12px;
  font-weight: 800;
  text-transform: capitalize;
}

.utility-facts dd {
  margin: 0;
  color: #68737b;
  font-size: 12px;
}

.utility-note {
  margin: 0;
  color: #68737b;
  font-size: 12px;
  line-height: 1.45;
}

.utility-list {
  display: grid;
  gap: 7px;
}

.utility-list span,
.utility-list p {
  margin: 0;
  color: #68737b;
  font-size: 12px;
  line-height: 1.4;
}

.utility-actions {
  display: grid;
  gap: 8px;
}

.ai-analysis-panel p,
.ai-analysis-panel ul {
  margin: 0;
  color: #4f5f69;
  font-size: 12px;
  line-height: 1.5;
}

.ai-analysis-panel ul {
  padding-left: 17px;
}

.ai-analysis-panel li + li {
  margin-top: 5px;
}

.ai-status {
  justify-self: start;
  border-radius: 6px;
  padding: 4px 7px;
  background: #eef4f2;
  color: #34685b;
  font-size: 11px;
  font-weight: 760;
  text-transform: capitalize;
}

.ai-status.error {
  background: #fff5e7;
  color: #9b650e;
}

.ai-status.not_configured {
  background: #f1f3f5;
  color: #65707a;
}

.ai-meta,
.ai-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ai-meta span,
.ai-chip-row span {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 7px;
  background: #f8fafb;
  color: #5c6870;
  font-size: 11px;
  font-weight: 700;
}

.missing-list {
  display: grid;
  gap: 5px;
}

.agent-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.agent-list div {
  display: grid;
  gap: 3px;
  color: #68737b;
  font-size: 11px;
  line-height: 1.35;
}

.agent-list strong {
  color: #3e4850;
  font-size: 12px;
  text-transform: capitalize;
}

.missing-item {
  min-height: 28px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 7px;
  color: #4f5963;
  font-size: 12px;
}

.count-badge {
  min-width: 24px;
  height: 22px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  background: #eef1f3;
  color: #4b545c;
  font-weight: 780;
  font-size: 12px;
}

.link-button {
  width: 100%;
  margin-top: 10px;
  border: 0;
  background: transparent;
  color: var(--cyan);
  justify-content: space-between;
  padding: 0;
}

.storyboard-builder {
  display: grid;
  gap: 11px;
}

.storyboard-builder .primary-button.wide {
  min-height: 56px;
  flex-direction: column;
  gap: 2px;
  line-height: 1.1;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.segmented button,
.voice-source button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: #5a636c;
  font-size: 12px;
  font-weight: 720;
}

.segmented .selected,
.voice-source .selected {
  border-color: var(--cyan);
  background: #f2f8ff;
  color: #126bc7;
  box-shadow: inset 0 0 0 1px rgba(25, 119, 210, 0.16);
}

.context-note {
  margin: 2px 0 0;
  min-height: 62px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #6f7880;
  background: #fbfcfd;
  font-size: 12px;
  line-height: 1.45;
}

.provider-panel {
  display: grid;
  gap: 10px;
}

.voice-source {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.voice-source button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.prompt-toggle {
  width: 100%;
  justify-content: space-between;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5d6872;
}

#promptPreview {
  max-height: 170px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #111b20;
  color: #dce8ee;
  font-size: 11px;
  line-height: 1.5;
}

.run-status {
  margin: 0;
  padding: 9px 10px;
  border-radius: 7px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
  font-weight: 740;
}

.run-status.warn {
  background: #fff5e7;
  color: #9b650e;
}

.storyboard-preview {
  margin-top: 8px;
  padding: 12px 14px;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.preview-header strong {
  font-size: 12px;
  color: #5c6872;
  text-transform: uppercase;
  letter-spacing: 0.035em;
}

.preview-header span {
  margin-left: 8px;
  padding: 4px 7px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: #6e7780;
  font-size: 11px;
}

.frame-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(148px, 1fr);
  gap: 11px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.story-frame {
  min-width: 148px;
  display: grid;
  gap: 7px;
}

.frame-image {
  aspect-ratio: 16 / 10;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid #b7bec5;
  position: relative;
  background: #d8dee3;
}

.frame-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1);
}

.frame-index {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: rgba(12, 17, 22, 0.82);
  color: #fff;
  font-weight: 820;
  font-size: 12px;
}

.frame-meta {
  display: grid;
  gap: 3px;
  color: #606870;
  font-size: 11px;
}

.frame-meta strong {
  color: #39414a;
  font-size: 12px;
}

.frame-provider {
  color: #7a838b;
  font-size: 10px;
  font-weight: 740;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.ref-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.ref-state.ok {
  color: var(--green);
}

.ref-state.warn {
  color: var(--amber);
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  flex: 0 0 auto;
  color: currentColor;
}

.icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.icon.warning {
  color: var(--amber);
}

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

  .brand div:not(.brand-mark),
  .workflow-step span:nth-child(2),
  .step-check,
  .project-nav,
  .storage,
  .nav-label {
    display: none;
  }

  .workflow::before {
    display: none;
  }

  .workflow-step {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 52px;
  }

  .content-grid {
    grid-template-columns: 1fr;
  }

  .right-column {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1380px) {
  .summary-strip {
    grid-template-columns: repeat(4, minmax(132px, 1fr));
  }

  .group-header {
    grid-template-columns: 28px minmax(120px, 1fr) auto 22px;
  }

  .group-header .meta {
    display: none;
  }
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    min-height: auto;
    flex-direction: row;
    overflow-x: auto;
    max-width: 100vw;
    gap: 10px;
  }

  .brand {
    flex: 0 0 46px;
    min-width: 46px;
    border-bottom: 0;
    padding-bottom: 0;
  }

  .workflow {
    display: flex;
    flex: 0 0 auto;
    min-width: 0;
  }

  .workflow-step {
    flex: 0 0 52px;
    width: 52px;
  }

  .workspace {
    padding: 8px;
  }

  .topbar,
  .active-stage {
    align-items: stretch;
    flex-direction: column;
  }

  .drop-heading,
  .script-input-grid {
    grid-template-columns: 1fr;
  }

  .drop-heading {
    display: grid;
  }

  .top-controls,
  .stage-actions {
    justify-content: start;
  }

  .summary-strip,
  .right-column {
    grid-template-columns: 1fr;
  }

  .summary-strip,
  .accordion,
  .group,
  .group-body,
  .scene-table,
  .storyboard-preview {
    min-width: 0;
    max-width: 100%;
  }

  .scene-table {
    overflow-x: auto;
  }

  .table-row {
    min-width: 0;
    grid-template-columns: 34px minmax(0, 1fr) 92px;
    gap: 8px;
  }

  .heading-cell {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .table-row span:nth-child(3),
  .table-row span:nth-child(4),
  .table-row span:nth-child(5),
  .table-row span:nth-child(7) {
    display: none;
  }

  .group-header {
    grid-template-columns: 28px minmax(0, 1fr) auto 22px;
  }

  .group-header .meta {
    display: none;
  }
}
