/* Сервис роликов «Простор». Гамма и шрифт те же, что в самих роликах: синий, оранжевый, белый, Ubuntu. */
:root {
  --blue: #2678a1; --blue-deep: #17536f; --blue-soft: #d9e8f4; --orange: #f7823d; --orange-deep: #dd6a24;
  --paper: #fff; --field: #eef3f7; --line: #d3dfe8; --ink: #1f2a33; --muted: #5c6e7a;
  --danger: #b3261e; --ok: #2e7d4f; --warn: #a96a0b;
  --frame: 5px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.5 "Ubuntu", system-ui, sans-serif; color: var(--ink); background: var(--field); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: var(--blue-deep); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- вход: синее поле и белая карточка в рамке, как кадр ролика ---------- */
.gate { min-height: 100vh; background: var(--blue); display: grid; place-items: center; padding: 24px 16px; }
.gate-card { width: min(440px, 100%); background: var(--paper); border: var(--frame) solid var(--paper); outline: 2px solid var(--paper); outline-offset: 5px; }
.gate-head { background: var(--blue); display: flex; align-items: center; gap: 16px; padding: 16px 20px; color: #fff; }
.gate-head img { width: 76px; height: auto; display: block; }
.gate-head h1 { font-size: 20px; font-weight: 700; line-height: 1.2; }
.gate-body { padding: 24px 20px 28px; display: grid; gap: 16px; }
.gate-strip { background: var(--orange); color: #fff; padding: 8px 20px; font-weight: 500; }
.hint { color: var(--muted); font-size: 14px; }
.dev-code { background: var(--blue-soft); padding: 10px 12px; font-size: 14px; }
.dev-code b { font-size: 22px; letter-spacing: 0.12em; }

/* ---------- общие элементы ---------- */
label.f { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 14px; color: var(--muted); }
input[type=text], input[type=email], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #aebfcb; background: #fff; border-radius: 3px; color: var(--ink); font-size: 16px;
}
textarea { resize: vertical; min-height: 64px; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: 3px solid rgba(38, 120, 161, 0.25); outline-offset: 0; }
.code-input { font-size: 30px; letter-spacing: 0.35em; text-align: center; padding: 12px 0 12px 0.35em; font-weight: 500; }
.btn { appearance: none; border: 0; cursor: pointer; padding: 11px 20px; font-weight: 500; border-radius: 0; background: var(--blue); color: #fff; }
.btn:hover { background: var(--blue-deep); }
.btn.primary { background: var(--orange); color: #1b1006; font-weight: 700; }
.btn.primary:hover { background: var(--orange-deep); }
.btn.ghost { background: transparent; color: var(--blue-deep); border: 1px solid var(--blue); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn:disabled { background: #c7d2da; color: #6d7d88; cursor: not-allowed; border-color: transparent; }
.link-btn { background: none; border: 0; color: var(--blue-deep); text-decoration: underline; cursor: pointer; padding: 0; }
.err { color: var(--danger); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.grow { flex: 1 1 220px; }

/* ---------- каркас ---------- */
.top { background: var(--blue); color: #fff; }
.top-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.top img { width: 64px; display: block; }
.top nav { display: flex; gap: 4px; flex: 1 1 auto; }
.top nav a { color: #fff; text-decoration: none; padding: 8px 14px; font-weight: 500; border-bottom: 3px solid transparent; }
.top nav a[aria-current=page] { border-bottom-color: var(--orange); }
.top nav a:hover { background: rgba(255, 255, 255, 0.12); }
.who { font-size: 14px; text-align: right; line-height: 1.3; }
.who small { display: block; opacity: 0.85; }
.lamp { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; background: rgba(255, 255, 255, 0.14); padding: 6px 12px; }
.lamp i { width: 10px; height: 10px; border-radius: 50%; background: #5bd48a; }
.lamp.yellow i { background: #ffd24a; } .lamp.red i { background: #ff6a5e; }
main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 120px; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; align-items: start; }
.flow { display: grid; gap: 20px; min-width: 0; }
.block { background: var(--paper); border: 1px solid var(--line); }
.block > h2 { background: var(--blue); color: #fff; font-size: 17px; font-weight: 500; padding: 9px 18px; display: flex; gap: 12px; align-items: baseline; }
.block > h2 b { color: var(--orange); font-weight: 700; }
.block > h2 span { margin-left: auto; font-size: 14px; font-weight: 400; opacity: 0.9; }
.pad { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chips-edit { display: grid; gap: 8px; }
.chip-row { display: grid; grid-template-columns: 110px 1fr 36px; gap: 8px; }
.x { border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 18px; line-height: 1; color: var(--muted); }
.x:hover { color: var(--danger); border-color: var(--danger); }
.loaded-note { font-size: 14px; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* фото */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ph { position: relative; border: 3px solid transparent; background: var(--field); cursor: pointer; padding: 0; text-align: left; }
.ph img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ph.on { border-color: var(--orange); }
.ph .n { position: absolute; top: 6px; left: 6px; min-width: 28px; height: 28px; background: var(--orange); color: #1b1006; font-weight: 700; display: grid; place-items: center; }
.ph .info { display: block; font-size: 13px; padding: 4px 6px; background: #fff; line-height: 1.25; }
.ph .info.ok { color: var(--ok); } .ph .info.mid { color: var(--warn); } .ph .info.bad { color: var(--danger); }
.ph:disabled { opacity: 0.5; cursor: not-allowed; }
.counter { font-weight: 500; } .counter.bad { color: var(--danger); } .counter.good { color: var(--ok); }
.order-strip { display: flex; gap: 8px; flex-wrap: wrap; }
.os { width: 92px; border: 1px solid var(--line); background: #fff; }
.os img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.os div { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px; font-size: 13px; }
.os button { border: 0; background: var(--blue-soft); cursor: pointer; width: 26px; height: 24px; }
.os button:disabled { opacity: 0.35; cursor: default; }

/* музыка и шаблон */
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); cursor: pointer; }
.opt:has(input:checked) { border-color: var(--blue); background: #f2f8fc; }
.opt input { margin-top: 4px; accent-color: var(--blue); }
.opt small { display: block; color: var(--muted); }
.opt.disabled { opacity: 0.55; cursor: not-allowed; }
.tpl { display: flex; gap: 14px; align-items: center; }
.tpl .sw { width: 54px; height: 96px; background: var(--blue); border: 3px solid #fff; outline: 1px solid var(--line); position: relative; flex: none; }
.tpl .sw::before { content: ""; position: absolute; left: 6px; right: 6px; top: 8px; height: 10px; background: var(--orange); }
.tpl .sw::after { content: ""; position: absolute; left: 6px; right: 6px; top: 22px; bottom: 8px; background: #fff; }

/* правая колонка */
.side { position: sticky; top: 16px; display: grid; gap: 16px; }
.pv-wrap { background: var(--t-canvas, #2678a1); padding: 12px; }
.pv-box { position: relative; width: 100%; aspect-ratio: 9 / 16; overflow: hidden; background: var(--t-canvas, #2678a1); }
.pv { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; transform-origin: 0 0; font-family: "Ubuntu", sans-serif; color: var(--t-ink, #2f2f2f); }
.pv > * { position: absolute; }
.pv .card { left: 72px; top: 156px; width: 936px; height: 1656px; background: var(--t-bg, #fff); }
.pv .tr { left: 648px; top: 161px; width: 355px; height: 236px; background: var(--t-blue, #2678a1); }
.pv .band { left: 77px; top: 385px; width: 926px; height: 12px; background: var(--t-blue, #2678a1); }
.pv .lg { left: 722px; top: 180px; width: 200px; height: 190px; background: var(--t-logo, #fff); -webkit-mask: url(logo.png) center / contain no-repeat; mask: url(logo.png) center / contain no-repeat; }
.pv .h1, .pv .h2, .pv .h3 { left: 77px; width: 571px; display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; }
.pv .h1 { top: 161px; height: 77px; font-size: 54px; } .pv .h2 { top: 240px; height: 75px; font-size: 38px; background: var(--t-orange, #f7823d); color: var(--t-onOrange, #fff); } .pv .h3 { top: 318px; height: 67px; font-size: 46px; }
.pv .win { left: 77px; top: 397px; width: 926px; height: 683px; background: var(--t-placeholder, #cfe0ec); overflow: hidden; }
.pv .win img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv .chips { left: 0; top: 1105px; width: 1080px; height: 143px; display: flex; justify-content: center; gap: 24px; }
.pv .chip { width: 155px; height: 143px; border-radius: 22px; background: var(--t-chipBg, #d9e8f4); color: var(--t-chipInk, #3b4b56); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pv .chip b { font-size: 44px; line-height: 1.1; max-width: 140px; white-space: nowrap; overflow: hidden; } .pv .chip span { font-size: 26px; margin-top: 8px; }
.pv .addr { left: 168px; top: 1285px; width: 810px; height: 112px; font-size: 40px; line-height: 1.25; color: var(--t-accent, #17536f); overflow: hidden; }
.pv .metro { left: 165px; top: 1445px; width: 400px; font-size: 30px; line-height: 38px; color: var(--t-accent, #17536f); }
.pv .bb { left: 572px; top: 1426px; width: 431px; height: 381px; background: var(--t-blue, #2678a1); }
.pv .tag { left: 592px; top: 1444px; width: 390px; height: 345px; color: var(--t-onBlue, #fff); font-size: 36px; line-height: 47px; overflow: hidden; }
.pv .bo { left: 77px; top: 1593px; width: 495px; height: 214px; background: var(--t-orange, #f7823d); }
.pv .bl { left: 324.5px; transform: translateX(-50%); top: 1661px; min-width: 324px; max-width: 465px; padding: 0 36px; box-sizing: border-box; white-space: nowrap; overflow: hidden; height: 78px; background: var(--t-blue, #2678a1); color: var(--t-onBlue, #fff); font-size: 44px; display: flex; align-items: center; justify-content: center; }

.pv-cap { font-size: 13px; color: var(--muted); margin-top: 6px; }
.panel { background: var(--paper); border: 1px solid var(--line); padding: 16px; display: grid; gap: 10px; }
.price { font-size: 34px; font-weight: 700; line-height: 1.1; }
.price s { font-size: 18px; color: var(--muted); font-weight: 400; margin-right: 8px; }
.meta { font-size: 14px; color: var(--muted); }
.meta.alert { color: var(--danger); font-weight: 500; }
.warnbox { border-left: 4px solid var(--danger); background: #fdf0ef; padding: 10px 12px; font-size: 14px; }
.okbox { border-left: 4px solid var(--ok); background: #eef8f1; padding: 10px 12px; font-size: 14px; }
.mobbar { display: none; }

/* история */
.jobs { display: grid; gap: 10px; }
.job { background: var(--paper); border: 1px solid var(--line); border-left: 6px solid var(--blue); padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
.job.done { border-left-color: var(--ok); } .job.failed { border-left-color: var(--danger); } .job.queued, .job.preparing, .job.running { border-left-color: var(--orange); } .job.expired, .job.canceled { border-left-color: #9aa9b3; }
.job h3 { font-size: 17px; font-weight: 500; }
.job .sub { color: var(--muted); font-size: 14px; }
.badge { display: inline-block; font-size: 13px; padding: 2px 8px; background: var(--blue-soft); color: var(--blue-deep); font-weight: 500; }
.job .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.empty { background: var(--paper); border: 1px dashed #9db3c1; padding: 40px 20px; text-align: center; color: var(--muted); }

/* окна и уведомления */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 35, 48, 0.62); display: grid; place-items: center; padding: 16px; z-index: 50; }
.modal { background: #fff; width: min(460px, 100%); border-top: 6px solid var(--orange); padding: 22px; display: grid; gap: 14px; max-height: 92vh; overflow: auto; }
.modal.wide { width: min(560px, 100%); }
.modal video { width: 100%; max-height: 70vh; background: #000; display: block; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 10px; z-index: 60; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--blue-deep); color: #fff; padding: 12px 16px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); }
.toast.warn { background: var(--danger); font-weight: 500; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .pv-wrap { max-width: 330px; }
  .mobbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; background: #fff; border-top: 3px solid var(--blue); padding: 10px 16px; gap: 14px; align-items: center; z-index: 20; }
  .mobbar .price { font-size: 24px; } .mobbar .btn { margin-left: auto; }
}
@media (max-width: 560px) {
  main { padding: 14px 12px 120px; }
  .grid2 { grid-template-columns: 1fr; }
  .chip-row { grid-template-columns: 90px 1fr 36px; }
  .job { grid-template-columns: 1fr; } .job .acts { justify-content: flex-start; }
  .who { text-align: left; } .top nav { order: 3; flex-basis: 100%; }
}
@media (prefers-reduced-motion: no-preference) { .toast { animation: tin 0.25s ease-out; } @keyframes tin { from { transform: translateY(8px); opacity: 0; } } }

/* красная полоса о неоплаченном счёте: на всю ширину страницы под шапкой */
.alertbar { display: block; background: #b3261e; color: #fff; font-weight: 700; text-align: center; padding: 10px 16px; text-decoration: none; }
.alertbar[hidden] { display: none; }
.alertbar:hover { background: #9b1f19; }
