/* Shared pieces for the Videos & audio apps (video editor, recorder, voiceover, AI media). Uses ../shared/theme.css tokens. */
body { overflow-x: hidden; }
.mx-title { font-weight: 650; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); }
.mx-grow { flex: 1; }
.mx-bar-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mx-main { max-width: 1100px; margin: 0 auto; padding: 18px 16px 40px; }
.mx-hero { text-align: center; margin: 8px auto 18px; max-width: 720px; }
.mx-hero h1 { font-size: 28px; line-height: 1.2; margin: 6px 0 8px; letter-spacing: -.01em; }
.mx-hero p { color: var(--muted); margin: 0 auto; }
.mx-field { display: grid; gap: 5px; margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--fg); min-width: 0; }
.mx-field > span small, .mx-hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.mx-field input[type=range] { width: 100%; accent-color: var(--accent); }
.mx-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.mx-row > .mx-field { flex: 1 1 140px; }
.mx-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mx-seg button, .mx-chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: 600 13px/1.2 system-ui, sans-serif; color: var(--fg); cursor: pointer; }
.mx-seg button.on, .mx-seg button[aria-pressed=true], .mx-chip.on { background: #efedff; border-color: var(--sel); color: var(--accent); }
.mx-seg button:focus-visible, .mx-chip:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.ad-input { min-width: 0; max-width: 100%; }
textarea.ad-input { width: 100%; resize: vertical; line-height: 1.5; }
.mx-drop { display: grid; place-items: center; gap: 10px; text-align: center; padding: 34px 18px; border: 2px dashed #d3d0f5; border-radius: 18px; background: linear-gradient(180deg, #fff, #f8f7ff); cursor: pointer; }
.mx-drop.over { border-color: var(--accent); background: #f1efff; }
.mx-drop .big { font-size: 17px; font-weight: 700; }
.mx-drop p { margin: 0; color: var(--muted); }
.mx-msg { padding: 10px 12px; border-radius: 12px; background: #fff6e8; border: 1px solid #ffd9a0; color: #7a4a00; margin: 10px 0; }
.mx-msg.err { background: #fff0f0; border-color: #ffc7c7; color: #9b1c1c; }
.mx-msg.ok { background: #ecfdf3; border-color: #a6f0c6; color: #075e34; }
.mx-result { display: grid; gap: 10px; }
.mx-result video, .mx-result audio { width: 100%; max-height: 60vh; border-radius: 12px; background: #000; }
.mx-result audio { background: none; }
.mx-meta { color: var(--muted); font-size: 13px; }
.mx-time { font-variant-numeric: tabular-nums; font-weight: 650; }
.mx-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.mx-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Progress dialog (ui.js progressBox) */
.mx-progress { width: min(440px, calc(100vw - 32px)); }
.mx-progress-in { padding: 22px; display: grid; gap: 10px; }
.mx-progress h3 { margin: 0; font-size: 17px; }
.mx-progress-text { margin: 0; color: var(--muted); min-height: 1.4em; }
.mx-progress-pct { margin: 0; font-size: 12.5px; color: var(--muted); min-height: 1.2em; font-variant-numeric: tabular-nums; }
.mx-progress .btn { justify-self: end; }
.mx-bar { height: 10px; border-radius: 999px; background: #eceafd; overflow: hidden; position: relative; }
.mx-bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: inherit; transition: width .2s; }
.mx-bar.busy i { width: 35%; animation: mx-slide 1.1s linear infinite; }
@keyframes mx-slide { from { transform: translateX(-100%); } to { transform: translateX(300%); } }

/* Two-handle range (trimmers) */
.mx-range { position: relative; height: 54px; border-radius: 10px; background: #1b2133; overflow: hidden; touch-action: none; user-select: none; }
.mx-range .strip { position: absolute; inset: 0; display: flex; opacity: .85; }
.mx-range .strip canvas, .mx-range .strip img { flex: 1; min-width: 0; height: 100%; object-fit: cover; }
.mx-range .sel { position: absolute; top: 0; bottom: 0; border: 3px solid #ffc83d; border-radius: 8px; box-shadow: 0 0 0 9999px rgba(10, 12, 20, .55); pointer-events: none; }
.mx-range.cut .sel { box-shadow: none; background: rgba(239, 68, 68, .45); border-color: #ef4444; }
.mx-range .h { position: absolute; top: 0; bottom: 0; width: 22px; margin-left: -11px; background: #ffc83d; border-radius: 6px; cursor: ew-resize; display: grid; place-items: center; border: 0; padding: 0; }
.mx-range.cut .h { background: #ef4444; }
/* Handles sit inside the selection so they stay grabbable at the very start and end. */
.mx-range .h[data-h=start] { margin-left: 0; border-radius: 6px 2px 2px 6px; }
.mx-range .h[data-h=end] { margin-left: -22px; border-radius: 2px 6px 6px 2px; }
.mx-range .h::after { content: ""; width: 3px; height: 18px; border-radius: 2px; background: rgba(27, 33, 51, .55); }
.mx-range .h:focus-visible { outline: 3px solid #fff; }
.mx-range .ph { position: absolute; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; }

@media (max-width: 640px) {
  .mx-title { display: none; }
  .ad-brand .name { display: none; }
  .mx-main { padding: 12px 12px 90px; }
  .mx-hero h1 { font-size: 22px; }
  .ad-toast { bottom: 90px; }
}
