/* ==========================================================================
   UNICUM Studi-Avatar – Styles
   Eigenständig: keine Abhängigkeit von UNICUM-CSS, keine Webfonts.
   ========================================================================== */
:root {
  --sa-red: #DE2234;
  --sa-red-dark: #B81A2A;
  --sa-petrol: #1C909F;
  --sa-petrol-dark: #0F6E7A;
  --sa-mint: #D2E4E6;
  --sa-mint-soft: #EAF3F4;
  --sa-coral: #F24B4B;
  --sa-bg: #F8F8F8;
  --sa-text: #111111;
  --sa-muted: #4F565E;
  --sa-line: #E2E6E8;
  --sa-white: #FFFFFF;
  --sa-radius: 16px;
  --sa-radius-lg: 22px;
  --sa-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --sa-shadow: 0 1px 2px rgba(17, 17, 17, 0.06), 0 8px 22px rgba(17, 17, 17, 0.08);
  --sa-dots: radial-gradient(rgba(28, 144, 159, 0.2) 1.2px, transparent 1.7px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--sa-font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--sa-text);
  background: transparent; /* im iframe scheint die Artikelseite durch die runden Ecken */
  overflow: hidden; /* gescrollt wird innerhalb der App */
}

html:not(.sa-embedded) body {
  background: var(--sa-white);
}

button,
input {
  font: inherit;
}

.sa-sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------- Rahmen */
.sa-app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 960px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: var(--sa-bg);
  border-radius: var(--sa-radius-lg);
  overflow: hidden;
}

@media (min-width: 720px) and (min-height: 960px) {
  html:not(.sa-embedded) .sa-app {
    height: 900px;
    margin-top: calc(50vh - 450px);
  }
}

@media (max-width: 719px) {
  html:not(.sa-embedded) .sa-app {
    border-radius: 0;
  }
}

.sa-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 56px;
  padding: 0 20px;
  background: var(--sa-white);
  border-bottom: 1px solid var(--sa-line);
}

.sa-top__logo {
  display: block;
  width: auto;
  height: 20px;
}

.sa-top__title {
  padding-left: 12px;
  border-left: 2px solid var(--sa-line);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
}

.sa-top__step {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--sa-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sa-progress {
  flex: none;
  height: 4px;
  background: var(--sa-line);
}

.sa-progress__bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sa-red);
  border-radius: 0 4px 4px 0;
  transition: width 0.35s ease;
}

.sa-main {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sa-screen {
  flex: 1 1 auto;
  min-height: 0;
}

.sa-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: auto;
  padding: 24px;
  max-width: 420px;
  text-align: center;
  font-weight: 600;
  color: var(--sa-muted);
}

.sa-loading p {
  margin: 0;
}

.sa-spinner {
  width: 34px;
  height: 34px;
  border: 4px solid var(--sa-mint);
  border-top-color: var(--sa-red);
  border-radius: 50%;
  animation: sa-spin 0.8s linear infinite;
}

/* -------------------------------------------------------------- Buttons */
.sa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
}

.sa-btn:active {
  transform: translateY(1px);
}

.sa-btn:focus-visible,
.sa-direct a:focus-visible,
.sa-dialog__close:focus-visible {
  outline: 3px solid var(--sa-petrol-dark);
  outline-offset: 3px;
}

.sa-btn--primary {
  background: var(--sa-red);
  color: var(--sa-white);
}

.sa-btn--primary:hover {
  background: var(--sa-red-dark);
}

.sa-btn--ghost {
  background: var(--sa-white);
  color: var(--sa-text);
  border-color: #CDD3D6;
}

.sa-btn--ghost:hover {
  border-color: var(--sa-text);
}

.sa-btn--light {
  background: var(--sa-white);
  color: var(--sa-red-dark);
}

.sa-btn--light:hover {
  background: var(--sa-mint);
}

.sa-btn.is-disabled {
  background: #EBA3AA;
  cursor: not-allowed;
}

.sa-btn.is-busy {
  cursor: progress;
  opacity: 0.85;
}

.sa-icon {
  flex: none;
  width: 20px;
  height: 20px;
}

