.upload-fit-panel {
  display: grid;
  gap: 14px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.poster-form > .upload-fit-panel:first-child {
  margin-top: 0;
  margin-bottom: 16px;
  border-color: #9fdad7;
  background: #f4fbfa;
}

.upload-fit-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.upload-fit-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.orientation-options {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2f5;
}

.orientation-option {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 46px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.orientation-option span {
  overflow: hidden;
  color: inherit;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orientation-option small {
  color: inherit;
  font-size: 11px;
  font-weight: 700;
}

.orientation-option.active {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 2px var(--teal), 0 1px 5px #16243424;
}

.upload-fit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, max-content);
  gap: 12px;
  align-items: end;
}

.upload-fit-grid input[type="color"] {
  min-height: 44px;
  padding: 5px;
}

.upload-title-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #7ec9c4;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  white-space: nowrap;
}

.upload-title-toggle input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.upload-title-toggle span {
  font-size: 14px;
  font-weight: 800;
}

.upload-fit-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.preview-frame.orientation-framed {
  background: #111827;
}

#previewImageTitle {
  font-size: clamp(30px, 9.5cqw, 72px);
  line-height: 1.08;
}

.preview-frame[data-frame-orientation="landscape"] {
  aspect-ratio: 16 / 9;
}

.preview-frame[data-frame-orientation="portrait"] {
  aspect-ratio: 3 / 4;
}

.preview-frame[data-frame-orientation="square"] {
  aspect-ratio: 1 / 1;
}

.display-screen.active {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 68px);
  background: #0d1117;
}

.display-screen .did-stage {
  display: grid;
  grid-template-rows: 1fr;
  width: min(100%, calc((100vh - 68px) * 16 / 9));
  max-height: calc(100vh - 68px);
  min-height: 0;
  aspect-ratio: 16 / 9;
  background: #000;
}

.display-screen .did-header,
.display-screen .did-footer {
  display: none;
}

.display-screen .slide-area {
  min-height: 0;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: #000;
}

.display-screen .slide-area img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 680px) {
  .orientation-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .upload-fit-grid {
    grid-template-columns: 1fr;
  }

  .display-screen .did-stage {
    width: 100%;
  }
}
