/* ============================================================
   Tooltip – sauber & stabil (iOS-sicher)
   ============================================================ */

.preview-dialog {
  position: fixed;
  top: 5svh;
  left: 0;
  transform: none;
  background: #000;
  color: #fff;
  border-radius: 10px;
  width: min(375px, 92vw);
  max-height: 90svh;
  padding: 1.2rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  z-index: 9999;
  opacity: 0;
  display: none;
  transition: opacity 0.25s ease;

  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow-y: auto;
}
.preview-dialog::after {
  content: "";
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  height: 24px;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0),
    rgba(0,0,0,0.9)
  );
  pointer-events: none;
}


.preview-dialog.show {
  display: block;
  opacity: 1;
}

.preview-dialog[hidden] {
  display: none !important;
}

/* Struktur */

.preview-body {
  flex: 1 1 auto;
  min-height: 0; /* wichtig für iOS */
}

.preview-footer {
  flex-shrink: 0;
  margin-top: 0.8rem;
}

/* Text */

.preview-text {
  font-size: 1rem;
  line-height: 1.45;
  color: #f5f5f5;
}
p.preview-text {
  margin: 0.5em;
  }


/* Footer-Link */

.preview-dialog .tip-go {
  display: block;
  color: #4dabf7;
  font-weight: 600;
  text-decoration: underline;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-dialog .tip-go:hover,
.preview-dialog .tip-go:focus {
  color: #ff8500;
}

/* Schließen-X */

.preview-dialog .tip-close {
  position: absolute;
  top: 1px;
  right: 5px;
  font-size: 1.6rem;
  font-weight: bold;
  line-height: 1;
  background: transparent;
  color: #fff;
  border: none;
  cursor: pointer;
  padding: 6px;
}

/* ---------------- Mobile ---------------- */

@media (max-width: 700px) {
  .preview-dialog {
    width: 92vw;
    padding: 1rem;
    max-height: 90svh;
  }
}


@media (max-height: 499px) {
  .preview-dialog {
    overflow-y: auto;
  }

  .preview-text {
    display: block;
    overflow: visible;
  }
}
/* A+ */
html.font-large .preview-text {
    font-size: 1.25rem;
    line-height: 1.5;
}

/* A++ */
html.font-xlarge .preview-text {
    font-size: 1.55rem;
    line-height: 1.6;
}
html.font-large .preview-dialog .tip-go {
    font-size: 1.15rem;
}

html.font-xlarge .preview-dialog .tip-go {
    font-size: 1.3rem;
}