/* Clip bearbeiten: Transkript-Editor mit Wellenform. Handy: Schublade von unten, alles untereinander.
   Ab 760 px füllt die Ansicht den ganzen Schirm, ab 900 px Transkript links, Vorschau rechts, Zeitleiste unten. */

.sn { display: grid; gap: 26px; grid-template-areas: "vorschau" "zeit" "text" "unter"; min-width: 0; }
.sn-seite { display: contents; }
.sn h3 { font-size: 24px; }
.sn-kopf { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; }

/* Vorschau und Zeitwerte */
.sn-vorschau { grid-area: vorschau; display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 16px; align-items: start; }
.sn-video { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: 8px; background: #24221b; object-fit: cover; }
.sn-werte { display: grid; gap: 10px; min-width: 0; }
.sn .zeit-zeile { grid-template-columns: 64px minmax(0, 1fr); }
.sn .nudge { grid-column: 1 / -1; }
.sn-leise { font-size: 13px; }
.sn-untertitel { grid-area: unter; }

/* Transkript */
.sn-text { grid-area: text; display: grid; gap: 10px; min-width: 0; }
.sn-modus label { min-height: 36px; font-size: 14px; }
.sn-zum-clip { min-height: 32px; padding: 0 4px; border: 0; background: transparent; color: var(--tinte); font-weight: 600; font-size: 14px; text-decoration: underline; text-decoration-color: var(--linie-2); text-underline-offset: 3px; cursor: pointer; }
.sn-woerter { position: relative; max-height: 46dvh; overflow-y: auto; overscroll-behavior: contain; padding: 14px 16px; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); font-size: 16px; line-height: 1.85; }
.sn-woerter span { padding: 1px 0; border-radius: 3px; color: var(--grau); text-decoration: line-through; text-decoration-color: rgba(107, 103, 92, 0.55); text-decoration-thickness: 1px; cursor: pointer; transition: background-color 120ms ease; }
.sn-woerter span.drin { color: var(--tinte); text-decoration: none; }
.sn-woerter span.anfang { box-shadow: -3px 0 0 var(--signal); }
.sn-woerter span.schluss { box-shadow: 3px 0 0 var(--signal); }
.sn-woerter span.anfang.schluss { box-shadow: -3px 0 0 var(--signal), 3px 0 0 var(--signal); }
@media (hover: hover) and (pointer: fine) { .sn-woerter span:hover { background: var(--papier-2); } }

/* Zeitleiste mit Wellenform */
.sn-zeit { grid-area: zeit; display: grid; gap: 8px; min-width: 0; }
.sn-zoom { display: flex; align-items: center; gap: 6px; }
.sn-zoom .zahl { margin-right: 6px; font-size: 12.5px; color: var(--grau); }
.sn-zoom .knopf-mini { font-size: 18px; line-height: 1; }
.sn-welle { position: relative; height: 96px; overflow: hidden; border: 1px solid var(--linie); border-radius: 8px; background: var(--flaeche); cursor: grab; user-select: none; touch-action: pan-y; }
.sn-welle.zieht { cursor: grabbing; }
.sn-welle canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sn-wahl { position: absolute; top: 0; bottom: 0; background: rgba(229, 72, 31, 0.1); box-shadow: inset 0 2px 0 var(--signal), inset 0 -2px 0 var(--signal); cursor: move; touch-action: none; }
.sn-griff { position: absolute; z-index: 1; top: 0; bottom: 0; width: 24px; cursor: ew-resize; touch-action: none; }
.sn-griff[data-griff="start"] { left: -12px; }
.sn-griff[data-griff="ende"] { right: -12px; }
.sn-griff::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; margin-left: -1.5px; background: var(--signal); }
.sn-griff::after { content: ""; position: absolute; top: 50%; left: 50%; width: 10px; height: 30px; margin: -15px 0 0 -5px; border-radius: 3px; background: var(--signal); box-shadow: 0 0 0 2px var(--flaeche); transition: transform 140ms var(--ease-out); }
.sn-griff:focus-visible { outline: none; }
.sn-griff:focus-visible::after { box-shadow: 0 0 0 2px var(--flaeche), 0 0 0 4px var(--tinte); }
.zieht .sn-griff:focus::after { transform: scaleY(1.12); }
.sn-welle-hinweis { position: absolute; left: 12px; bottom: 6px; margin: 0; font-size: 12.5px; pointer-events: none; }
.sn-lineal { position: relative; height: 20px; overflow: hidden; font-size: 11.5px; color: var(--grau); }
.sn-lineal span { position: absolute; top: 0; padding-top: 6px; transform: translateX(-50%); white-space: nowrap; }
.sn-lineal span::before { content: ""; position: absolute; top: 0; left: 50%; width: 1px; height: 4px; background: var(--linie-2); }

/* Ganzer Schirm statt Schublade: ruhiges Einblenden statt Hereinfahren */
@media (min-width: 760px) {
  .schublade.schnitt { inset: 0; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; box-shadow: none; opacity: 0; transform: translateY(14px); transition: opacity 200ms ease, transform 260ms var(--ease-out), display 260ms allow-discrete, overlay 260ms allow-discrete; }
  .schublade.schnitt[open] { opacity: 1; transform: none; }
  @starting-style { .schublade.schnitt[open] { opacity: 0; transform: translateY(14px); } }
  .sn-vorschau { grid-template-columns: 120px minmax(0, 1fr); }
}
@media (min-width: 900px) {
  .schnitt .schublade-inhalt { display: flex; flex-direction: column; overflow: hidden; padding-bottom: 18px; }
  .sn { flex: 1; min-height: 0; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "text seite" "zeit zeit"; gap: 22px 32px; }
  .sn-seite { grid-area: seite; display: flex; flex-direction: column; gap: 26px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 4px 4px 0; }
  .sn-vorschau { grid-template-columns: 1fr; justify-items: center; }
  .sn-video { width: auto; height: min(38dvh, 400px); }
  .sn-werte { justify-self: stretch; }
  .sn-text { display: flex; flex-direction: column; min-height: 0; }
  .sn-woerter { flex: 1; min-height: 0; max-height: none; font-size: 17px; }
  .sn-welle { height: 104px; }
}
@media (prefers-reduced-motion: reduce) { .schublade.schnitt { transform: none !important; } }
