/* =========================================================================
 * Werkbank – Design-Elemente der Kundenseite auf einer Arbeitsfläche
 * Farben/Schriften kommen als Variablen aus dem Scan (--wb-*).
 * ====================================================================== */

.idss-wb {
  --wb-ui: #0d99ff;           /* Auswahlfarbe wie in Design-Tools */
  --wb-paper: #ffffff;
  --wb-surface: #ebe9e4;
  --wb-label: #8a867f;
  --wb-radius: 8px;

  position: relative;
  width: 100%;
  container-type: inline-size;
  overflow: hidden;
  background-color: var(--wb-surface);
  background-image: radial-gradient(rgba(20, 21, 28, 0.13) 1px, transparent 1.2px);
  background-size: 22px 22px;
  background-position: 11px 11px;
  font-family: inherit;
  text-align: left;
  line-height: 1.3;
}

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

.idss-wb__canvas {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 34px 22px;
  padding: clamp(28px, 5cqw, 64px);
}

/* Spaltenbreiten der Elemente */
.idss-wb__item--logo     { grid-column: span 5; }
.idss-wb__item--palette  { grid-column: span 4; }
.idss-wb__item--meta     { grid-column: span 3; }
.idss-wb__item--type     { grid-column: span 4; grid-row: span 2; }
.idss-wb__item--headline { grid-column: span 8; }
.idss-wb__item--ui       { grid-column: span 5; }
.idss-wb__item--photo    { grid-column: span 3; }

.idss-wb__item {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
}

/* Ebenen-Name über jedem Element, wie in Figma */
.idss-wb__label {
  display: block;
  margin: 0 0 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wb-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idss-wb__card {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--wb-paper);
  border-radius: var(--wb-radius);
  box-shadow: 0 1px 2px rgba(20, 21, 28, 0.06), 0 12px 32px -14px rgba(20, 21, 28, 0.22);
  overflow: hidden;
}

/* ---------- Logo mit Auswahlrahmen ---------- */

.idss-wb__logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 170px;
  padding: 34px 28px 40px;
  overflow: visible;
  transition: background-color .4s ease;
}

.idss-wb__logo.is-dark {
  background: #1d1e23;
}

.idss-wb__select {
  position: relative;
  display: inline-block;
  max-width: 82%;
  line-height: 0;
  outline: 1.5px solid var(--wb-ui);
  outline-offset: 6px;
}

.idss-wb__select img {
  display: block;
  max-width: 100%;
  max-height: 92px;
  width: auto;
  height: auto;
  margin: 0;
}

.idss-wb__select .h {
  position: absolute;
  width: 9px;
  height: 9px;
  background: #fff;
  border: 1.5px solid var(--wb-ui);
  border-radius: 1px;
}

.idss-wb__select .tl { top: -11px; left: -11px; }
.idss-wb__select .tr { top: -11px; right: -11px; }
.idss-wb__select .bl { bottom: -11px; left: -11px; }
.idss-wb__select .br { bottom: -11px; right: -11px; }

