.bottom-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 14px;
}

.draft-panel,
.asset-panel {
  min-width: 0;
  padding-bottom: 18px;
}

.draft-list {
  display: grid;
  gap: 9px;
  padding: 14px 18px 0;
}

.draft-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px;
  text-align: left;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.draft-row.active {
  border-color: #92d7ef;
  background: #f2fbff;
}

.draft-row img {
  width: 76px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.draft-row span,
.draft-row strong,
.draft-row small {
  display: block;
  min-width: 0;
}

.draft-row strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.draft-row small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.draft-row em {
  color: var(--green);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.asset-matrix {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 14px 18px 0;
}

.asset-matrix article {
  min-height: 92px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}

.asset-matrix span,
.asset-matrix strong,
.asset-matrix small {
  display: block;
}

.asset-matrix span {
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
}

.asset-matrix strong {
  margin-top: 9px;
  color: var(--ink);
  font-size: 13px;
}

.asset-matrix small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.inspector {
  min-width: 0;
  display: grid;
  gap: 14px;
  align-content: start;
}

.approval-card,
.publish-card,
.project-card {
  padding-bottom: 18px;
}

.readiness {
  display: grid;
  place-items: center;
  width: 144px;
  height: 144px;
  margin: 18px auto;
  color: var(--green);
  border: 12px solid #e3f7ef;
  border-top-color: var(--green);
  border-radius: 50%;
  background: #ffffff;
}

.readiness strong {
  color: var(--ink);
  font-size: 36px;
  line-height: 1;
}

.readiness span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.check-list {
  display: grid;
  gap: 10px;
  padding: 0 18px;
}

.check-list label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  color: #344658;
  font-size: 13px;
  font-weight: 800;
}

.check-list input {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 14px 18px 0;
}

.platform-grid button {
  min-height: 66px;
  color: #304154;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.platform-grid button.active {
  color: #006e8c;
  border-color: #92d7ef;
  background: var(--cyan-soft);
}

.platform-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 15px;
}

.publish-note {
  margin: 12px 18px 0;
  padding: 12px;
  color: #4e6275;
  border-radius: var(--radius);
  background: #f7fafc;
  font-size: 12px;
  line-height: 1.7;
}

.asset-stack {
  display: grid;
  gap: 10px;
  padding: 14px 18px 0;
}

