/* kigebaut.ch — Entwürfe und Dateien im Chat (/chat) und die Vorschau (/vorschau).
   Eigene Datei, damit die Landingpage (lp/lp.css) unabhängig davon umgebaut
   werden kann. Nur Tokens aus /styles.css. */

/* ---------- Entwürfe als Karten im Verlauf ---------- */
.ew-reihe {
  align-self: stretch; display: flex; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  margin: 2px -20px 0; padding: 4px 20px 12px; scroll-padding: 0 20px;
  scrollbar-width: thin;
}
.ew-karte {
  flex: 0 0 min(76%, 270px); scroll-snap-align: start;
  display: flex; flex-direction: column; text-align: left;
  font: inherit; color: var(--ink); cursor: pointer;
  background: #fff; border: 1.5px solid var(--ink); border-radius: 2px; padding: 0; overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ew-reihe.einzeln .ew-karte { flex-basis: min(86%, 300px); }
.ew-karte:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(19, 20, 23, 0.12); }
.ew-karte:focus-visible { outline: 2px solid var(--rot); outline-offset: 3px; }
.ew-karte-kopf { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px 9px; border-bottom: 1px solid var(--hairline); }
.ew-nr { font-family: var(--font-mono); font-size: 0.7rem; color: var(--grau); text-transform: uppercase; letter-spacing: 0.04em; }
.ew-name { font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.2; }
.ew-bild { position: relative; overflow: hidden; background: var(--flaeche); pointer-events: none; }
.ew-bild iframe { border: 0; display: block; background: #fff; }
.ew-karte-fuss { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 12px; font-size: 0.84rem; color: var(--grau); border-top: 1px solid var(--hairline); }
.ew-karte-fuss strong { color: var(--ink); font-weight: 600; }
.ew-karte.gewaehlt { border-color: var(--rot); box-shadow: 0 0 0 2px var(--rot); }
.ew-karte.gewaehlt .ew-karte-fuss strong { color: var(--rot); }

/* Wird gezeichnet: Platzhalter, bis die Daten der KI vollständig sind. */
.ew-karte.laedt { cursor: default; }
.ew-karte.laedt:hover { transform: none; box-shadow: none; }
.ew-karte.laedt .ew-bild { display: grid; place-items: center; }
.ew-laedt-text { font-family: var(--font-mono); font-size: 0.74rem; color: var(--grau); }
@media (prefers-reduced-motion: no-preference) {
  .ew-karte.laedt .ew-bild { background: linear-gradient(100deg, var(--flaeche) 30%, #fff 50%, var(--flaeche) 70%) 0 0 / 300% 100%; animation: ew-schimmer 1.4s infinite linear; }
  @keyframes ew-schimmer { to { background-position: -300% 0; } }
}

/* ---------- Vollansicht (Prototyp) ---------- */
.ev {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column;
  background: var(--werk); color: var(--werk-papier);
}
.ev[hidden] { display: none; }
.ev-seite { position: static; height: 100vh; height: 100dvh; }
.ev-kopf {
  flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--werk-hairline);
}
.ev-kopf .wortmarke { color: var(--werk-papier); font-size: 1rem; }
.ev-titel { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-schliessen {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center;
  background: none; border: 1px solid var(--werk-hairline); border-radius: 2px; color: var(--werk-papier); cursor: pointer; font-size: 1.3rem; line-height: 1;
}
.ev-schliessen:hover { border-color: var(--werk-papier); }
.ev-umschalter { flex: none; display: inline-flex; border: 1px solid var(--werk-hairline); border-radius: 2px; overflow: hidden; }
.ev-umschalter button { font: inherit; font-size: 0.86rem; font-weight: 500; padding: 8px 14px; background: none; color: var(--werk-grau); border: none; cursor: pointer; min-height: 40px; }
.ev-umschalter button[aria-pressed="true"] { background: var(--werk-papier); color: var(--ink); }
.ev-buehne { flex: 1; min-height: 0; display: flex; justify-content: center; padding: 16px 16px 0; overflow: hidden; }
.ev-rahmen { width: 100%; overflow: hidden; border-radius: 6px 6px 0 0; background: #fff; }
.ev-rahmen iframe { border: 0; display: block; background: #fff; }
.ev-fuss {
  flex: none; display: flex; align-items: center; justify-content: center; gap: 14px 22px; flex-wrap: wrap;
  padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--werk-hairline); background: var(--werk);
}
.ev-fuss .knopf { min-width: 240px; }
.ev-fuss .ev-leise { font-size: 0.86rem; color: var(--werk-grau); }
.ev-leer { padding: 40px 20px; text-align: center; color: var(--grau); }
@media (max-width: 600px) {
  .ev-kopf .wortmarke { display: none; }
  .ev-titel { white-space: normal; font-size: 0.9rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .ev-buehne { padding: 10px 10px 0; }
  .ev-fuss .knopf { width: 100%; }
}

/* ---------- Dateien ---------- */
.chat-eingabe .chat-anhang {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center;
  background: none; color: var(--ink); border: 1.5px solid var(--hairline); border-radius: 2px; cursor: pointer;
}
.chat-eingabe .chat-anhang:hover { border-color: var(--ink); }
.chat-eingabe .chat-anhang:disabled { color: var(--grau-hell); cursor: default; border-color: var(--hairline); }
.chat-anhang svg { width: 20px; height: 20px; }

/* Ausgewählt, noch nicht gesendet: über dem Eingabefeld. */
.chat-dateien { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 0 0; }
.chat-dateien[hidden] { display: none; }
.datei-stueck {
  position: relative; width: 64px; height: 64px; border-radius: 2px; overflow: hidden;
  border: 1px solid var(--hairline); background: var(--flaeche); display: grid; place-items: center;
}
.datei-stueck img { width: 100%; height: 100%; object-fit: cover; display: block; }
.datei-stueck .pdf { font-family: var(--font-mono); font-size: 0.7rem; color: var(--grau); text-align: center; padding: 4px; overflow-wrap: anywhere; line-height: 1.2; }
.datei-stueck.laedt::after { content: ""; position: absolute; inset: 0; background: rgba(250, 249, 245, 0.65); }
.datei-stueck.laedt::before {
  content: ""; position: absolute; z-index: 1; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--hairline); border-top-color: var(--ink); animation: datei-dreh 0.8s linear infinite;
}
@keyframes datei-dreh { to { transform: rotate(360deg); } }
.datei-stueck.fehler { border-color: var(--rot); }
.datei-weg {
  position: absolute; z-index: 2; top: 2px; right: 2px; width: 22px; height: 22px; display: grid; place-items: center;
  background: var(--ink); color: #fff; border: none; border-radius: 50%; cursor: pointer; font-size: 0.8rem; line-height: 1;
}
.chat-datei-fehler { font-size: 0.84rem; color: var(--rot-dunkel); padding-top: 6px; }
.chat-datei-fehler[hidden] { display: none; }

/* Gesendet: im Verlauf, rechts wie die eigene Nachricht. */
.blase-dateien { align-self: flex-end; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 85%; }
.blase-dateien .datei-stueck { width: 84px; height: 84px; }
.blase-dateien + .chat-blase.du { margin-top: -6px; }

/* Wenn die KI nach Dateien fragt: grosser Knopf in den Tipp-Antworten. */
.chat-option.hochladen { background: var(--ink); color: var(--paper); display: inline-flex; align-items: center; gap: 8px; }
.chat-option.hochladen:hover { background: var(--rot); border-color: var(--rot); }
.chat-option.hochladen svg { width: 16px; height: 16px; }

/* Datei über den Chat ziehen (Computer). */
.cs.ziehen .cs-verlauf { outline: 2px dashed var(--rot); outline-offset: -8px; }

/* Die KI liest gerade eine Website oder zeichnet Entwürfe. */
.chat-status { align-self: flex-start; font-family: var(--font-mono); font-size: 0.76rem; color: var(--grau); display: inline-flex; align-items: center; gap: 8px; }
.chat-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--rot); }
@media (prefers-reduced-motion: no-preference) { .chat-status::before { animation: tippen 1s infinite ease-in-out; } }

/* Zusammenfassung: gewählter Entwurf und Dateien. */
.chat-karte .ew-mini { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 10px; border: 1px solid var(--hairline); border-radius: 2px; font: inherit; background: var(--paper); cursor: pointer; width: 100%; text-align: left; color: var(--ink); }
.chat-karte .ew-mini:hover { border-color: var(--ink); }
.ew-mini-bild { flex: none; width: 56px; height: 84px; overflow: hidden; border-radius: 2px; border: 1px solid var(--hairline); pointer-events: none; }
.ew-mini-bild iframe { border: 0; display: block; }
.ew-mini-text { font-size: 0.9rem; line-height: 1.4; }
.ew-mini-text strong { display: block; font-family: var(--font-display); font-size: 1rem; }
.ew-mini-text span { color: var(--grau); }

@media (max-width: 600px) {
  .ew-reihe { margin: 2px -14px 0; padding: 4px 14px 12px; scroll-padding: 0 14px; }
}
/* Am Computer stehen die drei nebeneinander: vergleichen statt wischen. */
@media (min-width: 760px) {
  .ew-reihe:not(.einzeln) { overflow: visible; margin: 2px 0 0; padding: 4px 0 8px; }
  .ew-reihe:not(.einzeln) .ew-karte { flex: 1 1 0; min-width: 0; }
  .ew-reihe:not(.einzeln) .ew-karte-kopf { flex-direction: column; gap: 2px; }
  .ew-reihe:not(.einzeln) .ew-karte-fuss > span { display: none; }
  .ew-reihe:not(.einzeln) .ew-karte-fuss { justify-content: flex-end; }
}

/* ---------- Unser Gedanke: warum wir einen Entwurf so vorschlagen ---------- */
.ew-gedanke { display: block; padding: 10px 12px 11px; font-size: 0.84rem; line-height: 1.4; color: var(--ink); border-top: 1px solid var(--hairline); background: var(--paper); }
.ew-gedanke-titel { display: block; font-family: var(--font-mono); font-size: 0.68rem; color: var(--grau); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 3px; }

/* ---------- Seitenplan vor dem Bau ---------- */
.plan-karte .plan-hinweis, .chat-karte .plan-hinweis { font-size: 0.9rem; color: var(--grau); margin: 0 0 12px; }
.plan-liste { list-style: none; margin: 0; padding: 0; counter-reset: plan; display: grid; gap: 0; }
.plan-liste li { counter-increment: plan; padding: 10px 0 10px 30px; border-top: 1px solid var(--hairline); position: relative; }
.plan-liste li::before { content: counter(plan); position: absolute; left: 0; top: 10px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--grau); }
.plan-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.plan-kopf strong { font-weight: 600; }
.plan-quelle { flex: none; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.03em; text-transform: uppercase; padding: 3px 7px; border-radius: 2px; border: 1px solid var(--hairline); color: var(--grau); }
.plan-angenommen .plan-quelle { border-color: var(--rot); color: var(--rot); }
.plan-liste p { margin: 3px 0 0; font-size: 0.9rem; color: var(--grau); }
.plan-details { margin: 0 0 12px; font-size: 0.94rem; }
.plan-details summary { cursor: pointer; color: var(--ink); font-weight: 500; min-height: 44px; display: flex; align-items: center; }
/* Auf der Karte höchstens drei Zeilen: die Karte muss am Handy über die
   Tipp-Antworten passen. Ganz steht der Gedanke in der Vollansicht. */
.ew-gedanke-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ev-fuss .ev-leise { max-width: 60ch; }