.idss-wb__dim {
  position: absolute;
  left: 50%;
  bottom: -32px;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 4px;
  background: var(--wb-ui);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

/* ---------- Farben ---------- */

.idss-wb__palette {
  display: flex;
  gap: 10px;
  padding: 14px;
}

.idss-wb__swatch {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.idss-wb__chip {
  display: block;
  height: 92px;
  border-radius: 6px;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(20, 21, 28, 0.08);
}

.idss-wb__swatch code {
  padding: 0;
  background: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: #14151c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idss-wb__swatch small {
  font-size: 10.5px;
  color: var(--wb-label);
}

/* ---------- Lighthouse-Ring ---------- */

.idss-wb__score {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 16px 18px;
}

.idss-wb__ring {
  position: relative;
  display: block;
  width: min(140px, 80%);
}

.idss-wb__ring svg {
  display: block;
  width: 100%;
  height: auto;
  transform: rotate(-90deg);
}

.idss-wb__score circle {
  fill: none;
  stroke-width: 9;
}

.idss-wb__score .bg {
  stroke: color-mix(in srgb, var(--ring) 16%, #fff);
}

.idss-wb__score .fg {
  stroke: var(--ring);
  stroke-linecap: round;
  stroke-dasharray: var(--score) 100;
  transition: stroke-dasharray 1.6s cubic-bezier(.2, .8, .2, 1) .5s;
}

.idss-wb__score b {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(26px, 3.6cqw, 40px);
  font-weight: 600;
  line-height: 1.2;
  color: color-mix(in srgb, var(--ring) 75%, #14151c);
}

.idss-wb__score small {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: var(--wb-label);
  text-align: center;
}

.idss-wb.is-ready .idss-wb__score .fg {
  stroke-dasharray: 0 100;
}

.idss-wb.is-live .idss-wb__score .fg {
  stroke-dasharray: var(--score) 100;
}

/* ---------- Kontrast-Check ---------- */

.idss-wb__contrast {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 18px 16px;
}

.idss-wb__crow {
  display: flex;
  align-items: center;
  gap: 12px;
}

.idss-wb__cchip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(20, 21, 28, 0.08);
  font-family: var(--wb-head);
  font-size: 18px;
  font-weight: 700;
}

.idss-wb__cmeta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.idss-wb__cmeta b {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px;
  color: #14151c;
}

.idss-wb__cmeta small {
  font-size: 11px;
  color: var(--wb-label);
}

.idss-wb__crow em {
  padding: 3px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.idss-wb__crow em.is-ok { background: #e3f6ec; color: #0b7a43; }
.idss-wb__crow em.is-fail { background: #fde8e7; color: #b42318; }

/* ---------- Typografie ---------- */

.idss-wb__type {
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  color: var(--wb-text);
  background: var(--wb-bg);
}

.idss-wb__aa {
  font-family: var(--wb-head);
  font-size: clamp(76px, 12cqw, 150px);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.03em;
  color: var(--wb-primary);
}

.idss-wb__fontname {
  margin-top: 18px;
  font-family: var(--wb-head);
  font-size: 22px;
  font-weight: 700;
}

.idss-wb__type small {
  margin-top: 2px;
  font-size: 11px;
  opacity: .6;
}

.idss-wb__alphabet {
  margin-top: auto;
  padding-top: 18px;
  font-family: var(--wb-head);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  opacity: .8;
  word-break: break-word;
}

.idss-wb__bodyfont {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid currentColor;
  border-top-color: color-mix(in srgb, currentColor 18%, transparent);
  font-family: var(--wb-body);
  font-size: 14px;
}

/* ---------- Headline ---------- */

.idss-wb__headline {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  min-height: 150px;
  padding: 26px 30px;
  background: var(--wb-bg);
  color: var(--wb-text);
}

.idss-wb__h {
  font-family: var(--wb-head);
  font-size: clamp(24px, 4cqw, 46px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.idss-wb__h.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 3px;
  vertical-align: -0.08em;
  background: var(--wb-ui);
  animation: idssWbCaret 1s steps(1) infinite;
}

.idss-wb__sub {
  font-family: var(--wb-body);
  font-size: 15px;
  line-height: 1.5;
  opacity: .72;
  max-width: 60ch;
}

/* ---------- Komponenten ---------- */

.idss-wb__ui {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 0 22px;
  background: var(--wb-bg);
  color: var(--wb-text);
}

.idss-wb__browser {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  background: rgba(20, 21, 28, 0.05);
  border-bottom: 1px solid rgba(20, 21, 28, 0.06);
}

.idss-wb__browser i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(20, 21, 28, 0.18);
}

.idss-wb__browser em {
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.75);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-style: normal;
  color: #55524d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.idss-wb__nav {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  min-width: 0;
}

.idss-wb__nav img {
  flex: 0 0 auto;
  max-height: 26px;
  max-width: 96px;
  width: auto;
  margin: 0;
}

.idss-wb__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: var(--wb-body);
  font-size: 13px;
  font-weight: 500;
}

.idss-wb__links span {
  white-space: nowrap;
}

.idss-wb__links span:first-child {
  text-decoration: underline;
  text-decoration-color: var(--wb-primary);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.idss-wb__btn {
  align-self: flex-start;
  margin: 4px 20px 0;
  padding: 11px 20px;
  border-radius: 999px;
  background: var(--wb-primary);
  color: var(--wb-on-primary);
  font-family: var(--wb-body);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  outline: 1.5px dashed transparent;
  outline-offset: 4px;
  transition: outline-color .3s ease;
}

.idss-wb__btn.is-hover {
  outline-color: var(--wb-ui);
}

/* ---------- Bildwelt ---------- */

.idss-wb__photo {
  min-height: 180px;
}

.idss-wb__photo img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  min-height: 180px;
  object-fit: cover;
  margin: 0;
}

/* ---------- Cursor ---------- */

.idss-wb__cursor {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transform: translate3d(40px, 40px, 0);
  transition: transform 1.2s cubic-bezier(.45, 0, .2, 1), opacity .4s ease;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18));
}

.idss-wb__cursor b {
  margin-top: 14px;
  padding: 2px 7px;
  border-radius: 4px 10px 10px 10px;
  background: #a8424b;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.idss-wb.is-live .idss-wb__cursor {
  opacity: 1;
}

/* ---------- Einblenden (JS setzt .is-ready, dann .is-live) ---------- */

.idss-wb.is-ready .idss-wb__item {
  opacity: 0;
  transform: translateY(18px) scale(.985);
  transition: opacity .7s ease, transform .9s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--i) * 160ms);
}