.sa-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------------------------------------------------------- Startscreen */
.sa-start {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sa-start__art {
  flex: none;
  height: clamp(200px, 36vh, 330px);
  padding: 18px 16px 0;
  overflow: hidden;
  background-color: var(--sa-white);
  background-image: var(--sa-dots);
  background-size: 18px 18px;
  border-bottom: 1px solid var(--sa-line);
}

.sa-fan {
  position: relative;
  height: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.sa-fan__item {
  position: absolute;
  bottom: -2%;
  left: 50%;
  height: 96%;
  aspect-ratio: 400 / 480;
  transform-origin: 50% 100%;
}

.sa-fan__item svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sa-fan__item--1 {
  z-index: 1;
  transform: translateX(-104%) rotate(-7deg) scale(0.8);
}

.sa-fan__item--2 {
  z-index: 2;
  transform: translateX(-50%);
}

.sa-fan__item--3 {
  z-index: 1;
  transform: translateX(4%) rotate(7deg) scale(0.8);
}

.sa-start__copy {
  padding: 22px 20px 28px;
}

.sa-h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 2.6vw + 18px, 44px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -0.02em;
}

.sa-h1:focus,
.sa-q:focus {
  outline: none;
}

.sa-lead {
  margin: 0 0 22px;
  max-width: 46ch;
  font-size: 17px;
  color: var(--sa-muted);
}

.sa-start .sa-btn {
  flex: 1 1 200px;
}

.sa-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--sa-muted);
}

.sa-hint .sa-icon {
  width: 18px;
  height: 18px;
  color: var(--sa-petrol-dark);
}

.sa-direct {
  margin: 10px 0 0;
  font-size: 14px;
}

.sa-direct a {
  color: var(--sa-petrol-dark);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------- Wizard */
.sa-wizard {
  display: flex;
  flex-direction: column;
}

.sa-stage {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  height: clamp(170px, 31vh, 300px);
  padding: 10px 12px;
  background-color: var(--sa-white);
  background-image: var(--sa-dots);
  background-size: 18px 18px;
  border-bottom: 1px solid var(--sa-line);
}

.sa-stage__avatar {
  width: 100%;
  height: 100%;
}

.sa-stage__avatar svg,
.sa-result__avatar svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sa-stage__avatar.is-pop svg {
  animation: sa-pop 0.3s ease-out;
}

.sa-panel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.sa-panel__scroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 18px 16px 22px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.sa-step.is-entering {
  animation: sa-fade-in 0.28s ease both;
}

.sa-eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sa-petrol-dark);
}

.sa-q {
  margin: 0 0 6px;
  font-size: clamp(21px, 1.4vw + 15px, 28px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.sa-qhint {
  margin: 0;
  font-size: 15px;
  color: var(--sa-muted);
}

.sa-nav {
  flex: none;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--sa-white);
  border-top: 1px solid var(--sa-line);
}

.sa-nav__row {
  display: flex;
  gap: 10px;
}

.sa-nav__row .sa-btn--ghost {
  flex: none;
  padding: 0 18px;
}

.sa-nav__row .sa-btn--primary {
  flex: 1 1 auto;
}

.sa-nav__hint {
  display: none;
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
  color: var(--sa-red-dark);
}

.sa-nav__hint.is-visible {
  display: block;
}

/* Zusatztext der gewählten Kachel, z. B. „LinkedIn ist bereits geöffnet“ */
.sa-nav__comment {
  display: none;
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--sa-muted);
}

.sa-nav__comment strong {
  color: var(--sa-petrol-dark);
}

.sa-nav__comment.is-visible {
  display: block;
}

