/* ==========================================================================
   Textildesigner — eingebettet in die Website
   --------------------------------------------------------------------------
   Aus dem Prototyp uebernommen. Geaendert gegenueber der eigenstaendigen
   Fassung: kein eigener Seitenkopf, keine Regeln auf html/body, und die
   Variablen haengen an .tv-app statt an :root. So kann nichts in die uebrige
   Seite durchschlagen.
   ========================================================================== */

.tv-app {
  --ink: #0B0D10;
  --navy: #1E3C72;
  --cyan: #25DAFF;
  --paper: #FFFFFF;
  --paper-50: #F7F8FA;
  --paper-100: #EFF2F5;
  --paper-200: #E2E7ED;
  --text-muted: #5C6675;
  --line: rgba(11, 13, 16, .10);
  --line-soft: rgba(11, 13, 16, .06);
  --font-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 18px;
  --td-hoehe: clamp(420px, 74vh, 760px);
  --radius-s: 10px;
}


.tv-app, .tv-app * { box-sizing: border-box; }
.tv-app {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-l, 28px);
  overflow: hidden;
  background: var(--paper);
}
/* ==========================================================================
   Textilvorschau – Prototyp
   Farben und Typografie aus dem Design-System der Website.
   ========================================================================== */



/* ------------------------------------------------------------------ Aufbau */
.tv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  /* Feste Hoehe im Seitenfluss - gescrollt wird nur im Bedienfeld. */
  height: var(--td-hoehe);
  min-height: 420px;
}
.tv > * { min-height: 0; }
@media (max-width: 900px) {
  .tv { grid-template-columns: 1fr; height: auto; }
}

