/* Gemeinsames Dashboard-Studio für Vorhersage- und Umfrage-Overlays. */
.result-overlay-studio {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.result-overlay-settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.result-overlay-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.85rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.025);
}

.result-overlay-field label,
.result-overlay-layout-field legend {
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
}

.result-overlay-field select {
  width: 100%;
  min-height: 42px;
  padding: 0.62rem 2.15rem 0.62rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-sm);
  background-color: rgba(4, 7, 15, 0.68);
  color: var(--text-primary);
  color-scheme: dark;
  font: inherit;
  font-size: 0.82rem;
}

.result-overlay-field select:focus-visible {
  border-color: var(--accent);
  outline: 2px solid rgba(72, 233, 226, 0.18);
  outline-offset: 2px;
}

.result-overlay-field small,
.result-overlay-preview-panel > small,
.result-overlay-share-label small {
  color: var(--text-muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.result-overlay-layout-field {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.result-overlay-layout-field legend {
  margin-bottom: 0.45rem;
}

.result-overlay-segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.3rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.18);
}

.result-overlay-segmented-option {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.result-overlay-segmented-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.result-overlay-segmented-option > span {
  display: flex;
  min-height: 58px;
  flex-direction: column;
  justify-content: center;
  gap: 0.12rem;
  padding: 0.58rem 0.72rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius-md) - 4px);
  color: var(--text-secondary);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.result-overlay-segmented-option strong {
  color: inherit;
  font-size: 0.81rem;
}

.result-overlay-segmented-option small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 0.69rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-overlay-segmented-option:hover > span {
  border-color: rgba(72, 233, 226, 0.18);
  background: rgba(72, 233, 226, 0.04);
}

.result-overlay-segmented-option input:checked + span {
  border-color: rgba(72, 233, 226, 0.42);
  background:
    linear-gradient(135deg, rgba(72, 233, 226, 0.13), rgba(155, 123, 255, 0.09)),
    rgba(255, 255, 255, 0.025);
  color: var(--text-primary);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.055);
}

.result-overlay-segmented-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.result-overlay-preview-panel {
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid rgba(72, 233, 226, 0.14);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 0, rgba(72, 233, 226, 0.07), transparent 64%),
    rgba(0, 0, 0, 0.16);
}

.result-overlay-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.result-overlay-preview-heading > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 0.12rem;
}

.result-overlay-preview-heading strong {
  color: var(--text-primary);
  font-size: 0.78rem;
}

.result-overlay-preview-eyebrow {
  color: var(--accent);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.result-overlay-preview-scale {
  flex: 0 0 auto;
  padding: 0.24rem 0.45rem;
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.64rem;
  white-space: nowrap;
}

.result-overlay-preview-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 960 / 360;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  background-color: #080b12;
  background-image:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.035) 75%);
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.result-overlay-preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 960px;
  height: 360px;
  border: 0;
  background: transparent;
  transform: scale(var(--result-overlay-preview-scale, 0.5));
  transform-origin: top left;
}

.result-overlay-share-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.05rem;
}

.result-overlay-share-label > span {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.result-overlay-url-row {
  margin-top: 0.45rem;
}

.result-overlay-url-row input:focus-visible,
.result-overlay-url-row .btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.result-overlay-footnote {
  display: block;
  margin-top: 0.2rem;
}

@media (max-width: 620px) {
  .result-overlay-settings-grid {
    grid-template-columns: 1fr;
  }

  .result-overlay-preview-heading,
  .result-overlay-share-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  .result-overlay-segmented-option > span {
    padding-inline: 0.55rem;
  }

  .result-overlay-segmented-option small {
    white-space: normal;
  }
}