/* "Mehr anzeigen" unter großen Auswahlgruppen */
.sa-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  padding: 0 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--sa-petrol-dark);
  background: transparent;
  border: 2px dashed #B9C7CA;
  border-radius: var(--sa-radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sa-more:hover {
  background: var(--sa-white);
  border-color: var(--sa-petrol);
}

.sa-more:focus-visible {
  outline: 3px solid var(--sa-petrol-dark);
  outline-offset: 2px;
}

.sa-more .sa-icon {
  width: 18px;
  height: 18px;
}

.sa-chips + .sa-more {
  width: auto;
  display: inline-flex;
}

/* --------------------------------------------------- Felder & Optionen */
.sa-field {
  min-width: 0;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.sa-label {
  margin: 0 0 10px;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sa-label__opt {
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--sa-muted);
}

.sa-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

.sa-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.sa-field .sa-options {
  margin-top: 0;
}

/* Antwort-Cards mit Text: eine Spalte (lesbar); Frisuren-Kacheln: zwei Spalten */
.sa-options--tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sa-opt {
  position: relative;
  display: block;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sa-opt__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  min-height: 68px;
  padding: 10px 44px 10px 10px;
  background: var(--sa-white);
  border: 2px solid var(--sa-line);
  border-radius: var(--sa-radius);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.sa-opt:hover .sa-opt__inner {
  border-color: #B9C7CA;
}

.sa-input:checked + .sa-opt__inner {
  background: #F1F9FA;
  border-color: var(--sa-petrol);
  box-shadow: 0 0 0 3px rgba(28, 144, 159, 0.16);
}

.sa-input:focus-visible + .sa-opt__inner,
.sa-input:focus-visible + .sa-chip__inner {
  outline: 3px solid var(--sa-petrol-dark);
  outline-offset: 2px;
}

.sa-opt__media {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  background: var(--sa-mint-soft);
  border-radius: 12px;
}

.sa-opt__media svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sa-opt__media--head {
  width: 54px;
  height: 58px;
}

.sa-opt__media--torso {
  width: 72px;
  height: 56px;
}

.sa-opt__media--backdrop {
  width: 52px;
  height: 52px;
  background: transparent;
  border-radius: 50%;
}

.sa-emoji {
  font-size: 24px;
  line-height: 1;
}

.sa-opt__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sa-opt__title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
}

.sa-opt__text {
  font-size: 14px;
  line-height: 1.3;
  color: var(--sa-muted);
}

.sa-opt__check {
  position: absolute;
  top: 50%;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  color: transparent;
  background: var(--sa-white);
  border: 2px solid #C5CED1;
  border-radius: 50%;
  transition: background-color 0.15s, border-color 0.15s;
}

.sa-opt__check .sa-icon {
  width: 14px;
  height: 14px;
  stroke-width: 3;
}

.sa-input:checked + .sa-opt__inner .sa-opt__check {
  color: var(--sa-white);
  background: var(--sa-petrol-dark);
  border-color: var(--sa-petrol-dark);
}

/* Kacheln (Frisur, Outfit, Accessoire, Ort): Bild oben, Name darunter –
   so passen auch lange Wörter wie „Auslandssemester“ ohne Silbensalat */
.sa-opt--compact .sa-opt__inner {
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  min-height: 0;
  padding: 6px 6px 10px;
  text-align: center;
}

.sa-opt--compact .sa-opt__body {
  align-items: center;
}

.sa-opt--compact .sa-opt__title {
  font-size: 15px;
  overflow-wrap: break-word;
  hyphens: auto;
}

.sa-opt--compact .sa-opt__media--head {
  width: 100%;
  height: 84px;
}

.sa-opt--compact .sa-opt__media--torso {
  width: 100%;
  height: 68px;
}

.sa-opt--compact .sa-opt__media--backdrop {
  width: 68px;
  height: 68px;
}

/* Häkchen sitzt auf der Ecke des Vorschaubilds, damit der Text Platz hat */
.sa-opt--compact .sa-opt__check {
  top: 2px;
  right: auto;
  left: 2px;
  width: 20px;
  height: 20px;
  margin-top: 0;
}

.sa-opt--compact .sa-opt__check .sa-icon {
  width: 12px;
  height: 12px;
}

/* Farbfelder */
.sa-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sa-swatch {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sa-swatch__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: transparent;
  background: var(--swatch);
  border-radius: 50%;
  box-shadow: inset 0 -7px 0 var(--swatch-shade), 0 0 0 1px rgba(17, 17, 17, 0.14);
  transition: transform 0.15s, box-shadow 0.15s;
}

.sa-swatch:hover .sa-swatch__dot {
  transform: scale(1.06);
}

.sa-swatch__dot .sa-icon {
  width: 24px;
  height: 24px;
  padding: 4px;
  stroke-width: 3.2;
  border-radius: 50%;
}

.sa-input:checked + .sa-swatch__dot {
  color: var(--sa-white);
  box-shadow: inset 0 -7px 0 var(--swatch-shade), 0 0 0 3px var(--sa-white), 0 0 0 6px var(--sa-text);
}

.sa-input:checked + .sa-swatch__dot .sa-icon {
  background: rgba(17, 17, 17, 0.6);
}

.sa-input:focus-visible + .sa-swatch__dot {
  outline: 3px solid var(--sa-petrol-dark);
  outline-offset: 8px;
}

/* Körperbau: kleine Bild-Kacheln in einer Reihe (wie die Farbfelder) */
.sa-builds {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  max-width: 460px;
}

.sa-build {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sa-build__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 4px 8px;
  background: var(--sa-white);
  border: 2px solid var(--sa-line);
  border-radius: 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}

.sa-build:hover .sa-build__inner {
  border-color: #B9C7CA;
}

.sa-build__media {
  display: block;
  width: 100%;
  height: 56px;
  overflow: hidden;
  background: var(--sa-mint-soft);
  border-radius: 10px;
}

.sa-build__media svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sa-build__label {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}

.sa-build .sa-opt__check {
  top: 2px;
  right: auto;
  left: 2px;
  width: 20px;
  height: 20px;
  margin-top: 0;
}

.sa-build .sa-opt__check .sa-icon {
  width: 12px;
  height: 12px;
}

.sa-input:checked + .sa-build__inner {
  background: #F1F9FA;
  border-color: var(--sa-petrol);
  box-shadow: 0 0 0 3px rgba(28, 144, 159, 0.16);
}

.sa-input:checked + .sa-build__inner .sa-opt__check {
  color: var(--sa-white);
  background: var(--sa-petrol-dark);
  border-color: var(--sa-petrol-dark);
}

.sa-input:focus-visible + .sa-build__inner {
  outline: 3px solid var(--sa-petrol-dark);
  outline-offset: 2px;
}

.sa-example {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--sa-muted);
}

/* Extras */
.sa-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sa-chip {
  position: relative;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sa-chip__inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 16px 0 12px;
  font-size: 15px;
  font-weight: 700;
  background: var(--sa-white);
  border: 2px solid var(--sa-line);
  border-radius: 999px;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.sa-chip:hover .sa-chip__inner {
  border-color: #B9C7CA;
}

.sa-chip__inner .sa-icon {
  width: 16px;
  height: 16px;
}

.sa-chip .sa-icon--check {
  display: none;
}

.sa-input:checked + .sa-chip__inner {
  color: var(--sa-white);
  background: var(--sa-petrol-dark);
  border-color: var(--sa-petrol-dark);
}

.sa-input:checked + .sa-chip__inner .sa-icon--plus {
  display: none;
}

.sa-input:checked + .sa-chip__inner .sa-icon--check {
  display: block;
}

/* Akku-Symbol */
.sa-battery {
  position: relative;
  display: block;
  width: 32px;
  height: 18px;
  padding: 2px;
  border: 3px solid var(--sa-text);
  border-radius: 5px;
}

.sa-battery::after {
  content: "";
  position: absolute;
  top: 3px;
  right: -7px;
  width: 4px;
  height: 6px;
  background: var(--sa-text);
  border-radius: 0 2px 2px 0;
}

.sa-battery__fill {
  display: block;
  height: 100%;
  border-radius: 2px;
}

/* ------------------------------------------------------------- Ergebnis */
.sa-result {
  display: flex;
  flex-direction: column;
}

.sa-result__main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Bühne: größer als im Wizard, getönt in Typ-Farbe, Szene des Lieblingsorts */
.sa-result__stage {
  --sa-accent: var(--sa-petrol);
  --sa-scene: var(--sa-mint);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: clamp(300px, 52vh, 460px);
  padding: 14px 12px 10px;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--sa-white);
  border-bottom: 1px solid var(--sa-line);
}

.sa-result__stage::before,
.sa-result__stage::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.sa-result__stage::before {
  inset: 0;
  background-color: var(--sa-accent);
  opacity: 0.13;
}

.sa-result__stage::after {
  inset: 0;
  background-image: radial-gradient(circle at 50% 58%, var(--sa-scene) 0 34%, transparent 34.5%), var(--sa-dots);
  background-size: 100% 100%, 18px 18px;
  opacity: 0.55;
}

.sa-result__headline {
  flex: none;
  margin: 0;
  padding: 6px 14px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--sa-text);
  background: var(--sa-white);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(17, 17, 17, 0.08);
}

