:root {
    --bg: #0f1117;
    --panel: #161a23;
    --panel2: #1b2030;
    --line: #232838;
    --txt: #c9d1e0;
    --dim: #8b95ad;
    --acc: #4f8cff;
    --ok: #4ade80;
    --warn: #fbbf24;
    --err: #f87171;
    --r: 6px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--txt);
    font: 13px/1.6 Tahoma, Arial, sans-serif;
}
a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: var(--bg); padding: 1px 5px; border-radius: 3px; color: #7ab4ff; }

.wrap { display: flex; min-height: 100vh; }
.sidebar {
    width: 210px; flex: 0 0 210px; background: var(--panel);
    border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 16px 0;
}
.brand { padding: 0 16px 16px; color: #fff; font-size: 15px; font-weight: bold; }
.brand .ver { color: var(--dim); font-size: 11px; font-weight: normal; }
.sidebar nav { display: flex; flex-direction: column; }
.sidebar nav a {
    padding: 9px 16px; color: var(--txt); border-left: 2px solid transparent;
}
.sidebar nav a:hover { background: var(--panel2); text-decoration: none; }
.sidebar nav a.on { background: var(--panel2); border-left-color: var(--acc); color: #fff; }
.side-foot { margin-top: auto; padding: 16px 16px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.side-foot a { color: var(--dim); font-size: 12px; }
.main { flex: 1; padding: 22px 26px; max-width: 1180px; }

.head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.head h1 { font-size: 19px; color: #fff; margin: 0; }
.head-act { margin-left: auto; display: flex; gap: 8px; }
.count { color: var(--dim); font-size: 13px; font-weight: normal; }
h2.sub { font-size: 14px; color: #fff; margin: 26px 0 10px; }

.alert { padding: 9px 14px; border-radius: var(--r); margin-bottom: 16px; }
.alert.ok { background: #12301c; color: var(--ok); border: 1px solid #22623b; }
.alert.err { background: #3a1418; color: var(--err); border: 1px solid #6b2028; }

label { display: block; margin-bottom: 14px; color: var(--dim); }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
    width: 100%; margin-top: 5px; padding: 8px 10px; background: var(--bg);
    border: 1px solid var(--line); border-radius: var(--r); color: var(--txt);
    font: 13px/1.5 Tahoma, Arial, sans-serif;
}
textarea { resize: vertical; font-family: Consolas, "Courier New", monospace; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--acc); }
input[type=file] { margin-top: 6px; color: var(--dim); font-size: 12px; }
input.tiny { width: 70px; }
.hint { display: block; margin-top: 4px; color: var(--dim); font-size: 11px; }
.check { display: flex; align-items: center; gap: 7px; color: var(--txt); margin-bottom: 10px; }
.check input { width: auto; margin: 0; }
.counter { display: inline-block; margin-top: 4px; font-size: 11px; color: var(--dim); }
.counter.good { color: var(--ok); }
.counter.bad { color: var(--warn); }

.btn {
    display: inline-block; padding: 8px 16px; background: var(--acc); color: #fff;
    border: 0; border-radius: var(--r); cursor: pointer; font: bold 13px Tahoma, Arial, sans-serif;
}
.btn:hover { background: #3d7bee; text-decoration: none; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--txt); font-weight: normal; }
.btn.ghost:hover { border-color: var(--acc); background: var(--panel2); }
.btn.wide { width: 100%; margin-bottom: 16px; }
.link { background: none; border: 0; color: var(--acc); cursor: pointer; padding: 0; font: 12px Tahoma, Arial, sans-serif; }
.link.danger, .danger { color: var(--err); }
.inline { display: inline; }

.row-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; background: var(--panel); padding: 14px; border-radius: var(--r); }
.row-form label { margin: 0; flex: 1; min-width: 140px; }
.row-form .check { margin: 0 0 8px; flex: 0; white-space: nowrap; }

.grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.col-side { position: sticky; top: 22px; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.box-t { color: #fff; font-weight: bold; margin-bottom: 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.box label:last-child { margin-bottom: 0; }
.meta-line { color: var(--dim); font-size: 11px; margin-top: 6px; }
.preview { display: block; max-width: 100%; border-radius: var(--r); border: 1px solid var(--line); margin-bottom: 8px; background: #fff; }
.logo-prev { max-height: 70px; padding: 8px; }
.fav-prev { width: 48px; height: 48px; object-fit: contain; padding: 6px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.toolbar button {
    background: var(--panel2); border: 1px solid var(--line); color: var(--txt);
    padding: 4px 9px; border-radius: 4px; cursor: pointer; font: 11px Tahoma, Arial, sans-serif;
}
.toolbar button:hover { border-color: var(--acc); color: #fff; }
.toolbar + textarea { margin-top: 4px; border-top-left-radius: 0; border-top-right-radius: 0; }

.tbl { width: 100%; border-collapse: collapse; background: var(--panel); border-radius: var(--r); overflow: hidden; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl th { background: var(--panel2); color: var(--dim); font-weight: normal; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td input { margin-top: 0; }
.tbl .strong { color: #fff; font-weight: bold; }
.tbl img { max-width: 100%; }
.thumb { width: 52px; }
.thumb img { width: 40px; height: 30px; object-fit: cover; border-radius: 3px; display: block; }
.actions { text-align: right; }
.nowrap { white-space: nowrap; }
.muted { color: var(--dim); }
.opt { color: var(--dim); font-size: 11px; font-weight: normal; }
.cta-demo { position: relative; display: flex; align-items: center; justify-content: center;
            height: 130px; border-radius: 6px; border: 1px dashed var(--line);
            background: repeating-linear-gradient(45deg, #2a2340, #2a2340 8px, #241e38 8px, #241e38 16px); }
.cta-demo-box { background: rgba(0,0,0,.6); border-radius: 8px; padding: 14px 20px; display: flex; }
.cta-demo-img { position: absolute; top: 8px; left: 10px; color: var(--dim); font-size: 11px; }
.cta-demo-btn { background: #8918e7; color: #fff; padding: 9px 18px; border-radius: 6px;
                font-weight: bold; font-size: 13px; text-transform: uppercase; letter-spacing: .5px;
                box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px;
         background: var(--pink, #ec4899); color: #fff; font-size: 11px; text-align: center; }
.msg-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.msg-card.new { border-left: 3px solid var(--acc); }
.msg-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; font-size: 12px; }
.msg-act { margin-left: auto; display: flex; gap: 12px; }
.msg-body { color: var(--txt); font-size: 13px; white-space: pre-wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }
.ok-txt { color: #4ade80; }
.err-txt { color: #f87171; }
.row-btns { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }
.tabs.sub { border-bottom: 0; margin: 0 0 12px; }
.tabs.sub a { padding: 6px 12px; font-size: 12px; }

.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px;
              background: var(--bg-1); border: 1px solid var(--line); border-left: 3px solid var(--line);
              border-radius: var(--r); padding: 14px 16px; margin: 0 0 16px; }
.switch-row.is-on { border-left-color: #4ade80; }
.switch-row b { display: block; margin-bottom: 3px; }
.switch-row .hint { margin: 0; }
.btn.sw { min-width: 84px; font-weight: bold; letter-spacing: .5px; }
.btn.sw-on { background: #15803d; border-color: #15803d; color: #fff; }
.btn.sw-on:hover { background: #b91c1c; border-color: #b91c1c; }
.btn.sw-off { background: transparent; border-color: var(--line); color: var(--dim); }
.btn.sw-off:hover { background: #15803d; border-color: #15803d; color: #fff; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 7px; vertical-align: middle; }
.dot.live { background: #4ade80; }
.dot.off { background: #4b5563; }
.chip.sub { background: rgba(129,140,248,.14); color: #a5b4fc; }
.chip.sub .kid-mark { position: static; transform: none; color: inherit; margin-right: 3px; }
.in-sub { display: block; margin: 3px 0 0; }
.ocat-section { margin-top: 20px; padding-top: 20px; border-top: 2px solid var(--line); }
.ocat-pick { margin: 10px 0; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.ocat-pick-h { font-weight: 700; margin: 0 0 6px; }
.cta-layout { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.cta-btn-list { display: flex; flex-direction: column; gap: 4px; margin: 0 0 12px; }
.cta-btn-row { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px;
    background: var(--bg-2); border: 1px solid var(--line); text-decoration: none; color: var(--txt); }
.cta-btn-row.on { border-color: var(--accent); background: var(--soft); }
.cta-btn-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.cta-btn-row .dot.g { background: #16a34a; }
.cta-btn-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cta-btn-scope { font-size: 11px; color: var(--dim); flex: none; }
.btn.danger { color: #dc2626; border-color: #dc2626; }
@media (max-width: 800px) { .ocat-section { margin-top: 20px; padding-top: 20px; border-top: 2px solid var(--line); }
.ocat-pick { margin: 10px 0; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.ocat-pick-h { font-weight: 700; margin: 0 0 6px; }
.cta-layout { grid-template-columns: 1fr; } }
.cta-pages { margin: 4px 0 14px; padding: 12px 14px; background: var(--bg-2);
    border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow-y: auto; }
.cta-pages-h { font-weight: 700; margin: 0 0 8px; }
.cta-pages .pg { display: flex; align-items: center; gap: 8px; padding: 5px 0; margin: 0; }
.cta-pages .opt { color: var(--dim); font-weight: 400; }
.cta-pages[data-scope="all"] { opacity: .45; pointer-events: none; }
.faq-row { display: grid; grid-template-columns: 1fr 40px; grid-template-rows: auto auto; gap: 8px;
            padding: 10px; margin: 0 0 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.faq-row .faq-q { grid-column: 1; grid-row: 1; margin: 0; }
.faq-row .faq-a { grid-column: 1; grid-row: 2; margin: 0; min-height: 68px; }
.faq-row .faq-del { grid-column: 2; grid-row: 1 / 3; margin: 0; width: 40px; align-self: stretch;
                    display: flex; align-items: center; justify-content: center; }
.faq-rows:empty + .row-btns .hint::before { content: "Вопросов пока нет. "; }
.diag { list-style: none; margin: 0 0 12px; padding: 0; }
.diag li { padding: 4px 0 4px 22px; position: relative; font-size: 13px; }
.diag li::before { position: absolute; left: 0; top: 4px; font-weight: bold; }
.diag li.y::before { content: "\2713"; color: #16a34a; }
.diag li.n::before { content: "\2717"; color: #dc2626; }
.diag li.i::before { content: "\2022"; color: var(--dim); }
.diag li.n { color: #dc2626; }
.is-kid { padding-left: 26px; position: relative; }
.kid-mark { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--dim); }
.ban-add { border-left: 3px solid #b91c1c; }
.presets { align-items: center; margin: 0 0 10px; }
.preset-lbl { color: var(--dim); font-size: 12px; }

.presets .btn.on { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.presets .btn.on .count { background: rgba(0,0,0,.25); color: #fff; }
.presets .btn.part { border-color: #b91c1c; color: var(--txt); }
.presets .btn.part .count { color: #f87171; }
.ban-add textarea { font-family: Consolas, Monaco, monospace; font-size: 12px; }
.inline-hint { flex: 1; min-width: 240px; }
.pat { display: inline-block; padding: 3px 9px; border-radius: 5px; font-family: Consolas, Monaco, monospace;
       font-size: 12px; background: rgba(248,113,113,.12); color: #f87171; }
.btn.danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.danger:hover { background: #dc2626; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-block; padding: 5px 10px; border-radius: 999px; background: var(--bg-2);
        border: 1px solid var(--line); color: var(--dim); text-decoration: none; font-size: 12px; }
.chip:hover { color: var(--txt); border-color: var(--acc); }
.chip.on { border-color: var(--acc); color: var(--txt); }
.chip b { color: #f87171; margin-left: 4px; }
.bot-tag { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: 11px; font-weight: bold;
           background: rgba(248,113,113,.12); color: #f87171; }
.stat-row { display: flex; flex-wrap: wrap; gap: 18px; margin: 0; }
.stat { color: var(--dim); font-size: 13px; }
.stat b { display: block; color: var(--txt); font-size: 20px; }
.ua { font-size: 11px; }
.pager { display: flex; flex-wrap: wrap; gap: 4px; margin: 14px 0; }
.pager a { padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; color: var(--dim);
           text-decoration: none; font-size: 12px; }
.pager a:hover { color: var(--txt); }
.pager a.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.pager .gap { padding: 6px 4px; color: var(--dim); }
.btn.small.danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn.small.danger:hover { background: #dc2626; }
.tabs { display: flex; gap: 6px; margin: -6px 0 18px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 16px; color: var(--dim); text-decoration: none; font-size: 13px; font-weight: bold;
          border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--txt); }
.tabs a.on { color: var(--txt); border-bottom-color: var(--acc); }
.tabs .count { margin-left: 6px; }
.offer-thumb { max-height: 34px; max-width: 110px; width: auto; background: #fff; border-radius: 4px; padding: 3px; }
.edit-offer { border-color: var(--acc); margin-bottom: 18px; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 3px; background: var(--panel2); border: 1px solid var(--line); color: var(--txt); font-size: 12px; }
.btn.small { padding: 4px 10px; font-size: 11px; font-weight: normal; }
.warn-dot { display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 3px; background: #3a2f10; color: var(--warn); font-size: 10px; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 26px; width: 320px; }
.login-card h1 { font-size: 17px; color: #fff; margin: 0 0 18px; }

@media (max-width: 900px) {
    .grid { grid-template-columns: 1fr; }
    .col-side { position: static; }
}
@media (max-width: 820px) {
    .wrap { flex-direction: column; }
    .sidebar { width: 100%; flex: none; }
    .sidebar nav { flex-direction: row; flex-wrap: wrap; }
    .sidebar nav a { border-left: 0; border-bottom: 2px solid transparent; }
    .sidebar nav a.on { border-left: 0; border-bottom-color: var(--acc); }
    .main { padding: 16px; }
}
.foot-badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 10px 0 14px; }
.foot-badge-slot { padding: 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.foot-badge-n { font-weight: 700; margin: 0 0 6px; font-size: 13px; }
.foot-badge-slot .preview { max-height: 44px; width: auto; display: block; margin: 0 0 6px; }
.wysiwyg { min-height: 360px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow-y: auto; line-height: 1.6; }
.wysiwyg:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.wysiwyg:empty::before { content: "Пишите здесь — текст сразу выглядит как на сайте"; color: var(--dim); }
.wysiwyg h2 { font-size: 22px; margin: 18px 0 10px; }
.wysiwyg h3 { font-size: 18px; margin: 16px 0 8px; }
.wysiwyg p { margin: 0 0 12px; }
.wysiwyg ul, .wysiwyg ol { margin: 0 0 12px; padding-left: 24px; }
.wysiwyg img { max-width: 100%; height: auto; border-radius: 6px; }
.wysiwyg table { border-collapse: collapse; width: 100%; margin: 0 0 12px; }
.wysiwyg th, .wysiwyg td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.tb-sep { display: inline-block; width: 1px; height: 20px; background: var(--line); margin: 0 4px; vertical-align: middle; }
.tb-mode { font-weight: 700; }
.radio-logo-row { display: flex; gap: 14px; align-items: flex-start; margin: 10px 0; }
.radio-logo-prev { width: 72px; height: 72px; flex: none; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--bg-2); }
.radio-logo-prev img { width: 100%; height: 100%; object-fit: cover; }
.radio-logo-fields { flex: 1; }
.tb-radio { font-weight: 600; }
.radio-pick { margin: 8px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-2); }
.radio-pick-h { font-size: 13px; color: var(--dim); margin-bottom: 10px; }
.radio-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 14px; margin-bottom: 10px; }
.radio-pick-i { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.radio-pick-act { display: flex; align-items: center; gap: 12px; }
.radio-pick-code { font-family: monospace; font-size: 13px; color: var(--accent); }
.cta-btn-row.featured { border: 1px solid #f1c40f; box-shadow: 0 0 0 2px rgba(241,196,15,.15); }
.feat-star { color: #f1c40f; margin-left: auto; font-size: 13px; }
.color-row { display: flex; align-items: center; gap: 10px; }
.color-row input[type="color"] { width: 44px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; background: none; }
.color-row input[type="text"] { flex: 1; }
.radio-opts { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 14px 0; padding: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 8px; }
.radio-opts label { margin: 0; }
.radio-opts select { min-width: 200px; }
.radio-listens { margin-left: auto; font-size: 12px; color: var(--dim); background: rgba(255,255,255,.06); padding: 1px 7px; border-radius: 10px; }
.cta-btn-row.featured .radio-listens { margin-left: auto; }
.radio-tabs { display: flex; gap: 6px; margin: 16px 0 18px; border-bottom: 1px solid rgba(127,127,127,.25); }
.radio-tab { padding: 10px 18px; cursor: pointer; border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; font-weight: 600; opacity: .6; margin-bottom: -1px; }
.radio-tab:hover { opacity: .85; }
.radio-pane { display: none; }
#radio-tab-stations:checked ~ .radio-pane-stations { display: block; }
#radio-tab-settings:checked ~ .radio-pane-settings { display: block; }
#radio-tab-stations:checked ~ .radio-tabs label[for="radio-tab-stations"],
#radio-tab-settings:checked ~ .radio-tabs label[for="radio-tab-settings"] { opacity: 1; border-color: rgba(127,127,127,.25); background: rgba(127,127,127,.06); }
