:root {
  /* палитра сайта (style.css в корне): чернила, кость, угли, неон, фиолет */
  --ink: #07060a; --ink2: rgba(20, 15, 22, .82); --ink3: #1c1520; --line: #2a2130;
  --bone: #ece3d6; --dim: #a3958a; --gold: #d6a35c; --violet: #a58cff;
  --neon: #ff2d95; --ember: #ff8a3d; --blood: #9a1024;
  --green: #5fc48a; --red: #ff5a6e; --blue: #8fb4ff;
  --uni: 'Cormorant Unicase', 'Cormorant Garamond', Georgia, serif;
  --serif: 'Spectral', Georgia, serif;
  --ui: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
::selection { background: var(--neon); color: #fff; }
body { margin: 0; color: var(--bone); font: 14px/1.45 var(--ui); min-height: 100vh;
  /* аура Ворожеи сверху и тлеющие угли снизу — как фон кодекса, только тише */
  background:
    radial-gradient(1100px 520px at 50% -160px, rgba(165, 140, 255, .14), transparent 70%),
    radial-gradient(900px 420px at 100% 110%, rgba(255, 45, 149, .07), transparent 70%),
    radial-gradient(800px 380px at 0% 115%, rgba(255, 138, 61, .07), transparent 70%),
    var(--ink) fixed; }
/* виньетка и неподвижное зерно плёнки */
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 60%, rgba(0, 0, 0, .55) 100%); }
body::after { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
main, .top { position: relative; z-index: 1; }
a { color: var(--gold); }
code { background: var(--ink3); padding: 1px 5px; border-radius: 4px; }
.muted { color: var(--dim); }
.small { font-size: 12.5px; }
[hidden] { display: none !important; }

/* искры: несколько угольков поднимаются снизу экрана */
.embers { position: fixed; inset: auto 0 0 0; height: 60vh; pointer-events: none; z-index: 0; overflow: hidden; }
.embers i { position: absolute; bottom: -10px; left: var(--x); width: var(--s); height: var(--s); border-radius: 50%;
  background: radial-gradient(circle, #ffd2a0 0 25%, var(--c) 45%, transparent 70%); filter: blur(.3px); opacity: 0;
  animation: rise var(--d) linear var(--w) infinite; }
@keyframes rise {
  0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: .8; }
  50% { transform: translate(var(--dx), -30vh); }
  100% { transform: translate(calc(var(--dx) * -1), -60vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .embers { display: none; } }

button, .btn { font: 500 13.5px var(--ui); border-radius: 8px; padding: 8px 14px; cursor: pointer; border: 1px solid var(--line);
  background: var(--ink3); color: var(--bone); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  transition: border-color .2s, box-shadow .2s, background .2s; }
button:hover, .btn:hover { border-color: #4d3a52; }
.primary { background: linear-gradient(135deg, #ff3d9e, #d91a72); color: #fff; border-color: transparent; box-shadow: 0 0 0 rgba(255, 45, 149, 0); }
.primary:hover { box-shadow: 0 0 18px rgba(255, 45, 149, .45); border-color: transparent; }
button:disabled { opacity: .5; cursor: default; }
.ghost { background: transparent; }
.danger { color: var(--red); }
button.small, .btn.small { padding: 5px 10px; font-size: 12.5px; }
button.link { background: none; border: 0; padding: 0; color: var(--gold); text-decoration: underline dotted; }
input, textarea, select { width: 100%; font: 14px var(--ui); color: var(--bone); background: rgba(7, 6, 10, .8); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
input:focus, textarea:focus, select:focus { outline: 2px solid rgba(255, 45, 149, .45); border-color: transparent; }
textarea { resize: vertical; }
label { display: block; font-weight: 500; }
label small { font-weight: 400; color: var(--dim); margin-left: 6px; }
label > input, label > textarea, label > select { margin-top: 5px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 28px; padding: 12px 28px;
  background: linear-gradient(rgba(7, 6, 10, .96), rgba(7, 6, 10, .84)); backdrop-filter: blur(8px); border-bottom: 1px solid rgba(255, 45, 149, .14); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--bone); }
.brand svg { width: 26px; height: 26px; flex: none; filter: drop-shadow(0 0 6px rgba(255, 45, 149, .7)); }
.brand b { font: 500 22px/1 var(--uni); white-space: nowrap; }
.brand b em { font-style: normal; color: var(--neon); text-shadow: 0 0 12px rgba(255, 45, 149, .7); }
.brand span { color: var(--dim); font: 400 11px/1 var(--serif); letter-spacing: .3em; text-transform: uppercase; padding-left: 10px; border-left: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; }
.tabs a { position: relative; color: var(--dim); text-decoration: none; padding: 9px 12px; font: 400 12px/1 var(--serif); letter-spacing: .22em; text-transform: uppercase; transition: color .3s; }
.tabs a::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 1px; height: 1px; background: var(--neon); box-shadow: 0 0 8px var(--neon); transform: scaleX(0); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.tabs a:hover, .tabs a.on { color: var(--bone); }
.tabs a.on::after { transform: scaleX(1); }
.top-act { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.dry { white-space: nowrap; font: 500 11px/1 var(--serif); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); border: 1px dashed rgba(214, 163, 92, .6); padding: 6px 10px; border-radius: 6px; }

main { max-width: 1100px; margin: 0 auto; padding: 26px 24px 100px; }
.filters { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.seg { background: transparent; }
.seg.on { background: var(--ink3); border-color: rgba(255, 45, 149, .45); }
.seg.alert { color: var(--red); }
.filters select { width: auto; margin-left: auto; }

.day { margin-bottom: 26px; }
.day h3 { display: flex; align-items: center; gap: 14px; font: 500 21px/1.2 var(--uni); letter-spacing: .03em; color: var(--dim); margin: 0 0 10px; }
.day h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }
.day.today h3 { color: var(--bone); }
.day.today h3 b { color: var(--neon); font-weight: 500; text-shadow: 0 0 10px rgba(255, 45, 149, .6); }
.day.past { opacity: .8; }
.row { display: grid; grid-template-columns: 52px 64px 1fr; gap: 14px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(28, 21, 32, .85), rgba(16, 12, 18, .85)); border-radius: 12px; margin-bottom: 8px; transition: border-color .25s; }
.row:hover { border-color: #3d2f44; }
.row time { font: 600 15px var(--ui); font-variant-numeric: tabular-nums; padding-top: 2px; }
.row.st-failed { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.row.st-due { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.thumb { width: 64px; height: 84px; border-radius: 8px; overflow: hidden; background: var(--ink3); cursor: pointer; display: grid; place-items: center; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.nothumb { font: 600 18px var(--uni); color: var(--dim); }
.what { min-width: 0; }
.ttl { color: var(--bone); text-decoration: none; font: 500 20px/1.15 var(--uni); letter-spacing: .01em; }
.ttl:hover { text-decoration: underline; }
.sub { margin: 2px 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl { display: grid; gap: 4px; }
.tline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; min-height: 30px; padding: 2px 0; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.tline:first-child { border-top: 0; }
.err { color: var(--red); }
.prog { color: var(--gold); }
.stats { color: var(--dim); }
.acts { display: inline-flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }

.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 16%, transparent); color: color-mix(in srgb, var(--c) 70%, white); }
.chip i { font-style: normal; font-weight: 400; opacity: .85; }
.pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--ink3); }
.pill.green { color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.pill.red { color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.pill.gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
.pill.blue { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.pill.muted { color: var(--dim); }
.tag { font-size: 11px; color: var(--dim); border: 1px solid var(--line); border-radius: 5px; padding: 0 6px; }
.tag.ok { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.empty { text-align: center; padding: 70px 0; color: var(--dim); }
.empty p:first-child { font: italic 400 22px var(--serif); color: var(--bone); opacity: .8; }

/* площадки */
.accounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.acc { border: 1px solid var(--line); border-top: 2px solid var(--c); background: linear-gradient(180deg, rgba(28, 21, 32, .85), rgba(16, 12, 18, .85)); border-radius: 12px; padding: 16px 18px; }
.acc header { display: flex; justify-content: space-between; align-items: center; }
.acc h3 { margin: 0; font: 500 24px var(--uni); letter-spacing: .03em; }
.formats { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.setup { border-top: 1px solid var(--line); padding-top: 10px; }
.acc-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tok { display: flex; gap: 8px; width: 100%; }

/* журнал */
.log { list-style: none; padding: 0; margin: 0; }
.log li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.log time { color: var(--dim); font-size: 12.5px; margin-right: 10px; font-variant-numeric: tabular-nums; }
.log .lv-error { color: var(--red); }
.log .lv-warn { color: var(--gold); }

/* редактор */
dialog { border: 1px solid var(--line); border-top-color: rgba(255, 45, 149, .35); background: #110d14; box-shadow: 0 30px 80px rgba(0, 0, 0, .7), 0 0 60px rgba(165, 140, 255, .08); color: var(--bone); border-radius: 14px; padding: 0; width: min(1080px, 96vw); max-height: 94vh; }
dialog::backdrop { background: rgba(4, 3, 6, .72); backdrop-filter: blur(3px); }
#pack { width: min(640px, 96vw); }
.ed-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.ed-head h2 { margin: 0; font: 500 26px var(--uni); display: flex; gap: 10px; align-items: center; }
.x { background: none; border: 0; font-size: 24px; color: var(--dim); padding: 0 6px; }
/* колонки сами прокручиваются: высота строки сетки ограничена, иначе лишнее обрезалось без прокрутки */
.ed-body { display: grid; grid-template-columns: 1fr 380px; grid-template-rows: minmax(0, 1fr); height: calc(94vh - 130px); overflow: hidden; }
.ed-main, .ed-side { min-height: 0; }
.ed-main { padding: 18px 20px; overflow: auto; display: grid; gap: 14px; align-content: start; }
.ed-side { padding: 18px 20px; overflow: auto; border-left: 1px solid var(--line); background: rgba(7, 6, 10, .6); }
.ed-foot { display: flex; gap: 10px; padding: 12px 20px; border-top: 1px solid var(--line); }
.spacer { flex: 1; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.count { display: block; text-align: right; font-size: 12px; color: var(--dim); font-weight: 400; }
.media-head { display: flex; gap: 10px; align-items: center; }
.upload { margin-left: auto; font-weight: 500; }
.picked { display: flex; gap: 10px; flex-wrap: wrap; }
.picked figure { margin: 0; width: 110px; position: relative; }
.picked img, .picked video { width: 110px; height: 150px; object-fit: cover; border-radius: 8px; background: var(--ink3); display: block; }
.picked figcaption { font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-act { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; }
.pk-act button { padding: 1px 7px; background: rgba(0, 0, 0, .7); }
.library summary { cursor: pointer; color: var(--gold); }
.lib-dir h4 { font-size: 12px; color: var(--dim); font-weight: 500; margin: 14px 0 6px; }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.lib-item { display: block; padding: 4px; text-align: left; background: var(--ink); white-space: normal; }
.lib-item.on { border-color: var(--neon); box-shadow: 0 0 0 1px var(--neon), 0 0 14px rgba(255, 45, 149, .35); }
.lib-item img, .lib-item video { width: 100%; aspect-ratio: 9 / 13; object-fit: cover; border-radius: 6px; display: block; }
.lib-item span { display: block; font-size: 11.5px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-item small { color: var(--dim); font-size: 10.5px; }
.tp { margin-top: 14px; }
.tp h4 { margin: 0 0 6px; font-size: 13px; color: color-mix(in srgb, var(--c) 70%, white); }
.tf { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; margin-bottom: 6px; }
.tf.on { border-color: color-mix(in srgb, var(--c) 45%, var(--line)); background: var(--ink2); }
.tf.unfit:not(.on) { opacity: .45; }
.tf-head { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 400; }
.tf-head input { width: auto; margin: 0; accent-color: var(--neon); }
.tf-when { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.tf-when select { width: auto; }
.tf-body { display: grid; gap: 7px; margin-top: 8px; }
.hint { color: var(--dim); margin: 0; }
.problems { margin: 0; padding-left: 16px; color: var(--red); font-size: 12.5px; }
.problems .ok { color: var(--green); list-style: '✓ '; }
.pack { padding: 0 0 4px; }
.pack > *:not(header):not(footer) { margin-left: 20px; margin-right: 20px; }
.pack-cap pre { white-space: pre-wrap; font: 14px/1.5 var(--ui); background: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 280px; overflow: auto; }
.pack-files { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; margin-bottom: 14px; }

.toast { font-family: var(--ui); position: fixed; bottom: 22px; left: 50%; translate: -50% 0; background: var(--ink3); border: 1px solid var(--line); padding: 10px 16px; border-radius: 10px; z-index: 20; max-width: min(720px, 92vw); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.toast.bad { border-color: var(--red); color: #ffd0d6; }

@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .top-act { margin-left: 0; width: 100%; flex-wrap: wrap; }
  #run { display: none; }
  .top-act .primary { margin-left: auto; }
  main { padding: 16px; }
  .row { grid-template-columns: 44px 1fr; }
  .row .thumb { display: none; }
  .acts { margin-left: 0; }
  .ed-body { grid-template-columns: 1fr; grid-template-rows: none; overflow: auto; }
  .ed-main, .ed-side { overflow: visible; }
  .ed-side { border-left: 0; border-top: 1px solid var(--line); }
}

/* вход */
.login-page { display: grid; place-items: center; min-height: 100vh; }
.login { position: relative; z-index: 1; width: min(360px, calc(100vw - 32px)); display: grid; gap: 14px; text-align: center; padding: 34px 28px 30px;
  border: 1px solid var(--line); border-top-color: rgba(255, 45, 149, .35); border-radius: 16px; background: rgba(17, 13, 20, .9); box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 80px rgba(165, 140, 255, .08); }
.login svg { width: 46px; height: 46px; margin: 0 auto; filter: drop-shadow(0 0 10px rgba(255, 45, 149, .7)); }
.login h1 { margin: 0; font: 500 34px/1 var(--uni); }
.login h1 em { font-style: normal; color: var(--neon); text-shadow: 0 0 14px rgba(255, 45, 149, .7); }
.login .kick { margin: -4px 0 8px; font: 400 11px/1 var(--serif); letter-spacing: .4em; text-transform: uppercase; color: var(--dim); }
.login label { text-align: left; }
.login button { justify-content: center; padding: 10px; }
.note { position: relative; z-index: 1; max-width: 560px; margin: 12vh auto; padding: 0 16px; }
.note h1 { font: 500 30px var(--uni); }

/* пользователь в шапке */
.me { position: relative; }
.me summary { list-style: none; cursor: pointer; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 500; white-space: nowrap; }
.me summary::-webkit-details-marker { display: none; }
.me-menu { position: absolute; right: 0; top: calc(100% + 6px); display: grid; gap: 4px; padding: 6px; background: #110d14; border: 1px solid var(--line); border-radius: 10px; z-index: 10; min-width: 170px; }
.me-menu button { justify-content: flex-start; border: 0; }
#pw { width: min(420px, 96vw); }
.pw-body { padding: 18px 20px; display: grid; gap: 12px; }

/* площадки: настройка */
.acc { display: grid; gap: 10px; align-content: start; }
.acc-who { margin: 0; }
.setup, .caps { border-top: 1px solid var(--line); padding-top: 10px; }
.setup summary, .caps summary { cursor: pointer; font-weight: 600; color: var(--bone); }
.caps summary { color: var(--dim); font-weight: 500; }
.steps { margin: 10px 0; padding-left: 20px; display: grid; gap: 7px; font-size: 13px; color: color-mix(in srgb, var(--bone) 88%, transparent); }
.steps code, .copy-row code { font-size: 12px; word-break: break-all; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; margin: 10px 0; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 8px; }
.copy-row span { grid-column: 1 / -1; }
.set-form { display: grid; gap: 8px; margin-top: 8px; }
.set-form label { font-size: 13px; }
.tok { flex-wrap: wrap; }
.tok input { flex: 1 1 140px; }
.acc .acc-act { gap: 10px; }
.service { grid-column: 1 / -1; }
.service .svc { border-top: 1px solid var(--line); padding-top: 12px; }
.service h4 { margin: 0 0 6px; display: flex; gap: 8px; align-items: center; font-size: 14px; }
.service .set-form { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: end; }
.service .set-form .acc-act { grid-column: 1 / -1; }
.log .who { color: var(--violet); font-weight: 600; }

.people { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }

/* предпросмотр: раскладка площадок, нейтрально, без копирования их интерфейсов */
#pv { width: min(720px, 96vw); }
.pv-tabs { display: flex; gap: 6px; flex-wrap: wrap; padding: 12px 20px 0; }
.pv-stage { padding: 16px 20px 22px; display: grid; justify-items: center; gap: 12px; max-height: 76vh; overflow: auto; }
.pv-card { width: 100%; max-width: 470px; background: #fff; color: #111; border-radius: 12px; overflow: hidden; font: 14px/1.45 -apple-system, system-ui, sans-serif; }
.pv-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; }
.pv-head img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; }
.pv-head b { display: block; font-size: 14px; }
.pv-head span { font-size: 12.5px; color: #818c99; }
.pv-text { padding: 0 14px 12px; word-wrap: break-word; }
.pv-tag, .pv-link, .pv-more { color: #2a5885; text-decoration: none; }
.pv-media img, .pv-media video { width: 100%; display: block; max-height: 560px; object-fit: cover; }
.pv-media.sq { position: relative; aspect-ratio: 4 / 5; background: #000; }
.pv-media.sq img, .pv-media.sq video { height: 100%; max-height: none; }
.pv-count { position: absolute; top: 10px; right: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.pv-dots { display: flex; gap: 4px; justify-content: center; padding-top: 8px; }
.pv-dots i { width: 6px; height: 6px; border-radius: 50%; background: #c7c7c7; }
.pv-dots i.on { background: #0095f6; }
.pv-grid { display: grid; gap: 2px; grid-template-columns: 1fr 1fr; }
.pv-grid.n3 > div:first-child { grid-column: 1 / -1; }
.pv-grid > div { position: relative; aspect-ratio: 1; overflow: hidden; background: #000; }
.pv-grid img, .pv-grid video { width: 100%; height: 100%; object-fit: cover; }
.pv-grid b { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.5); color: #fff; font-size: 22px; }
.pv-acts { padding: 10px 14px; color: #818c99; display: flex; gap: 4px; }
.pv-acts span { margin-left: auto; }
.pv-ig .pv-text, .pv-ig .pv-acts { color: #111; }
.pv-ig .pv-more { color: #8e8e8e; }
.pv-yt { padding: 12px 14px 0; display: grid; gap: 4px; }
.pv-yt .pv-text { padding: 6px 0 12px; color: #333; }
.pv-tg { width: 100%; max-width: 440px; background: #0e1621 radial-gradient(circle at 30% 20%, #17212b, #0e1621); border-radius: 12px; padding: 10px 10px 14px; display: grid; gap: 8px; }
.pv-tg-chan .pv-head { padding: 4px 4px 8px; color: #fff; }
.pv-tg-chan .pv-head span { color: #6d7f8f; }
.pv-bubble { background: #182533; color: #f5f5f5; border-radius: 12px; overflow: hidden; max-width: 380px; font: 14.5px/1.4 -apple-system, system-ui, sans-serif; }
.pv-bubble .pv-text { padding: 8px 12px 2px; }
.pv-bubble .pv-tag, .pv-bubble .pv-link { color: #6ab3f3; }
.pv-meta { text-align: right; color: #6d7f8f; font-size: 12px; padding: 2px 10px 6px; }
.pv-phone { position: relative; width: 270px; aspect-ratio: 9 / 16; border-radius: 22px; overflow: hidden; background: #000; box-shadow: 0 0 0 6px #1d1722, 0 20px 50px rgba(0,0,0,.6); color: #fff; font: 13px/1.35 -apple-system, system-ui, sans-serif; }
.pv-fill { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-empty { display: grid; place-items: center; color: #777; }
.pv-over { position: absolute; left: 0; right: 48px; bottom: 0; padding: 40px 12px 14px; background: linear-gradient(transparent, rgba(0,0,0,.7)); display: grid; gap: 5px; }
.pv-who { display: flex; gap: 7px; align-items: center; }
.pv-who img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }
.pv-title { font-weight: 600; }
.pv-cap { display: -webkit-box; -webkit-line-clamp: var(--lines); -webkit-box-orient: vertical; overflow: hidden; }
.pv-cap .pv-tag, .pv-cap .pv-link, .pv-title { color: #fff; font-weight: 600; }
.pv-side { position: absolute; right: 10px; bottom: 70px; text-align: center; font-size: 20px; line-height: 2; text-shadow: 0 1px 4px #000; }
.pv-note { max-width: 420px; margin: 0; color: var(--dim); font-size: 12.5px; text-align: center; }

#pv-mode { padding-top: 8px; }
#pv-mode .seg { font-size: 12.5px; padding: 5px 10px; }
.pv-full-view { width: 100%; display: grid; gap: 12px; }
.pv-fv-title { font: 600 16px var(--ui); }
.pv-fv-cap { background: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 14px; font: 14.5px/1.55 var(--ui); white-space: normal; }
.pv-fv-cap .pv-tag, .pv-fv-cap .pv-link { color: #8fb4ff; }
.pv-full-view figure { margin: 0; }
.pv-full-view img, .pv-full-view video { width: 100%; max-height: 70vh; object-fit: contain; background: #000; border-radius: 10px; display: block; }
.pv-full-view figcaption { color: var(--dim); font-size: 12px; margin-top: 4px; }

/* обложка ролика */
.cover { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 10px; }
.cover-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.cover-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; align-items: start; }
.cover-shot video, .cover-shot img { width: 120px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: #000; display: block; }
.cover-opts { display: grid; gap: 8px; align-content: start; }
.cover-opts .rad { display: flex; gap: 8px; align-items: center; font-weight: 400; cursor: pointer; }
.cover-opts .rad input { width: auto; margin: 0; accent-color: var(--neon); }
.cover-opts input[type=range] { padding: 0; accent-color: var(--neon); }
.cover-opts .upload { justify-self: start; }

/* кто публикует */
.lv { font-size: 11.5px; font-weight: 600; padding: 1px 7px; border-radius: 6px; white-space: nowrap; border: 1px solid; }
.lv-full { color: var(--green); border-color: color-mix(in srgb, var(--green) 40%, transparent); }
.lv-half { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 45%, transparent); }
.lv-manual { color: #ff9e7a; border-color: color-mix(in srgb, #ff9e7a 40%, transparent); }
.day-sum { margin-left: auto; font: 500 12.5px var(--ui); color: var(--dim); letter-spacing: 0; white-space: nowrap; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; width: 100%; order: 10; margin-top: 4px; }
.day h3::after { order: 1; }
.day h3 .day-sum { order: 2; margin-left: 0; }

.copy-post { margin-top: 14px; }

/* состояние поста в редакторе */
.ed-state { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; background: var(--ink3); border: 1px solid var(--line); }
.ed-state.st-published { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.ed-state.st-scheduled { border-color: color-mix(in srgb, var(--blue) 45%, var(--line)); }
.ed-state.st-due, .ed-state.st-publishing { border-color: color-mix(in srgb, var(--gold) 45%, var(--line)); }
.ed-state.st-failed, .ed-state.st-unknown { border-color: color-mix(in srgb, var(--red) 45%, var(--line)); }
.picked.ro .pk-act { display: none; }
#post-form :disabled { opacity: .75; cursor: default; }

.ed-manual { border: 1px dashed color-mix(in srgb, #ff9e7a 55%, var(--line)); border-radius: 10px; padding: 12px; display: grid; gap: 8px; }
.ed-manual p { margin: 0; }
.ed-manual .steps { margin: 0; }
.ed-manual .acc-act { flex-wrap: wrap; }

/* аналитика */
.an-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.an-head h2 { margin: 0; font: 500 30px var(--uni); }
.an-head button { margin-left: auto; }
.an-muted { color: var(--dim); font-size: 12.5px; }
.an-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.an-tile { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: linear-gradient(180deg, rgba(28, 21, 32, .85), rgba(16, 12, 18, .85)); display: grid; gap: 4px; align-content: start; }
.an-tile header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.an-big { font: 600 32px/1.1 var(--ui); font-variant-numeric: tabular-nums; color: var(--bone); }
.an-sub { font-size: 12.5px; color: var(--dim); }
.an-sub b { color: var(--bone); font-weight: 600; }
.an-sub b.up { color: var(--green); }
.an-sub b.down { color: var(--red); }
.an-spark { width: 100%; height: 48px; margin-top: 4px; overflow: visible; }
.an-pt:hover circle:last-child { r: 4.5; }
.an-h { font: 500 21px var(--uni); margin: 26px 0 10px; }
.an-h .an-muted { font: 400 12.5px var(--ui); }
.an-bars { display: grid; gap: 6px; max-width: 760px; }
.an-bar { display: grid; grid-template-columns: 190px 1fr 140px; gap: 10px; align-items: center; font-size: 13px; }
.an-bar-name { color: var(--bone); }
.an-bar-track { height: 14px; display: block; }
.an-bar-track i { display: block; height: 100%; background: var(--gold); border-radius: 0 4px 4px 0; }
.an-bar:hover .an-bar-track i { filter: brightness(1.15); }
.an-bar-val { font-variant-numeric: tabular-nums; color: var(--bone); }
.an-bar-val small { color: var(--dim); }
.an-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.an-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.an-table th { text-align: left; font-weight: 600; color: var(--dim); padding: 9px 12px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
.an-table th:hover { color: var(--bone); }
.an-table td { padding: 8px 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); vertical-align: middle; }
.an-table tr:last-child td { border-bottom: 0; }
.an-table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.an-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.an-table .an-title a { color: var(--bone); text-decoration: none; }
.an-table .an-title a:hover { text-decoration: underline; }
.an-limits { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--dim); }
.an-limits b { color: var(--bone); font-weight: 500; }
@media (max-width: 760px) { .an-bar { grid-template-columns: 1fr 90px; } .an-bar-track { grid-column: 1 / -1; grid-row: 2; } }
@media (max-width: 760px) {
  .tabs { width: 100%; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { padding: 9px 8px; letter-spacing: .14em; flex: none; }
}

/* задачи после публикации */
.ed-tasks { border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); border-radius: 10px; padding: 12px; display: grid; gap: 6px; }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tasks li { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; }
.tasks li > div { grid-column: 1 / -1; }
.tasks label { display: flex; gap: 8px; align-items: center; font-weight: 400; cursor: pointer; }
.tasks input { width: auto; margin: 0; accent-color: var(--green); }
.tasks li.done label { color: var(--dim); text-decoration: line-through; }
.tag-task { font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 6px; color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); border: 0; cursor: pointer; }
#comment-tpl { margin-top: 4px; }

/* Утверждение поста человеком */
.ed-approve { border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.6; background: var(--ink3); border: 1px solid var(--line); }
.ed-approve.wait { border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); }
.ed-approve.ok { color: var(--dim); }
.ed-approve button { margin-left: 6px; }

/* Только просмотр: кнопки действий не показываем (сервер их всё равно не пустит) */
body.readonly :is(#run, #new, #save, #save-queue, #del, #ed-unschedule, #ed-copy, .ed-approve button,
  [data-act], [data-approve], [data-mark], [data-man], [data-test], [data-paste], [data-dry], [data-disconnect],
  [data-tg-link], [data-tg-unlink], [data-notify-test], [data-copy-post], [data-pick], [data-unpick], [data-removed]) { display: none !important; }
body.readonly :is(input, textarea, select) { pointer-events: none; }

/* Аналитика: блок «Сайт» — плитка слева, источники справа */
.an-site { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 20px; align-items: start; }
.an-h4 { margin: 0 0 8px; font-size: 14px; font-weight: 600; }
.an-site .an-bars + .an-h4 { margin-top: 16px; }
@media (max-width: 700px) { .an-site { grid-template-columns: 1fr; } }
.an-act { white-space: nowrap; } .an-act button { margin-left: 8px; opacity: .5; } .an-act button:hover { opacity: 1; }