.sa-result__headline:focus {
  outline: none;
}

.sa-result__avatar {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  margin-top: 4px;
}

.sa-result.is-animated .sa-result__avatar {
  animation: sa-arrive 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sa-result__place {
  position: absolute;
  bottom: 10px;
  left: 12px;
  margin: 0;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sa-muted);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 999px;
}

.sa-result__body {
  padding: 20px 20px 28px;
}

.sa-result__type {
  margin: 0 0 10px;
}

.sa-result__bar {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--sa-white);
  border-top: 1px solid var(--sa-line);
}

.sa-result__bar .sa-btn--primary {
  flex: 1 1 auto;
}

.sa-result__bar .sa-btn--ghost {
  flex: none;
  padding: 0 18px;
}

/* Handy: Kurzformen der Button-Texte, Desktop: volle Texte */
.sa-long {
  display: none;
}

@media (min-width: 720px) {
  .sa-long {
    display: inline;
  }

  .sa-short {
    display: none;
  }
}

.sa-result__label {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--sa-petrol-dark);
}

.sa-result__name {
  display: block;
  font-size: clamp(26px, 2.2vw + 18px, 38px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-transform: uppercase;
  color: var(--sa-red);
}

.sa-result__desc {
  max-width: 54ch;
  margin: 0 0 20px;
  color: #2B3036;
}

.sa-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.sa-stat {
  display: grid;
  grid-template-areas: "emoji label" "value value" "bar bar";
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  padding: 12px 14px;
  background: var(--sa-white);
  border: 1px solid var(--sa-line);
  border-radius: 14px;
}

.sa-stat__emoji {
  grid-area: emoji;
  font-size: 18px;
  line-height: 1;
}

.sa-stat__label {
  grid-area: label;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--sa-muted);
  hyphens: auto;
  overflow-wrap: break-word;
}

