/* RallyPD Media Tools — local prototype. Indicative RallyPD look (navy + orange), not design-system tokens. */
:root {
  --navy-950: #0b1220;
  --navy-900: #0f172a;
  --navy-800: #1e293b;
  --navy-700: #334155;
  --navy-600: #475569;
  --page: #f3f4f6;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #111827;
  --muted: #4b5563;
  --muted-dark: #94a3b8;
  --pick: #c2410c;
  --pick-hover: #9a3412;
  --pick-soft: #fff4ed;
  --suggest: #3b82f6;
  --suggest-text: #1d4ed8;
  --suggest-soft: #eff6ff;
  --saved: #9db4d6;
  --ok: #15803d;
  --ok-soft: #f0fdf4;
  --err: #b91c1c;
  --err-soft: #fef2f2;
  --radius: 12px;
  --header-h: 52px;
  --side-w: 372px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page); }
body { font-size: 14px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.muted-dark { color: var(--muted-dark); }
.small { font-size: 12.5px; }
h1, h2 { letter-spacing: -0.01em; margin: 0; }

/* ---------- top bar ---------- */
.topbar { height: var(--header-h); background: var(--navy-900); color: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-mark { width: 26px; height: 26px; border-radius: 6px; background: #ea580c; display: grid; place-items: center; font-weight: 800; }
.brand-name { font-weight: 800; font-size: 16px; }
.brand-sep { color: #64748b; }
.brand-sub { font-weight: 500; color: #e2e8f0; }
.proto-tag { font-size: 11px; font-weight: 600; color: #cbd5e1; border: 1px solid #334155; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.btn-ghost-dark { background: transparent; color: #fff; border: 1px solid #475569; border-radius: 8px; padding: 6px 14px; font-weight: 600; }
.btn-ghost-dark:hover { background: #1e293b; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--side-w); gap: 20px; padding: 16px 20px; height: calc(100vh - var(--header-h)); }
.look-col { min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.side-col { min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; padding-right: 2px; padding-bottom: 20px; }

/* ---------- open view ---------- */
.open-view { display: grid; gap: 18px; align-content: start; max-width: 640px; margin: 24px auto; width: 100%; overflow-y: auto; }
.open-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: grid; gap: 14px; }
.open-card h1 { font-size: 22px; }
.open-card p { margin: 0; }
.drop-zone { border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 22px; display: grid; gap: 4px; justify-items: center; cursor: pointer; background: #f8fafc; text-align: center; }
.drop-zone:hover, .drop-zone.drag { border-color: var(--navy-600); background: #f1f5f9; }
.drop-zone input { display: none; }
.drop-title { font-weight: 700; }
.drop-sub { color: var(--muted); font-size: 13px; word-break: break-all; }
.auth-check { display: flex; gap: 10px; align-items: flex-start; background: #f8fafc; border-radius: 8px; padding: 12px; }
.auth-check input { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--navy-900); }
.btn-primary-dark { background: var(--navy-900); color: #fff; border: 0; border-radius: 8px; padding: 12px 16px; font-weight: 700; }
.btn-primary-dark:disabled { background: #cbd5e1; color: #f8fafc; }
.btn-block { width: 100%; }
.open-status { font-size: 13px; color: var(--muted); }
.inline-error { background: var(--err-soft); color: var(--err); border: 1px solid #fecaca; border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.link-btn { background: none; border: 0; color: #1d4ed8; text-decoration: underline; padding: 4px 0; font-weight: 600; justify-self: start; }
.link-btn.center { display: block; margin: 6px auto 0; color: var(--muted); text-decoration: none; }
.link-btn.center:hover { color: var(--text); }
.recent { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.recent h2 { font-size: 15px; margin-bottom: 10px; }
.recent ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.recent li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.recent li .r-name { font-weight: 600; word-break: break-all; }
.recent li .r-meta { color: var(--muted); font-size: 12.5px; }

/* ---------- workspace ---------- */
.work-view { display: flex; flex-direction: column; min-height: 0; flex: 1; gap: 10px; }
.source-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.source-ident { display: flex; align-items: center; gap: 12px; min-width: 0; }
.source-icon { width: 38px; height: 38px; border-radius: 9px; background: #e2e8f0; display: grid; place-items: center; color: var(--navy-800); }
.source-icon svg { width: 20px; height: 20px; }
.source-name { font-weight: 700; font-size: 15px; word-break: break-all; }
.source-meta { color: var(--muted); font-size: 12.5px; }
.source-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 99px; padding: 5px 10px; font-size: 12.5px; font-weight: 500; }
.chip-auth { background: #e8ebf0; color: var(--navy-700); }
.chip-suggest { border: 1.5px dashed var(--suggest); color: var(--suggest-text); background: var(--suggest-soft); padding: 3px 4px 3px 10px; }
.chip-btn { background: var(--suggest-text); color: #fff; border: 0; border-radius: 99px; padding: 3px 10px; font-weight: 700; font-size: 12px; }
.welcome { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 14px; display: flex; gap: 10px; align-items: center; font-size: 13.5px; }
.welcome svg { color: var(--ok); width: 18px; height: 18px; }

.look-panel { background: var(--navy-950); border-radius: 14px; padding: 12px 14px 10px; display: flex; flex-direction: column; gap: 8px; color: #e2e8f0; flex: 1; min-height: 520px; }
.stage { position: relative; flex: 1; min-height: 180px; background: #000; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.stage video { width: 100%; height: 100%; object-fit: contain; display: block; position: absolute; inset: 0; }
.stage-badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: rgba(2, 6, 23, 0.82); color: #fff; }
.badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; }
.badge b { font-variant-numeric: tabular-nums; }
.badge-ctx { background: var(--pick); }
.badge-ctx.saved { background: #dbe4f0; color: var(--navy-900); }
.badge-ctx.suggest { background: var(--suggest-soft); color: var(--suggest-text); }
.badge-state { position: absolute; top: 10px; right: 10px; }
.stage-error { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; background: rgba(15, 23, 42, 0.92); color: #fecaca; font-size: 14px; }

.controls { display: flex; align-items: center; gap: 8px; }
.round-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #fff; color: var(--navy-900); display: grid; place-items: center; }
.round-btn svg { fill: currentColor; stroke: none; width: 18px; height: 18px; }
.step-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--navy-800); color: #fff; border: 1px solid var(--navy-700); border-radius: 8px; padding: 8px 12px; font-weight: 600; }
.step-btn:hover { background: var(--navy-700); }
.step-btn svg { width: 14px; height: 14px; fill: currentColor; }
.clock { font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 700; margin-left: 6px; color: #fff; white-space: nowrap; }
.clock-dur { color: var(--muted-dark); font-weight: 500; }
.clock-frame { font-size: 12px; color: var(--muted-dark); font-weight: 500; margin-left: 8px; }
.spacer { flex: 1; }
.pick-actions { display: flex; gap: 8px; }
.btn-pick { display: inline-flex; align-items: center; gap: 8px; background: var(--pick); color: #fff; border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 700; font-size: 14.5px; }
.btn-pick:hover:not(:disabled) { background: var(--pick-hover); }
.btn-pick:disabled, .btn-edge:disabled { opacity: 0.45; }
.btn-edge { background: transparent; color: #fff; border: 1.5px solid #64748b; border-radius: 8px; padding: 8px 14px; font-weight: 700; }
.btn-edge:hover:not(:disabled) { border-color: #fff; }
.btn-edge.on { background: var(--pick); border-color: var(--pick); }

.label { font-weight: 700; font-size: 13px; color: #fff; }
.timeline-wrap { padding-top: 2px; }
.timeline-head, .strip-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.legend { display: flex; gap: 12px; color: #cbd5e1; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { display: inline-block; }
.lg-suggest { width: 14px; height: 10px; border: 1.5px dashed var(--suggest); border-radius: 2px; }
.lg-pick { width: 9px; height: 9px; background: var(--pick); transform: rotate(45deg); }
.lg-clip { width: 14px; height: 7px; background: var(--pick); border-radius: 2px; }
.lg-saved { width: 14px; height: 5px; background: var(--saved); border-radius: 2px; }
.lg-now { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.timeline { position: relative; height: 34px; margin: 4px 8px 0; cursor: pointer; touch-action: none; outline: none; }
.timeline:focus-visible { box-shadow: 0 0 0 2px #60a5fa; border-radius: 6px; }
.tl-track { position: absolute; left: 0; right: 0; top: 14px; height: 6px; border-radius: 3px; background: #334155; }
.tl-suggest { position: absolute; top: 6px; height: 22px; border: 1.5px dashed var(--suggest); border-radius: 5px; background: rgba(59, 130, 246, 0.14); min-width: 6px; pointer-events: none; }
.tl-clip { position: absolute; top: 12px; height: 10px; background: var(--pick); border-radius: 3px; min-width: 3px; pointer-events: none; }
.tl-saved-layer { position: absolute; inset: 0; pointer-events: none; }
.tl-saved { position: absolute; top: 25px; height: 4px; background: var(--saved); border-radius: 2px; min-width: 3px; }
.tl-saved.pt { width: 4px; height: 7px; top: 24px; }
.tl-saved.hl { background: #dbeafe; box-shadow: 0 0 0 1px #60a5fa; }
.tl-pick { position: absolute; top: 0; width: 10px; height: 10px; background: var(--pick); transform: translateX(-50%) rotate(45deg); pointer-events: none; }
.tl-now { position: absolute; top: 8px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-950); box-shadow: 0 0 0 1.5px #fff; transform: translateX(-50%); pointer-events: none; }
.tl-ticks { position: relative; height: 14px; margin: 0 8px; font-size: 11px; color: var(--muted-dark); }
.tl-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-ticks span:first-child { transform: none; }
.tl-ticks span:last-child { transform: translateX(-100%); }

.strip-wrap { border-top: 1px solid #1e293b; padding-top: 8px; }
.strip-tools { display: flex; align-items: center; gap: 12px; }
.spacing { color: var(--muted-dark); display: inline-flex; gap: 6px; align-items: center; }
.spacing select { background: var(--navy-800); color: #fff; border: 1px solid var(--navy-700); border-radius: 6px; padding: 2px 4px; font-size: 12px; }
.strip { display: flex; align-items: stretch; gap: 6px; margin-top: 6px; }
.strip-nav { width: 22px; border-radius: 6px; border: 1px solid var(--navy-700); background: var(--navy-800); color: #cbd5e1; font-size: 16px; padding: 0; }
.strip-tiles { flex: 1; display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.strip-tiles.dim { opacity: 0.55; }
.tile { position: relative; background: transparent; border: 0; padding: 0; color: #cbd5e1; display: grid; gap: 3px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.tile .img { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #1e293b; border: 2px solid transparent; }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile:hover .img { border-color: #64748b; }
.tile.now .img { border-color: #fff; }
.tile.now { color: #fff; font-weight: 700; }
.tile.picked .img { border-color: var(--pick); }
.tile.inclip .img { box-shadow: inset 0 -4px 0 var(--pick); }
.tile.edge-start .img::before, .tile.edge-end .img::before { content: ""; position: absolute; top: 0; bottom: 0; width: 5px; background: var(--pick); z-index: 1; }
.tile.edge-start .img::before { left: 0; }
.tile.edge-end .img::before { right: 0; }
.tile.insaved::after { content: ""; position: absolute; left: 3px; right: 3px; bottom: 15px; height: 3px; background: var(--saved); border-radius: 2px; }
.tile .tag { position: absolute; top: 3px; left: 3px; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; background: #fff; color: var(--navy-900); z-index: 2; }
.tile .tag.pick { background: var(--pick); color: #fff; left: auto; right: 3px; }
.tile.missing .img { opacity: 0.2; }

.edge-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid #1e293b; padding-top: 8px; }
.edge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #334155; border-radius: 9px; padding: 3px 6px; }
.edge-label { font-weight: 700; font-size: 13px; padding: 0 4px; color: #fff; }
.nudge { width: 30px; height: 28px; border-radius: 6px; border: 1px solid var(--navy-700); background: var(--navy-800); color: #fff; font-size: 16px; padding: 0; }
.nudge:disabled { opacity: 0.35; }
.edge-time { min-width: 76px; background: transparent; border: 0; color: #fff; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.edge-time:hover:not(:disabled) { text-decoration: underline; }
.edge-hint { font-size: 12.5px; }

/* ---------- right column ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.card h2 { font-size: 19px; font-weight: 800; }
.card-label { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #eef0f3; border-radius: 10px; padding: 4px; margin-bottom: 14px; }
.seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 8px; padding: 9px; background: transparent; font-weight: 700; color: var(--navy-800); }
.seg-btn.active { background: var(--navy-900); color: #fff; }
.seg-btn:disabled { opacity: 0.5; }
.empty-pick { border: 1.5px dashed #cbd5e1; border-radius: 10px; padding: 18px; text-align: center; display: grid; gap: 4px; color: var(--muted); margin-bottom: 12px; }
.empty-pick b { color: var(--text); font-size: 15px; }
.pick-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.pill { font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pill-pick { background: var(--pick); color: #fff; }
.preview-frame { position: relative; border: 3px solid var(--pick); border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.preview-frame img, .preview-frame video { width: 100%; height: 100%; object-fit: contain; display: block; }
.preview-loading { position: absolute; inset: 0; display: grid; place-items: center; color: #cbd5e1; font-size: 12.5px; background: rgba(15, 23, 42, 0.6); }
.preview-tag { position: absolute; top: 8px; left: 8px; display: inline-flex; gap: 6px; align-items: center; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(2, 6, 23, 0.8); padding: 3px 9px; border-radius: 99px; }
.preview-tag svg { width: 13px; height: 13px; }
.preview-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: linear-gradient(transparent, rgba(2, 6, 23, 0.85)); color: #fff; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.mini-play { width: 26px; height: 26px; border-radius: 50%; border: 0; background: #fff; color: var(--navy-900); display: grid; place-items: center; padding: 0; }
.mini-play svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }
.pbar { flex: 1; height: 3px; background: rgba(255, 255, 255, 0.3); border-radius: 2px; overflow: hidden; }
.pbar i { display: block; height: 100%; width: 0; background: #fff; }
.preview-caption { margin: 8px 0 6px; font-weight: 600; font-size: 13.5px; }
.fmt-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.fmt-row label { display: inline-flex; gap: 5px; align-items: center; }
.drift-note { display: flex; gap: 8px; background: #f3f4f6; border-radius: 8px; padding: 9px 11px; font-size: 13px; margin-bottom: 10px; }
.drift-note svg { margin-top: 2px; color: var(--muted); }
.drift-note button { background: none; border: 0; padding: 0; color: #1d4ed8; text-decoration: underline; font-weight: 600; font-size: 13px; }
.sound { margin: 12px 0 10px; }
.sound-opt { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; cursor: pointer; }
.sound-opt:has(input:checked) { border-color: var(--pick); background: var(--pick-soft); }
.sound-opt.disabled { opacity: 0.5; cursor: not-allowed; }
.sound-opt input { margin-top: 3px; accent-color: var(--pick); }
.sound-opt b { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.sound-opt small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.btn-save { width: 100%; background: var(--pick); color: #fff; border: 0; border-radius: 9px; padding: 12px; font-size: 16px; font-weight: 800; margin-top: 4px; }
.btn-save:hover:not(:disabled) { background: var(--pick-hover); }
.btn-save:disabled { background: #e5e7eb; color: #9ca3af; }
.save-meta { text-align: center; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.saving { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; display: grid; gap: 8px; }
.saving-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.saving-head .muted { display: inline-flex; gap: 4px; align-items: center; font-weight: 500; }
.ico-lock { width: 13px; height: 13px; }
.progress { height: 6px; border-radius: 3px; background: #e5e7eb; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: #64748b; transition: width 0.2s; }
.progress.indeterminate i { width: 35%; animation: indet 1.1s infinite ease-in-out; }
@keyframes indet { 0% { margin-left: -35%; } 100% { margin-left: 100%; } }
.btn-secondary { background: #fff; color: var(--text); border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 14px; font-weight: 600; }
.btn-secondary:hover { background: #f9fafb; }
.btn-small { padding: 5px 12px; font-size: 13px; justify-self: start; }
.btn-dark-small { background: var(--navy-900); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 13px; }

.notice { border-radius: 10px; padding: 12px; margin-top: 12px; display: grid; gap: 4px; font-size: 13.5px; }
.notice .n-title { font-weight: 800; display: flex; gap: 8px; align-items: center; }
.notice .n-title svg { width: 18px; height: 18px; }
.notice.ok { background: var(--ok-soft); border: 1px solid #bbf7d0; }
.notice.ok .n-title { color: var(--ok); }
.notice.err { background: var(--err-soft); border: 1px solid #fecaca; }
.notice.err .n-title { color: var(--err); }
.notice.info { background: #f3f4f6; border: 1px solid var(--line); }
.notice .n-actions { display: flex; gap: 8px; margin-top: 6px; align-items: center; flex-wrap: wrap; }
.notice .n-detail { font-family: ui-monospace, Menlo, monospace; font-size: 11px; color: var(--muted); white-space: pre-wrap; word-break: break-all; max-height: 80px; overflow: auto; }

.saved-head { display: flex; justify-content: space-between; align-items: center; }
.count { min-width: 26px; height: 26px; border-radius: 99px; background: #f3f4f6; display: grid; place-items: center; font-weight: 700; font-size: 13px; padding: 0 6px; }
#savedSub { margin: 2px 0 10px; }
.saved-empty { border: 1.5px dashed #d1d5db; border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.saved-list { display: grid; gap: 10px; }
.asset { border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: grid; gap: 8px; }
.asset.hl { border: 2px solid var(--navy-900); }
.asset.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { box-shadow: 0 0 0 4px rgba(21, 128, 61, 0.35); } to { box-shadow: 0 0 0 0 rgba(21, 128, 61, 0); } }
.asset-media { border-radius: 7px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.asset-media img, .asset-media video { width: 100%; height: 100%; object-fit: contain; display: block; }
.asset-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; }
.asset-chip { font-size: 11.5px; font-weight: 600; background: #f1f5f9; border-radius: 99px; padding: 2px 8px; color: var(--navy-700); display: inline-flex; gap: 4px; align-items: center; }
.asset-chip svg { width: 12px; height: 12px; }
.asset-from { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.asset-ok { font-size: 12.5px; color: var(--ok); font-weight: 600; display: flex; gap: 4px; align-items: center; }
.asset-ok svg { width: 13px; height: 13px; }
.asset-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.asset-actions a, .asset-actions button { font-size: 12.5px; padding: 5px 10px; border-radius: 7px; font-weight: 700; text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.asset-actions .a-show { background: var(--navy-900); color: #fff; border: 0; }
.asset-actions .a-show:disabled { background: #cbd5e1; }
.asset-actions .a-dl, .asset-actions .a-info { background: #fff; color: var(--text); border: 1px solid #d1d5db; }
.asset-warn { font-size: 12px; color: #92400e; background: #fffbeb; border-radius: 6px; padding: 5px 8px; }
.json { font-family: ui-monospace, Menlo, monospace; font-size: 11px; background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 10px; max-height: 300px; overflow: auto; white-space: pre; margin: 0; }

.harness summary { font-weight: 700; cursor: pointer; font-size: 13.5px; }
.harness[open] summary { margin-bottom: 8px; }
.h-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.h-grid label { display: grid; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
.h-grid input { border: 1px solid #d1d5db; border-radius: 6px; padding: 5px 7px; font: inherit; font-size: 12.5px; color: var(--text); min-width: 0; }
.h-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.h-sim { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; margin-bottom: 6px; }
.h-sim input { margin-top: 2px; }

/* Shorter laptop windows: tighten vertical rhythm so the strip and edge controls stay on screen. */
@media (max-height: 820px) {
  .layout { padding-top: 10px; padding-bottom: 10px; gap: 16px; }
  .look-panel { padding: 10px 12px 8px; gap: 6px; min-height: 470px; }
  .clock { font-size: 15.5px; }
  .welcome { padding: 6px 12px; }
}
@media (max-width: 1100px) {
  :root { --side-w: 330px; }
  .legend span:nth-child(1), .legend span:nth-child(4) { display: none; }
  .strip-tiles { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .strip-tiles .tile:nth-child(1), .strip-tiles .tile:nth-child(9) { display: none; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .look-panel { min-height: 0; }
  .stage { aspect-ratio: 16 / 9; flex: none; }
  .side-col { overflow: visible; }
}

/* ---------- account / sign-in (both layouts) ---------- */
.top-right { display: flex; align-items: center; gap: 14px; }
.account { display: inline-flex; align-items: center; gap: 10px; color: #cbd5e1; font-size: 13px; }
.link-dark { background: none; border: 0; color: #e2e8f0; text-decoration: underline; padding: 0; font-size: 13px; }
.signin-view { min-height: calc(100vh - var(--header-h)); display: grid; place-items: start center; padding: 48px 16px; }
.signin-card { width: min(420px, 100%); }
.field { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; color: var(--text); }
.stage-error .ve-inner { display: grid; gap: 10px; justify-items: center; max-width: 440px; }
.stage-error p { margin: 0; }
.stage-error .ve-sub { color: #cbd5e1; font-size: 13px; }

/* ---------- phone layout (Look · Pick · Keep on an iPhone) ---------- */
body.is-mobile { overflow: hidden; touch-action: manipulation; background: var(--navy-950); }
body.is-mobile .topbar, body.is-mobile #app { display: none !important; }
body.is-mobile .signin-view { min-height: 100dvh; background: var(--page); padding-top: calc(48px + env(safe-area-inset-top)); }
.m-root { position: fixed; inset: 0; height: 100dvh; display: flex; flex-direction: column; color: #e2e8f0; background: var(--navy-950); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
.m-root > section { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.m-root button { -webkit-tap-highlight-color: transparent; }
.m-muted { color: #94a3b8; font-size: 13.5px; }
.m-small { font-size: 12.5px; }
.m-center { text-align: center; }
.m-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-gap { gap: 10px; justify-content: flex-start; }
.m-grow { flex: 1; min-width: 0; }

.m-top { display: flex; align-items: center; gap: 8px; padding: calc(8px + env(safe-area-inset-top)) 10px 8px; background: #0e1626; flex: none; }
.m-top-light { background: transparent; }
.m-brand { display: flex; align-items: center; gap: 8px; font-weight: 800; color: #fff; flex: 1; }
.m-text-btn, .m-done { background: none; border: 0; color: #e2e8f0; font-size: 16px; font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; }
.m-done svg { width: 20px; height: 20px; }
.m-seg { flex: 1; display: grid; grid-template-columns: 1fr 1fr; background: #1e293b; border-radius: 12px; padding: 3px; max-width: 200px; margin: 0 auto; }
.m-seg-btn { min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: #cbd5e1; font-weight: 700; font-size: 15px; }
.m-seg-btn.active { background: #fff; color: var(--navy-900); }
.m-saved-btn { min-height: 44px; display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid #334155; border-radius: 22px; background: transparent; color: #fff; font-weight: 700; padding: 0 12px; font-size: 14.5px; }
.m-saved-btn b { color: #94a3b8; }
.m-saved-btn.fresh { border-color: #22c55e; background: #052e1a; }
.m-saved-btn.fresh b, .m-saved-btn.fresh svg { color: #4ade80; }

.m-stage { position: relative; flex: 1 1 auto; min-height: 150px; background: #000; overflow: hidden; }
/* Never crop the frame being judged: portrait fits by height, landscape by width. */
.m-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.m-tap-layer { position: absolute; inset: 0; background: transparent; border: 0; z-index: 1; }
.m-stage-top { position: absolute; top: 8px; left: 8px; display: flex; gap: 6px; z-index: 2; pointer-events: none; flex-wrap: wrap; max-width: 62%; }
.m-stage-right { position: absolute; top: 8px; right: 8px; z-index: 2; }
.m-playstate { position: absolute; right: 8px; bottom: 8px; z-index: 2; pointer-events: none; }
.m-suggest { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; border: 1.5px dashed #60a5fa; border-radius: 99px; background: rgba(15, 23, 42, 0.85); color: #bfdbfe; font-weight: 600; font-size: 13px; padding: 2px 3px 2px 10px; }
.m-suggest b { background: #1d4ed8; color: #fff; border-radius: 99px; padding: 5px 12px; }
.m-src-chip { position: absolute; left: 8px; bottom: 8px; z-index: 2; display: inline-flex; gap: 6px; align-items: center; font-size: 12px; background: rgba(2, 6, 23, 0.8); color: #e2e8f0; padding: 4px 10px; border-radius: 99px; max-width: 66%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.m-src-chip svg { width: 13px; height: 13px; }
.m-tap-load { position: absolute; inset: 0; margin: auto; width: 220px; height: 52px; z-index: 3; border: 0; border-radius: 12px; background: #fff; color: var(--navy-900); font-weight: 800; font-size: 16px; }
.m-video-error { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(15, 23, 42, 0.94); color: #fecaca; text-align: center; padding: 16px; font-size: 14px; }
.m-video-error .ve-inner { display: grid; gap: 10px; justify-items: center; }
.m-video-error p { margin: 0; }
.m-video-error .ve-sub { color: #cbd5e1; font-size: 13px; }

.m-look { flex: none; padding: 6px 12px 4px; background: var(--navy-950); }
.m-controls { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.m-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-time b { font-size: 24px; color: #fff; }
.m-time span { color: #94a3b8; font-size: 14px; }
.m-ctrl-group { display: flex; gap: 6px; }
.m-ctrl { width: 48px; height: 44px; border-radius: 10px; border: 1px solid #334155; background: #1e293b; color: #fff; display: grid; place-items: center; }
.m-ctrl svg { width: 18px; height: 18px; }
.m-ctrl:disabled { opacity: 0.35; }
.m-ctrl-play { background: #fff; color: var(--navy-900); border-color: #fff; }
/* Thin bar, 44 px hit area */
.m-bar { position: relative; height: 44px; margin: 0 6px; touch-action: none; }
.m-bar-track { position: absolute; left: 0; right: 0; top: 19px; height: 6px; border-radius: 3px; background: #334155; }
.m-bar-suggest { position: absolute; top: 12px; height: 20px; margin-left: -3px; border: 1.5px dashed #60a5fa; border-radius: 5px; background: rgba(59, 130, 246, 0.14); pointer-events: none; min-width: 6px; }
.m-bar-clip { position: absolute; top: 17px; height: 10px; background: var(--pick); border-radius: 3px; min-width: 3px; pointer-events: none; }
.m-bar-pick { position: absolute; top: 4px; width: 10px; height: 10px; background: var(--pick); transform: translateX(-50%) rotate(45deg); pointer-events: none; }
.m-bar-saved-layer { position: absolute; inset: 0; pointer-events: none; }
.m-bar-saved { position: absolute; top: 30px; height: 4px; background: var(--saved); border-radius: 2px; min-width: 3px; }
.m-bar-saved.pt { width: 4px; margin-left: -2px; }
.m-bar-now { position: absolute; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 3px solid var(--navy-950); box-shadow: 0 0 0 1.5px #fff; transform: translateX(-50%); pointer-events: none; }

/* Strip: the pictures move, the white box stays */
.m-strip { position: relative; height: 66px; overflow: hidden; touch-action: none; margin: 2px -12px 0; cursor: grab; }
.m-strip.dim .m-strip-track { opacity: 0.5; }
.m-strip-track { position: absolute; inset: 0; }
.m-tile { position: absolute; top: 5px; left: 0; width: 56px; height: 56px; border-radius: 7px; overflow: hidden; background: #1e293b; border: 2px solid transparent; will-change: transform; }
.m-tile img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.m-tile.picked { border-color: var(--pick); }
.m-tile.picked::after { content: ""; position: absolute; top: 3px; left: 50%; width: 9px; height: 9px; margin-left: -4px; background: var(--pick); transform: rotate(45deg); }
.m-tile.inclip { box-shadow: inset 0 -5px 0 var(--pick); }
.m-tile.edge-start::before, .m-tile.edge-end::before { content: ""; position: absolute; top: 0; bottom: 0; width: 5px; background: var(--pick); z-index: 1; }
.m-tile.edge-start::before { left: 0; }
.m-tile.edge-end::before { right: 0; }
.m-tile.insaved { box-shadow: inset 0 -3px 0 var(--saved); }
.m-tile.inclip.insaved { box-shadow: inset 0 -5px 0 var(--pick); }
.m-strip-box { position: absolute; top: 1px; left: 50%; width: 64px; height: 64px; margin-left: -32px; border: 3px solid #fff; border-radius: 10px; pointer-events: none; box-shadow: 0 0 0 2px rgba(2, 6, 23, 0.6); }
.m-strip-box::before { content: ""; position: absolute; top: -3px; left: 50%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
.m-strip-caption { text-align: center; font-size: 12.5px; color: #94a3b8; padding: 3px 0 2px; }
.m-strip-caption.adjusting { color: #fdba74; font-weight: 600; }

/* Keep sheet: two heights */
.m-sheet { flex: none; background: #fff; color: var(--text); border-radius: 18px 18px 0 0; padding: 4px 16px calc(12px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.3); z-index: 5; }
.m-sheet.expanded { position: absolute; left: 0; right: 0; bottom: 0; top: calc(56px + env(safe-area-inset-top)); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.m-work { position: relative; }
.m-work.sheet-expanded .m-stage, .m-work.sheet-expanded .m-look { filter: brightness(0.35); }
.m-grabber { align-self: center; width: 64px; height: 22px; border: 0; background: transparent; position: relative; flex: none; }
.m-grabber::after { content: ""; position: absolute; left: 14px; right: 14px; top: 8px; height: 5px; border-radius: 3px; background: #cbd5e1; }
.m-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; margin: 0; color: var(--text); }
.m-head { margin-top: 2px; }
.m-primary, .m-dark, .m-secondary { min-height: 52px; border-radius: 12px; font-size: 17px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; text-decoration: none; }
.m-primary { border: 0; background: var(--pick); color: #fff; width: 100%; }
.m-primary:disabled { background: #e5e7eb; color: #9ca3af; }
.m-primary svg, .m-secondary svg { width: 18px; height: 18px; }
.m-dark { border: 0; background: var(--navy-900); color: #fff; }
.m-dark:disabled { background: #cbd5e1; }
.m-secondary { border: 1.5px solid #d1d5db; background: #fff; color: var(--text); width: 100%; }
.m-small-btn { min-height: 44px; font-size: 14.5px; padding: 0 14px; width: auto; }
.m-save-small { width: auto; min-height: 52px; padding: 0 22px; }
.m-link { background: none; border: 0; color: #1d4ed8; font-weight: 700; font-size: 15px; min-height: 44px; }
.m-center-btn { align-self: center; color: var(--muted); }
.m-picked { align-items: center; }
.m-picked-thumb { width: 52px; height: 64px; border-radius: 9px; border: 3px solid var(--pick); padding: 0; overflow: hidden; background: #000; flex: none; }
.m-picked-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-picked-title { font-weight: 800; font-size: 17px; display: flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; }
.diamond { width: 10px; height: 10px; background: var(--pick); transform: rotate(45deg); display: inline-block; }
.m-preview { border: 3px solid var(--pick); border-radius: 14px; overflow: hidden; background: #000; height: min(46dvh, 420px); display: grid; place-items: center; flex: none; }
.m-preview-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.m-preview-video .preview-frame { border: 0; border-radius: 0; width: 100%; height: 100%; aspect-ratio: auto; }
.m-caption { font-weight: 700; text-align: center; margin: 2px 0 0; }
.m-fmt { font-size: 13px; }
.m-label { font-weight: 700; color: var(--muted); font-size: 14px; }
.m-sound { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.m-sound-opt { display: flex; gap: 8px; align-items: flex-start; text-align: left; border: 1.5px solid #d1d5db; border-radius: 12px; background: #fff; padding: 10px; min-height: 64px; color: var(--text); }
.m-sound-opt b { display: block; font-size: 15.5px; }
.m-sound-opt small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.m-sound-opt.on { border-color: var(--pick); background: var(--pick-soft); }
.m-sound-opt:disabled { opacity: 0.5; }
.m-radio { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9ca3af; flex: none; margin-top: 2px; }
.m-sound-opt.on .m-radio { border-color: var(--pick); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 9px var(--pick); }
.m-edges { align-items: stretch; }
.m-edge { flex: 1; min-height: 56px; border: 1.5px solid #d1d5db; border-radius: 12px; background: #fff; text-align: left; padding: 6px 12px; display: grid; color: var(--text); }
.m-edge.on { border-color: var(--pick); background: var(--pick-soft); }
.m-edge-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.m-edge.on .m-edge-label { color: var(--pick); }
.m-edge-time { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.m-dur { align-self: center; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.m-error-text { color: var(--err); font-size: 13.5px; margin: 0; }
.m-saving { display: grid; gap: 8px; }
.m-progress { height: 6px; border-radius: 3px; background: #e5e7eb; overflow: hidden; }
.m-progress i { display: block; height: 100%; width: 0; background: #64748b; transition: width 0.2s; }
.m-progress.indeterminate i { width: 35% !important; animation: indet 1.1s infinite ease-in-out; }
.m-fail { background: var(--err-soft); border: 1px solid #fecaca; border-radius: 12px; padding: 12px; display: grid; gap: 6px; color: var(--text); }
.m-fail p { margin: 0; font-size: 14px; }
.m-fail-title { color: var(--err); font-weight: 800; display: flex; gap: 8px; align-items: center; }
.m-fail-title svg { width: 18px; height: 18px; }
.m-saved-note { display: flex; gap: 12px; align-items: center; }
.m-note-thumb { width: 52px; height: 64px; object-fit: cover; border-radius: 8px; background: #000; flex: none; }
.m-ok-title { color: var(--ok); font-weight: 800; font-size: 17px; display: flex; gap: 6px; align-items: center; }
.m-ok-title svg { width: 16px; height: 16px; }
.m-info { font-size: 13px; color: var(--muted); background: #f3f4f6; border-radius: 8px; padding: 6px 10px; }

/* Open / library */
.m-open { background: var(--page); color: var(--text); overflow-y: auto; }
.m-open .m-brand { color: var(--text); }
.m-open .m-text-btn { color: var(--muted); }
.m-open-body { padding: 8px 18px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; align-content: start; }
.m-open-body h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 6px 0 0; }
.m-open-body .m-muted, .m-saved-body .m-muted { color: var(--muted); }
.m-big-btn { min-height: 56px; border-radius: 12px; background: var(--navy-900); color: #fff; font-weight: 800; font-size: 17px; display: grid; place-items: center; }
.m-file { display: none; }
.m-h2 { font-size: 16px; margin: 10px 0 0; }
.m-recent { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.m-recent-item { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: 12px; display: grid; gap: 2px; min-height: 56px; color: var(--text); }
.m-recent-name { font-weight: 700; word-break: break-all; }
.m-error { background: var(--err-soft); color: var(--err); border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.m-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.55); display: flex; align-items: flex-end; z-index: 20; }
.m-sheet-modal { width: 100%; max-height: 92dvh; overflow-y: auto; gap: 10px; padding-top: 4px; }
.m0-file { display: flex; gap: 12px; align-items: center; }
.m0-thumb { width: 64px; height: 84px; border-radius: 10px; background: #0f172a; object-fit: cover; flex: none; }
.m0-name { font-weight: 800; font-size: 17px; word-break: break-all; }
.m-declare { display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--navy-900); border-radius: 12px; padding: 12px; font-size: 16px; background: #f8fafc; }
.m-declare input { width: 24px; height: 24px; accent-color: var(--navy-900); flex: none; }

/* Saved screen */
.m-saved-screen { background: var(--page); color: var(--text); overflow-y: auto; }
.m-done-dark { color: var(--text); }
.m-saved-body { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); display: grid; gap: 12px; align-content: start; }
.m-saved-body h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.m-saved-list { display: grid; gap: 12px; }
.m-asset { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: flex; gap: 12px; }
.m-asset-clip.first { border: 2px solid var(--navy-900); }
.m-asset-media { position: relative; width: 44%; flex: none; border-radius: 10px; overflow: hidden; background: #000; align-self: flex-start; }
.m-asset-media video { width: 100%; display: block; max-height: 260px; object-fit: contain; }
.m-dur-chip { position: absolute; right: 6px; top: 6px; background: rgba(2, 6, 23, 0.85); color: #fff; font-weight: 700; font-size: 12px; border-radius: 6px; padding: 2px 6px; pointer-events: none; }
.m-asset-info { display: grid; gap: 6px; align-content: start; min-width: 0; flex: 1; }
.m-asset-info .m-dark, .m-asset-info .m-secondary { min-height: 44px; font-size: 15px; }
.m-asset-title { font-weight: 800; font-size: 19px; }
.m-asset-thumb { width: 76px; height: 96px; border-radius: 10px; overflow: hidden; background: #000; flex: none; }
.m-asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.m-fail .m-dark, .m-asset .m-dark, .m-asset .m-secondary { white-space: nowrap; }
.m-asset-image .m-small-btn { padding: 0 10px; font-size: 14px; }
.m-src-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
