/* The Shortsmith app (dashboard, editor, settings). Shared tokens live in site.css. */
body.app { min-height: 100vh; }
.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: var(--bg2); padding: calc(16px + env(safe-area-inset-top, 0px)) 12px 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .brand { padding: 4px 8px 16px; }
.side a.nav { display: flex; align-items: center; gap: .7em; padding: .55em .75em; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 500; }
.side a.nav:hover { background: var(--card); color: var(--text); }
.side a.nav.on { background: var(--card2); color: var(--text); box-shadow: inset 2px 0 0 var(--hot); }
.side a.nav .i { width: 18px; text-align: center; opacity: .9; }
.side .grow { flex: 1; }
.side .mins { margin: 8px 4px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); font-size: 13px; }
.side .mins b { font-size: 18px; }
.side .mins .bar { height: 6px; border-radius: 3px; background: var(--line); margin: 8px 0; overflow: hidden; }
.side .mins .bar i { display: block; height: 100%; background: var(--grad); }
.main { min-width: 0; padding: calc(20px + env(safe-area-inset-top, 0px)) 28px 60px; }
.top { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-size: 24px; margin: 0; font-family: var(--display); letter-spacing: -.01em; }
.top .sp { flex: 1; }
.top select { width: auto; min-width: 180px; }
.burger { display: none; }

