/* Telemarket - кабинет маркетолога. Рабочий интерфейс для компьютера (1024-1920 px), светлая тема.
 * Все стили во внешнем файле: CSP запрещает inline-стили (style-src 'self'). */
:root {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --ink: #1a1a1c;
  --muted: #5d6168;
  --line: #e3e3e7;
  --line-strong: #cfcfd6;
  --accent: #D40019;
  --accent-dark: #a80014;
  --accent-ink: #ffffff;
  --accent-soft: #fde8ea;
  --ok: #17703f; --ok-soft: #e3f4ea;
  --warn: #8a5a00; --warn-soft: #fff3d6;
  --info: #1d5fa8; --info-soft: #e6f0fb;
  --bad: #b00018;
  --font-display: "Unbounded", "Golos Text", system-ui, sans-serif;
  --font-body: "Golos Text", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 12px;
  --r-sm: 8px;
  --side: 236px;
  --shadow: 0 1px 2px rgba(26, 26, 28, .05), 0 8px 24px -16px rgba(26, 26, 28, .25);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 var(--font-body); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
[hidden] { display: none !important; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.center { text-align: center; display: block; }
.grow { flex: 1; min-width: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- кнопки ---------- */
.btn { border: 0; border-radius: 10px; padding: 10px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 600; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.3; }
.btn:hover { background: var(--accent-dark); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn.danger { background: var(--bad); }
.btn-ghost { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 10px; padding: 9px 16px; font-weight: 500; cursor: pointer; text-decoration: none; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; line-height: 1.3; }
.btn-ghost:hover { border-color: var(--ink); }
.btn-ghost[disabled] { opacity: .5; cursor: default; }
.btn-ghost.danger { color: var(--bad); }
.btn-ghost.sm, .btn.sm { padding: 6px 12px; font-size: 13px; }
.with-ico .ico { width: 18px; height: 18px; }
.icon-btn { width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--muted); text-decoration: none; padding: 0; }
.icon-btn:hover { background: var(--bg); color: var(--ink); }
.icon-btn.danger:hover { background: var(--accent-soft); color: var(--bad); }
.icon-btn[disabled] { opacity: .3; cursor: default; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- поля ---------- */
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=date], input[type=datetime-local], select, textarea {
  width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); padding: 8px 11px; min-height: 38px;
}
textarea { resize: vertical; line-height: 1.45; }
input:hover, select:hover, textarea:hover { border-color: #9a9aa4; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field-label { font-weight: 600; font-size: 13px; }
.field.narrow { max-width: 260px; }
.field.invalid > input, .field.invalid textarea, .field.invalid .md-input, .field.invalid .dropzone { border-color: var(--bad); background: #fff7f8; }
.hint { color: var(--muted); font-size: 12.5px; }
.field-err { color: var(--bad); font-size: 12.5px; font-weight: 500; min-height: 0; }
.field-err:empty { display: none; }
.counter { color: var(--muted); font-size: 12px; display: block; text-align: right; margin-top: 3px; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); font-weight: 600; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.inline { display: flex; gap: 10px; align-items: center; }
.inline input { flex: 1; }
.form-error { color: var(--bad); font-weight: 500; font-size: 13.5px; }
.form-error.big { background: var(--accent-soft); border: 1px solid #f1b4bb; border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 16px; }
.warn { color: var(--warn); }
.dates { display: flex; gap: 14px; flex-wrap: wrap; }
.dates label { display: flex; align-items: center; gap: 8px; }
.dates input { width: 170px; }

/* переключатель */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; cursor: pointer; }
.switch input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-track { position: absolute; inset: 0; background: #c4c4cc; border-radius: 13px; transition: background .15s; }
.switch-track::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.switch input:checked + .switch-track { background: var(--ok); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch input:disabled { cursor: default; }
.switch input:disabled + .switch-track { opacity: .6; }
.row-switch { display: flex; align-items: flex-start; gap: 14px; }
.row-switch > div { display: flex; flex-direction: column; gap: 2px; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 10px; padding: 2px; background: var(--surface); gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed=true] { background: var(--ink); color: #fff; }
.radios { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.radio, .check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.radio input, .check input { width: 17px; height: 17px; accent-color: var(--accent); margin: 0; }

/* ---------- вход ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(900px 500px at 70% -10%, #fde8ea 0, transparent 60%), var(--bg); }
.login-card { width: 100%; max-width: 400px; background: var(--surface); border-radius: 20px; padding: 36px 32px 32px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 16px; }
.login-card h1 { font-family: var(--font-display); font-weight: 500; font-size: 20px; margin-top: 8px; }
.login-card .btn { padding: 12px; }

/* ---------- каркас ---------- */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { padding: 0 8px; display: block; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 500; }
.nav a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.nav a:hover { background: var(--bg); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.nav a.on svg { color: var(--accent); }
.side-foot { margin-top: auto; padding: 0 8px; display: flex; flex-direction: column; gap: 10px; }
.who { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.main { padding: 28px 36px 64px; min-width: 0; max-width: 1640px; width: 100%; }
.main:focus { outline: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1, .editor-title h1 { font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.25; }
.page-head .muted { display: block; margin-top: 4px; }
.toolbar { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar select { width: auto; min-width: 200px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 420px; }
.search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search input { padding-left: 38px; }

/* ---------- таблицы ---------- */
.table-wrap { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; text-transform: none; }
.tbl th.num { text-align: right; }
.tbl td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:first-child td { border-top: 0; }
.tbl tbody tr:hover { background: #fafafb; }
.tbl .c-grip { width: 34px; padding-right: 0; }
.tbl .c-thumb { width: 120px; padding-right: 0; }
.tbl .c-sw { width: 130px; text-align: center; }
.tbl th.c-sw { text-align: center; white-space: normal; }
.tbl td.c-sw .switch { vertical-align: middle; }
.tbl .c-ord { width: 90px; }
.tbl .c-act { width: 84px; text-align: right; white-space: nowrap; }
input.ord { width: 72px; text-align: center; padding: 6px; min-height: 34px; }
.thumb { display: block; width: 104px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); }
.thumb.empty { display: grid; place-items: center; color: #b4b4bc; }
.row-title { font-weight: 600; color: var(--ink); text-decoration: none; display: inline-block; max-width: 420px; }
.row-title:hover { color: var(--accent); text-decoration: underline; }
.row-sub { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12.5px; }
.grip { display: inline-grid; place-items: center; cursor: grab; color: #9a9aa4; }
.tbl tr.dragging { opacity: .4; }
.tbl tr.drop-before td { box-shadow: inset 0 2px 0 var(--accent); }
.tbl tr.drop-after td { box-shadow: inset 0 -2px 0 var(--accent); }
.hint-line { margin-top: 10px; color: var(--muted); font-size: 12.5px; }

.tag { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); line-height: 1.5; }
.tag.muted { background: var(--bg); color: var(--muted); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.info { background: var(--info-soft); color: var(--info); }

.state { background: var(--surface); border-radius: var(--r); padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: var(--muted); box-shadow: var(--shadow); }
.state b { color: var(--ink); font-size: 16px; }
.state.err b { color: var(--bad); }
.state .btn { margin-top: 6px; }
.spinner { width: 24px; height: 24px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } .switch-track, .switch-track::after { transition: none; } }

/* ---------- карточки / редактор ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.card > h2 { font-size: 15px; font-weight: 700; }
.editor-head { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; margin-top: -10px; }
.editor-head .back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 500; }
.editor-head .back:hover { color: var(--accent); }
.editor-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 200px; }
.editor-title h1 { overflow-wrap: anywhere; }
.editor-actions { display: flex; gap: 10px; }
.status { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.status.dirty { color: var(--warn); font-weight: 600; }
.status.ok { color: var(--ok); }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 28px; align-items: start; }
.editor-form { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.editor-preview { position: sticky; top: 78px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.pv-ctl { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lang-bar { display: flex; align-items: center; gap: 14px; }

/* Markdown-lite панель */
.md-editor { border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.md-editor:focus-within { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.md-bar { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px; background: #f8f8fa; border-bottom: 1px solid var(--line); }
.md-btn { border: 1px solid transparent; background: transparent; border-radius: 6px; padding: 4px 10px; min-width: 34px; height: 30px; cursor: pointer; font-weight: 500; }
.md-btn:hover { background: var(--surface); border-color: var(--line-strong); }
.md-input { border: 0 !important; border-radius: 0 !important; min-height: 180px; outline: none !important; font-family: var(--font-body); }
.md-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 10px 6px; border-top: 1px solid var(--line); background: #fcfcfd; }
.md-foot .counter { margin: 0; white-space: nowrap; }

/* баннер */
.dropzone { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; text-align: center; color: var(--muted); background: #fafafb; }
.dropzone .ico { width: 34px; height: 34px; color: var(--accent); margin-bottom: 4px; }
.dropzone b { color: var(--ink); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.banner-box { display: flex; flex-direction: column; gap: 10px; }
.banner-prev { position: relative; width: 100%; max-width: 520px; aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--bg); }
.banner-prev img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner-busy { position: absolute; inset: 0; background: rgba(255, 255, 255, .8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-weight: 500; }

/* правило, товары, выпадающие списки */
.combo { position: relative; }
.pop { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-sm); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .35); z-index: 20; max-height: 340px; overflow-y: auto; padding: 4px; }
.pop-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; cursor: pointer; flex-direction: column; align-items: flex-start; }
.pop-item small { color: var(--muted); }
.pop-item.prod-pick { flex-direction: row; align-items: center; }
.pop-item.prod-pick > .grow { display: flex; flex-direction: column; }
.pop-item:hover { background: var(--bg); }
.pop-item[disabled] { opacity: .5; cursor: default; }
.pop-empty { padding: 12px; color: var(--muted); text-align: center; }
.rule-sel { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: #fafafb; }
.rule-sel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.rule-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; color: var(--muted); }
.rule-sel .auto p { margin-top: 2px; }
.prod-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); }
.prod-list:empty { display: none; }
.prod-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-top: 1px solid var(--line); }
.prod-row:first-child { border-top: 0; }
.prod-img { width: 48px; height: 48px; border-radius: 6px; background: var(--bg); overflow: hidden; flex: none; display: block; }
.prod-img.sm { width: 36px; height: 36px; }
.prod-img img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.prod-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prod-info b { font-weight: 500; overflow-wrap: anywhere; }
.prod-act { display: flex; flex: none; }
.notice { background: var(--info-soft); color: var(--info); border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* аудитория */
.check-list { border: 1px solid var(--line); border-radius: var(--r-sm); max-height: 220px; overflow-y: auto; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.check { padding: 5px 0; }
.estimate { background: var(--bg); border-radius: var(--r-sm); padding: 10px 14px; color: var(--muted); }
.estimate.ready { background: var(--ok-soft); color: var(--ok); }
.estimate.ready.zero { background: var(--warn-soft); color: var(--warn); }
.estimate b { font-size: 16px; }
.summary { margin: 0; display: grid; grid-template-columns: 90px 1fr; gap: 6px 14px; }
.summary.wide { grid-template-columns: 130px 1fr; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }

/* плитки статистики */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.tile { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.tile-l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.tile-v { font-family: var(--font-display); font-weight: 500; font-size: 30px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.tile.accent .tile-v { color: var(--accent); }
.tile.bad .tile-v { color: var(--bad); }

/* ---------- модальные окна, уведомления ---------- */
.overlay { position: fixed; inset: 0; background: rgba(20, 20, 24, .5); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); display: flex; flex-direction: column; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.modal:has(.crop) { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0 22px; }
.modal-head h2 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 14px 22px 8px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.modal-text { color: var(--ink); }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: 420px; }
.toast { background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .5); }
.toast.err { background: var(--bad); }

/* кадрирование */
.crop { display: flex; flex-direction: column; gap: 12px; }
.crop-stage { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0 / 20px 20px; }
.crop-canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; cursor: grab; touch-action: none; }
.crop-canvas.grabbing { cursor: grabbing; }
.crop-ctl { display: flex; align-items: center; gap: 12px; }
.crop-ctl input { flex: 1; accent-color: var(--accent); }

/* ---------- предпросмотр: рамка телефона ---------- */
.phone { width: 340px; border-radius: 44px; padding: 10px; background: #17171a; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .55), inset 0 0 0 2px #3a3a40; }
.phone-screen { --p-bg: #f5f5f6; --p-surface: #fff; --p-ink: #1a1a1c; --p-muted: #5d6168; --p-line: #e3e3e7;
  background: var(--p-bg); color: var(--p-ink); border-radius: 34px; overflow: hidden; height: 640px; display: flex; flex-direction: column; position: relative; font-size: 13.5px; }
.pv-status { display: flex; justify-content: space-between; align-items: center; padding: 10px 24px 4px; font-size: 12px; font-weight: 600; background: var(--p-surface); }
.pv-status > span { flex: 1; }
.pv-status > span:last-child { text-align: right; }
.pv-notch { flex: none !important; width: 80px; height: 18px; border-radius: 10px; background: #17171a; margin: 0 auto; }
.pv-top { background: var(--p-surface); padding: 6px 16px 10px; border-bottom: 1px solid var(--p-line); }
.pv-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 12px 12px 16px; scrollbar-width: thin; }
.pv-h { font-family: var(--font-display); font-weight: 500; font-size: 18px; margin: 4px 4px 12px; }
.pv-card { background: var(--p-surface); border-radius: 18px; overflow: hidden; }
.pv-banner { position: relative; aspect-ratio: 16 / 9; background: #fff; display: block; overflow: hidden; }
.pv-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pv-banner.empty { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #f1f1f3 0 10px, #f8f8fa 10px 20px); color: #9a9aa4; font-weight: 500; }
.pv-badge { position: absolute; left: 10px; top: 10px; background: #D40019; color: #fff; font-weight: 700; font-size: 13px; padding: 3px 9px; border-radius: 8px; }
.pv-card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.pv-card h4 { font-size: 16px; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
.pv-card p { color: var(--p-muted); overflow-wrap: anywhere; }
.pv-clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.pv-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.pv-tags:empty { display: none; }
.pv-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: #fde8ea; color: #D40019; }
.pv-tag.quiet { background: transparent; color: var(--p-muted); padding-left: 0; }
.pv-ghost { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; opacity: .5; }
.pv-ghost span { display: block; height: 14px; border-radius: 7px; background: #e6e6ea; }
.pv-ghost span:nth-child(2) { width: 70%; }
.pv-ghost span:nth-child(3) { width: 45%; }
.pv-back { color: #D40019; font-weight: 600; margin: 0 4px 10px; }
.pv-detail { background: var(--p-surface); border-radius: 0 0 18px 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; margin-top: -4px; }
.pv-body > .pv-banner { border-radius: 18px 18px 0 0; }
.pv-detail h2 { font-size: 18px; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; }
.pv-btn { display: block; text-align: center; border: 1px solid var(--p-line); border-radius: 12px; padding: 10px; font-weight: 500; }
.pv-sec { font-weight: 700; font-size: 14px; margin: 6px 0 0; color: var(--p-ink); }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pv-prod { border: 1px solid var(--p-line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pv-prod-img { aspect-ratio: 1; background: #f1f1f3; border-radius: 8px; overflow: hidden; }
.pv-prod-img img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.pv-prod-name { font-size: 12.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.pv-prices { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; }
.pv-prices b { color: #D40019; }
.pv-prices s { color: var(--p-muted); font-size: 12px; }
.pv-pct { font-size: 11px; font-weight: 700; background: #fde8ea; color: #D40019; border-radius: 5px; padding: 0 5px; }
.pv-tabbar { display: flex; border-top: 1px solid var(--p-line); background: var(--p-surface); padding: 8px 4px 14px; }
.pv-tabbar span { flex: 1; text-align: center; font-size: 10.5px; color: var(--p-muted); }
.pv-tabbar span.on { color: #D40019; font-weight: 700; }
.notif { background: rgba(255, 255, 255, .95); border-radius: 18px; padding: 10px 14px 12px; box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .35); display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.notif-app { display: flex; align-items: center; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--p-muted); }
.notif-app img { border-radius: 4px; }
.notif-app .muted { margin-left: auto; text-transform: none; }
.notif p, .msg p { color: var(--p-muted); overflow-wrap: anywhere; }
.msg { background: var(--p-surface); border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; }
.msg .dot { width: 9px; height: 9px; border-radius: 50%; background: #D40019; flex: none; margin-top: 6px; }
.msg > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Markdown-lite в экране акции */
.md > * + * { margin-top: 8px; }
.md p, .md li { overflow-wrap: anywhere; }
.md h3 { font-size: 15px; font-weight: 700; }
.md ul, .md ol { margin: 0; padding-left: 20px; }
.md a { color: #D40019; }
.pv-md { color: var(--p-ink); }
.pv-md:empty { display: none; }

/* ---------- ширина 1024-1280 ---------- */
@media (max-width: 1279px) {
  :root { --side: 188px; }
  .main { padding: 22px 22px 56px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; }
  .phone { width: 322px; }
  .phone-screen { height: 600px; }
  .tbl .c-thumb { width: 100px; }
  .thumb { width: 88px; }
  .row-title { max-width: 260px; }
}
@media (min-width: 1700px) {
  .editor-grid { grid-template-columns: minmax(0, 1fr) 460px; gap: 36px; }
}

/* проверка на сервере */
.srv-check { width: 340px; max-width: 100%; }
.srv-in { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.srv-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.srv-why { margin: 0; padding-left: 18px; color: var(--warn); }
.srv-in .btn-ghost { align-self: flex-start; }