@media (max-width: 359px) {
  .sa-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sa-stat__value {
  grid-area: value;
  margin: 6px 0 8px;
  font-size: 24px;
  font-weight: 900;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.sa-stat__value--text {
  font-size: 17px;
  font-weight: 800;
}

.sa-stat__bar {
  grid-area: bar;
  height: 8px;
  overflow: hidden;
  background: var(--sa-mint);
  border-radius: 4px;
}

.sa-stat__fill {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sa-petrol);
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.2, 0.7, 0.2, 1) 0.15s;
}

.sa-actions--result .sa-btn {
  flex: 1 1 260px;
}

.sa-privacy {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 24px;
  font-size: 13px;
  color: var(--sa-muted);
}

.sa-privacy .sa-icon {
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.sa-cta {
  position: relative;
  padding: 24px 22px;
  overflow: hidden;
  color: var(--sa-white);
  background: var(--sa-petrol-dark);
  border-radius: 20px;
}

.sa-cta::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -60px;
  width: 190px;
  height: 190px;
  background: rgba(210, 228, 230, 0.16);
  border-radius: 50%;
}

.sa-cta__title {
  position: relative;
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.sa-cta__text {
  position: relative;
  margin: 0 0 18px;
  max-width: 52ch;
}

.sa-cta__text:last-child {
  margin-bottom: 0;
}

.sa-cta .sa-btn {
  position: relative;
}

.sa-cta .sa-btn:focus-visible {
  outline-color: var(--sa-white);
}

.sa-debug {
  margin-top: 22px;
  padding: 10px 14px;
  font-size: 13px;
  background: var(--sa-white);
  border: 1px dashed #9AA4A8;
  border-radius: 12px;
}

.sa-debug summary {
  font-weight: 800;
  cursor: pointer;
}

.sa-debug table {
  width: 100%;
  border-collapse: collapse;
}

.sa-debug th,
.sa-debug td {
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid #EEF0F1;
}

/* --------------------------------------------------------------- Dialog */
.sa-dialog {
  width: min(92vw, 460px);
  max-width: none;
  max-height: 94vh;
  padding: 0;
  color: var(--sa-text);
  background: var(--sa-white);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.sa-dialog::backdrop {
  background: rgba(17, 17, 17, 0.6);
}

.sa-dialog.is-fallback {
  position: fixed;
  inset: 0;
  z-index: 10;
  height: fit-content;
  margin: auto;
}

.sa-dialog__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 94vh;
  padding: 20px;
  overflow-y: auto;
}

.sa-dialog__title {
  margin: 0;
  padding-right: 44px;
  font-size: 20px;
  font-weight: 800;
}

.sa-dialog__close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--sa-text);
  background: var(--sa-bg);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.sa-dialog__img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 54vh;
  margin: 0 auto;
  border-radius: 12px;
  box-shadow: var(--sa-shadow);
}

