:root {
      --bg: #111;
      --panel: #1b1b1c;
      --panel2: #242426;
      --line: #303031;
      --text: #efeff4;
      --muted: #909093;
      --green: #05a47a;
      --green2: #5ddcac;
      --amber: #f0a21a;
      --purple: #8a63ff;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }
    * { box-sizing: border-box; }
    body {
      margin: 0;
      min-height: 100vh;
      display: grid;
      place-items: center;
      background: radial-gradient(circle at 12% 12%, rgb(5 164 122 / 14%), transparent 360px), #050505;
      color: var(--text);
      overflow: hidden;
    }
    button { font: inherit; }
    .stage { width: min(1120px, 100vw); height: min(920px, 100vh); display: grid; grid-template-columns: 402px 1fr; gap: 28px; align-items: center; padding: 24px; }
    .phone { width: 402px; height: 874px; border-radius: 30px; overflow: hidden; position: relative; background: var(--bg); border: 1px solid #202022; box-shadow: 0 18px 50px rgb(0 0 0 / 45%); }
    .screen { position: absolute; inset: 0; padding: 0 16px; background: var(--bg); }
    .status { height: 62px; display: flex; justify-content: space-between; align-items: center; padding: 0 8px; font-size: 12px; }
    .brand { color: #596070; font-size: 9px; font-weight: 800; }
    .nav { height: 52px; display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 0 16px; }
    .back { width: 28px; height: 36px; border: 0; background: transparent; color: var(--text); font-size: 28px; cursor: pointer; }
    h1, h2, h3, p { margin: 0; }
    h1 { font-size: 18px; line-height: 24px; font-weight: 800; }
    h2 { font-size: 17px; line-height: 24px; font-weight: 800; }
    h3 { font-size: 13px; line-height: 18px; font-weight: 800; }
    p, .meta { color: var(--muted); font-size: 11px; line-height: 17px; }
    .body { height: calc(100% - 114px); overflow: auto; scrollbar-width: none; padding-bottom: 18px; }
    .body::-webkit-scrollbar { display: none; }
    .card { background: var(--panel); border-radius: 16px; }
    .btn { height: 46px; border: 0; border-radius: 999px; color: var(--text); background: linear-gradient(135deg, var(--green), var(--green2)); font-size: 14px; font-weight: 800; cursor: pointer; }
    .btn.secondary { background: var(--panel); border: 1px solid var(--line); }
    .btn.warning { background: linear-gradient(135deg, var(--amber), #ffd36b); color: #2b1c00; }
    .btn:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.45); }
    .task-entry { width: 100%; height: 56px; margin-top: 16px; border: 0; color: var(--text); display: flex; justify-content: center; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; cursor: pointer; }
    .function-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
    .function { height: 64px; border: 0; border-radius: 16px; color: #f4fff7; background: linear-gradient(135deg, var(--green), var(--green2)); display: grid; place-items: center; font-size: 12px; font-weight: 800; cursor: pointer; position: relative; }
    .quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0 18px; }
    .quick { height: 64px; border: 0; border-radius: 16px; color: #f4fff7; background: linear-gradient(135deg, var(--green), var(--green2)); display: grid; place-items: center; text-align: center; font-size: 12px; line-height: 16px; font-weight: 800; cursor: pointer; }
    .pill { height: 32px; border: 0; border-radius: 999px; padding: 0 13px; background: var(--panel2); color: var(--text); font-size: 12px; font-weight: 800; }
    .pill.active { color: var(--green2); box-shadow: inset 0 0 0 1px var(--green); background: rgb(5 164 122 / 14%); }
    .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: rgb(255 255 255 / 16%); font-size: 11px; }
    .new { position: absolute; top: -6px; right: -4px; padding: 2px 6px; border-radius: 999px; color: #05241c; background: var(--green2); font-size: 8px; font-weight: 900; }
    .date { margin: 22px 0 8px; font-size: 13px; font-weight: 800; }
    .media-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
    .thumb { aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; position: relative; background: linear-gradient(135deg, #12151b, #243044); }
    .thumb.deep { background: radial-gradient(circle at 38% 42%, rgb(255 255 255 / 28%), transparent 16%), linear-gradient(135deg, #0a111f, #18345d); }
    .thumb.moon { background: radial-gradient(circle at 42% 48%, #d7dbe4 0 15%, transparent 16%), linear-gradient(135deg, #15171d, #717985); }
    .thumb.milky { background: radial-gradient(circle at 44% 52%, rgb(240 240 255 / 36%), transparent 28%), linear-gradient(135deg, #130c1f, #5a2a62); }
    .thumb.video { background: linear-gradient(135deg, #10191b, #05606e); }
    .thumb.site { background: linear-gradient(135deg, #151717, #687274); }
    .thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
    .album-thumb { min-height: 0; }
    .thumb span { position: absolute; left: 6px; bottom: 5px; font-size: 8px; font-weight: 900; }
    .album-thumb span { right: 5px; left: auto; bottom: 4px; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px #000; }
    .source-tabs { height: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 8px 0 10px; padding: 6px; border-radius: 16px; background: var(--panel); }
    .source-tab { border: 0; border-radius: 12px; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; font-weight: 800; cursor: pointer; }
    .source-tab.active { color: var(--text); background: rgb(5 164 122 / 16%); }
    .filters { height: 34px; display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
    .filter { height: 28px; padding: 0 13px; border: 0; border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 11px; font-weight: 900; cursor: pointer; }
    .filter.active { color: var(--green); background: rgb(5 164 122 / 16%); }
    .filter-icon { margin-left: auto; color: var(--muted); font-size: 18px; }
    .picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding-bottom: 106px; }
    .picker-item { border: 0; padding: 0; aspect-ratio: 1 / 1; border-radius: 8px; position: relative; overflow: hidden; cursor: pointer; background: var(--panel); }
    .picker-item:nth-child(2n) { background: linear-gradient(135deg, #90c2ff 0%, #f2a9b8 34%, #59724e 58%, #274a2f 100%); }
    .picker-item:nth-child(3n) { background: linear-gradient(135deg, #80b9ff 0%, #fac0b9 35%, #7e8a68 53%, #2f592a 100%); }
    .picker-item::before { content: none; }
    .picker-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
    .picker-item.is-disabled { opacity: .45; cursor: not-allowed; }
    .category-badge { position: absolute; left: 6px; top: 6px; height: 18px; padding: 0 6px; border-radius: 999px; color: var(--text); background: rgb(0 0 0 / 46%); font-size: 9px; font-weight: 900; display: grid; place-items: center; }
    .expand { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgb(0 0 0 / 42%); font-size: 12px; font-weight: 900; }
    .picker-check { position: absolute; left: 6px; bottom: 6px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgb(255 255 255 / 82%); background: rgb(0 0 0 / 18%); }
    .picker-check.selected { border-color: var(--green); background: var(--green); }
    .picker-check.selected::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #05241c; font-size: 11px; font-weight: 900; }
    .selection-dock { position: absolute; left: 0; right: 0; bottom: 0; min-height: 88px; padding: 12px 16px 18px; background: linear-gradient(180deg, rgb(17 17 17 / 74%), #090a0d 26%); display: grid; grid-template-columns: 1fr 142px; gap: 12px; align-items: center; z-index: 5; }
    .permission-mask { position: absolute; inset: 0; background: rgb(0 0 0 / 58%); z-index: 8; }
    .permission-card { position: absolute; left: 24px; right: 24px; top: 254px; padding: 20px 18px; border-radius: 16px; background: var(--panel); box-shadow: 0 18px 50px rgb(0 0 0 / 45%); z-index: 9; }
    .confirm-mask { position: absolute; inset: 0; background: rgb(0 0 0 / 58%); z-index: 8; }
    .confirm-card { position: absolute; left: 24px; right: 24px; top: 292px; padding: 20px 18px; border-radius: 16px; background: var(--panel); box-shadow: 0 18px 50px rgb(0 0 0 / 45%); z-index: 9; }
    .task-tip { padding: 14px; margin-top: 14px; }
    .album-guide { position: relative; height: 174px; margin-top: 12px; border-radius: 14px; background: #121214; overflow: hidden; border: 1px solid var(--line); }
    .album-mini { position: absolute; left: 18px; top: 16px; width: 138px; height: 142px; border-radius: 16px; background: #0b0b0c; border: 1px solid #262628; padding: 10px; }
    .album-top { width: 58px; height: 8px; border-radius: 999px; background: #3a3a3d; margin-bottom: 12px; }
    .album-task-row { height: 30px; border-radius: 11px; background: #1c1f24; display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 10px; }
    .album-task-row span { width: 9px; height: 9px; border-radius: 50%; background: #9aa3ad; box-shadow: 0 0 0 3px rgb(255 255 255 / 8%); }
    .album-task-row b { color: var(--text); font-size: 10px; font-weight: 900; }
    .album-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 10px; }
    .album-tools span { height: 20px; border-radius: 7px; background: #202023; }
    .album-tools .task-dot { background: linear-gradient(135deg, var(--green), var(--green2)); box-shadow: 0 0 0 3px rgb(5 164 122 / 18%); }
    .album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .album-grid i { height: 30px; border-radius: 6px; background: linear-gradient(135deg, #13213b, #5c335f); }
    .task-callout { position: absolute; left: 174px; top: 26px; height: 34px; display: grid; place-items: center; padding: 0 14px; border-radius: 999px; background: rgb(5 164 122 / 16%); color: var(--green2); font-size: 12px; font-weight: 900; }
    .task-callout::before { content: ""; position: absolute; left: -56px; top: 16px; width: 56px; height: 2px; background: var(--green); }
    .share-sheet { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 9; padding: 18px; border-radius: 20px; background: var(--panel); box-shadow: 0 18px 50px rgb(0 0 0 / 45%); }
    .share-grid { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 16px -18px 16px; padding: 0 18px 2px; }
    .share-grid::-webkit-scrollbar { display: none; }
    .share-grid button { flex: 0 0 82px; min-height: 74px; border: 1px solid var(--line); border-radius: 14px; background: #121214; color: var(--text); display: grid; place-items: center; gap: 8px; padding: 10px 6px; cursor: pointer; }
    .share-grid img, .save-icon { width: 24px; height: 24px; display: block; }
    .share-grid b { font-size: 10px; line-height: 13px; font-weight: 900; }
    .save-icon { border: 2px solid var(--green2); border-radius: 7px; position: relative; }
    .save-icon::after { content: ""; position: absolute; left: 5px; right: 5px; bottom: 4px; height: 2px; background: var(--green2); border-radius: 999px; }
    .loading-panel { height: 100%; display: grid; place-items: center; text-align: center; padding-bottom: 96px; }
    .loading-cancel { position: absolute; left: 16px; right: 16px; bottom: 22px; width: calc(100% - 32px); }
    .loading-core { width: 172px; height: 172px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 28px; background: radial-gradient(circle, rgb(5 164 122 / 20%) 0 34%, transparent 35%), conic-gradient(from 0deg, var(--green), rgb(93 220 172 / 0), var(--green)); animation: spin 1.6s linear infinite; position: relative; }
    .loading-core::after { content: ""; width: 118px; height: 118px; border-radius: 50%; background: var(--bg); position: absolute; }
    .loading-core span { position: relative; z-index: 1; width: 58px; height: 58px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green2)); box-shadow: 0 0 34px rgb(5 164 122 / 42%); }
    @keyframes spin { to { transform: rotate(360deg); } }
    .result-video { width: 100%; aspect-ratio: 9 / 16; height: auto; border-radius: 8px; margin: 10px auto 0; position: relative; overflow: hidden; background: #050505; }
    .result-video.preview-video { width: 188px; max-width: 54%; margin-top: 2px; }
    .result-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
    .result-video .composer-meta { display: none; }
    .play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; border-radius: 50%; transform: translate(-50%, -50%); background: rgb(5 164 122 / 28%); display: grid; place-items: center; font-size: 22px; }
    .info { padding: 14px 16px; margin-top: 12px; }
    .player-controls { height: 32px; display: grid; grid-template-columns: 30px 1fr 58px; gap: 8px; align-items: center; margin-top: 8px; }
    .player-toggle { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgb(5 164 122 / 18%); color: var(--green); font-size: 12px; font-weight: 900; cursor: pointer; }
    .player-progress { width: 100%; accent-color: var(--green); cursor: pointer; }
    .player-time { color: var(--muted); font-size: 10px; font-weight: 800; text-align: right; white-space: nowrap; }
    .player-time b { color: inherit; font-weight: inherit; }
    .section-title { margin: 20px 0 8px; font-size: 14px; font-weight: 900; }
    .player-controls + .section-title { margin-top: 10px; margin-bottom: 6px; }
    .rail-head { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
    .rail-head .section-title { margin: 0 0 6px; }
    .rail-head button { height: 26px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); padding: 0 12px; font-size: 11px; font-weight: 900; cursor: pointer; }
    .tag { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; color: var(--green); background: rgb(5 164 122 / 16%); font-size: 10px; font-weight: 900; margin-top: 7px; }
    .tag.warn { color: var(--amber); background: rgb(240 162 26 / 16%); }
    .template-list { display: grid; gap: 8px; padding-bottom: 18px; }
    .template-card, .task-row { display: grid; grid-template-columns: 72px 1fr; gap: 12px; padding: 12px; margin-top: 8px; min-height: 82px; cursor: pointer; }
    button.template-card { width: 100%; border: 0; color: var(--text); text-align: left; font: inherit; }
    .template-card .thumb { width: 72px; height: 72px; }
    .template-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); font-size: 13px; line-height: 18px; font-weight: 900; }
    .template-title span:last-child { color: var(--text); font-size: 12px; white-space: nowrap; }
    .template-desc { margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 700; }
    .render-summary { cursor: default; align-items: center; }
    .render-progress { height: 5px; border-radius: 999px; background: #2b2b2d; overflow: hidden; margin-top: 10px; }
    .render-progress span { display: block; height: 100%; width: var(--p); background: linear-gradient(90deg, var(--green), var(--green2)); }
    .render-meta { display: flex; justify-content: space-between; gap: 10px; margin-top: 7px; color: var(--muted); font-size: 10px; font-weight: 900; }
    .render-meta b, .render-meta em { font: inherit; color: inherit; }
    .share-btn { width: 100%; height: 44px; margin-top: 14px; border: 1px solid rgb(5 164 122 / 42%); border-radius: 999px; background: rgb(5 164 122 / 14%); color: var(--green2); font-size: 14px; font-weight: 900; cursor: pointer; }
    .template-strip { display: flex; flex-wrap: nowrap; gap: 10px; overflow-x: auto; scrollbar-width: none; margin: 10px -16px 0; padding: 0 16px 2px; }
    .template-strip.preview-rail { margin: 8px 0 0; padding: 0 2px 4px; gap: 8px; max-width: 100%; }
    .template-strip.preview-rail .mini-template { flex-basis: 108px; }
    .mini-template { flex: 0 0 116px; border: 0; border-radius: 14px; background: var(--panel); color: var(--text); padding: 7px; text-align: left; cursor: pointer; }
    .mini-template.active { box-shadow: inset 0 0 0 2px var(--green); background: rgb(5 164 122 / 12%); }
    .mini-template .thumb { width: 100%; aspect-ratio: 16 / 10; margin-bottom: 8px; }
    .mini-template .thumb span, .mini-template p { display: none; }
    .compact-title { margin: 10px 0 6px; font-size: 12px; }
    .shot-strip { align-items: stretch; padding-bottom: 3px; }
    .shot-card { min-height: 112px; position: relative; }
    .shot-card.locked { opacity: .72; cursor: default; }
    .shot-thumb { position: relative; width: 100%; aspect-ratio: 16 / 10; border-radius: 9px; overflow: hidden; margin-bottom: 8px; background: #101114; }
    .shot-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
    .shot-overlay { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 4px; background: rgb(0 0 0 / 42%); color: var(--text); opacity: .94; }
    .shot-overlay b { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: rgb(5 164 122 / 82%); color: #05241c; font-size: 13px; font-weight: 900; }
    .shot-overlay i { font-style: normal; font-size: 10px; font-weight: 900; }
    .shot-card h3 { font-size: 11px; line-height: 14px; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .intro-shot, .ending-shot { background: rgb(5 164 122 / 10%); border: 1px solid rgb(5 164 122 / 26%); }
    .middle-shot { background: var(--panel); }
    .ending-shot { margin-left: 10px; }
    .ending-shot::before { content: ""; position: absolute; left: -11px; top: 12px; bottom: 12px; width: 1px; background: var(--line); }
    .add-shot { display: grid; place-items: center; text-align: center; }
    .add-shot span { color: var(--green2); font-size: 28px; font-weight: 800; line-height: 1; }
    .replacement-strip { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 8px -16px 0; padding: 0 16px 2px; }
    .replacement-sources { display: flex; gap: 8px; margin-top: 8px; }
    .replacement-sources button { height: 28px; border: 0; border-radius: 999px; padding: 0 12px; background: var(--panel); color: var(--muted); font-size: 11px; font-weight: 900; cursor: pointer; }
    .replacement-sources button.active { color: var(--green); background: rgb(5 164 122 / 16%); }
    .replacement-card { flex: 0 0 52px; width: 52px; height: 52px; border: 0; border-radius: 8px; padding: 0; overflow: hidden; background: var(--panel); cursor: pointer; }
    .replacement-card.active { outline: 2px solid var(--green); }
    .replacement-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .empty-replacement { height: 52px; min-width: 160px; display: grid; place-items: center; color: var(--muted); background: var(--panel); border-radius: 8px; font-size: 11px; font-weight: 800; }
    .shot-picker { position: absolute; left: 16px; right: 16px; bottom: 16px; z-index: 9; padding: 16px; border-radius: 20px; background: var(--panel); box-shadow: 0 18px 50px rgb(0 0 0 / 45%); }
    .shot-picker-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; max-height: 232px; overflow: auto; scrollbar-width: none; }
    .shot-picker-grid button { aspect-ratio: 1 / 1; border: 0; border-radius: 8px; padding: 0; overflow: hidden; position: relative; background: #111; cursor: pointer; }
    .shot-picker-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .shot-picker-grid span { position: absolute; left: 5px; top: 5px; height: 18px; padding: 0 6px; border-radius: 999px; background: rgb(0 0 0 / 52%); color: var(--text); font-size: 9px; font-weight: 900; display: grid; place-items: center; }
    .replacement-screen { z-index: 12; }
    .replacement-screen .body { padding-bottom: 108px; }
    .compact-source-tabs { height: 48px; margin-top: 0; }
    .replacement-picker-grid { padding-bottom: 108px; }
    .replacement-picker-grid .picker-item.active { outline: 2px solid var(--green); }
    .replacement-screen .picker-check { left: auto; right: 6px; top: 6px; bottom: auto; }
    .upload-card { display: grid; place-items: center; border: 1px dashed rgb(93 220 172 / 50%); color: var(--green2); background: rgb(5 164 122 / 10%); }
    .upload-card span { position: static; height: auto; padding: 0; background: transparent; font-size: 11px; font-weight: 900; }
    .upload-card.active { outline: 2px solid var(--green); }
    .video-mask { z-index: 13; }
    .video-adjust { position: absolute; left: 24px; right: 24px; top: 112px; z-index: 14; padding: 18px; border-radius: 18px; background: var(--panel); box-shadow: 0 18px 50px rgb(0 0 0 / 45%); }
    .adjust-video { height: 142px; border-radius: 12px; background: #0c0c0d; margin: 14px 0; position: relative; overflow: hidden; }
    .adjust-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
    .adjust-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
    .adjust-options button { height: 34px; border: 0; border-radius: 999px; background: #121214; color: var(--muted); font-size: 12px; font-weight: 900; cursor: pointer; }
    .adjust-options button.active { color: var(--green); background: rgb(5 164 122 / 16%); }
    .trim-editor, .apple-trim { margin-top: 14px; padding: 12px; border-radius: 14px; background: #121214; }
    .trim-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 10px; font-weight: 900; }
    .trim-meta b { color: var(--green2); font: inherit; }
    .fit-status { margin-top: 8px; text-align: center; color: var(--muted); font-size: 10px; font-weight: 900; }
    .fit-status.ready { color: var(--green2); }
    .fit-status.pending { color: var(--amber); }
    .dialog-wrap { position: absolute; inset: 0; z-index: 14; display: grid; place-items: center; background: rgb(0 0 0 / 58%); padding: 36px; }
    .dialog { width: 100%; background: var(--panel); 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; }
    .dialog-actions button { height: 44px; border: 0; border-radius: 999px; font-size: 13px; font-weight: 900; cursor: pointer; }
    .dialog-actions .ghost { color: var(--text); background: var(--panel2); border: 1px solid var(--line); }
    .dialog-actions .primary { color: #05241c; background: linear-gradient(135deg, var(--green), var(--green2)); }
    .video-fit-wrap { align-items: end; }
    .video-fit-dialog { padding: 18px; border: 1px solid var(--line); box-shadow: 0 18px 50px rgb(0 0 0 / 45%); }
    .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-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: -6px 0 10px; }
    .fit-summary span { min-width: 0; height: 32px; border-radius: 10px; background: #121214; border: 1px solid var(--line); color: var(--muted); display: grid; place-items: center; text-align: center; font-size: 10px; line-height: 12px; font-weight: 900; }
    .fit-summary .fit-need, .fit-summary .fit-output { color: var(--green2); background: rgb(5 164 122 / 10%); border-color: rgb(5 164 122 / 22%); }
    .trim-labels, .trim-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; line-height: 18px; }
    .trim-meta { justify-content: center; margin-top: 8px; }
    .trim-meta span:last-child { color: var(--green2); font-weight: 800; }
    .trim-filmstrip { height: 58px; position: relative; overflow: hidden; border-radius: 10px; background: #050505; border: 2px solid rgb(255 255 255 / 18%); touch-action: none; cursor: ew-resize; }
    .ios-trim { margin-top: 4px; }
    .film-frames { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(9, 1fr); gap: 1px; }
    .film-frames span { background-size: cover; background-repeat: no-repeat; opacity: .86; filter: saturate(1.08); }
    .trim-filmstrip .trim-range { position: absolute; top: 0; bottom: 0; height: auto; border-radius: 8px; background: transparent; box-shadow: inset 0 0 0 3px #f5f5f7, inset 0 0 0 5px rgb(5 164 122 / 72%); z-index: 3; pointer-events: none; }
    .trim-dim { position: absolute; top: 0; bottom: 0; background: rgb(0 0 0 / 58%); z-index: 2; pointer-events: none; }
    .trim-dim.left { left: 0; }
    .trim-dim.right { right: 0; }
    .trim-filmstrip .trim-handle { position: absolute; top: 0; height: 100%; width: 18px; border-radius: 6px; background: #f5f5f7; box-shadow: 0 0 0 1px rgb(0 0 0 / 20%); z-index: 4; touch-action: none; cursor: ew-resize; }
    .trim-filmstrip .trim-handle::before { content: ""; position: absolute; left: 50%; top: 16px; bottom: 16px; width: 2px; border-radius: 999px; transform: translateX(-50%); background: rgb(0 0 0 / 38%); }
    .trim-filmstrip .trim-handle.start { transform: translateX(-1px); }
    .trim-filmstrip .trim-handle.end { transform: translateX(calc(-100% + 1px)); }
    .clip-processing { position: absolute; left: 50%; top: 50%; z-index: 20; transform: translate(-50%, -50%); min-width: 150px; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: rgb(27 27 28 / 96%); color: var(--text); font-size: 15px; line-height: 22px; font-weight: 800; text-align: center; box-shadow: 0 12px 28px rgb(0 0 0 / 30%); }
    .trim-track { height: 34px; margin: 10px 0; border-radius: 999px; background: repeating-linear-gradient(90deg, #2d3034 0 12px, #222428 12px 24px); position: relative; overflow: hidden; }
    .trim-selection { position: absolute; left: 24%; right: 24%; top: 5px; bottom: 5px; border-radius: 999px; background: rgb(5 164 122 / 24%); border: 2px solid var(--green2); }
    .trim-selection b { position: absolute; top: -5px; bottom: -5px; width: 10px; border-radius: 999px; background: var(--green2); }
    .trim-selection b:first-child { left: -6px; }
    .trim-selection b:last-child { right: -6px; }
    .filmstrip { height: 46px; margin: 10px 0; border-radius: 10px; overflow: hidden; position: relative; display: grid; grid-template-columns: repeat(12, 1fr); background: #050607; }
    .filmstrip span { background-size: cover; background-repeat: no-repeat; filter: saturate(.78) brightness(.72); border-right: 1px solid rgb(0 0 0 / 42%); }
    .trim-window { position: absolute; z-index: 4; top: 0; bottom: 0; border: 3px solid var(--green2); border-radius: 10px; background: rgb(5 164 122 / 12%); box-shadow: 0 0 0 999px rgb(0 0 0 / 42%); cursor: grab; touch-action: none; }
    .trim-window:active { cursor: grabbing; }
    .trim-window b { position: absolute; z-index: 1; top: -3px; bottom: -3px; width: 12px; background: var(--green2); border-radius: 8px; cursor: ew-resize; }
    .trim-window b:first-child { left: -8px; }
    .trim-window b:last-child { right: -8px; }
    .apple-trim { position: relative; }
    .apple-trim .trim-range { position: absolute; left: 12px; right: 12px; width: calc(100% - 24px); top: 39px; height: 50px; margin: 0; opacity: .001; pointer-events: none; cursor: ew-resize; }
    .apple-trim .trim-start { z-index: 2; clip-path: inset(0 50% 0 0); }
    .apple-trim .trim-end { z-index: 3; clip-path: inset(0 0 0 50%); }
    .actions { display: grid; gap: 10px; margin-top: 18px; }
    .preview-video ~ .actions { margin-top: 10px; }
    .modal-screen::before { content: ""; position: absolute; inset: 0; background: rgb(0 0 0 / 48%); }
    .modal { position: absolute; left: 32px; right: 32px; top: 248px; padding: 20px 18px; border-radius: 16px; background: var(--panel); box-shadow: 0 18px 50px rgb(0 0 0 / 45%); }
    .tabs { display: flex; gap: 8px; height: 48px; align-items: center; margin: 0 -16px; padding: 0 16px; }
    .chip { white-space: nowrap; border: 0; height: 28px; padding: 0 13px; border-radius: 999px; color: var(--muted); background: var(--panel); font-size: 11px; font-weight: 900; cursor: pointer; }
    .chip.active { color: var(--green); background: rgb(5 164 122 / 16%); }
    .progress { height: 4px; border-radius: 999px; background: #2b2b2d; overflow: hidden; margin-top: 8px; }
    .progress i { display: block; height: 100%; width: var(--p); background: var(--green); }
    .task-row { grid-template-columns: 54px 1fr 84px; margin: 0 -16px; border-radius: 0; padding: 12px 16px; min-height: 74px; }
    .task-row .thumb { width: 52px; height: 52px; }
    .task-status { text-align: right; color: var(--green); font-size: 11px; font-weight: 900; }
    .divider { height: 8px; margin: 8px -16px 14px; background: var(--panel); }
    .side { min-width: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; }
    .flow-card { background: rgb(17 17 17 / 78%); border: 1px solid #242426; border-radius: 20px; padding: 22px; max-width: 620px; box-shadow: 0 18px 50px rgb(0 0 0 / 45%); }
    .flow-card h2 { font-size: 22px; margin-bottom: 8px; }
    .flow-card p { font-size: 13px; line-height: 22px; }
    .swipe-controls { display: grid; grid-template-columns: 46px 1fr 46px; gap: 10px; align-items: center; margin-top: 18px; }
    .swipe-controls button { height: 46px; border: 0; border-radius: 999px; color: var(--text); background: var(--panel); border: 1px solid var(--line); font-size: 22px; cursor: pointer; }
    .swipe-controls span { color: var(--muted); font-size: 12px; text-align: center; }
    .steps { display: grid; gap: 8px; margin-top: 18px; }
    .step { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
    .dot { width: 8px; height: 8px; border-radius: 50%; background: #5f6064; }
    .step.active { color: var(--text); }
    .step.active .dot { background: var(--green); }
    @media (max-width: 780px) {
      body { overflow: auto; }
      .stage { height: auto; grid-template-columns: 1fr; justify-items: center; padding: 12px; }
      .side { display: none; }
      .phone { width: min(402px, 100vw - 24px); height: min(874px, calc(100vh - 24px)); }
    }
