.workspace-note {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 38px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  color: #8a867f;
  font-size: 12px;
}

.workspace-note strong {
  color: var(--ink);
}

.toast {
  position: fixed;
  z-index: 20;
  right: 24px;
  bottom: 24px;
  max-width: min(420px, calc(100vw - 48px));
  padding: 14px 18px;
  border-left: 6px solid var(--orange);
  color: #fff;
  background: var(--ink);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  font-size: 13px;
  line-height: 1.55;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-error {
  border-left-color: var(--red);
}

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

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

  .preview-card {
    max-width: 900px;
  }

  .preview-card[data-format="classic"] {
    max-width: 690px;
  }
}

@media (max-width: 920px) {
  .masthead {
    min-height: 94px;
    padding: 16px 22px;
  }

  .masthead::before {
    width: 68vw;
  }

  .brand-lockup {
    min-width: 240px;
  }

  .brand-kicker {
    font-size: 9px;
  }

  .brand-title {
    font-size: 34px;
  }

  .masthead-meta {
    display: none;
  }

  .app-shell {
    display: block;
  }

  .control-rail {
    border-right: 0;
  }

  .control-section,
  .export-section {
    padding-inline: max(20px, calc((100vw - 680px) / 2));
  }

  .workspace {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 36px 18px 30px;
  }

  .workspace-heading {
    display: block;
  }

  .workspace-heading p {
    margin-top: 14px;
    white-space: normal;
  }

  .preview-card,
  .preview-card[data-format="classic"] {
    max-width: none;
  }
}

@media (max-width: 560px) {
  body {
    background-size: 34px 34px;
  }

  .masthead {
    min-height: 82px;
    border-bottom-width: 5px;
  }

  .masthead::before {
    width: 92vw;
  }

  .brand-title {
    font-size: 30px;
  }

  .control-section,
  .export-section {
    padding: 24px 18px;
  }

  .section-heading {
    grid-template-columns: 44px 1fr;
    gap: 14px;
    margin-bottom: 18px;
  }

  .step-index {
    width: 44px;
    height: 44px;
  }

  .section-heading h1,
  .section-heading h2 {
    font-size: 22px;
  }

  .video-id-input {
    min-height: 178px;
  }

  .local-replace {
    align-items: stretch;
    flex-direction: column;
  }

  .local-replace .button {
    width: 100%;
  }

  .order-grid {
    gap: 5px;
  }

  .order-card-index {
    top: 3px;
    left: 3px;
    min-width: 23px;
    height: 20px;
    font-size: 9px;
  }

  .order-actions,
  .copy-controls {
    grid-template-columns: 1fr;
  }

  .nudge-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .nudge-reset {
    grid-column: 1 / -1;
  }

  .foreground-upload {
    align-items: stretch;
    flex-direction: column;
  }

  .foreground-upload small {
    max-width: none;
  }

  .foreground-buttons .button,
  .clear-foreground {
    flex: 1;
  }

  .workspace {
    padding-inline: 10px;
  }

  .workspace-heading h2 {
    font-size: 31px;
  }

  .preview-grid {
    gap: 20px;
  }

  .preview-card-head {
    min-height: 76px;
    padding: 13px 15px;
  }

  .preview-card-head strong {
    font-size: 36px;
  }

  .preview-card-head > div {
    gap: 10px;
  }

  .sync-badge {
    padding: 7px 9px;
  }

  .selection-overlay {
    border-width: 2px;
  }

  .selection-overlay span {
    top: 4px;
    left: 4px;
    min-width: 29px;
    height: 24px;
    font-size: 10px;
  }

  .preview-foot {
    min-height: 64px;
    padding: 10px 12px;
  }

  .preview-foot span {
    display: none;
  }

  .activate-format {
    width: 100%;
  }

  .workspace-note {
    justify-content: flex-start;
    margin-top: 24px;
  }
}

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