/* ═══════════════════════════════════════════════════════════════════════════
 * transkript.css — V-Serie V3d: die Transkriptionsseite
 * ═══════════════════════════════════════════════════════════════════════════
 *
 * Ergaenzt susi.css, ersetzt nichts. Was es dort schon gibt, wird benutzt
 * statt nachgebaut: .view, .view-head, .card-grid, .lib-card, .prim-btn und
 * die Farbvariablen. Deshalb ist die Seite ohne eine einzige Zeile hier
 * schon mobiltauglich — der Mobile-Zweig von susi.css greift auf .view und
 * .card-grid (susi.css:1432-1436).
 *
 * Hier steht nur, was es vorher nicht gab: die Segmentzeile, die
 * Sprecherleiste, die Tonleiste und der Fortschritt beim Hochladen.
 *
 * ZUR SEGMENTZEILE
 *   Drei Spalten in einem Raster: Zeitmarke, Sprecher, Text. Feste Breiten
 *   fuer die ersten beiden, damit der Text bei 1.500 Zeilen an derselben
 *   Stelle beginnt — ein Transkript liest man von oben nach unten, und
 *   eine Textkante, die je nach Sprechername wandert, macht das muehsam.
 * ═══════════════════════════════════════════════════════════════════════════
 */

/* ── Liste ────────────────────────────────────────────────────────────────── */

/* Karten wachsen nur so hoch wie ihr Inhalt. Ohne das zieht das Raster
   alle Karten einer Reihe auf die Hoehe der hoechsten — und eine
   gescheiterte Aufnahme mit Fehlertext macht ihre beiden Nachbarn zu
   halbleeren Kaesten. */
.tr-grid { align-items: start }

.tr-card { align-items: flex-start }

.tr-card-fehler {
  margin-top: 6px; font-size: 12px; color: #b91c1c;
  background: #fef2f2; border-radius: 8px; padding: 6px 9px;
}

