/* media tools — styles owned by the media work; keep area-specific rules here, shared tokens stay in style.css */

/* the device check: a quiet list with a dot per line (green: fine, amber: slower or limited) */
.mx-caps { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--panel); }
.mx-caps-h { margin: 0 0 6px; font-weight: 600; font-size: 14px; }
.mx-caps ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mx-caps li { position: relative; padding-left: 18px; font-size: 14px; color: var(--muted); line-height: 1.4; }
.mx-caps li::before { content: ""; position: absolute; left: 2px; top: .5em; width: 8px; height: 8px; border-radius: 50%; background: var(--local); }
.mx-caps li.warn::before { background: #C99400; }
.mx-caps li.warn { color: var(--ink); }

.mx-info { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.mx-info:empty, .mx-status:empty { display: none; }
.mx-plan { color: var(--ink); background: var(--soft); border-radius: 10px; padding: 10px 12px; }
.mx-opts [hidden] { display: none; }

/* progress: step and percent above the bar, time left under it */
.mx-progress { display: grid; gap: 6px; }
.mx-progress[hidden] { display: none; }
.mx-prow { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; }
.mx-pct, .mx-eta { font-variant-numeric: tabular-nums; }
.mx-eta { font-size: 14px; color: var(--muted); }
.mx-progress progress { appearance: none; -webkit-appearance: none; width: 100%; height: 12px; border: 0; border-radius: 999px; background: var(--soft); overflow: hidden; }
.mx-progress progress::-webkit-progress-bar { background: var(--soft); border-radius: 999px; }
.mx-progress progress::-webkit-progress-value { background: var(--yellow); border-radius: 999px; transition: width .2s var(--ease-out); }
.mx-progress progress::-moz-progress-bar { background: var(--yellow); border-radius: 999px; }
@media (prefers-reduced-motion: reduce) { .mx-progress progress::-webkit-progress-value { transition: none; } }

.mx-result { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 8px; }
.mx-result .bigout { margin: 0; }
.mx-play-video { width: 100%; max-height: 50vh; border-radius: 12px; background: #000; }
.mx-play-audio { width: 100%; }
.mx-actions [hidden] { display: none; }

/* quick edit: preview, then a range bar with two handles */
.mx-editor { display: grid; gap: 10px; }
.mx-editor[hidden] { display: none; }
.mx-preview { width: 100%; max-height: 46vh; border-radius: 12px; background: #000; transform: rotate(var(--rot, 0deg)) scale(var(--fitrot, 1)); transition: transform .25s var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .mx-preview { transition: none; } }
.mx-scrub { position: relative; height: 36px; }
.mx-track, .mx-fill { position: absolute; top: 14px; height: 8px; border-radius: 999px; }
.mx-track { left: 0; right: 0; background: var(--soft); }
.mx-fill { background: var(--yellow); }
.mx-scrub input[type=range] { position: absolute; inset: 0; width: 100%; margin: 0; background: none; pointer-events: none; appearance: none; -webkit-appearance: none; height: 36px; }
.mx-scrub input[type=range]::-webkit-slider-runnable-track { background: none; height: 36px; }
.mx-scrub input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 18px; height: 32px; margin-top: 2px; border-radius: 6px; background: var(--ink); border: 2px solid var(--panel); cursor: ew-resize; }
.mx-scrub input[type=range]::-moz-range-track { background: none; }
.mx-scrub input[type=range]::-moz-range-thumb { pointer-events: auto; width: 14px; height: 28px; border-radius: 6px; background: var(--ink); border: 2px solid var(--panel); cursor: ew-resize; }
.mx-scrub input[type=range]:focus-visible::-webkit-slider-thumb { outline: 3px solid var(--blue); outline-offset: 1px; }
.mx-trow { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; }
.mx-times { font-variant-numeric: tabular-nums; }

@media (max-width: 560px) {
  .mx-trow .inline { width: 100%; }
  .mx-trow .inline .btn { flex: 1; }
  .mx-actions .btn { flex: 1; }
}

/* device check folds like a details box; its summary carries the key fact */
.mx-caps summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; list-style: none; font-size: 14px; }
.mx-caps summary::-webkit-details-marker { display: none; }
.mx-caps summary::after { content: "Show"; margin-left: auto; color: var(--muted); font-size: 13px; }
.mx-caps[open] summary::after { content: "Hide"; }
.mx-caps[open] summary { margin-bottom: 8px; }
.mx-caps .mx-caps-h { margin: 0; }
.mx-caps-key { color: var(--muted); }
.mx-caps-key.warn { color: var(--server); font-weight: 600; }
.mx-caps[open] .mx-caps-key { display: none; }
@media (min-width: 900px) { .mx-caps ul { grid-template-columns: 1fr 1fr; column-gap: 24px; } }

.mx-part { display: grid; gap: 8px; }
.mx-part-h { margin: 0; font-size: 14px; font-weight: 600; }
.mx-part-h .note { font-weight: 400; }
