/* Отклик — веб-приложение */
:root {
  --bg: #f6f5fa;
  --surface: #fcfcfd;
  --ink: #16142a;
  --ink-2: #514e69;
  --muted: #8b889e;
  --line: #e6e3ef;
  --line-2: #d6d2e3;
  --grid: #e8e6ef;
  --axis: #c9c6d6;
  --accent: #5b3cf5;
  --accent-2: #4527e0;
  --accent-soft: #eeeaff;
  --lime: #d6f65c;
  --side: #141128;
  --side-2: #221e40;
  --good: #11845b;
  --good-bg: #e3f4ec;
  --bad: #c42f2f;
  --bad-bg: #fdecec;
  --warn: #8a5a00;
  --warn-bg: #fff4dc;
  --star: #f5a524;
  --pos: #2a78d6;
  --neu: #a9a7b5;
  --neg: #e34948;
  --font: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; white-space: nowrap; text-decoration: none; }
.btn:hover { border-color: var(--line-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: #efedf5; }
.btn-danger { color: var(--bad); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.input, .select { height: 36px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 11px; outline: none; min-width: 0; }
.input:focus, .select:focus, textarea.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91, 60, 245, .12); }
textarea.input { height: auto; padding: 10px 12px; line-height: 1.55; resize: vertical; }
.field { display: grid; gap: 5px; }
.field > span { font-size: 12px; font-weight: 600; color: var(--muted); }

/* ---------- Каркас ---------- */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100%; }
.side { background: var(--side); color: #bdb8d8; display: flex; flex-direction: column; padding: 18px 12px; gap: 18px; position: sticky; top: 0; height: 100vh; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; font-size: 20px; letter-spacing: -.03em; text-decoration: none; color: #fff; padding: 2px 8px; }
.logo-mark { width: 28px; height: 28px; border-radius: 9px 9px 9px 3px; background: var(--accent); display: grid; place-items: center; }
.logo-mark::before { content: ""; width: 12px; height: 3px; border-radius: 2px; background: var(--lime); box-shadow: 0 6px 0 #fff; transform: translateY(-3px); }
.side nav { display: grid; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px; text-decoration: none; font-weight: 500; }
.side nav a:hover { background: var(--side-2); color: #fff; }
.side nav a.active { background: var(--side-2); color: #fff; }
.side nav a.active .i { color: var(--lime); }
.side nav .count { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 99px; }
.usage { margin-top: auto; background: var(--side-2); border-radius: 12px; padding: 12px; font-size: 12px; }
.usage b { color: #fff; }
.meter { height: 6px; border-radius: 3px; background: #332e5a; overflow: hidden; margin: 8px 0 6px; }
.meter i { display: block; height: 100%; background: var(--lime); border-radius: 3px; }
.meter.light { background: #ece9f6; }
.meter.light i { background: var(--accent); }
.meter.warn i { background: #f5a524; }
.me { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; }
.ava { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #8f7bff, #5b3cf5); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.me b { color: #fff; display: block; font-size: 13px; }
.me span { font-size: 11px; }
.me button { margin-left: auto; background: none; border: 0; color: #bdb8d8; padding: 4px; border-radius: 6px; }
.me button:hover { color: #fff; background: var(--side-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.trial { background: var(--ink); color: #d9d5ee; font-size: 13px; padding: 8px 24px; display: flex; gap: 12px; align-items: center; justify-content: center; }
.trial a { color: var(--lime); font-weight: 600; }
.top { display: flex; align-items: center; gap: 12px; padding: 14px 24px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top h1 { font-size: 19px; margin: 0; letter-spacing: -.01em; }
.top .grow { flex: 1; }
.auto { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; padding: 4px 6px 4px 12px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); }
.auto.on { background: var(--good-bg); border-color: #bfe5d2; color: var(--good); }
.menu-btn { display: none; }
.view { padding: 22px 24px 48px; }
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; z-index: 40; transform: translateX(-100%); transition: transform .25s; }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .top { padding: 10px 14px; flex-wrap: wrap; }
  .top .shop-filter { display: none; }
  .view { padding: 14px; }
}

/* ---------- Сетки и карточки ---------- */
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-wide, .g3 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g4, .g2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; min-width: 0; }
.card-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.card-h h2 { font-size: 15px; margin: 0; }
.card-h span { font-size: 12px; color: var(--muted); }
.tile .label { color: var(--ink-2); font-size: 13px; }
.tile .value { font-size: 30px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0; }
.delta { font-size: 12px; font-weight: 600; color: var(--ink-2); display: inline-flex; gap: 4px; align-items: center; }
.delta .i { width: 14px; height: 14px; }
.delta.good .i { color: var(--good); }
.delta.bad .i { color: var(--bad); }

.checklist { display: grid; gap: 8px; }
.check-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: #f4f2fa; }
.check-item .dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; flex: none; }
.check-item.done .dot { background: var(--good); border-color: var(--good); color: #fff; }
.check-item.done .dot .i { width: 13px; height: 13px; stroke-width: 3; }
.check-item.done b { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.check-item .btn { margin-left: auto; }

/* ---------- Графики ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--grid); }
.chart .baseline { stroke: var(--axis); }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; }
.chart .seg { transition: opacity .12s; }
.chart .dim { opacity: .35; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: #fff; font-size: 12px; padding: 8px 10px; border-radius: 8px; white-space: nowrap; opacity: 0; transition: opacity .1s; z-index: 5; transform: translate(-50%, calc(-100% - 12px)); line-height: 1.5; }
.tip.show { opacity: 1; }
.tip i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: 120px 1fr 44px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .track { height: 18px; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--neg); min-width: 2px; }
.hbar b { font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink-2); text-align: right; }

/* ---------- Отзывы ---------- */
.inbox { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 14px; align-items: start; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; align-items: center; }
.chip { height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .c { opacity: .65; font-size: 11px; }
.list { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; max-height: calc(100vh - 210px); overflow-y: auto; }
.item { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; }
.item:hover { background: #f6f4fb; }
.item.active { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.item-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.item-top b { font-size: 13px; }
.item-top .t { margin-left: auto; font-size: 11px; color: var(--muted); }
.item p { margin: 0; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item .prod { font-size: 11px; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.stars { color: var(--star); letter-spacing: .5px; font-size: 13px; white-space: nowrap; }
.stars .off { color: #dcd9e6; }
.mp { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 5px; color: #fff; letter-spacing: .02em; }
.mp.wb { background: #8b2bb9; }
.mp.ozon { background: #1f5fe0; }
.mp.ym { background: #f4c400; color: #1d1d1d; }
.st { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; }
.st.new { background: var(--bad-bg); color: var(--bad); }
.st.draft { background: var(--warn-bg); color: var(--warn); }
.st.published { background: var(--good-bg); color: var(--good); }
.detail { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px; position: sticky; top: 76px; }
.detail-h { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.thumb { width: 48px; height: 48px; border-radius: 10px; background: linear-gradient(135deg, #efe9ff, #d9d0ff); display: grid; place-items: center; color: var(--accent); flex: none; }
.detail-h h3 { margin: 0; font-size: 15px; }
.review-box { background: #f6f4fb; border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.review-box p { margin: 6px 0 0; font-size: 14px; }
.review-box .pc { font-size: 13px; margin-top: 6px; }
.photos { display: flex; gap: 6px; margin-top: 10px; }
.photos span { width: 56px; height: 56px; border-radius: 8px; background: repeating-linear-gradient(45deg, #e2def0 0 6px, #ebe8f4 6px 12px); }
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tag { font-size: 12px; padding: 3px 9px; border-radius: 7px; background: #efedf5; color: var(--ink-2); }
.tag.neg { background: var(--bad-bg); color: var(--bad); }
.tag.pos { background: var(--good-bg); color: var(--good); }
.editor { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.editor-h { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #faf9fd; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--accent); font-weight: 600; flex-wrap: wrap; }
.editor textarea { border: 0; width: 100%; min-height: 170px; padding: 12px; resize: vertical; outline: none; line-height: 1.6; font-size: 14px; background: var(--surface); }
.checks { list-style: none; margin: 10px 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; color: var(--ink-2); }
.checks li { display: flex; gap: 6px; align-items: center; }
.checks .ok { color: var(--good); }
.checks .no { color: var(--bad); }
.checks .i { width: 14px; height: 14px; stroke-width: 2.4; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kbd { font-size: 11px; color: var(--muted); }
kbd { font: 11px ui-monospace, Consolas, monospace; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; }
.published-box { border-radius: 12px; background: var(--good-bg); padding: 12px 14px; font-size: 14px; white-space: pre-line; }
.published-box small { display: block; color: var(--good); font-weight: 600; margin-bottom: 6px; white-space: normal; }
@media (max-width: 1100px) { .inbox { grid-template-columns: 1fr; } .detail { position: static; } .list { max-height: 420px; } }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
.t th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t .r { text-align: right; }

/* ---------- Правила ---------- */
.rule { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.rule:last-child { border-bottom: 0; }
.rule b { display: block; }
.rule .cond { font-size: 12px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.pill { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: #efedf5; color: var(--ink-2); white-space: nowrap; }
.pill.publish { background: var(--good-bg); color: var(--good); }
.pill.draft { background: var(--warn-bg); color: var(--warn); }
.pill.notify { background: var(--accent-soft); color: var(--accent); }
.switch { position: relative; width: 38px; height: 22px; flex: none; display: inline-block; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; z-index: 1; cursor: pointer; }
.switch i { position: absolute; inset: 0; background: #d9d6e4; border-radius: 99px; transition: background .2s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.switch input:checked + i { background: var(--good); }
.switch input:checked + i::after { transform: translateX(16px); }
.stop-words { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.stop-words span { display: inline-flex; gap: 4px; align-items: center; background: var(--bad-bg); color: var(--bad); border-radius: 7px; padding: 3px 4px 3px 9px; font-size: 12px; }
.stop-words button { border: 0; background: none; color: inherit; padding: 0 3px; font-size: 14px; line-height: 1; }
.preview { background: #f6f4fb; border-radius: 12px; padding: 14px; font-size: 14px; white-space: pre-line; min-height: 120px; }

/* ---------- Магазины и тарифы ---------- */
.shop { display: flex; flex-direction: column; gap: 12px; }
.shop-h { display: flex; gap: 12px; align-items: center; }
.shop-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; flex: none; }
.shop dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13px; }
.shop dt { color: var(--muted); }
.shop dd { margin: 0; }
.status { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 600; }
.status i { width: 8px; height: 8px; border-radius: 50%; }
.plan-card { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.plan-card.current { border: 2px solid var(--accent); }
.plan-card .price { font-size: 24px; font-weight: 700; }
.plan-card ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 3px; }
.plan-card .btn { margin-top: auto; }

/* ---------- Модальное окно и тост ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal-bg { position: absolute; inset: 0; background: rgba(20, 17, 40, .45); }
.modal-box { position: relative; width: 100%; max-width: 520px; background: var(--surface); border-radius: 18px; padding: 24px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 30px 80px rgba(20, 17, 40, .3); }
.modal-box h3 { margin: 0 0 6px; font-size: 20px; }
.modal-box .x { position: absolute; top: 14px; right: 14px; }
.steps { margin: 10px 0 16px; padding-left: 20px; color: var(--ink-2); display: grid; gap: 6px; }
.note { font-size: 13px; background: var(--warn-bg); color: var(--warn); border-radius: 10px; padding: 10px 12px; }
.note.ok { background: var(--good-bg); color: var(--good); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 600; opacity: 0; transition: .2s; pointer-events: none; z-index: 100; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.locked { display: inline-flex; gap: 4px; align-items: center; font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 7px; border-radius: 6px; }