.tv__buehne {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(115% 85% at 50% 8%, #FDFEFF 0%, #EDF2F8 46%, #D9E1EB 100%);
}
@media (max-width: 900px) { .tv__buehne { height: clamp(300px, 52vh, 460px); } }

.tv__buehne canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.tv__buehne canvas.ist-greifend { cursor: grabbing; }

.tv__laden, .tv__tipp {
  position: absolute; left: 50%; transform: translateX(-50%);
  margin: 0; font-size: .82rem; color: var(--text-muted);
  pointer-events: none;
}
.tv__laden { top: 50%; }
.tv__tipp {
  bottom: .8rem; display: flex; gap: .5rem;
  justify-content: center; white-space: nowrap;
}
.tv__tipp span {
  background: rgba(255,255,255,.8); padding: .25rem .7rem; border-radius: 100px;
  backdrop-filter: blur(3px);
}
@media (max-width: 620px) {
  .tv__tipp { font-size: .74rem; }
  .tv__tipp span:last-child { display: none; }
}

/* ------------------------------------------------------------------ Bedienfeld */
.tv__steuer {
  padding: clamp(1.25rem, 3vw, 2rem);
  border-left: 1px solid var(--line-soft);
  overflow-y: auto;
}
@media (max-width: 900px) { .tv__steuer { border-left: 0; border-top: 1px solid var(--line-soft); } }

.tv-titel {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.5rem; line-height: 1.2; letter-spacing: -.02em;
  margin: 0 0 .5rem;
}
.tv-lead { margin: 0 0 1.75rem; color: var(--text-muted); font-size: .92rem; }

.tv-block { margin-bottom: 1.75rem; }
.tv-h2 {
  font-family: var(--font-display); font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
  margin: 0 0 .75rem;
}

/* ------------------------------------------------------------------ Ablage */
.tv-ablage {
  display: grid; justify-items: center; gap: .35rem;
  padding: 1.4rem 1rem;
  border: 1.5px dashed var(--line); border-radius: var(--radius);
  background: var(--paper-50);
  color: var(--text-muted);
  text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.tv-ablage:hover, .tv-ablage:focus-visible, .tv-ablage.ist-bereit {
  border-color: var(--navy); background: #fff; color: var(--navy); outline: none;
}
.tv-ablage.hat-bild { border-style: solid; border-color: var(--line); }
.tv-ablage__text { font-weight: 600; color: var(--ink); font-size: .92rem; }
.tv-ablage__klein { font-size: .76rem; line-height: 1.45; }

.tv-datei {
  display: flex; justify-content: space-between; align-items: baseline; gap: .75rem;
  margin: .6rem 0 0; font-size: .82rem; color: var(--text-muted);
}
.tv-link {
  border: 0; background: none; padding: 0; cursor: pointer;
  font: inherit; color: var(--navy); text-decoration: underline;
  text-underline-offset: 3px;
}

/* ------------------------------------------------------------------ Hinweise */
.tv-notiz {
  margin: .6rem 0 0; padding: .55rem .75rem;
  border-radius: var(--radius-s); font-size: .8rem; line-height: 1.5;
  border-left: 3px solid;
}
.tv-notiz.ist-gut     { background: #F1F8F3; border-color: #2E7D4F; color: #1F5637; }
.tv-notiz.ist-mittel  { background: #FFF8EC; border-color: #C08420; color: #7A5210; }
.tv-notiz.ist-warnung { background: #FDF2F2; border-color: #B4232E; color: #7E1A22; }
.tv-notiz.ist-info    { background: var(--paper-100); border-color: var(--navy); color: var(--ink); }

/* ------------------------------------------------------------------ Knöpfe */
.tv-knopfreihe { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.tv-knopf {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 100px; padding: .45rem .95rem;
  font: inherit; font-size: .84rem; cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.tv-knopf:hover { border-color: var(--navy); }
.tv-knopf.ist-aktiv { background: var(--ink); border-color: var(--ink); color: #fff; }
.tv-knopf--voll {
  display: block; width: 100%; margin-top: .25rem;
  border-radius: var(--radius-s); padding: .7rem 1rem; font-weight: 600;
}

/* ------------------------------------------------------------------ Regler */
.tv-regler {
  display: grid; grid-template-columns: 4.5rem 1fr 4rem;
  align-items: center; gap: .6rem;
  font-size: .84rem; color: var(--text-muted); margin-bottom: .55rem;
}
.tv-regler output { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.tv-regler input[type=range] { width: 100%; accent-color: var(--navy); }

/* ------------------------------------------------------------------ Farben */
.tv-farben { display: flex; flex-wrap: wrap; gap: .5rem; }
.tv-farbe {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--ton);
  cursor: pointer; padding: 0;
  transition: transform .15s, box-shadow .15s;
}
.tv-farbe:hover { transform: scale(1.08); }
.tv-farbe.ist-aktiv {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ink);
}
.tv-farbname { margin: .7rem 0 0; font-size: .82rem; color: var(--text-muted); }

.tv-fuss {
  margin: 0; padding-top: 1.25rem; border-top: 1px solid var(--line-soft);
  font-size: .75rem; line-height: 1.55; color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* ------------------------------------------------------------------ Motivliste */
.tv-motive { display: grid; gap: .4rem; margin-bottom: .7rem; }
.tv-motiv {
  display: grid; grid-template-columns: 1.4rem 34px 1fr auto;
  align-items: center; gap: .55rem;
  padding: .4rem .5rem .4rem .6rem;
  border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fff; cursor: pointer; text-align: left;
  font: inherit; font-size: .82rem; color: var(--text-muted);
  transition: border-color .18s, background .18s;
}
.tv-motiv:hover { border-color: var(--navy); }
.tv-motiv.ist-aktiv { border-color: var(--ink); background: var(--paper-50); color: var(--ink); }
.tv-motiv__nr { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text-muted); }
.tv-motiv.ist-aktiv .tv-motiv__nr { color: var(--ink); }
.tv-motiv__bild {
  width: 34px; height: 28px; object-fit: contain;
  background: var(--paper-100); border-radius: 5px;
}
.tv-motiv__text { overflow: hidden; }
.tv-motiv__name {
  display: block; color: var(--ink); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tv-motiv__wo { display: block; font-size: .74rem; }
.tv-motiv__weg {
  border: 0; background: none; cursor: pointer; padding: .2rem .35rem;
  font: inherit; font-size: 1rem; line-height: 1; color: var(--text-muted);
  border-radius: 4px;
}
.tv-motiv__weg:hover { background: var(--paper-100); color: var(--ink); }
.tv-h2__klein { text-transform: none; letter-spacing: 0; font-weight: 400; opacity: .75; }

/* ------------------------------------------------------------------ Dunkler Grund */
.tv__buehne.ist-dunkel {
  background: radial-gradient(115% 85% at 50% 8%, #2B323B 0%, #1A1F26 46%, #0E1216 100%);
}
.tv__buehne.ist-dunkel .tv__tipp { color: rgba(255,255,255,.72); }
.tv__buehne.ist-dunkel .tv__tipp span { background: rgba(255,255,255,.12); }
.tv__buehne.ist-dunkel .tv__laden { color: rgba(255,255,255,.72); }

/* ------------------------------------------------------------------ Motivoptionen */
.tv-optionen {
  margin: .1rem 0 .7rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line-soft); border-radius: var(--radius-s);
  background: var(--paper-50);
}
.tv-schalter {
  display: flex; align-items: center; gap: .55rem;
  font-size: .84rem; color: var(--ink); cursor: pointer;
}
.tv-schalter input { width: 16px; height: 16px; accent-color: var(--navy); cursor: pointer; }
.tv-mini { margin: .4rem 0 0; font-size: .76rem; line-height: 1.45; color: var(--text-muted); }
.tv-mini.ist-vorschlag { color: #7A5210; }

/* Durchsichtigkeit im Vorschaubild sichtbar machen */
.tv-motiv__bild {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #DfE3E8 25%, transparent 25%, transparent 75%, #DfE3E8 75%),
    linear-gradient(45deg, #DfE3E8 25%, transparent 25%, transparent 75%, #DfE3E8 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}
