/* Studio: the video editor. Reuses style.css tokens (colors, radius, fonts, .btn). */

.st-body { background: var(--bg); min-height: 100vh; }

/* ------------------------------------------------------------------ top bar */
.st-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  height: 60px; padding: 0 24px;
  background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line-2);
}
.st-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.st-brand:hover { color: var(--ink); }
.st-brand em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--red-ink); background: var(--red-bg); padding: 2px 7px; border-radius: 999px; }
.st-nav { display: flex; gap: 2px; flex: 1; }
.st-nav a { text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 500; padding: 7px 11px; border-radius: 8px; transition: background .15s, color .15s; }
.st-nav a:hover { background: var(--hover); color: var(--ink); }
.st-nav a.is-on { color: var(--ink); background: var(--nav-active); }
.st-acct { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.st-meter { display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.st-meter-txt { font-size: 12px; color: var(--muted); white-space: nowrap; }
.st-meter-txt b { color: var(--ink); font-weight: 600; }
.st-meter-bar { height: 4px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.st-meter-bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; }
.st-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 600; font-size: 12px; color: var(--ink); overflow: hidden; cursor: pointer; padding: 0; }
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-menu { position: absolute; right: 24px; top: 54px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-pop); padding: 6px; min-width: 200px; z-index: 30; }
.st-menu a, .st-menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; border: none; background: none; font-size: 13.5px; color: var(--ink); text-decoration: none; cursor: pointer; }
.st-menu a:hover, .st-menu button:hover { background: var(--hover); color: var(--ink); }
.st-menu .st-menu-sub { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }

.st-main { max-width: 1120px; margin: 0 auto; padding: 36px 24px 96px; }
.st-loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* ------------------------------------------------------------------ new edit */
.st-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.st-h1 { font-size: 30px; line-height: 1.15; letter-spacing: -.025em; font-weight: 650; margin: 0 0 8px; }
.st-sub { color: var(--muted); font-size: 15px; margin-bottom: 22px; max-width: 520px; }

.st-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 300px; padding: 36px 24px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 18px; background: var(--surface-2);
  cursor: pointer; transition: border-color .2s, background .2s, transform .2s var(--ease-out);
}
.st-drop:hover, .st-drop.is-over { border-color: var(--ink); background: #fff; }
.st-drop.is-over { transform: scale(1.01); }
.st-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.st-drop-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--ink); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(23,23,22,.18); }
.st-drop-icon svg { width: 26px; height: 26px; }
.st-drop-title { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.st-drop-sub { color: var(--muted); font-size: 13px; }
.st-drop-or { display: flex; gap: 8px; align-items: center; color: var(--faint); font-size: 12.5px; }
.st-link-row { display: flex; gap: 8px; margin-top: 12px; }
.st-link-row input { flex: 1; height: 38px; border: 1px solid var(--line-strong); border-radius: 9px; padding: 0 12px; font: inherit; font-size: 13.5px; background: #fff; }
.st-link-row input:focus { border-color: var(--ink); }

.st-what { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.st-what div { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.4; }
.st-what svg { flex: 0 0 16px; width: 16px; height: 16px; color: var(--green); margin-top: 1px; }

/* settings card */
.st-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); }
.st-settings { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.st-set-h { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 7px; display: flex; justify-content: space-between; }
.st-set-h span { text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--faint); }
.st-seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.st-seg button { flex: 1; height: 32px; border: none; background: none; border-radius: 7px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.st-seg button:hover { color: var(--ink); }
.st-seg button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(23,23,22,.08), 0 0 0 1px var(--line); }
.st-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.st-toggle { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--line-strong); border: none; cursor: pointer; transition: background .2s; flex: 0 0 38px; }
.st-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.2); transition: transform .2s var(--ease-out); }
.st-toggle[aria-checked="true"] { background: var(--ink); }
.st-toggle[aria-checked="true"]::after { transform: translateX(16px); }
.st-row-label { font-size: 13.5px; font-weight: 500; }
.st-row-label small { display: block; font-size: 12px; color: var(--muted); font-weight: 400; }
.st-swatches { display: flex; gap: 6px; }
.st-swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; padding: 0; transition: transform .15s; }
.st-swatch:hover { transform: scale(1.1); }
.st-swatch.is-on { box-shadow: 0 0 0 2px var(--ink); }
.st-stepper { display: flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 9px; padding: 2px; }
.st-stepper button { width: 28px; height: 28px; border: none; background: none; border-radius: 7px; cursor: pointer; font-size: 16px; color: var(--ink); }
.st-stepper button:hover:not(:disabled) { background: var(--hover); }
.st-stepper b { min-width: 22px; text-align: center; font-size: 13.5px; }