.tr-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; white-space: nowrap;
}
.tr-st-wartet { background: #f1f5f9; color: #475569 }
.tr-st-laeuft { background: #eff6ff; color: #1d4ed8 }
.tr-st-fertig { background: #ecfdf5; color: #047857 }
.tr-st-fehler { background: #fef2f2; color: #b91c1c }

.tr-marke {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 10px; background: #fefce8; color: #a16207;
}

.tr-hinweis {
  margin-top: 22px; font-size: 12px; color: var(--txt3);
  line-height: 1.6; max-width: 640px;
}

.tr-leer {
  grid-column: 1 / -1; text-align: center;
  padding: 48px 24px; color: var(--txt2);
}
.tr-leer-icon  { font-size: 40px; margin-bottom: 12px }
.tr-leer-titel { font-size: 15px; font-weight: 600; color: var(--txt); margin-bottom: 8px }
.tr-leer-text  { font-size: 13px; line-height: 1.6; max-width: 460px; margin: 0 auto }

/* ── Hochladen ────────────────────────────────────────────────────────────── */

.tr-arbeit {
  max-width: 560px; margin: 40px auto; text-align: center;
  background: #fff; border: 1.5px solid var(--bdr);
  border-radius: 18px; padding: 28px 26px; box-shadow: var(--shadow-sm);
}
.tr-arbeit-name { font-size: 13px; font-weight: 600; color: var(--txt); margin-bottom: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.tr-arbeit-text { font-size: 13px; color: var(--txt2); margin-bottom: 16px; min-height: 20px }
.tr-arbeit-fuss { font-size: 12px; color: var(--txt3); margin-top: 16px; line-height: 1.5 }

.tr-balken {
  height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden;
}
.tr-balken-fuellung {
  height: 100%; width: 0;
  background: linear-gradient(135deg, var(--acc), var(--cyan));
  transition: width .25s;
}
/* Kein Fortschritt bekannt (Pruefen, Umpacken): ein wandernder Streifen
   statt eines Balkens, der bei 100 % steht und nichts tut. */
.tr-balken-unbestimmt {
  background: linear-gradient(90deg,
    var(--bg2) 0%, var(--acc) 40%, var(--cyan) 60%, var(--bg2) 100%);
  background-size: 240% 100%;
  animation: tr-wandern 1.3s linear infinite;
  transition: none;
}
@keyframes tr-wandern {
  from { background-position: 120% 0 }
  to   { background-position: -120% 0 }
}

/* ── Editor-Kopf ──────────────────────────────────────────────────────────── */

.tr-kopf { align-items: flex-start; flex-wrap: wrap; gap: 16px }
.tr-kopf-links  { min-width: 0; flex: 1 }
.tr-kopf-rechts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap }

/* display:block, damit der Rueckweg ueber dem Titel steht und nicht neben
   ihm — ein Knopf ist von Haus aus inline-block und wuerde sich sonst in
   dieselbe Zeile wie die Ueberschrift setzen. */
.tr-zurueck {
  display: block;
  background: none; border: none; padding: 0 0 6px 0; cursor: pointer;
  font-size: 12px; color: var(--txt3);
}
.tr-zurueck:hover { color: var(--acc) }

.tr-titel {
  font-size: 20px; font-weight: 700; outline: none;
  border-bottom: 1.5px solid transparent; display: inline-block;
  min-width: 60px; max-width: 100%;
}
.tr-titel:hover { border-bottom-color: var(--bdr) }
.tr-titel:focus { border-bottom-color: var(--acc) }

.tr-kopf-meta {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  font-size: 11px; color: var(--txt3); margin-top: 8px;
}

.tr-btn {
  padding: 7px 14px; border-radius: 18px;
  border: 1.5px solid var(--bdr); background: #fff;
  color: var(--txt); cursor: pointer; font-size: 12px; font-weight: 600;
  transition: all .15s;
}
.tr-btn:hover { border-color: var(--acc); color: var(--acc) }
.tr-btn-gefahr:hover { border-color: #dc2626; color: #dc2626 }

.tr-export { display: flex; align-items: center; gap: 6px; flex-wrap: wrap }
.tr-export-lbl { font-size: 11px; color: var(--txt3); margin-right: 2px }

/* ── Tonleiste ────────────────────────────────────────────────────────────── */

.tr-tonleiste {
  position: sticky; top: 0; z-index: 5;
  background: #fff; border: 1.5px solid var(--bdr); border-radius: 14px;
  padding: 12px 14px; margin-bottom: 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.tr-tonleiste audio { flex: 1; min-width: 260px; height: 36px }
.tr-ton-hinweis { font-size: 11px; color: var(--txt3) }

.tr-ton-fehlt {
  background: var(--bg2); border-radius: 12px; padding: 12px 14px;
  font-size: 12px; color: var(--txt2); margin-bottom: 18px;
}

/* ── Sprecherleiste ───────────────────────────────────────────────────────── */

.tr-sprecherleiste {
  background: var(--bg2); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 20px;
}
.tr-sp-titel { font-size: 12px; font-weight: 700; color: var(--txt2); margin-bottom: 10px }
.tr-sp-reihe { display: flex; gap: 12px; flex-wrap: wrap }
.tr-sp-fuss  { font-size: 11px; color: var(--txt3); margin-top: 12px; line-height: 1.5; max-width: 640px }

.tr-sp {
  background: #fff; border: 1.5px solid var(--bdr); border-radius: 12px;
  padding: 10px 12px; min-width: 210px;
}
.tr-sp-name {
  width: 100%; border: none; outline: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--txt);
  border-bottom: 1.5px solid transparent; padding-bottom: 3px;
}
.tr-sp-name:hover { border-bottom-color: var(--bdr) }
.tr-sp-name:focus { border-bottom-color: var(--acc) }
.tr-sp-name::placeholder { font-weight: 500; color: var(--txt3) }

.tr-sp-wahl {
  margin-top: 8px; width: 100%; font-size: 11px; color: var(--txt2);
  border: 1px solid var(--bdr); border-radius: 8px;
  padding: 4px 6px; background: #fff; cursor: pointer;
}

.tr-sp-zufluss { margin-top: 8px; display: flex; gap: 5px; flex-wrap: wrap }
.tr-sp-chip {
  font-size: 10px; color: var(--txt3); background: var(--bg2);
  border-radius: 8px; padding: 2px 4px 2px 7px;
  display: inline-flex; align-items: center; gap: 2px;
}
.tr-sp-loesen {
  border: none; background: none; cursor: pointer;
  color: var(--txt3); font-size: 13px; line-height: 1; padding: 0 3px;
}
.tr-sp-loesen:hover { color: #dc2626 }

/* ── Segmentzeilen ────────────────────────────────────────────────────────── */

.tr-segmente {
  background: #fff; border: 1.5px solid var(--bdr);
  border-radius: 14px; overflow: hidden;
}

.tr-seg {
  display: grid;
  grid-template-columns: 62px 128px 1fr 30px;
  gap: 10px; align-items: start;
  padding: 7px 12px;
  border-top: 1px solid var(--bdr);
}
.tr-seg:first-child { border-top: none }
.tr-seg:hover { background: #fafbfc }

/* Das laufende Segment. Ein Streifen links statt einer Flaechenfarbe —
   die Zeile bleibt lesbar, waehrend man in ihr tippt. */
.tr-seg-aktiv { background: #eff6ff; box-shadow: inset 3px 0 0 var(--acc) }

.tr-seg-bearbeitet .tr-seg-zeit { color: #a16207 }

.tr-seg-zeit {
  border: none; background: none; cursor: pointer; padding: 2px 0;
  font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--txt3); text-align: left;
}
.tr-seg-zeit:hover { color: var(--acc); text-decoration: underline }

/* Ein Knopf, kein Text: ein Klick ordnet den Abschnitt jemand anderem zu.
   Er soll aber nicht wie ein Knopf aussehen, solange niemand daraufzeigt —
   in einer Liste mit 1.500 Zeilen waeren 1.500 Rahmen unerträglich. */
.tr-seg-sprecher {
  font-size: 12px; font-weight: 600; color: var(--txt2);
  padding: 2px 5px; margin: 0 -5px; text-align: left;
  border: none; background: none; cursor: pointer; border-radius: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.tr-seg-sprecher:hover { background: #eef2ff; color: var(--acc) }
/* Von Hand umgehaengt: eine gepunktete Unterkante, kein Farbwechsel —
   die Spalte muss beim Ueberfliegen ruhig bleiben. */
.tr-seg-umgehaengt { text-decoration: underline dotted; text-underline-offset: 3px }

.tr-seg-text {
  font-size: 13.5px; line-height: 1.55; color: var(--txt);
  outline: none; border-radius: 6px; padding: 2px 6px;
  margin: 0 -6px; min-height: 20px;
}
.tr-seg-text:hover { background: #f8fafc }
.tr-seg-text:focus { background: #fff; box-shadow: 0 0 0 2px var(--acc) }

.tr-seg-zurueck {
  border: none; background: none; cursor: pointer;
  color: var(--txt3); font-size: 14px; line-height: 1; padding: 3px;
}
.tr-seg-zurueck:hover { color: var(--acc) }

/* ── Kästen für die Zustände außerhalb von „fertig" ───────────────────────── */

.tr-wartekasten, .tr-fehlerkasten {
  border-radius: 14px; padding: 20px 22px;
  font-size: 13px; line-height: 1.6; max-width: 620px;
}
.tr-wartekasten { background: var(--bg2); color: var(--txt2) }
.tr-fehlerkasten { background: #fef2f2; color: #7f1d1d }
.tr-wartekasten-titel, .tr-fehlerkasten-titel {
  font-size: 14px; font-weight: 700; margin-bottom: 8px;
}
.tr-wartekasten-titel { color: var(--txt) }
.tr-fehlerkasten-titel { color: #b91c1c }

/* ── Platz für Aufnahmen ──────────────────────────────────────────────────── */

.tr-platz { margin-top: 24px; max-width: 420px }
.tr-platz-kopf {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 12px; color: var(--txt2); margin-bottom: 6px;
}
.tr-platz-eng { color: #b45309; font-weight: 600 }
.tr-platz-balken {
  height: 6px; background: var(--bg2); border-radius: 3px; overflow: hidden;
}
.tr-platz-fuellung {
  height: 100%; background: linear-gradient(135deg, var(--acc), var(--cyan));
  transition: width .3s;
}
.tr-platz-fuellung-eng { background: linear-gradient(135deg, #f59e0b, #dc2626) }
.tr-platz-fuss { font-size: 11px; color: var(--txt3); margin-top: 6px; line-height: 1.5 }

/* ── Laufende Verarbeitung in der Karte ───────────────────────────────────── */

.tr-lauf { margin-top: 10px }
.tr-lauf .tr-balken { height: 4px }
.tr-lauf-text { font-size: 11px; color: var(--txt3); margin-top: 5px; line-height: 1.45 }

.tr-marke-still { background: var(--bg2); color: var(--txt3) }

/* ── Tonleiste: die beiden Knöpfe ─────────────────────────────────────────── */

.tr-ton-knoepfe { display: flex; gap: 6px; flex-wrap: wrap }

/* ── Schwebendes Menü zum Umhängen ────────────────────────────────────────── */

.tr-menue {
  position: fixed; z-index: 1200;
  background: #fff; border: 1.5px solid var(--bdr); border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.16);
  padding: 6px; min-width: 200px; max-width: 280px;
}
.tr-menue-kopf {
  font-size: 11px; color: var(--txt3); padding: 4px 8px 6px;
}
.tr-menue-eintrag {
  display: block; width: 100%; text-align: left;
  padding: 7px 9px; border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--txt); border-radius: 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tr-menue-eintrag:hover { background: var(--bg2) }
.tr-menue-aktiv { font-weight: 600; color: var(--acc) }
.tr-menue-still {
  color: var(--txt3); font-size: 12px;
  border-top: 1px solid var(--bdr); margin-top: 4px; padding-top: 8px;
  border-radius: 0 0 8px 8px;
}

/* ── Sprecher entfernen ───────────────────────────────────────────────────── */

.tr-sp { position: relative }
.tr-sp-weg {
  position: absolute; top: 4px; right: 5px;
  border: none; background: none; cursor: pointer;
  color: var(--txt3); font-size: 15px; line-height: 1; padding: 2px 4px;
}
.tr-sp-weg:hover { color: #dc2626 }

/* ── Bibliotheks-Auswahl ──────────────────────────────────────────────────── */

.tr-overlay {
  position: fixed; inset: 0; z-index: 1300;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
}
.tr-lib-kasten {
  background: #fff; border: 1px solid var(--bdr); border-radius: 14px;
  width: min(420px, 92vw); max-height: 70vh; overflow-y: auto;
  padding: 18px; box-shadow: 0 8px 40px rgba(0,0,0,.3);
}
.tr-lib-kopf {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 6px;
}
.tr-lib-titel { font-weight: 700; font-size: 15px }
.tr-lib-zu {
  background: none; border: none; font-size: 20px; cursor: pointer;
  color: var(--txt3); line-height: 1;
}
.tr-lib-text { font-size: 12px; color: var(--txt3); margin-bottom: 12px; line-height: 1.5 }
.tr-lib-hinweis {
  font-size: 12px; color: #a16207; background: #fefce8;
  border-radius: 8px; padding: 8px 10px; margin-bottom: 12px; line-height: 1.5;
}
.tr-lib-liste { display: flex; flex-direction: column; gap: 8px }
.tr-lib-knopf {
  display: flex; align-items: center; gap: 8px; width: 100%;
  text-align: left; padding: 10px 12px;
  border: 1px solid var(--bdr); border-radius: 8px; background: #fff;
  cursor: pointer; font-size: 13px; color: var(--txt);
}
.tr-lib-knopf:hover { border-color: var(--acc); color: var(--acc) }
.tr-lib-leer { font-size: 13px; color: var(--txt3); padding: 8px 2px; line-height: 1.5 }

/* ── Schmale Fenster ──────────────────────────────────────────────────────── */

@media (max-width: 900px) {
  /* Zeitmarke und Sprecher wandern in eine Kopfzeile über den Text —
     bei 320 px Breite bleibt für drei Spalten kein Platz. */
  .tr-seg {
    grid-template-columns: 62px 1fr 30px;
    grid-template-areas: "zeit sprecher zurueck" "text text text";
    row-gap: 2px; padding: 9px 12px;
  }
  .tr-seg-zeit     { grid-area: zeit }
  .tr-seg-sprecher { grid-area: sprecher }
  .tr-seg-zurueck  { grid-area: zurueck }
  .tr-seg-text     { grid-area: text }

  .tr-kopf-rechts { width: 100% }
  .tr-sp { min-width: 100%; }
  .tr-tonleiste { position: static }
}
