:root {
  --bg: #faf7f2;
  --surface: #ffffff;
  --surface-2: #f3eee6;
  --line: #e7dfd3;
  --ink: #26211c;
  --ink-2: #6d655b;
  --ink-3: #9b9285;
  --gold: #a8834b;
  --gold-2: #8c6a37;
  --gold-soft: #f4ead9;
  --ok: #3f7a53;
  --ok-soft: #e4f0e7;
  --warn: #a5671d;
  --warn-soft: #fbeedb;
  --err: #a63d36;
  --err-soft: #f8e3e1;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(38, 33, 28, .05), 0 8px 24px rgba(38, 33, 28, .06);
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --sidebar: 268px;
  --panel: 480px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.hide { display: none !important; }
.scrim { display: none; }
svg { width: 18px; height: 18px; fill: currentColor; flex: none; }

/* ---------- раздели ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr auto; height: 100vh; height: 100dvh; }

.sidebar { background: #f4efe7; border-right: 1px solid var(--line); display: flex; flex-direction: column; padding: 18px 14px; gap: 14px; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 6px 6px; }
.brand-mark { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--gold); box-shadow: var(--shadow); }
.brand-mark svg { width: 22px; height: 22px; }
.brand-name { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: .02em; line-height: 1; }
.brand-sub { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }
.brand .icon-btn { margin-left: auto; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: none; border-radius: 10px; text-align: left; color: var(--ink-2); }
.side-link:hover, .side-link.active { background: rgba(168, 131, 75, .1); color: var(--ink); }
.side-section-title { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: 4px 10px 0; }

.product-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; margin: 0 -4px; padding: 0 4px; }
.p-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; border: 0; background: none; text-align: left; width: 100%; }
.p-item:hover { background: rgba(168, 131, 75, .08); }
.p-item.active { background: var(--surface); box-shadow: var(--shadow); }
.p-thumb { width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2) center/cover no-repeat; flex: none; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }
.p-info { min-width: 0; flex: 1; }
.p-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 6px; align-items: center; }
.empty-list { font-size: 13px; color: var(--ink-3); padding: 8px 10px; }

.side-footer { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.conn-status { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; font-size: 12px; color: var(--ink-2); }
.conn { display: flex; align-items: center; gap: 7px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.dot.ok { background: var(--ok); }
.dot.off { background: var(--err); }

.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.topbar { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); background: rgba(250, 247, 242, .9); backdrop-filter: blur(8px); min-height: 62px; }
.topbar-title { flex: 1; min-width: 0; }
.top-title { font-family: var(--serif); font-size: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.top-meta { font-size: 12px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; }

/* ---------- бутони ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 10px; padding: 9px 14px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; font-size: 14px; transition: background .15s, border-color .15s, opacity .15s; white-space: nowrap; }
.btn:hover { border-color: #d6cbbb; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: #3a332c; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-2); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--err); }
.btn-sm { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; display: inline-grid; place-items: center; color: var(--ink-2); font-size: 18px; }
.icon-btn:hover { background: rgba(38, 33, 28, .06); color: var(--ink); }
.only-mobile { display: none; }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 500; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.draft { background: var(--surface-2); color: var(--ink-2); }
.chip.published { background: var(--ok-soft); color: var(--ok); }
.chip.error { background: var(--err-soft); color: var(--err); }
.chip.publishing { background: var(--gold-soft); color: var(--gold-2); }
.chip.dirty { background: var(--warn-soft); color: var(--warn); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 999px; font-size: 13px; color: var(--ink-2); }
.chip-btn.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- чат ---------- */
.chat-view { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.messages { flex: 1; overflow-y: auto; padding: 28px 22px 12px; display: flex; flex-direction: column; gap: 18px; }
.messages > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }

.welcome { text-align: center; margin-top: 6vh; }
.welcome h1 { font-family: var(--serif); font-weight: 600; font-size: 38px; margin: 10px 0 6px; line-height: 1.1; }
.welcome p { color: var(--ink-2); margin: 0 auto 22px; max-width: 520px; }
.welcome .brand-mark { margin: 0 auto; width: 56px; height: 56px; }
.welcome .brand-mark svg { width: 32px; height: 32px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: left; margin-bottom: 20px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; font-size: 13.5px; color: var(--ink-2); }
.step b { display: block; color: var(--ink); font-weight: 600; margin-bottom: 3px; font-size: 14px; }
.step .n { font-family: var(--serif); color: var(--gold); font-size: 22px; line-height: 1; display: block; margin-bottom: 6px; }
.examples { display: flex; flex-direction: column; gap: 8px; }
.example { text-align: left; border: 1px dashed #d8ccb9; background: transparent; border-radius: 12px; padding: 10px 14px; font-size: 13.5px; color: var(--ink-2); }
.example:hover { background: var(--surface); border-style: solid; }

.msg { display: flex; gap: 12px; align-items: flex-start; }
.msg.user { justify-content: flex-end; }
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--surface); color: var(--gold); box-shadow: var(--shadow); }
.avatar svg { width: 17px; height: 17px; }
.bubble { max-width: 86%; }
.msg.user .bubble { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 18px 18px 4px 18px; }
.msg.assistant .bubble { padding-top: 3px; }
.msg.assistant .text { white-space: pre-wrap; }
.msg.assistant.error .text { color: var(--err); }
.msg-images { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; justify-content: flex-end; }
.msg-images img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; cursor: zoom-in; border: 1px solid rgba(255, 255, 255, .2); }
.msg.system { justify-content: center; }
.msg.system .bubble { background: var(--ok-soft); color: var(--ok); padding: 7px 14px; border-radius: 999px; font-size: 13.5px; text-align: center; }
.msg-meta { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.msg-meta .label { font-size: 12px; color: var(--ink-3); }
.missing { background: var(--warn-soft); color: var(--warn); }
.changed { background: var(--gold-soft); color: var(--gold-2); }
.open-preview { margin-top: 10px; }
.typing { display: inline-flex; gap: 4px; padding: 10px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); opacity: .4; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.composer { padding: 8px 22px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.composer > * { max-width: 760px; margin-left: auto; margin-right: auto; }
.composer-box { display: flex; align-items: flex-end; gap: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 7px; box-shadow: var(--shadow); transition: border-color .15s; }
.composer-box:focus-within { border-color: #cdbb9f; }
.composer.drag .composer-box { border-color: var(--gold); border-style: dashed; }
.composer textarea { flex: 1; border: 0; outline: 0; resize: none; background: transparent; padding: 8px 4px; max-height: 220px; line-height: 1.45; }
.attach-btn { cursor: pointer; }
.attach-btn svg { width: 21px; height: 21px; fill: none; }
.send-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; display: grid; place-items: center; flex: none; }
.send-btn:disabled { background: #cfc6b8; cursor: not-allowed; }
.send-btn svg { fill: none; }
.composer-hint { font-size: 11.5px; color: var(--ink-3); text-align: center; margin-top: 7px; }
.attachments { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.attachments:empty { display: none; }
.att { position: relative; width: 64px; height: 64px; }
.att img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.att button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 12px; line-height: 1; }

/* ---------- табло ---------- */
.dashboard-view { flex: 1; overflow-y: auto; padding: 26px 28px 40px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.dash-head h1 { font-family: var(--serif); font-weight: 600; font-size: 32px; margin: 0; }
.dash-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.stat .v { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--ink-3); }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-align: left; padding: 0; display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.card-img { aspect-ratio: 1; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--ink-3); font-size: 30px; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 5px; }
.card-name { font-weight: 500; font-size: 14px; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-row { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.card-price { font-weight: 600; color: var(--ink); }
.dash-empty { grid-column: 1 / -1; text-align: center; padding: 50px 10px; color: var(--ink-3); }

/* ---------- панел ---------- */
.panel { width: var(--panel); border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.panel-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 11px; flex: 1; }
.tab { flex: 1; border: 0; background: transparent; padding: 7px 6px; border-radius: 8px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.panel-body { flex: 1; overflow-y: auto; padding: 16px; }
.panel-foot { border-top: 1px solid var(--line); padding: 12px 16px; padding-bottom: max(12px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 8px; background: #fffdf9; }
.foot-row { display: flex; gap: 8px; align-items: center; }
.foot-row .btn { flex: 1; }
.problems { font-size: 12.5px; color: var(--warn); display: flex; flex-direction: column; gap: 2px; }
.foot-note { font-size: 12px; color: var(--ink-3); }
.foot-note a { color: var(--gold-2); }

.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 2px; }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.seg button.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.preview-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.preview-bar .label { font-size: 12px; color: var(--ink-3); }

.serp { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-family: Arial, sans-serif; }
.serp-label { font: 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 6px; }
.serp-url { font-size: 12px; color: #4d5156; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.serp-title { font-size: 18px; color: #1a0dab; line-height: 1.3; margin: 2px 0; }
.serp-desc { font-size: 13px; color: #4d5156; line-height: 1.45; }

.pp { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.pp-gallery { background: #fbfaf8; }
.pp-main { aspect-ratio: 1; display: grid; place-items: center; background: #f6f3ee center/contain no-repeat; color: var(--ink-3); cursor: zoom-in; }
.pp-thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; }
.pp-thumbs button { width: 54px; height: 54px; border-radius: 8px; border: 2px solid transparent; padding: 0; background: #eee center/cover no-repeat; flex: none; }
.pp-thumbs button.active { border-color: var(--gold); }
.pp-info { padding: 16px 18px 20px; }
.pp-cat { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.pp-name { font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.15; margin: 4px 0 8px; }
.pp-price { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.pp-stock { font-size: 13px; margin-bottom: 12px; }
.pp-stock.in { color: var(--ok); }
.pp-stock.out { color: var(--err); }
.pp-short { color: var(--ink-2); margin: 0 0 14px; }
.pp-short p { margin: 0; }
.pp-buy { width: 100%; padding: 12px; border-radius: 10px; border: 0; background: var(--ink); color: #fff; font-weight: 500; margin-bottom: 18px; cursor: default; }
.pp-desc { border-top: 1px solid var(--line); padding-top: 14px; font-size: 14.5px; }
.pp-desc h3 { font-family: var(--serif); font-size: 20px; margin: 16px 0 6px; font-weight: 600; }
.pp-desc p { margin: 0 0 10px; }
.pp-desc ul { padding-left: 20px; margin: 0 0 10px; }
.pp-specs { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 13.5px; }
.pp-specs td { padding: 7px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.pp-specs td:first-child { color: var(--ink-3); width: 42%; }
.placeholder-text { color: var(--ink-3); font-style: italic; }

/* ---------- форми ---------- */
.group { margin-bottom: 22px; }
.group-title { font-family: var(--serif); font-size: 19px; font-weight: 600; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
.field { margin-bottom: 12px; }
.field label { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 500; color: var(--ink-2); margin-bottom: 4px; gap: 8px; }
.field .count { font-weight: 400; color: var(--ink-3); }
.field .count.over { color: var(--err); font-weight: 600; }
.input, .field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; background: #fffdfa; outline: 0; transition: border-color .15s; }
.field textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
.field textarea.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; min-height: 160px; }
.input:focus, .field input:focus, .field textarea:focus, .field select:focus { border-color: var(--gold); background: #fff; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.lang-tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px; background: var(--surface-2); color: var(--ink-2); margin-right: 4px; }
.spec-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 28px; gap: 6px; margin-bottom: 6px; }
.spec-row input { padding: 6px 8px; font-size: 13px; }
.save-bar { position: sticky; bottom: -16px; margin: 0 -16px -16px; padding: 10px 16px; background: rgba(255, 253, 249, .96); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.save-bar .note { margin-right: auto; font-size: 12.5px; color: var(--warn); }

/* ---------- снимки ---------- */
.img-help { font-size: 13px; color: var(--ink-2); margin: 0 0 12px; }
.img-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.img-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.img-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.img-card .ph { aspect-ratio: 1; background: #f6f3ee center/cover no-repeat; position: relative; cursor: zoom-in; }
.img-card .badges { position: absolute; top: 6px; left: 6px; display: flex; gap: 4px; flex-wrap: wrap; }
.img-card .badge { font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .92); color: var(--ink-2); }
.img-card .badge.main { background: var(--gold); color: #fff; }
.img-card .badge.ai { background: var(--ink); color: #fff; }
.img-card .processing { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(250, 247, 242, .85); font-size: 12.5px; color: var(--ink-2); text-align: center; padding: 10px; }
.img-card .processing.err { color: var(--err); }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--gold-soft); border-top-color: var(--gold); border-radius: 50%; animation: spin .9s linear infinite; margin: 0 auto 6px; }
@keyframes spin { to { transform: rotate(360deg); } }
.img-card .ctrl { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.img-card .ctrl-row { display: flex; gap: 4px; align-items: center; }
.img-card .ctrl-row .btn { flex: 1; padding: 5px 4px; font-size: 12px; }
.img-card .toggle { display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.img-card input[type=text] { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 5px 7px; font-size: 12px; }
.add-images { border: 1.5px dashed #d8ccb9; border-radius: 12px; display: grid; place-items: center; aspect-ratio: 1; color: var(--ink-3); cursor: pointer; font-size: 13px; text-align: center; padding: 10px; }
.add-images:hover { background: var(--bg); color: var(--ink-2); }

/* ---------- история ---------- */
.timeline { list-style: none; padding: 0; margin: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl { position: relative; padding: 0 0 16px 38px; }
.tl-ico { position: absolute; left: 0; top: 0; width: 27px; height: 27px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); border: 2px solid #fff; }
.tl-ico.ai { background: var(--gold-soft); color: var(--gold-2); }
.tl-ico.user { background: var(--ink); color: #fff; }
.tl-ico.system { background: var(--ok-soft); color: var(--ok); }
.tl-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink-3); }
.tl-note { font-size: 13.5px; margin: 2px 0 4px; }
.tl-changes { display: flex; gap: 4px; flex-wrap: wrap; }
.tl-changes .chip { font-size: 10.5px; }
.tl .btn { margin-top: 6px; }

/* ---------- модали ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(38, 33, 28, .45); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0, 0, 0, .2); }
.modal-head { padding: 18px 20px 0; }
.modal-head h2 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin: 0; line-height: 1.15; }
.modal-head p { color: var(--ink-2); margin: 4px 0 0; font-size: 14px; }
.modal-body { padding: 16px 20px; }
.modal-foot { padding: 0 20px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.summary { display: grid; grid-template-columns: 84px 1fr; gap: 14px; align-items: start; background: var(--bg); border-radius: 12px; padding: 12px; margin-bottom: 14px; }
.summary img, .summary .noimg { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.summary .s-name { font-weight: 600; line-height: 1.3; }
.summary .s-row { font-size: 13px; color: var(--ink-2); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 0; }
.check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--gold); flex: none; }
.check small { display: block; color: var(--ink-3); font-size: 12.5px; }
.warnbox { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.errbox { background: var(--err-soft); color: var(--err); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 10px; }
.lightbox { position: fixed; inset: 0; background: rgba(20, 17, 14, .9); z-index: 60; display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 70; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--err); }

.login { max-width: 360px; margin: 18vh auto 0; text-align: center; padding: 20px; }
.login h1 { font-family: var(--serif); font-size: 34px; margin: 12px 0 18px; }
.login .brand-mark { margin: 0 auto; width: 56px; height: 56px; }

/* ---------- мобилен изглед ---------- */
@media (max-width: 1180px) {
  :root { --panel: 420px; }
}
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .only-mobile { display: inline-grid; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 290px; z-index: 40; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .15); }
  .app.sidebar-open .sidebar { transform: none; }
  .app.sidebar-open .scrim { display: block; position: fixed; inset: 0; background: rgba(38, 33, 28, .35); z-index: 35; }
  .panel { position: fixed; inset: 0; width: 100%; z-index: 30; border: 0; transform: translateY(100%); transition: transform .22s; }
  .app.panel-open .panel { transform: none; }
  .panel.hide { display: flex !important; }
  .app:not(.has-product) .panel { display: none !important; }
  .topbar { padding: 10px 12px; }
  .messages { padding: 18px 14px 8px; }
  .composer { padding: 6px 10px 10px; }
  .steps { grid-template-columns: 1fr; }
  .dash-stats { grid-template-columns: 1fr 1fr; }
  .dashboard-view { padding: 18px 14px 30px; }
  .dash-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
}
@media (min-width: 981px) {
  #previewToggle { display: none !important; }
}
@media (max-width: 520px) {
  .row2, .row3 { grid-template-columns: 1fr; }
  .spec-row { grid-template-columns: 1fr 1fr 28px; }
  .spec-row .en { display: none; }
  .welcome h1 { font-size: 30px; }
}

.msg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-actions a.btn { text-decoration: none; color: inherit; }
.tl-ico.chatgpt { background: #e6f2ee; color: #2f6b57; }
.side-link[data-action="open-settings"] { }

.pp-tags { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 5px; }
.pp-tags .serp-label { width: 100%; margin-bottom: 2px; }