.asset-stack article {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.asset-stack [role="button"] {
  cursor: pointer;
}

.asset-stack [role="button"]:focus-visible {
  outline: 2px solid rgba(11, 121, 255, .48);
  outline-offset: 2px;
}

.asset-stack img {
  width: 62px;
  height: 46px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.asset-stack strong,
.asset-stack small {
  display: block;
  min-width: 0;
}

.asset-stack strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.asset-stack small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 60;
  max-width: calc(100vw - 32px);
  padding: 13px 15px;
  color: #064d3a;
  border: 1px solid #bae8d8;
  border-radius: var(--radius);
  background: #effff8;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: .22s ease;
  font-size: 13px;
  font-weight: 900;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

[data-icon] {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: currentColor;
}

[data-icon]::before,
[data-icon]::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

[data-icon="home"]::before { inset: 3px; border: 2px solid currentColor; border-top: 0; border-radius: 3px; }
[data-icon="home"]::after { left: 4px; top: 1px; width: 10px; height: 10px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
[data-icon="plus"]::before { left: 3px; right: 3px; top: 8px; height: 2px; background: currentColor; border-radius: 2px; }
[data-icon="plus"]::after { top: 3px; bottom: 3px; left: 8px; width: 2px; background: currentColor; border-radius: 2px; }
[data-icon="asset"]::before, [data-icon="video"]::before, [data-icon="doc"]::before, [data-icon="image"]::before { inset: 3px; border: 1.8px solid currentColor; border-radius: 3px; }
[data-icon="asset"]::after { left: 5px; right: 5px; top: 7px; height: 5px; border-top: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; }
[data-icon="video"]::after { right: 1px; top: 5px; border-left: 7px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent; }
[data-icon="calendar"]::before { inset: 3px; border: 1.8px solid currentColor; border-radius: 3px; }
[data-icon="calendar"]::after { left: 4px; right: 4px; top: 7px; height: 1.8px; background: currentColor; box-shadow: 0 4px 0 -1px currentColor; }
[data-icon="approve"]::before { inset: 3px; border: 1.8px solid currentColor; border-radius: 50%; }
[data-icon="approve"]::after { left: 5px; top: 8px; width: 8px; height: 4px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
[data-icon="chart"]::before { left: 4px; bottom: 3px; width: 3px; height: 8px; background: currentColor; box-shadow: 5px -4px 0 currentColor, 10px -7px 0 currentColor; border-radius: 2px; }
[data-icon="search"]::before { left: 2px; top: 2px; width: 10px; height: 10px; border: 2px solid currentColor; border-radius: 50%; }
[data-icon="search"]::after { right: 2px; bottom: 3px; width: 7px; height: 2px; background: currentColor; border-radius: 2px; transform: rotate(45deg); }
[data-icon="globe"]::before { inset: 3px; border: 1.8px solid currentColor; border-radius: 50%; }
[data-icon="globe"]::after { left: 3px; right: 3px; top: 8px; height: 1.8px; background: currentColor; box-shadow: 0 -4px 0 -1px currentColor, 0 4px 0 -1px currentColor; }
[data-icon="image"]::after { left: 5px; bottom: 4px; width: 8px; height: 8px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
[data-icon="stack"]::before { inset: 4px 3px 3px 4px; border: 1.8px solid currentColor; border-radius: 3px; box-shadow: 4px -4px 0 -1px #fff, 4px -4px 0 0 currentColor; }
[data-icon="upload"]::before { left: 8px; top: 3px; width: 2px; height: 10px; background: currentColor; border-radius: 2px; }
[data-icon="upload"]::after { left: 5px; top: 3px; width: 8px; height: 8px; border-left: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
[data-icon="play"]::before { left: 7px; top: 4px; border-left: 8px solid currentColor; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
[data-icon="arrow"]::before { right: 3px; top: 4px; width: 8px; height: 8px; border-right: 2px solid currentColor; border-top: 2px solid currentColor; transform: rotate(45deg); }
[data-icon="arrow"]::after { left: 3px; right: 5px; top: 8px; height: 2px; background: currentColor; border-radius: 2px; }

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

  .sidebar {
    padding: 18px 12px;
  }

  .brand {
    justify-content: center;
    padding-inline: 0;
  }

  body:has(.campaign-create-dialog[open]) .brand,
  body:has(.material-assets-page-dialog[open]) .brand,
  body:has(.script-center-dialog[open]) .brand,
  body:has(.platform-account-page-dialog[open]) .brand,
  body:has(.lead-review-page-dialog[open]) .brand {
    padding-inline: 0;
  }

  .brand img {
    width: 34px;
    height: 34px;
  }

  .brand .brand-logo-full {
    display: none;
  }

  .brand .brand-logo-emblem {
    display: block;
    width: 34px;
    height: 34px;
  }

  .brand strong,
  .brand span,
  .nav a span,
  .side-card {
    display: none;
  }

  .nav a {
    justify-content: center;
    padding: 0;
  }

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

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

@media (max-width: 1060px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-content: space-between;
  }

  .studio-body {
    grid-template-columns: 1fr;
  }

  .engine-lane,
  .source-dock {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bottom-grid,
  .inspector {
    grid-template-columns: 1fr;
  }
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: block;
    height: auto;
    padding: 12px 14px 0;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
  }

  .brand {
    justify-content: flex-start;
  }

  .brand img {
    width: min(174px, 54vw);
    height: auto;
  }

  .brand .brand-logo-full {
    display: block;
    width: min(174px, 54vw);
  }

  .brand .brand-logo-emblem {
    display: none;
  }

  .brand span {
    display: block;
  }

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

  .brand small {
    font-size: 11px;
  }

  .nav {
    display: flex;
    gap: 6px;
    margin: 10px -14px 0;
    padding: 0 14px 10px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav a {
    flex: 0 0 auto;
    width: auto;
    min-width: max-content;
    height: 36px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .nav a span {
    display: inline;
  }

  .workspace {
    padding: 16px 14px 24px;
  }

  .title-block h1 {
    font-size: 26px;
  }

  .status-row,
  .source-dock,
  .engine-lane,
  .scene-strip,
  .render-console,
  .platform-grid,
  .asset-matrix {
    grid-template-columns: 1fr;
  }

  .status-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .status-row article {
    padding: 11px 12px;
  }

  .status-row strong {
    font-size: 20px;
  }

  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .avatar {
    display: none;
  }

  .studio-body,
  .preview-stage,
  .source-dock {
    padding: 12px;
  }

  .section-title {
    display: grid;
  }

  #engineHint {
    width: max-content;
  }

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

  .quality-score {
    margin-left: 0;
  }

  .frame-overlay {
    align-items: flex-start;
    flex-direction: column;
  }

  .draft-row {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .draft-row em {
    grid-column: 2;
  }

  .toast {
    right: 14px;
    bottom: 14px;
  }
}
