/* Promptomizer-Uebersicht (AnalyseDESK).
   Nur was die Uebersicht eigenstaendig braucht - Farben, Karten, Tabellen und
   Schrift kommen aus main.css. */

:root {
  /* Zwei Reihen in einem Diagramm: eine Farbe in zwei Helligkeitsstufen.
     Teal und Sky liegen zu dicht beieinander (Delta E 9,2), um als zwei
     Reihen unterscheidbar zu sein. */
  --serie-besucher: #7fd6e4;
  --serie-aufrufe: #0e97ad;
  --serie-flaeche: rgba(176, 207, 229, 0.055);
  --serie-raster: rgba(176, 207, 229, 0.09);
}

[data-theme="light"] {
  --serie-besucher: #0a7d94;
  --serie-aufrufe: #5bbfd2;
  --serie-flaeche: rgba(14, 97, 150, 0.055);
  --serie-raster: rgba(14, 97, 150, 0.09);
}

/* --- Kopfband ---------------------------------------------------------- */

.pz-kopfband {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.pz-zahl {
  background: var(--bg-2);
  padding: 20px 22px;
}

/* Die eigentliche Zielgroesse traegt als einzige eine Auszeichnung. */
.pz-zahl--ziel {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(14, 151, 173, 0.06));
  box-shadow: inset 0 0 0 1px rgba(14, 165, 233, 0.35);
}

[data-theme="light"] .pz-zahl--ziel {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.1), rgba(14, 151, 173, 0.04));
  box-shadow: inset 0 0 0 1px rgba(2, 132, 199, 0.3);
}

