/*
 * Page « Montage » : reprend la mise en page du studio (main.css) — lecteur à gauche,
 * panneau à droite (dessous sur tablette en portrait) — avec la barre de lecture et la frise.
 */

.montage-main {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}
.player[hidden] { display: none; }
.menu button:disabled { opacity: .5; cursor: not-allowed; text-decoration: none; }

.btn.btn-resume {
  pointer-events: auto;
  border-color: #fff;
  background: rgba(0, 0, 0, .7);
  color: #fff;
}
.btn.btn-resume:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 7px #111418; }

/* ---------- Barre de lecture et frise ---------- */

.transport {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 6px;
  border-radius: var(--radius);
  background: var(--panel);
}
.transport-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }

.play-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.play-btn svg { width: 24px; height: 24px; fill: currentColor; }
.play-btn .i-pause, .play-btn.is-playing .i-play { display: none; }
.play-btn.is-playing .i-pause { display: block; }
.play-btn:disabled { background: var(--border-strong); cursor: not-allowed; }
.play-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.times { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.times [data-out-total] { color: var(--muted); font-weight: 600; }
.zoom { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.zoom .btn-icon { font-size: 1.3rem; font-weight: 700; }
.zoom-level { min-width: 3.2em; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.frise-hint { margin: 0; font-size: .8rem; }

.frise {
  display: block;
  width: 100%;
  height: 90px;
  border-radius: 8px;
  touch-action: none;
  cursor: pointer;
}
.position { display: block; }
.position input { display: block; width: 100%; min-height: 32px; margin: 0; accent-color: var(--accent); }
.position input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Panneau ---------- */

.montage-panel { flex-basis: 360px; }
.montage-panel:focus { outline: none; }
.montage-tools { display: flex; flex-direction: column; gap: 12px; }
.montage-panel h4.sub { margin: 4px 0 0; font-size: .9rem; }

.cut-row .btn { flex: 1 1 auto; }
.cut-row svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.btn-small { padding: 0 12px; font-size: .9rem; }
.file-btn.is-disabled { opacity: .4; cursor: not-allowed; }

/* Liste des parties : « 1. 00:00,0 → 00:12,3 · gardée · Supprimer » */
.segments, .tracks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.segment {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px 2px 0;
  border: 1px solid var(--border);
  border-left: 4px solid var(--ok);
  border-radius: 8px;
  background: var(--field);
}
.seg-title { font-weight: 700; }
.seg-time { white-space: nowrap; }
.segment.is-current { box-shadow: 0 0 0 2px var(--accent); }
.seg-go {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 44px;
  padding: 4px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  text-align: left;
  cursor: pointer;
}
.seg-go:hover .seg-title { text-decoration: underline; }
.seg-go:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: 6px; }
.seg-badge { color: var(--muted); font-weight: 400; }
.seg-actions { display: flex; gap: 4px; flex: 0 0 auto; }
.seg-actions .btn-icon-text { min-width: 44px; padding: 0 8px; font-size: 1.1rem; font-weight: 700; }
.seg-actions svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.track {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--cue);
  border-radius: 8px;
  background: var(--field);
}
.track-name { margin: 0; font-weight: 700; font-size: .9rem; overflow-wrap: anywhere; }

.export-hint { margin-top: 4px; }

/* Fenêtres « Exporter » et « Retour au studio » */
.export-dlg { width: min(520px, calc(100vw - 24px)); }
.export-dlg .site-dlg-body { display: flex; flex-direction: column; gap: 12px; padding-top: 14px; }
.export-done:empty { display: none; }
.export-done { margin: 0; font-weight: 700; }
.export-progress { display: flex; flex-direction: column; gap: 8px; font-size: .9rem; }
.export-progress progress { width: 100%; height: 12px; accent-color: var(--accent); }
.export-progress [data-export-pct] { font-variant-numeric: tabular-nums; font-weight: 700; }

@media (max-width: 900px), (orientation: portrait) {
  .montage-main { flex: 1 1 auto; min-height: 260px; }
  .frise { height: 72px; }
}
.export-dlg .site-dlg-body a.btn-download { color: #fff; text-decoration: none; }