.idss-wb.is-ready .idss-wb__swatch {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--n) * 90ms + 500ms);
}

.idss-wb.is-ready .idss-wb__select {
  outline-color: transparent;
  transition: outline-color .4s ease 1.1s;
}

.idss-wb.is-ready .idss-wb__select .h,
.idss-wb.is-ready .idss-wb__dim {
  opacity: 0;
  transform: scale(.4);
  transition: opacity .3s ease 1.3s, transform .4s cubic-bezier(.2, .8, .2, 1.4) 1.3s;
}

.idss-wb.is-ready .idss-wb__dim {
  transform: translateX(-50%) scale(.6);
}

.idss-wb.is-live .idss-wb__item,
.idss-wb.is-live .idss-wb__swatch {
  opacity: 1;
  transform: none;
}

.idss-wb.is-live .idss-wb__select {
  outline-color: var(--wb-ui);
}

.idss-wb.is-live .idss-wb__select .h {
  opacity: 1;
  transform: none;
}

.idss-wb.is-live .idss-wb__dim {
  opacity: 1;
  transform: translateX(-50%);
}

@keyframes idssWbCaret {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}

/* ---------- Schmale Container ---------- */

@container (max-width: 860px) {
  .idss-wb__canvas {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 28px 16px;
  }

  .idss-wb__item--logo     { grid-column: span 6; }
  .idss-wb__item--palette  { grid-column: span 6; }
  .idss-wb__item--meta     { grid-column: span 2; }
  .idss-wb__item--type     { grid-column: span 4; grid-row: span 1; }
  .idss-wb__item--headline { grid-column: span 6; }
  .idss-wb__item--ui       { grid-column: span 6; }
  .idss-wb__item--photo    { grid-column: span 6; }
}

@container (max-width: 520px) {
  .idss-wb__canvas {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Eine Spalte: jedes Element volle Breite. "span 6" aus der Tablet-Ansicht würde sonst
     unsichtbare Zusatzspalten erzeugen und schmale Karten (Score) zusammenquetschen. */
  .idss-wb__canvas > .idss-wb__item {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .idss-wb__chip {
    height: 64px;
  }

  .idss-wb__palette {
    flex-wrap: wrap;
  }

  .idss-wb__swatch {
    flex: 1 1 calc(33% - 10px);
  }

  .idss-wb__score {
    flex-direction: row;
    justify-content: flex-start;
    gap: 18px;
  }

  .idss-wb__ring {
    width: 96px;
    flex: 0 0 96px;
  }

  .idss-wb__score b {
    font-size: 26px;
  }

  .idss-wb__cursor {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .idss-wb *,
  .idss-wb *::before,
  .idss-wb *::after {
    transition: none !important;
    animation: none !important;
  }

  .idss-wb__cursor {
    display: none;
  }
}

/* Helles Logo: im Mini-Browser als dunkle Silhouette, sonst unsichtbar auf hellem Kopf */
.idss-wb.has-light-logo .idss-wb__nav img {
  filter: brightness(0);
  opacity: .85;
}