.pz-zahl-wert {
  font-size: 40px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.pz-zahl--ziel .pz-zahl-wert {
  color: var(--accent-2);
}

.pz-zahl--offen .pz-zahl-wert {
  color: var(--warning);
}

.pz-zahl-name {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.pz-zahl--ziel .pz-zahl-name {
  color: var(--text);
  font-weight: 600;
}

.pz-zahl-diff {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.pz-diff-plus {
  color: var(--success);
  font-weight: 700;
}

.pz-diff-minus,
.pz-diff-null {
  color: var(--text);
  font-weight: 700;
}

.pz-zeile-klein {
  margin-top: 18px;
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-muted);
}

.pz-fahne {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.pz-fahne--gut {
  background: rgba(34, 197, 94, 0.12);
  color: var(--success);
}

.pz-fahne--warnung {
  background: var(--warning-bg);
  color: var(--warning);
}

/* --- Auffaelligkeiten -------------------------------------------------- */

.pz-hinweise {
  display: grid;
  gap: 12px;
}

.pz-hinweis {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  line-height: 1.55;
}

.pz-hinweis-zeichen {
  flex: none;
  margin-top: 3px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.pz-hinweis--warnung .pz-hinweis-zeichen {
  background: var(--warning-bg);
  color: var(--warning);
}

.pz-hinweis--gut .pz-hinweis-zeichen {
  background: rgba(14, 151, 173, 0.16);
  color: var(--teal);
}

.pz-hinweis--hinweis .pz-hinweis-zeichen {
  background: rgba(122, 145, 171, 0.16);
  color: var(--text-muted);
}

/* --- Tagesbalken ------------------------------------------------------- */

.pz-diagramm-kopf {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.pz-steuerung {
  display: flex;
  gap: 22px;
  margin-top: 22px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.pz-legende {
  display: flex;
  gap: 22px;
  align-items: center;
  font-size: 12.5px;
  color: var(--text-muted);
}

.pz-legende-punkt {
  width: 11px;
  height: 11px;
  border-radius: 3px;
}

.pz-legende span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.2s ease;
}

.pz-legende span.is-aus {
  opacity: 0.35;
}

/* Umschalter Besucher / Aufrufe / beides */
.pz-schalter {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(176, 207, 229, 0.04);
}

.pz-schalter button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 6px 15px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

.pz-schalter button:hover {
  color: var(--text);
}

.pz-schalter button[aria-pressed="true"] {
  background: var(--bg-3);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* Umschalter Woche / Monat / Gesamt ueber der ganzen Uebersicht: dieselbe
   Form wie der Reihen-Umschalter, eine Stufe groesser, und er sitzt unter dem
   Seitenkopf statt in einer Karte. Leer, bis app.js ihn fuellt. */
.pz-schalter--gross {
  align-self: flex-start;
  margin-top: -8px;
}

.pz-schalter--gross:empty {
  display: none;
}

.pz-schalter--gross button {
  padding: 8px 20px;
  font-size: 14px;
}

.pz-plotzeile {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.pz-achse {
  flex: none;
  width: 34px;
  height: 240px;
  position: relative;
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.pz-achse span {
  position: absolute;
  right: 0;
}

.pz-plot {
  flex: 1 1 auto;
  min-width: 0;
}

.pz-balkenfeld {
  position: relative;
  height: 240px;
  border-bottom: 1px solid var(--border);
  background-image: linear-gradient(var(--serie-raster) 1px, transparent 1px);
  background-size: 100% 120px;
}

.pz-spalten {
  position: absolute;
  inset: 0;
  display: flex;
  gap: 3px;
  align-items: stretch;
}

.pz-spalte {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  flex: 1 1 0;
  min-width: 0;
  border-radius: 3px;
}

.pz-spalte--wochenende {
  background: var(--serie-flaeche);
}

.pz-paar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 100%;
}

.pz-balken {
  border-radius: 4px 4px 0 0;
  width: 46%;
  max-width: 15px;
  transition: height 0.18s ease;
}

.pz-spalten--einzeln .pz-balken {
  width: 72%;
  max-width: 26px;
}

.pz-balken--besucher {
  background: var(--serie-besucher);
}

.pz-balken--aufrufe {
  background: var(--serie-aufrufe);
}

/* Ein Tag ohne Besucher hat stattgefunden - er bekommt eine Spur auf der
   Grundlinie, keinen leeren Platz. */
.pz-balken--null {
  height: 2px;
  border-radius: 0;
  opacity: 0.45;
}

/* Eine fehlende Tagesdatei ist keine Null. Sie bekommt eine Luecke. */
.pz-luecke {
  width: 78%;
  max-width: 26px;
  height: 100%;
  border-radius: 4px;
  border: 1px dashed rgba(176, 207, 229, 0.28);
  background: repeating-linear-gradient(
    135deg,
    rgba(176, 207, 229, 0.07) 0 5px,
    transparent 5px 10px
  );
}

[data-theme="light"] .pz-luecke {
  border-color: rgba(14, 97, 150, 0.3);
  background: repeating-linear-gradient(
    135deg,
    rgba(14, 97, 150, 0.07) 0 5px,
    transparent 5px 10px
  );
}

/* Unsicher heisst schraffiert - der Wert wird gezeigt, aber nicht als
   gesichert ausgegeben. */
.pz-balken--unsicher.pz-balken--besucher {
  background: repeating-linear-gradient(
    135deg,
    var(--serie-besucher) 0 5px,
    color-mix(in srgb, var(--serie-besucher) 45%, transparent) 5px 10px
  );
}

.pz-balken--unsicher.pz-balken--aufrufe {
  background: repeating-linear-gradient(
    135deg,
    var(--serie-aufrufe) 0 5px,
    color-mix(in srgb, var(--serie-aufrufe) 45%, transparent) 5px 10px
  );
}

.pz-unsicher-zeichen {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--warning-bg);
  color: var(--warning);
}

.pz-tipp {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  white-space: nowrap;
  z-index: 5;
  box-shadow: var(--shadow);
  font-size: 12px;
  line-height: 1.5;
}

.pz-spalte:hover .pz-tipp,
.pz-spalte:focus-within .pz-tipp {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* Die Randspalten kippen den Tipp nach innen, sonst haengt er heraus. */
.pz-spalte:first-child .pz-tipp,
.pz-spalte:nth-child(2) .pz-tipp {
  left: 0;
  transform: translate(0, 4px);
}

.pz-spalte:first-child:hover .pz-tipp,
.pz-spalte:nth-child(2):hover .pz-tipp {
  transform: translate(0, 0);
}

.pz-spalte:last-child .pz-tipp,
.pz-spalte:nth-last-child(2) .pz-tipp {
  left: auto;
  right: 0;
  transform: translate(0, 4px);
}

.pz-spalte:last-child:hover .pz-tipp,
.pz-spalte:nth-last-child(2):hover .pz-tipp {
  transform: translate(0, 0);
}

.pz-xachse {
  display: flex;
  gap: 3px;
  margin-top: 8px;
}

.pz-xachse div {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* --- Wochenverlauf ----------------------------------------------------- */

.pz-wochen {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.pz-wochenfeld {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  background: color-mix(in srgb, var(--bg-2) 50%, transparent);
}

.pz-wochenfeld--ziel {
  border-color: rgba(14, 165, 233, 0.28);
  background: rgba(14, 165, 233, 0.05);
}

.pz-wochenwert {
  margin-top: 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.pz-wochenbalken {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 72px;
  margin-top: 18px;
}

.pz-wochenbalken div {
  flex: 1;
  background: var(--serie-aufrufe);
  border-radius: 4px 4px 0 0;
  opacity: 0.45;
}

/* Die letzte volle Woche steht kraeftiger - eine Helligkeitsstufe derselben
   Farbe, keine zweite Bedeutung fuer die Serienfarben. */
.pz-wochenbalken div:last-child {
  opacity: 1;
}

.pz-wochenbalken div.is-null {
  height: 2px !important;
  border-radius: 0;
  opacity: 0.45;
}

.pz-wochenachse {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.pz-wochenachse span {
  flex: 1;
  text-align: center;
}

/* --- Herkunft ---------------------------------------------------------- */

.pz-herkunft {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 28px;
  margin-top: 24px;
}

.pz-kanaele {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pz-kanal-kopf {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13.5px;
}

.pz-kanal-schiene {
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: rgba(176, 207, 229, 0.07);
  overflow: hidden;
}

.pz-kanal-fuellung {
  height: 100%;
  border-radius: 999px;
  background: rgba(122, 145, 171, 0.55);
}

/* Die Frage des Masterplans ist die organische Suche - nur sie traegt Farbe. */
.pz-kanal--organisch .pz-kanal-fuellung {
  background: var(--serie-besucher);
}

.pz-liste {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.pz-liste div {
  display: flex;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg-2);
  font-size: 13px;
}

.pz-untertitel {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

/* --- Einstiegsseiten --------------------------------------------------- */

.pz-gruppenzeile td {
  background: color-mix(in srgb, var(--bg-3) 50%, transparent);
  padding: 9px 16px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pz-seite--leer td {
  color: var(--text-muted);
}

.pz-zahl-stark {
  font-weight: 700;
  font-size: 15px;
}

/* --- Datenqualitaet ---------------------------------------------------- */

.pz-kalender {
  display: flex;
  gap: 5px;
  margin-top: 18px;
  flex-wrap: wrap;
}

.pz-kalender span {
  width: 22px;
  height: 22px;
  border-radius: 5px;
}

.pz-kalender .is-vollstaendig {
  background: var(--serie-aufrufe);
  opacity: 0.85;
}

.pz-kalender .is-unvollstaendig {
  background: var(--warning);
}

.pz-kalender .is-fehlt {
  border: 1px dashed rgba(176, 207, 229, 0.35);
}

@media (max-width: 900px) {
  .pz-kopfband,
  .pz-wochen {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pz-herkunft {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .pz-kopfband,
  .pz-wochen {
    grid-template-columns: 1fr;
  }

  .pz-steuerung {
    align-items: flex-start;
  }
}

/* --- Markierungen (Bereich 7) ------------------------------------------ */

.pz-spalte[role="button"] {
  cursor: pointer;
}

.pz-spalte[role="button"]:hover {
  background: rgba(14, 165, 233, 0.07);
}

.pz-spalte:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 1px;
}

/* Der Punkt sagt nur, dass etwas war. Was, steht in der Chipleiste darunter. */
.pz-marke {
  position: absolute;
  left: 50%;
  top: -6px;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 999px;
  background: var(--accent-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 20%, transparent);
}

.pz-markenleiste {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 18px;
}

.pz-markenchip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  border: 1px solid rgba(14, 165, 233, 0.28);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.pz-markenchip:hover {
  border-color: var(--accent-2);
  transform: translateY(-1px);
}

.pz-markenpunkt {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--accent-2);
}

.pz-notiz {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 20px;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-2) 50%, transparent);
}

.pz-meldung {
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 13.5px;
  font-weight: 600;
}

.pz-anfrage {
  display: inline-block;
  margin: 2px 6px 2px 0;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(176, 207, 229, 0.08);
  font-size: 12px;
}

/* --- Trichter (Bereich 6) ---------------------------------------------- */

.pz-trichter {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 34px;
  margin-top: 26px;
}

.pz-stufen {
  display: grid;
  gap: 12px;
}

/* Feste Beschriftungsspalte, damit die Balkenbreiten gegen eine gemeinsame
   Spur rechnen - sonst meinte 100 Prozent die ganze Zeile und jede Stufe
   waere zu lang gezeichnet. */
.pz-stufe {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.pz-stufe-name {
  font-size: 13.5px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pz-stufe-balken {
  height: 40px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-weight: 700;
  font-size: 15px;
  background: var(--serie-besucher);
  color: #06202a;
}

[data-theme="light"] .pz-stufe-balken {
  color: #ffffff;
}

.pz-stufe-balken.is-ziel {
  background: var(--accent-2);
  color: #ffffff;
  justify-content: center;
  padding: 0;
}

.pz-warnkasten {
  margin-top: 14px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
}

/* --- Seitenleistung (Bereich 5) ---------------------------------------- */

/* Der Vorwochenwert steht klein unter der Zahl - eine eigene Spalte je
   Kennzahl waere acht Spalten breit und nicht mehr zu ueberblicken. */
.pz-vor {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

/* --- Validierungs-Gate (Bereich 8) ------------------------------------- */

.pz-gate {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  margin-top: 24px;
}

.pz-gate-wert {
  font-size: 56px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--accent-2);
}

.pz-monate {
  display: flex;
  gap: 8px;
}

.pz-monat {
  flex: 1;
  text-align: center;
  padding: 14px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(176, 207, 229, 0.05);
  color: var(--text-muted);
}

.pz-monat.is-vorbei {
  background: rgba(14, 165, 233, 0.14);
  border-color: rgba(14, 165, 233, 0.3);
  color: var(--text);
}

.pz-monat.is-frist {
  border-style: dashed;
}

.pz-monat-note {
  font-size: 11px;
  margin-top: 4px;
  color: var(--text-muted);
}

.pz-protokoll {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 10px;
  border: 1px dashed var(--border);
  background: rgba(176, 207, 229, 0.03);
}

@media (max-width: 900px) {
  .pz-trichter,
  .pz-gate {
    grid-template-columns: 1fr;
  }

  .pz-stufe {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pz-monate {
    flex-wrap: wrap;
  }
}


/* --- Herkunft der Zielgroesse ------------------------------------------ */

.pz-zahl-quelle {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.pz-zahl-quelle--schwach {
  color: var(--warning);
}

.pz-quelle {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}

.pz-quelle strong {
  color: var(--text);
}

.pz-quelle--gut {
  background: rgba(14, 151, 173, 0.09);
  border: 1px solid color-mix(in srgb, var(--teal) 26%, transparent);
}

.pz-quelle--warnung {
  background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
}

.pz-quelle--warnung strong {
  color: var(--warning);
}
