:root {
  --bg: #eeeeee;
  --surface: #101011;
  --card: #1b1b1c;
  --card2: #252526;
  --line: #303033;
  --text: #f3f4f7;
  --muted: #9a9aa0;
  --primary: #05a479;
  --warning: #f2a23a;
  --w: 402px;
  --h: 874px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: var(--bg); color: var(--text); }
button { font: inherit; }
.demo-shell { display: grid; grid-template-columns: var(--w) 320px; gap: 24px; align-items: center; }
.phone { width: var(--w); height: var(--h); position: relative; overflow: hidden; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,.28); }
.route-panel { width: 320px; border-radius: 20px; background: #101011; color: var(--text); padding: 22px; border: 1px solid #2a2b2d; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.route-title { font-size: 18px; line-height: 26px; font-weight: 900; margin-bottom: 8px; }
.route-subtitle { color: var(--muted); font-size: 12px; line-height: 20px; margin-bottom: 14px; }
.route-list { list-style: none; margin: 0 0 18px; padding: 0; display: grid; gap: 8px; }
.route-list li { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; line-height: 18px; }
.route-list li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #6b6f76; flex: 0 0 auto; }
.route-list li.active { color: var(--text); font-weight: 800; }
.route-list li.active::before { background: var(--primary); }
.route-list li.done::before { background: #4a4d52; }
.route-list li.unmapped { opacity: .62; }
.route-hint { min-height: 36px; color: var(--muted); font-size: 12px; line-height: 20px; margin-bottom: 14px; }
.route-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.route-actions button { height: 40px; border: 0; border-radius: 999px; background: #ffffff; color: #101011; font-size: 28px; line-height: 1; font-weight: 900; display: grid; place-items: center; user-select: none; -webkit-user-select: none; touch-action: none; }
.route-actions button:active { transform: translateY(1px); }
@media (max-width: 760px) {
  .demo-shell { grid-template-columns: 1fr; gap: 12px; padding: 12px 0; }
  .route-panel { width: var(--w); order: -1; }
}
.screen { height: 100%; display: flex; flex-direction: column; background: var(--surface); }
.status { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 22px 16px 0; font-weight: 700; }
.nav { height: 52px; display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; padding: 0 8px; }
.nav h1 { margin: 0; text-align: center; font-size: 17px; line-height: 24px; }
.nav .left, .nav .right { border: 0; background: transparent; color: var(--text); min-height: 44px; }
.nav .right { color: var(--primary); font-size: 14px; }
.body { flex: 1; overflow: auto; padding: 16px; scrollbar-width: none; }
.body::-webkit-scrollbar { display: none; }
.bottom { padding: 12px 16px 24px; border-top: .5px solid var(--line); background: var(--surface); }
.primary { width: 100%; height: 48px; border: 0; border-radius: 999px; background: var(--primary); color: white; font-weight: 700; }
.primary:disabled { opacity: .42; }
.ghost { height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--card2); color: var(--text); }
.status-card, .card { background: var(--card); border-radius: 16px; }
.quick-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; margin: 10px 0 18px; }
.quick { height: 64px; border: 0; border-radius: 16px; background: var(--primary); color: white; font-size: 12px; font-weight: 700; }
.quick.active { background: var(--primary); color: white; }
.media-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; }
.thumb { position: relative; overflow: hidden; background: var(--card2); min-height: 88px; }
.media-grid .thumb { aspect-ratio: 1 / 1; min-height: 0; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .label { position: absolute; right: 5px; bottom: 4px; font-size: 10px; font-weight: 700; text-shadow: 0 1px 2px #000; }
.date { margin: 18px 4px 8px; font-size: 14px; font-weight: 700; }
.tabs { display: flex; gap: 8px; overflow: auto; margin-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.pill { flex: 0 0 auto; height: 32px; border: 0; border-radius: 999px; padding: 0 13px; background: var(--card2); color: var(--text); font-size: 12px; }
.pill.active { color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: rgba(5,164,121,.14); }
.template-list { display: grid; gap: 8px; padding-bottom: 12px; }
.template-card { border: 0; border-radius: 16px; background: var(--card); color: var(--text); display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px; text-align: left; }
.template-cover { width: 84px; height: 84px; border-radius: 8px; }
.template-title { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 800; }
.template-desc { color: var(--muted); font-size: 12px; line-height: 20px; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { height: 22px; display: inline-flex; align-items: center; border-radius: 999px; padding: 0 8px; background: var(--card2); color: var(--muted); font-size: 10px; }
.tag.green { color: var(--primary); background: rgba(5,164,121,.16); }
.preview { aspect-ratio: 9 / 16; height: 260px; border-radius: 8px; overflow: hidden; background: var(--card); position: relative; margin: 0 auto; }
.preview video { width: 100%; height: 100%; object-fit: cover; }
.video-controls { height: 34px; display: grid; grid-template-columns: 36px 1fr 48px; gap: 8px; align-items: center; margin: 8px 0 10px; }
.play-toggle { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--card2); color: var(--text); font-weight: 900; }
.time-total { color: var(--muted); font-size: 11px; text-align: right; }
.timeline-bar { height: 4px; border-radius: 999px; background: var(--line); overflow: hidden; }
.timeline-bar span { display: block; width: 0%; height: 100%; border-radius: inherit; background: var(--primary); }
.section-title { margin: 10px 0 6px; font-size: 14px; font-weight: 800; }
.subcopy { color: var(--muted); font-size: 12px; line-height: 20px; }
.rail { display: flex; gap: 10px; overflow-x: auto; margin: 8px -16px 0; padding: 0 16px 18px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.slot { flex: 0 0 132px; border: 0; border-radius: 16px; background: var(--card); color: var(--text); padding: 10px; text-align: left; }
.slot.fixed { opacity: .7; }
.slot .thumb { height: 82px; border-radius: 8px; margin-bottom: 8px; }
.slot-title { font-size: 12px; font-weight: 800; }
.slot-meta { color: var(--muted); font-size: 11px; line-height: 18px; margin-top: 2px; }
.overlay { position: absolute; right: 6px; bottom: 6px; height: 24px; border-radius: 999px; padding: 0 8px; background: rgba(16,16,17,.82); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.asset-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 4px; padding-bottom: 12px; }
.asset { height: 112px; border: 0; padding: 0; background: transparent; position: relative; overflow: hidden; }
.asset.selected::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 0 2px var(--primary); }
.check { position: absolute; right: 6px; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: rgba(16,16,17,.72); box-shadow: inset 0 0 0 1px rgba(255,255,255,.4); }
.asset.selected .check { background: var(--primary); box-shadow: none; }
.asset-count { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin: -2px 0 10px; }
.source-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.source-tabs .pill { width: 100%; padding: 0 6px; }
.locked-note { border-radius: 12px; background: rgba(242,162,58,.12); color: var(--warning); padding: 10px 12px; font-size: 12px; line-height: 18px; margin-bottom: 12px; }
.dialog-wrap { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.58); padding: 36px; }
.dialog { width: 100%; background: var(--card); border-radius: 16px; padding: 22px; }
.dialog h2 { font-size: 17px; margin: 0 0 12px; }
.dialog p { color: var(--muted); font-size: 12px; line-height: 20px; margin: 0 0 16px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; }
.video-fit-wrap { padding: 24px; align-items: end; }
.video-fit-dialog { padding: 18px; border: 1px solid var(--line); }
.fit-preview { height: 150px; border-radius: 8px; overflow: hidden; background: #050505; margin-bottom: 12px; }
.fit-preview video { width: 100%; height: 100%; object-fit: cover; display: block; }
.fit-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.fit-options .pill { width: 100%; }
.fit-meter { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; margin-bottom: 14px; }
.fit-meter span:last-child { color: var(--primary); font-weight: 800; }
.task { height: 72px; border-bottom: .5px solid var(--line); display: grid; grid-template-columns: 54px 1fr 88px; gap: 12px; align-items: center; }
.task .thumb { height: 52px; border-radius: 4px; min-height: 52px; }
.task-type { color: var(--primary); font-size: 10px; }
.task-name { font-size: 13px; font-weight: 700; }
.progress { height: 3px; border-radius: 999px; overflow: hidden; background: var(--line); margin-top: 6px; }
.progress span { display: block; height: 100%; background: var(--primary); }
.result-player { height: 420px; border-radius: 8px; overflow: hidden; background: var(--card); position: relative; }
.result-player video { width: 100%; height: 100%; object-fit: cover; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.result-actions .primary { grid-column: 1 / -1; }
.toast { position: fixed; left: 50%; bottom: 64px; transform: translateX(-50%); min-height: 40px; border-radius: 999px; padding: 11px 16px; background: rgba(37,37,38,.96); color: white; font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .18s; }
.toast.show { opacity: 1; }