/* caption preview */
.st-preview {
  position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #3a3f4a 0%, #1b1d22 55%, #0f1013 100%);
}
.st-preview-face { position: absolute; left: 50%; top: 18%; width: 24%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: linear-gradient(160deg, #6b5b52, #3d332e); opacity: .85; }
.st-preview-body { position: absolute; left: 50%; bottom: -14%; width: 52%; height: 48%; transform: translateX(-50%); border-radius: 50% 50% 0 0; background: linear-gradient(160deg, #2c3e57, #1c2738); }
.st-cap { position: absolute; left: 6%; right: 6%; bottom: 11%; text-align: center; font-family: 'Poppins', var(--font); font-weight: 800; color: #fff; line-height: 1.15; }
.st-cap[data-style="pop"] { font-size: clamp(16px, 4.1cqw, 30px); text-transform: var(--cap-case, uppercase); -webkit-text-stroke: 1.2px #000; paint-order: stroke fill; text-shadow: 0 2px 0 rgba(0,0,0,.55); }
.st-cap[data-style="pop"] .w { display: inline-block; transition: transform .12s var(--ease-out), color .12s; }
.st-cap[data-style="pop"] .w.is-on { color: var(--cap-hi, #FFE11A); transform: scale(1.08); }
.st-cap[data-style="clean"] { font-size: clamp(12px, 2.8cqw, 21px); text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 2px #000; font-weight: 800; }
.st-cap[data-style="boxed"] span.box { background: rgba(0,0,0,.78); padding: .12em .45em; border-radius: 6px; font-size: clamp(12px, 2.8cqw, 21px); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.st-cap[data-style="none"] { display: none; }
.st-preview { container-type: inline-size; }
.st-preview-label { position: absolute; top: 10px; left: 12px; font-size: 11px; color: rgba(255,255,255,.6); font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.st-preview-mark { position: absolute; top: 10px; right: 12px; font-size: 10px; color: rgba(255,255,255,.55); font-weight: 600; }

/* ------------------------------------------------------------------ progress */
.st-job { max-width: 720px; margin: 0 auto; padding: 28px; }
.st-job-head { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.st-file-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink); }
.st-file-ico svg { width: 20px; height: 20px; }
.st-job-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.st-job-meta { font-size: 13px; color: var(--muted); }
.st-big-bar { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.st-big-bar i { display: block; height: 100%; background: var(--ink); border-radius: 99px; transition: width .6s var(--ease-out); }
.st-big-bar.is-up i { background: var(--red); }
.st-pct { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.st-pct b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.st-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.st-steps li { display: flex; align-items: center; gap: 11px; padding: 9px 4px; font-size: 14px; color: var(--faint); transition: color .3s; }
.st-steps li .dot { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; transition: background .3s, border-color .3s; }
.st-steps li.is-done { color: var(--text-2); }
.st-steps li.is-done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.st-steps li.is-done .dot svg { width: 11px; height: 11px; }
.st-steps li.is-now { color: var(--ink); font-weight: 500; }
.st-steps li.is-now .dot { border-color: var(--ink); }
.st-steps li.is-now .dot::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ink); animation: st-pulse 1.2s ease-in-out infinite; }
@keyframes st-pulse { 0%, 100% { transform: scale(.7); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
.st-note { font-size: 13px; color: var(--muted); margin-top: 16px; padding: 12px 14px; background: var(--surface-2); border-radius: 10px; }
.st-err { font-size: 14px; color: var(--red-ink); background: var(--red-bg); padding: 12px 14px; border-radius: 10px; margin-top: 16px; }

/* ------------------------------------------------------------------ result */
.st-res-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.st-back { font-size: 13px; color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.st-res-title { font-size: 24px; font-weight: 650; letter-spacing: -.02em; margin: 0; overflow-wrap: anywhere; }
.st-res-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.st-player { width: 100%; border-radius: 14px; background: #000; display: block; aspect-ratio: 16 / 9; }
.st-player.is-vertical { aspect-ratio: 9 / 16; max-height: 70vh; width: auto; margin: 0 auto; }

.st-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-top: 14px; }
.st-stat { background: #fff; padding: 12px 14px; }
.st-stat b { display: block; font-size: 19px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.st-stat span { font-size: 12px; color: var(--muted); }
.st-stat b.is-red { color: var(--red); }

.st-tl { margin-top: 14px; }
.st-tl-h { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.st-tl-bar { position: relative; height: 26px; border-radius: 7px; overflow: hidden; background: repeating-linear-gradient(-45deg, var(--red-bg), var(--red-bg) 4px, #f9d3cf 4px, #f9d3cf 8px); }
.st-tl-bar i { position: absolute; top: 0; bottom: 0; background: var(--ink); }
.st-tl-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.st-tl-legend span { display: inline-flex; align-items: center; gap: 5px; }
.st-tl-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--ink); display: inline-block; }
.st-tl-legend i.cut { background: #f4b7b1; }

.st-dl { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.st-dl a { text-decoration: none; }

.st-side { display: flex; flex-direction: column; gap: 14px; }
.st-sec { padding: 16px 16px 14px; }
.st-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.st-sec-h h3 { font-size: 13px; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.st-sec-h small { font-size: 12px; color: var(--muted); }
.st-titles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.st-titles li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 8px; border-radius: 9px; cursor: pointer; transition: background .15s; }
.st-titles li:hover { background: var(--row-hover); }
.st-titles li .t { font-size: 14px; font-weight: 550; line-height: 1.35; }
.st-titles li .why { font-size: 12px; color: var(--muted); margin-top: 2px; }
.st-titles li .n { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 3px; }
.st-titles li .len { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 3px; }
.st-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.st-chip { font-size: 12.5px; padding: 5px 10px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; transition: background .15s, border-color .15s; }
.st-chip:hover { border-color: var(--ink); }
.st-chip.is-thumb { font-family: 'Poppins', var(--font); font-weight: 800; text-transform: uppercase; background: #111; color: #fff; border-color: #111; font-size: 12px; letter-spacing: .01em; }
.st-chip.is-thumb:hover { background: #333; }
.st-desc { white-space: pre-wrap; font-size: 13px; color: var(--text-2); line-height: 1.55; max-height: 240px; overflow: auto; background: var(--surface-2); border-radius: 9px; padding: 10px 12px; }
.st-hook { display: flex; gap: 12px; align-items: flex-start; }
.st-hook-score { flex: 0 0 52px; height: 52px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.st-hook-score.good { background: var(--green-bg); color: var(--green); }
.st-hook-score.ok { background: var(--amber-bg); color: var(--amber); }
.st-hook-score.bad { background: var(--red-bg); color: var(--red-ink); }
.st-hook p { font-size: 13px; color: var(--text-2); line-height: 1.5; }
.st-copy { border: none; background: none; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; padding: 4px 8px; border-radius: 7px; }
.st-copy:hover { background: var(--hover); color: var(--ink); }
.st-niche { font-size: 11.5px; color: var(--green); background: var(--green-bg); padding: 2px 8px; border-radius: 99px; font-weight: 500; }

.st-shorts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.st-short video { width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; background: #000; display: block; }
.st-short .t { font-size: 13.5px; font-weight: 600; margin-top: 8px; line-height: 1.3; }
.st-short .m { font-size: 12px; color: var(--muted); margin: 2px 0 8px; }
.st-h2 { font-size: 17px; font-weight: 650; letter-spacing: -.015em; margin: 34px 0 12px; display: flex; align-items: center; gap: 10px; }
.st-h2 small { font-size: 13px; color: var(--muted); font-weight: 400; }

.st-rerender { padding: 16px; margin-top: 14px; }
.st-rerender .st-settings { padding: 0; }

/* ------------------------------------------------------------------ lists */
.st-list { display: flex; flex-direction: column; }
.st-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--ink); transition: background .15s; }
.st-item:hover { background: var(--row-hover); color: var(--ink); }
.st-thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; background: var(--surface-2) center / cover no-repeat; border: 1px solid var(--line-2); }
.st-item .t { font-weight: 550; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-item .m { font-size: 12.5px; color: var(--muted); }
.st-badge { font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.st-badge.done { background: var(--green-bg); color: var(--green); }
.st-badge.error { background: var(--red-bg); color: var(--red-ink); }
.st-badge.run { background: #eef2ff; color: #3f4fbf; }
.st-empty { padding: 40px 0; text-align: center; color: var(--muted); font-size: 14px; }
.st-recent { margin-top: 40px; }

/* ------------------------------------------------------------------ API page */
.st-api { max-width: 820px; }
.st-code { position: relative; background: #121212; color: #e9e9e6; border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px; line-height: 1.55; overflow-x: auto; white-space: pre; margin: 8px 0 4px; }
.st-code .st-copy { position: absolute; top: 6px; right: 6px; color: #aaa; background: #222; }
.st-code .st-copy:hover { color: #fff; background: #333; }
.st-api h2 { font-size: 16px; font-weight: 650; margin: 28px 0 4px; letter-spacing: -.01em; }
.st-api p { font-size: 14px; color: var(--text-2); }
.st-keys { margin-top: 10px; }
.st-key { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 13.5px; }
.st-key code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 2px 7px; border-radius: 6px; }
.st-key .m { color: var(--muted); font-size: 12.5px; margin-left: auto; }
.st-newkey { background: var(--green-bg); border: 1px solid #cfe7d8; border-radius: 12px; padding: 14px; margin-top: 12px; }
.st-newkey b { font-size: 13.5px; }
.st-tabs { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.st-tabs button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 11px; font-size: 13px; cursor: pointer; color: var(--muted); }
.st-tabs button.is-on { border-color: var(--ink); color: var(--ink); font-weight: 500; }

/* paywall modal */
.st-modal-bg { position: fixed; inset: 0; background: rgba(23,23,22,.42); z-index: 50; display: grid; place-items: center; padding: 16px; animation: st-fade .18s ease-out; }
.st-modal { background: #fff; border-radius: 18px; box-shadow: var(--shadow-pop); width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 26px; animation: st-rise .26s var(--ease-out); }
.st-modal h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; }
.st-modal > p { color: var(--muted); font-size: 14px; }
.st-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.st-plan { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.st-plan.is-pop { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.st-plan h4 { margin: 0; font-size: 14px; }
.st-plan .p { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.st-plan .p small { font-size: 13px; color: var(--muted); font-weight: 400; }
.st-plan ul { margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 5px; flex: 1; }
@keyframes st-fade { from { opacity: 0; } }
@keyframes st-rise { from { opacity: 0; transform: translateY(8px) scale(.98); } }

.st-drop-veil { position: fixed; inset: 0; z-index: 60; background: rgba(255,255,255,.86); backdrop-filter: blur(4px); display: grid; place-items: center; font-size: 22px; font-weight: 600; letter-spacing: -.01em; border: 3px dashed var(--ink); }

@media (max-width: 900px) {
  .st-hero, .st-res-grid { grid-template-columns: 1fr; }
  .st-nav { display: none; }
  .st-plans { grid-template-columns: 1fr; }
  .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .st-top { padding: 0 16px; gap: 12px; }
  .st-main { padding: 24px 16px 80px; }
  .st-meter { display: none; }
  .st-h1 { font-size: 25px; }
  .st-what { grid-template-columns: 1fr; }
  .st-item { grid-template-columns: 72px minmax(0, 1fr); }
  .st-item .st-badge { grid-column: 2; justify-self: start; }
  .st-thumb { width: 72px; }
}
@media (prefers-reduced-motion: reduce) {
  .st-steps li.is-now .dot::after { animation: none; }
  .st-big-bar i { transition: none; }
}