/* home: submit */
.submit { background: radial-gradient(800px 300px at 0% 0%, rgba(255,90,54,.12), transparent 60%), var(--card); border: 1px solid var(--line2); border-radius: 18px; padding: 22px; }
.submit .linkrow { display: flex; gap: 8px; }
.submit .linkrow input { font-size: 16px; padding: .8em 1em; border-radius: 12px; }
.drop { margin-top: 12px; border: 1.5px dashed var(--line2); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--hot); background: rgba(255,90,54,.05); color: var(--text); }
.opts-toggle { margin-top: 14px; background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-weight: 600; }
.opts-toggle:hover { color: var(--text); }
.opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; margin-top: 6px; }
.opts .wide { grid-column: span 2; }
.opts .full { grid-column: 1 / -1; }
.checks { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; }
.checks label { display: flex; align-items: center; gap: .45em; margin: 0; color: var(--text); font-size: 14px; cursor: pointer; }
.checks input { width: 16px; height: 16px; accent-color: var(--hot); }
.stylepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 4px; }
.stylepick button { aspect-ratio: 16/10; border-radius: 10px; border: 1.5px solid var(--line); background: linear-gradient(160deg, #2a2f45, #12131c); cursor: pointer; display: grid; place-items: center; position: relative; padding: 4px; overflow: hidden; }
.stylepick button.on { border-color: var(--hot); box-shadow: 0 0 0 3px rgba(255,90,54,.25); }
.stylepick button .n { position: absolute; left: 6px; bottom: 3px; font: 500 10.5px var(--ui); color: var(--muted); }

/* lists of videos and clips */
.section-title { display: flex; align-items: baseline; gap: 10px; margin: 30px 0 12px; }
.section-title h2 { font-size: 17px; margin: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.vcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.vcard:hover { border-color: var(--line2); transform: translateY(-2px); }
.vcard .thumb { aspect-ratio: 16/9; background: #0c0c12 center/cover; position: relative; }
.vcard .body { padding: 12px 14px 14px; }
.vcard .t { font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard .m { color: var(--muted); font-size: 13px; margin-top: 4px; }
.status { display: inline-flex; align-items: center; gap: .4em; font-size: 12px; font-weight: 600; padding: .2em .6em; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); }
.status.completed, .status.ready, .status.posted { color: var(--lime); border-color: rgba(184,255,92,.3); }
.status.failed { color: #ff8a8a; border-color: rgba(255,138,138,.3); }
.status.working::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; background: var(--grad); transition: width .6s; }
.vcard .thumb .status { position: absolute; left: 10px; top: 10px; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); }

.clips { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.ccard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.ccard .shot { aspect-ratio: 9/16; background: #08080c center/cover; position: relative; cursor: pointer; display: block; }
.ccard .shot.square { aspect-ratio: 1/1; }
.ccard .shot.wide { aspect-ratio: 16/9; }
.ccard .shot video { width: 100%; height: 100%; object-fit: cover; display: block; }
.score { position: absolute; top: 10px; left: 10px; font: 800 14px var(--ui); padding: .25em .6em; border-radius: 999px; background: rgba(0,0,0,.65); backdrop-filter: blur(6px); border: 1px solid rgba(255,255,255,.18); }
.score.hi { color: var(--lime); } .score.mid { color: var(--amber); } .score.lo { color: #ff9b8a; }
.dur { position: absolute; right: 10px; bottom: 10px; font-size: 12px; background: rgba(0,0,0,.65); padding: .15em .5em; border-radius: 6px; }
.ccard .shot .wait { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 13px; text-align: center; padding: 10px; }
.spin { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--line2); border-top-color: var(--hot); animation: spin .9s linear infinite; margin: 0 auto 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.ccard .body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ccard .t { font-weight: 600; font-size: 14.5px; line-height: 1.3; }
.ccard .acts { display: flex; gap: 6px; margin-top: auto; flex-wrap: wrap; }
.bars { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: center; font-size: 12px; color: var(--muted); }
.bars .b { height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bars .b i { display: block; height: 100%; background: var(--grad); }

/* editor */
.editor { display: grid; grid-template-columns: minmax(280px, 400px) 1fr; gap: 26px; align-items: start; }
.editor > div { min-width: 0; }
.stage-wrap { position: sticky; top: 18px; }
.tabs { display: flex; gap: 4px; background: var(--bg2); border: 1px solid var(--line); padding: 4px; border-radius: 12px; margin-bottom: 12px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; color: var(--muted); font-weight: 600; padding: .5em .9em; border-radius: 9px; cursor: pointer; white-space: nowrap; }
.tabs button.on { background: var(--card2); color: var(--text); }
.stage { position: relative; width: 100%; aspect-ratio: 9/16; background: #000; border-radius: 16px; overflow: hidden; container-type: inline-size; }
.stage.r11 { aspect-ratio: 1/1; } .stage.r169 { aspect-ratio: 16/9; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage.fit video.main { object-fit: contain; }
.stage .bgblur { filter: blur(18px) brightness(.6); transform: scale(1.15); }
.stage .sq { position: absolute; left: 0; right: 0; aspect-ratio: 1/1; top: 50%; transform: translateY(-50%); overflow: hidden; }
.stage .sq video { object-fit: cover; }
.stage .top-part { position: absolute; left: 0; right: 0; top: 0; overflow: hidden; }
.stage .bot-part { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(120deg, #ff3d7f, #7c3aed, #06b6d4, #f59e0b); background-size: 300% 300%; animation: drift 8s ease infinite; display: grid; place-items: center; color: rgba(255,255,255,.75); font-size: 12px; }
@keyframes drift { 50% { background-position: 100% 50%; } }
.overlay-cap { position: absolute; left: 6%; right: 6%; text-align: center; transform: translateY(-50%); pointer-events: none; line-height: 1.12; paint-order: stroke fill; }
.overlay-cap span { display: inline-block; transition: transform .09s; }
.overlay-hook { position: absolute; left: 8%; right: 8%; text-align: center; transform: translateY(-50%); pointer-events: none; }
.overlay-hook span { background: #fff; color: #111; font-family: 'Poppins ExtraBold', var(--ui); padding: .15em .45em; border-radius: .25em; line-height: 1.5; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.overlay-mark { position: absolute; top: 3%; left: 0; right: 0; text-align: center; font: 600 2.6cqw var(--ui); color: rgba(255,255,255,.65); pointer-events: none; }
.playbar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.playbar input[type=range] { flex: 1; accent-color: var(--hot); }
.playbar .time { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--muted); min-width: 92px; text-align: right; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }
.panel h3 { font-size: 15px; margin: 0 0 6px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line2); background: var(--bg2); color: var(--muted); padding: .45em .85em; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.seg button.on { border-color: var(--hot); color: var(--text); background: rgba(255,90,54,.1); }
.trim { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trim .nudge { display: flex; gap: 4px; margin-top: 6px; }
.words { display: flex; flex-wrap: wrap; gap: 4px; max-height: 260px; overflow-y: auto; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg2); }
.words .w { padding: .15em .4em; border-radius: 6px; cursor: text; font-size: 14px; border: 1px solid transparent; }
.words .w:hover { border-color: var(--line2); }
.words .w.now { background: rgba(255,90,54,.18); }
.words .w.changed { color: var(--amber); }
.words .w.gone { text-decoration: line-through; color: var(--faint); }
.words input { width: auto; padding: .1em .3em; font-size: 14px; border-radius: 6px; }
.why { font-size: 14px; color: var(--muted); }
.why b { color: var(--text); }
.savebar { position: sticky; bottom: env(safe-area-inset-bottom, 0px); background: rgba(11,11,16,.9); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 12px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; z-index: 5; }
.savebar .sp { flex: 1; }

/* tables, lists */
.table { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table.t { border-collapse: collapse; width: 100%; font-size: 14px; }
table.t th, table.t td { padding: .65em .8em; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
table.t th { color: var(--muted); font-weight: 600; font-size: 12.5px; background: var(--bg2); }
table.t tr:last-child td { border-bottom: 0; }
table.t td.wrap { white-space: normal; min-width: 220px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat .v { font-family: var(--display); font-size: 26px; }
.stat .k { color: var(--muted); font-size: 13px; }
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.platform { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.platform .pi { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 900; }
.pi.youtube { background: #ff0033; } .pi.tiktok { background: #111; border: 1px solid #333; } .pi.instagram { background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af); }
.acct { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.acct img { width: 32px; height: 32px; border-radius: 50%; }
.acct .sp { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; background: var(--bg2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; overflow-x: auto; white-space: pre; display: block; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); border: 1px dashed var(--line2); border-radius: var(--radius); }
.empty .big { font-size: 34px; margin-bottom: 6px; }

/* auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1000px 500px at 50% -10%, #2a1610 0%, var(--bg) 60%); }
.auth .card { width: 100%; max-width: 420px; padding: 28px; }
.auth h1 { font-family: var(--display); font-size: 26px; margin: 18px 0 6px; }
.auth .alt { margin-top: 16px; font-size: 14px; color: var(--muted); }
.auth .btn.primary { width: 100%; margin-top: 18px; padding: .8em; }

/* modal + toast */
dialog.modal { border: 1px solid var(--line2); background: var(--card); color: var(--text); border-radius: 18px; padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
dialog.modal .mh { padding: 18px 20px 0; display: flex; align-items: center; }
dialog.modal .mh h2 { font-size: 18px; margin: 0; flex: 1; }
dialog.modal .mb { padding: 6px 20px 20px; }
dialog.modal .mf { padding: 0 20px 20px; display: flex; gap: 8px; justify-content: flex-end; }
.x { background: none; border: 0; color: var(--muted); font-size: 22px; cursor: pointer; line-height: 1; }
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--card2); border: 1px solid var(--line2); border-left: 3px solid var(--hot); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); max-width: 360px; font-size: 14px; }
.toast.ok { border-left-color: var(--lime); }
.notice { border: 1px solid rgba(255,181,71,.35); background: rgba(255,181,71,.06); color: #f3d9a6; border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 16px; }

@media (max-width: 1100px) { .opts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 50; left: 0; width: 250px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .burger { display: inline-flex; }
  .main { padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 60px; }
  .editor { grid-template-columns: 1fr; }
  .stage-wrap { position: static; max-width: 380px; margin: 0 auto; width: 100%; }
}
@media (max-width: 560px) {
  .opts { grid-template-columns: 1fr; } .opts .wide { grid-column: auto; }
  .submit .linkrow { flex-direction: column; }
  .trim { grid-template-columns: 1fr; }
  .clips { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