.sa-dialog__hint,
.sa-dialog__error {
  margin: 0;
  font-size: 14px;
  color: var(--sa-muted);
}

.sa-dialog__error {
  color: var(--sa-red-dark);
  font-weight: 700;
}

.sa-dialog__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.sa-dialog__actions .sa-btn {
  flex: 1 1 150px;
}

[hidden] {
  display: none !important;
}

@media (hover: hover) and (pointer: fine) {
  .sa-dialog__hint {
    display: none;
  }
}

/* -------------------------------------------- Tablet & Desktop (≥ 720 px) */
@media (min-width: 720px) {
  .sa-top {
    padding: 0 28px;
  }

  .sa-top__logo {
    height: 22px;
  }

  .sa-start {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    align-items: stretch;
  }

  .sa-start__art {
    height: auto;
    min-height: 100%;
    padding: 40px 12px 0;
    border-right: 1px solid var(--sa-line);
    border-bottom: 0;
  }

  .sa-fan {
    max-width: none;
  }

  .sa-fan__item {
    top: 46%;
    bottom: auto;
    height: auto;
    width: 66%;
    transform-origin: 50% 50%;
  }

  .sa-fan__item--1 {
    transform: translate(-94%, -40%) rotate(-7deg) scale(0.76);
  }

  .sa-fan__item--2 {
    transform: translate(-50%, -50%);
  }

  .sa-fan__item--3 {
    transform: translate(-6%, -40%) rotate(7deg) scale(0.76);
  }

  .sa-start__copy {
    align-self: center;
    padding: 36px 40px 36px 36px;
  }

  .sa-wizard {
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  }

  .sa-stage {
    height: auto;
    padding: 28px 24px;
    border-right: 1px solid var(--sa-line);
    border-bottom: 0;
  }

  .sa-stage__avatar {
    max-height: 560px;
  }

  .sa-panel__scroll {
    padding: 28px 28px 24px;
  }

  .sa-nav {
    padding: 14px 28px 18px;
  }

  /* Ergebnis: links große Bühne, rechts Text (scrollt) + Buttonleiste */
  .sa-result {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
  }

  .sa-result__main {
    display: contents;
  }

  .sa-result__stage {
    grid-column: 1;
    grid-row: 1;
    height: auto;
    padding: 22px 16px 14px;
    border-right: 1px solid var(--sa-line);
    border-bottom: 0;
  }

  .sa-result__headline {
    font-size: 16px;
  }

  .sa-result__place {
    bottom: 14px;
    left: 16px;
  }

  .sa-result__body {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    padding: 30px 32px 28px;
    overflow-y: auto;
  }

  .sa-result__bar {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-end;
    padding: 14px 32px 18px;
  }

  .sa-result__bar .sa-btn--primary {
    flex: 0 1 auto;
  }
}

/* ------------------------------------------------------- Sehr schmal */
@media (max-width: 379px) {
  .sa-top {
    padding: 0 14px;
  }

  [data-screen="wizard"] .sa-top__title {
    display: none;
  }

  .sa-swatches {
    gap: 4px;
  }

  .sa-swatch__dot {
    width: 44px;
    height: 44px;
  }

  .sa-options--tiles {
    gap: 8px;
  }

  .sa-opt--compact .sa-opt__media--head {
    height: 72px;
  }

  .sa-opt--compact .sa-opt__media--torso,
  .sa-opt--compact .sa-opt__media--backdrop {
    height: 60px;
  }

  .sa-opt--compact .sa-opt__media--backdrop {
    width: 60px;
  }

  .sa-opt--compact .sa-opt__title {
    font-size: 14px;
  }

  /* Ergebnis-Leiste: "Nochmal" nur als Symbol (Text bleibt für Screenreader) */
  .sa-result__bar .sa-btn--ghost {
    padding: 0 14px;
  }

  .sa-result__bar .sa-btn--ghost .sa-btn__label {
    display: none; /* Name kommt aus aria-label="Nochmal erstellen" */
  }
}

/* --------------------------------------------------------- Animationen */
@keyframes sa-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sa-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes sa-pop {
  from {
    transform: scale(0.97);
  }
  to {
    transform: scale(1);
  }
}

@keyframes sa-arrive {
  from {
    opacity: 0;
    transform: translateY(26px) rotate(-3deg) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

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