[hidden] { display: none !important; }
:root {
  --gray: #5c5c5c;
  --gray-2: #939393;
  --gray-3: #c6c6c6;
  --gray-4: #e6e6e6;
  --bg: #f3f3f3;
  --ink: #1e1e1e;
  --ink-2: #555;
  --red: #ff0000;
  --red-ink: #d40000;
  --ok: #1f8a4c;
  --card: #fff;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: inherit; }
h1, h2 { margin: 0 0 .6em; line-height: 1.2; }
h1 { font-size: 26px; }
h2 { font-size: 17px; display: flex; align-items: center; gap: 10px; }
.mt { margin-top: 1.4em; }
.muted { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: 13px; margin: .35em 0 .9em; }
.small { font-size: 12px; }
.err { color: var(--red-ink); font-weight: 600; }
.warn { background: #fff4e5; border-left: 3px solid #f0a020; padding: 8px 10px; font-size: 13px; border-radius: 4px; }
.ok { color: var(--ok); font-weight: 600; }
.offscreen { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* шапка */
.top { background: var(--gray); color: #fff; }
.top-inner { max-width: 1240px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.brand { font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 10px; font-size: 16px; }
.brand-mark { width: 18px; height: 12px; background: var(--red); display: inline-block; }
.top nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top nav a { text-decoration: none; opacity: .92; }
.top nav a:hover { opacity: 1; text-decoration: underline; }
.top .muted { color: #e0e0e0; }
.langs { display: inline-flex; border: 1px solid rgba(255,255,255,.35); border-radius: 6px; overflow: hidden; }
.langs a { padding: 2px 8px; font-size: 12px; }
.langs a.on { background: #fff; color: var(--gray); opacity: 1; }

.wrap { max-width: 1240px; margin: 0 auto; padding: 24px 16px 60px; }
.page-h { margin-bottom: 20px; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 16px; }

/* сетка */
.grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; align-items: start; }
.sticky { position: sticky; top: 16px; }
@media (max-width: 960px) { .grid { grid-template-columns: 1fr; } .sticky { position: static; } }

/* поля */
label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 12px; color: var(--ink); }
input[type=text], input[type=password], input[type=number], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 5px; font: inherit; font-weight: 400; font-size: 15px;
  padding: 9px 11px; border: 1px solid var(--gray-3); border-radius: 7px; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gray); outline-offset: 0; border-color: var(--gray); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
legend { font-weight: 600; font-size: 13px; margin-bottom: 6px; padding: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }
.num { width: 24px; height: 24px; border-radius: 50%; background: var(--gray); color: #fff; font-size: 13px; display: inline-grid; place-items: center; }

/* сегментированные переключатели */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { margin: 0; font-weight: 500; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--gray-3); border-radius: 7px; cursor: pointer; font-size: 14px; background: #fff; }
.seg input:checked + span { border-color: var(--gray); background: var(--gray); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--red); }
.ar { display: inline-block; border: 2px solid currentColor; border-radius: 2px; }
.ar169 { width: 18px; height: 11px; } .ar916 { width: 10px; height: 16px; } .ar11 { width: 13px; height: 13px; }
.dur-inputs { margin-top: 8px; font-size: 14px; }
.dur-inputs input { display: inline-block; width: 90px; margin-right: 4px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; font-size: 14px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: 7px; border: 1px solid var(--gray-3);
  background: #fff; color: var(--ink); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--gray); }
.btn.primary { background: var(--gray); border-color: var(--gray); color: #fff; }
.btn.primary:hover { background: #474747; }
.btn.primary:disabled { opacity: .55; cursor: default; }
.btn.big { padding: 12px 22px; font-size: 15px; }
.btn.danger, .link.danger { color: var(--red-ink); }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.actions form { margin: 0; }

/* загрузка фото */
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; min-height: 130px;
  border: 2px dashed var(--gray-3); border-radius: var(--radius); cursor: pointer; padding: 16px; font-weight: 500; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--gray); background: #fafafa; }
.drop.has { min-height: 72px; }
.drop-text { font-size: 15px; }
.photo-bar { display: flex; align-items: center; gap: 4px; margin: 12px 0 8px; font-size: 14px; }
.photo-bar .link { margin-left: auto; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 6px; }
.thumb { position: relative; aspect-ratio: 1; background: var(--gray-4); border-radius: 5px; overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.noimg { display: grid; place-items: center; font-size: 11px; color: var(--ink-2); font-weight: 700; }
.thumb .x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff;
  cursor: pointer; font-size: 14px; line-height: 20px; padding: 0; opacity: 0; }
.thumb:hover .x, .thumb .x:focus { opacity: 1; }

/* Highlight-чипы */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 16px; min-height: 8px; }
.chip { border: 1px solid var(--gray-3); background: #fff; border-radius: 4px; padding: 4px 10px; font: inherit; font-size: 15px; cursor: pointer; }
.chip:hover { border-color: var(--gray); }
.chip.on { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }

/* превью */
.prev-box { position: relative; background: var(--gray-4); border-radius: 6px; overflow: hidden; min-height: 80px; }
.prev-box img { display: block; width: 100%; }
.spin { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.5); border-top-color: #fff; border-radius: 50%; animation: s .8s linear infinite; }
@keyframes s { to { transform: rotate(360deg); } }

/* отправка */
.submit-bar { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.progress { position: relative; width: 100%; height: 26px; background: var(--gray-4); border-radius: 6px; overflow: hidden; }
.progress > div { height: 100%; width: 0; background: var(--gray); transition: width .4s; }
.progress > span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13px; font-weight: 600; mix-blend-mode: difference; color: #fff; }

/* недавние */
.recent { list-style: none; margin: 0; padding: 0; }
.recent li a { display: grid; grid-template-columns: 72px 1fr; column-gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--gray-4); text-decoration: none; }
.recent li:last-child a { border-bottom: 0; }
.r-thumb { grid-row: span 2; width: 72px; height: 44px; object-fit: cover; border-radius: 4px; background: var(--gray-4); display: grid; place-items: center; }
.r-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r-meta { font-size: 12px; color: var(--ink-2); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gray-3); display: inline-block; }
.dot.st-running { background: #f0a020; animation: pulse 1.2s infinite; }
.dot.st-done { background: var(--ok); }
.dot.st-error { background: var(--red); }
@keyframes pulse { 50% { opacity: .35; } }

/* задача */
.job { max-width: 900px; margin: 0 auto; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); margin: 0 0 6px; }
.job-title { font-size: 28px; margin-bottom: 4px; }
.job-sub { color: var(--ink-2); margin: 0 0 18px; }
.status { display: flex; align-items: center; gap: 8px; font-size: 16px; }
video { width: 100%; background: #000; border-radius: 6px; display: block; max-height: 72vh; object-fit: contain; }
video[data-fmt="9:16"] { width: auto; max-width: 100%; margin: 0 auto; }

/* вход */
.login { max-width: 380px; margin: 60px auto; }

/* админка */
.tpl-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.swatches { display: flex; gap: 4px; margin-bottom: 12px; }
.swatches span { width: 28px; height: 18px; border-radius: 3px; border: 1px solid rgba(0,0,0,.1); }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.color { display: flex; gap: 10px; align-items: center; font-weight: 500; margin: 0; }
.color input { width: 44px; height: 44px; padding: 0; border: 1px solid var(--gray-3); border-radius: 6px; background: none; cursor: pointer; flex: none; }
.color code { font-size: 12px; color: var(--ink-2); }
.font-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--gray-4); }
.font-row:last-child { border-bottom: 0; }
.file { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; padding: 8px 12px; border: 1px dashed var(--gray-2); border-radius: 7px; cursor: pointer; margin: 0; }
.file input { font-size: 12px; font-weight: 400; max-width: 220px; }
.logos { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.logo-item { border-radius: 6px; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 120px; }
.logo-item img { max-height: 48px; max-width: 200px; }
.logo-actions { display: flex; gap: 10px; background: #fff; border-radius: 4px; padding: 2px 8px; }
.music { list-style: none; padding: 0; margin: 0 0 12px; }
.music li { display: flex; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.music audio { height: 32px; }
.nums { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
output { font-weight: 600; font-size: 13px; }
input[type=range] { width: 100%; margin-top: 8px; }
