:root {
  --bg: #efeff4;
  --card: #fff;
  --ink: #1d1b26;
  --mute: #8b8a99;
  --line: #e3e3ec;
  --dark: #25232f;
  --on-dark: #fff;
  --grad: linear-gradient(100deg, #f7b733 0%, #fc3c85 52%, #6a2bd1 100%);
  --ok: #1f9d55;
  --warn: #d98a00;
  --bad: #d64545;
  --shadow: 0 1px 2px rgba(30, 27, 50, .06), 0 6px 18px rgba(30, 27, 50, .05);
}
:root[data-theme="dark"] {
  --bg: #14131a;
  --card: #1f1d28;
  --ink: #f2f1f7;
  --mute: #8e8da0;
  --line: #2e2c3a;
  --dark: #f2f1f7;
  --on-dark: #1d1b26;
  --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(130px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
h2 { font-size: 17px; margin: 26px 0 10px 4px; display: flex; align-items: center; gap: 8px; color: var(--mute); }

.top { display: flex; justify-content: space-between; align-items: center; padding: 6px 0 14px; }
.logo { font: 800 26px/1 "Montserrat", "Arial Black", sans-serif; letter-spacing: -.02em; }
.logo i { color: #ff7a1a; font-style: normal; }
.top-right { display: flex; gap: 8px; }
.round, .pill {
  height: 44px; background: var(--card); border: 1px solid var(--line);
  border-radius: 22px; display: flex; align-items: center; justify-content: center;
}
.round { width: 44px; }
.pill { padding: 0 18px 0 14px; gap: 8px; font-weight: 700; font-size: 17px; }
.ico svg { width: 22px; height: 22px; display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.stage { display: flex; justify-content: center; }
.shot {
  position: relative; width: min(54vw, 232px); aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden;
  container-type: inline-size; background: #120f0d; box-shadow: var(--shadow);
}
.shot .bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(70% 45% at 82% 18%, rgba(255, 176, 90, .45), transparent 70%),
    radial-gradient(120% 80% at 50% 100%, #3a2a1f 0, #17110d 60%, #0b0908 100%);
}
.shot.zoom .bg { animation: push 7s ease-in-out infinite; }
@keyframes push { 0%, 12% { transform: scale(1); } 28%, 62% { transform: scale(1.12); } 78%, 100% { transform: scale(1); } }
.shot .bg::before {
  content: ""; position: absolute; left: 50%; top: 24%; width: 30%; aspect-ratio: 1; border-radius: 50%;
  transform: translateX(-50%); background: #4a3426; filter: blur(2px);
}
.shot .bg::after {
  content: ""; position: absolute; left: 50%; top: 44%; width: 78%; height: 60%; border-radius: 45% 45% 0 0;
  transform: translateX(-50%); background: #231a15;
}
.badge-ex {
  position: absolute; top: 10px; right: 10px; z-index: 3; padding: 5px 10px; border-radius: 12px;
  background: rgba(60, 50, 44, .75); color: #fff; font-size: 12px; font-weight: 600;
}
.hook {
  position: absolute; z-index: 2; left: 8%; right: 8%; top: 9%; padding: 2.5cqw 4cqw; border-radius: 3cqw;
  background: var(--accent); color: #111; font: 800 5.6cqw/1.15 "Montserrat", "Arial Black", sans-serif;
  text-transform: uppercase; text-align: center;
}
.cap {
  position: absolute; z-index: 2; left: 6%; right: 6%; text-align: center;
  font-size: calc(7.7cqw * var(--sz, 1)); line-height: 1.12; word-spacing: .12em;
}
.plate {
  position: absolute; z-index: 2; left: 50%; transform: translateX(-50%); padding: 2cqw 4cqw; border-radius: .5cqw; white-space: nowrap;
  background: var(--accent); color: #151515; font: 800 4.8cqw/1 "Montserrat", "Arial Black", sans-serif; text-transform: uppercase;
}
.plate[hidden], .emo[hidden], .hook[hidden] { display: none; }
.emo { font-size: 1.5em; line-height: 1.1; margin-bottom: .1em; }
.cap { display: flex; flex-direction: column; align-items: center; }
.cap.pos-top { flex-direction: column-reverse; }
.cap.pos-auto { bottom: 27%; }
.cap.pos-bottom { bottom: 15%; }
.cap.pos-top { top: 25%; }
.cap.pos-center { top: 50%; transform: translateY(-50%); }
.cap span { transition: color .15s; }
.st-billboard { font-family: "Montserrat", "Arial Black", Impact, sans-serif; font-weight: 800; text-transform: uppercase; color: #fff;
  -webkit-text-stroke: .5cqw #000; paint-order: stroke fill; text-shadow: 0 .6cqw 0 rgba(0,0,0,.5); }
.st-billboard .on { color: var(--accent); }
.st-editorial { font-family: "Liberation Serif", "Times New Roman", Georgia, serif; font-weight: 600; color: #fff; text-shadow: 0 0 1.4cqw rgba(0,0,0,.7); }
.st-editorial .on { color: var(--accent); text-decoration: underline; text-decoration-thickness: .5cqw; text-underline-offset: .9cqw; }
.st-neon { font-family: "Montserrat", "Arial Black", sans-serif; font-weight: 800; text-transform: uppercase; color: #fff; }
.st-neon .on { color: var(--accent); text-shadow: 0 0 1.5cqw var(--accent), 0 0 4cqw var(--accent); }
.st-clean { font-family: -apple-system, "Liberation Sans", Arial, sans-serif; font-weight: 700; color: #fff;
  -webkit-text-stroke: .45cqw #000; paint-order: stroke fill; }
.st-clean .on { color: var(--accent); }

.st-line { font-family: "Montserrat", "Arial Black", sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: #fff;
  -webkit-text-stroke: .35cqw #000; paint-order: stroke fill; }
.st-line .on { color: var(--accent); text-decoration: underline; text-underline-offset: .9cqw; }
.st-soft { font-family: "Liberation Serif", "Times New Roman", Georgia, serif; font-style: italic; font-weight: 600; color: #fff;
  text-shadow: 0 0 1.6cqw var(--accent), 0 0 .5cqw rgba(0,0,0,.6); }
.st-soft .on { color: var(--accent); }
.st-label { font-family: "Montserrat", "Arial Black", sans-serif; font-weight: 800; text-transform: uppercase; color: #fff; line-height: 1.5; }
.st-label span { background: #141414; padding: .15em .1em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.st-label .on { color: var(--accent); }

.scroll { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 6px; background: var(--card);
  border-radius: 26px; margin: 14px 0 0; border: 1px solid var(--line); }
.scroll::-webkit-scrollbar { display: none; }
.scroll + .scroll { margin-top: 10px; }
.chip { flex: none; height: 42px; padding: 0 18px; border-radius: 21px; font-weight: 600; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.chip.on { background: var(--dark); color: var(--on-dark); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; min-height: 92px;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left; box-shadow: var(--shadow); }
.card b { font-size: 14px; font-weight: 700; hyphens: auto; max-width: calc(100% - 22px); }
.card .val { display: flex; justify-content: space-between; align-items: center; font-weight: 600; }
.card .val .ico svg { width: 15px; height: 15px; }
.help { position: absolute; top: 9px; right: 9px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  color: var(--mute); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sw { width: 52px; height: 30px; border-radius: 15px; background: var(--line); position: relative; transition: background .2s; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.sw.on { background: var(--dark); }
:root[data-theme="dark"] .sw.on { background: #6a5cff; }
.sw.on::after { transform: translateX(22px); }
.card .sw { margin-top: 12px; }

.drop { border: 2px dashed var(--mute); border-radius: 20px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; }
.drop b { font-size: 17px; display: block; margin-bottom: 4px; }
.drop small { color: var(--mute); font-size: 13px; }
.plus { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--dark); color: var(--on-dark); display: flex; align-items: center; justify-content: center; }
.plus .ico svg { width: 24px; height: 24px; }
.note { color: var(--mute); font-size: 13px; margin: 8px 4px 0; }
.seg { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 4px; margin-top: 12px; }
.seg button { flex: 1; height: 38px; border-radius: 12px; font-weight: 600; }
.seg button.on { background: var(--dark); color: var(--on-dark); }
.seg-title { margin: 14px 4px -6px; font-weight: 700; }

.cta { display: block; width: 100%; margin-top: 22px; padding: 16px; border-radius: 30px; background: var(--grad); color: #fff; text-align: center;
  font-weight: 800; font-size: 18px; box-shadow: 0 10px 24px rgba(252, 60, 133, .3); }
.cta small { display: block; font-weight: 500; font-size: 13px; opacity: .9; margin-top: 2px; }
.caption { text-align: center; color: var(--mute); font-size: 12px; font-weight: 700; letter-spacing: .08em; margin-top: 12px; text-transform: uppercase; }
.caption b { color: var(--ink); margin-left: 6px; }

.job { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow); }
.job-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.job-name { font-weight: 700; overflow-wrap: anywhere; }
.job-meta { color: var(--mute); font-size: 13px; margin-top: 3px; }
.tag { flex: none; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 12px; background: var(--line); }
.tag.done { background: rgba(31, 157, 85, .15); color: var(--ok); }
.tag.queued, .tag.processing { background: rgba(217, 138, 0, .16); color: var(--warn); }
.tag.failed { background: rgba(214, 69, 69, .14); color: var(--bad); }
.clips { margin: 12px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.clips li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.clips li:last-child { border-bottom: 0; }
.clips em { display: block; color: var(--mute); font-style: normal; font-size: 13px; margin-top: 2px; }
.btn { display: block; width: 100%; margin-top: 12px; height: 44px; border-radius: 14px; background: var(--dark); color: var(--on-dark); font-weight: 700; }
.btn.alt { background: var(--line); color: var(--ink); }
.btn[disabled] { opacity: .5; }
.empty { text-align: center; color: var(--mute); padding: 48px 20px; }

.bal { text-align: center; padding: 28px 0 8px; }
.bal .num { font: 800 64px/1 "Montserrat", "Arial Black", sans-serif; letter-spacing: -.03em; }
.bal .lbl { color: var(--mute); margin-top: 6px; }
.rows { background: var(--card); border: 1px solid var(--line); border-radius: 18px; margin-top: 22px; box-shadow: var(--shadow); }
.rows div { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.rows div:last-child { border-bottom: 0; }
.rows span:first-child { color: var(--mute); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; align-items: flex-end;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-radius: 26px 26px 0 0; box-shadow: 0 -4px 24px rgba(30, 27, 50, .08); }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--mute); font-size: 12px; font-weight: 600; padding: 4px 0; }
.tabs button.on { color: var(--ink); }
.tabs .fab { margin-top: -38px; }
.tabs .fab .ico { width: 78px; height: 78px; border-radius: 50%; background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 22px rgba(252, 60, 133, .35); border: 4px solid var(--card); }
.tabs .fab .ico svg { width: 34px; height: 34px; fill: #fff; stroke: none; }
.tabs .fab b { color: var(--ink); }

#toast { position: fixed; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); max-width: 86vw; padding: 11px 16px; border-radius: 14px;
  background: var(--dark); color: var(--on-dark); font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 20; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.stub { text-align: center; padding: 60px 20px; color: var(--mute); }
