/* San Marco — фирменные цвета: красный #E12723, графитово-чёрный #231F1E, белый */
:root {
  --bg: #ffffff;
  --surface: #f6f5f4;
  --surface-2: #ecebe9;
  --ink: #231f1e;
  --muted: #7b7573;
  --line: #e7e5e3;
  --red: #e12723;
  --red-dark: #b81d19;
  --red-soft: #fdecec;
  --green: #2f7d4f;
  --radius: 14px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); }
body { font-family: var(--sans); color: var(--ink); font-size: 17px; line-height: 1.4; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

#app { overflow-x: hidden; height: 100vh; height: 100dvh; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; position: relative; overflow: hidden; background: var(--bg); }

/* ---------- шапка ---------- */
.topbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.brand { flex: 1; min-width: 0; }
.wordmark { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.wordmark i { width: 12px; height: 12px; background: var(--red); border-radius: 2px; }
.tagline { font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 0 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { flex: none; display: flex; align-items: center; gap: 4px; }
.pill-dealer { font-size: 12.5px; font-weight: 600; color: var(--red); background: var(--red-soft); padding: 4px 9px; border-radius: 99px; white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.icon-btn:active { background: var(--surface); }

main { flex: 1; min-height: 0; position: relative; }
.screen { display: none; height: 100%; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 16px 28px; }
.screen.active { display: block; }
.page-title { font-weight: 800; font-size: 30px; letter-spacing: -.02em; margin: 2px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 14.5px; }

/* ---------- заглушка ---------- */
.gate { min-height: 70%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; padding: 30px 10px; }
.gate h2 { font-weight: 800; font-size: 25.5px; margin: 0; }
.gate p { margin: 0; max-width: 300px; }
.gate .id-box { font-weight: 800; font-size: 32px; letter-spacing: .06em; padding: 14px 22px; border: 2px dashed var(--red); border-radius: var(--radius); user-select: all; -webkit-user-select: all; }
.spinner { width: 28px; height: 28px; border: 2.5px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- бонус ---------- */
.hero { border-radius: 18px; padding: 16px 18px; color: #fff; margin-bottom: 14px; background: var(--ink); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: var(--red); opacity: .9; }
.hero > * { position: relative; z-index: 1; }
.hero .label { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; opacity: .7; }
.hero .sum { font-weight: 800; font-size: 30px; margin: 6px 0 2px; letter-spacing: -.01em; }
.hero .sum small { font-size: 15px; font-weight: 500; opacity: .7; }
.hero .note { font-size: 14.5px; opacity: .8; }
.bar { height: 5px; border-radius: 9px; background: rgba(255,255,255,.18); margin: 12px 0 8px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 9px; background: var(--red); transition: width .5s ease; }

/* ---------- поиск, чипы ---------- */
.searchbox { display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 12px; padding: 0 14px; height: 46px; }
.searchbox svg { color: var(--muted); width: 19px; height: 19px; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; height: 100%; font-size: 17px; -webkit-appearance: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px; margin: 0 -16px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg); font-size: 15px; white-space: nowrap; }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- каталог ---------- */
.cat-title { font-weight: 800; font-size: 19.5px; margin: 16px 0 10px; display: flex; align-items: baseline; justify-content: space-between; }
.cat-title span { font-weight: 500; font-size: 14px; color: var(--muted); }
.card { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; transition: transform .12s; }
.card:active { transform: scale(.985); }
.tile { flex: none; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.tile img { width: 100%; height: 100%; object-fit: contain; }
.tile.sm { width: 46px; height: 46px; border-radius: 9px; }
.tile .mono { font-weight: 800; font-size: 20.5px; color: var(--muted); letter-spacing: -.02em; }
.card .info { flex: 1; min-width: 0; }
.card .nm { font-weight: 700; font-size: 18px; line-height: 1.2; }
.card .ds { font-size: 14.5px; color: var(--muted); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 15px; font-weight: 600; }
.tag { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--red-soft); color: var(--red-dark); }
.card > svg { color: #c2bdba; width: 18px; height: 18px; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty h3 { font-weight: 800; font-size: 23px; color: var(--ink); margin: 0 0 6px; }

/* ---------- кнопки ---------- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 18px; border-radius: 13px; background: var(--red); color: #fff; font-size: 18.5px; font-weight: 700; transition: background .15s, opacity .15s; }
.btn:active { background: var(--red-dark); }
.btn[disabled] { opacity: .45; }
.btn.ghost { background: var(--bg); color: var(--ink); border: 1.5px solid var(--ink); font-weight: 600; }
.btn.dark { background: var(--ink); }
.btn.sm { width: auto; min-height: 36px; padding: 0 14px; font-size: 16px; border-radius: 10px; }
.link-btn { color: var(--red); font-size: 15.5px; font-weight: 700; padding: 8px 0; white-space: nowrap; }
.mini { font-size: 15px; font-weight: 700; color: var(--red); padding: 6px 10px; border-radius: 8px; background: var(--red-soft); white-space: nowrap; }

/* ---------- выезжающие панели ---------- */
.sheet-layer { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
#layer2 { z-index: 40; }
.backdrop { position: absolute; inset: 0; background: rgba(35,31,30,.5); animation: fade .2s ease; }
.sheet { position: relative; max-height: 93%; display: flex; flex-direction: column; background: var(--bg); border-radius: 22px 22px 0 0; animation: rise .26s cubic-bezier(.2,.8,.2,1); }
.grabber { flex: none; width: 38px; height: 4px; border-radius: 9px; background: #d6d2cf; margin: 9px auto 4px; }
.sheet-body { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 16px calc(18px + var(--safe-b)); }
@keyframes rise { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
.sheet h2 { font-weight: 800; font-size: 26.5px; letter-spacing: -.02em; margin: 4px 0 4px; line-height: 1.15; }
.sheet .lead { color: var(--muted); font-size: 15.5px; margin: 0 0 12px; }
.sec { font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 18px 0 8px; }

.gallery { display: flex; gap: 8px; overflow-x: auto; margin: 4px -16px 10px; padding: 0 16px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; height: 190px; max-width: 86%; border-radius: 14px; background: var(--surface); object-fit: cover; scroll-snap-align: start; }
.gallery img.can { object-fit: contain; width: 190px; padding: 8px; }

/* фасовки */
.base-h { display: flex; align-items: center; justify-content: space-between; font-size: 14.5px; font-weight: 700; margin: 12px 0 6px; }
.base-h .why { font-weight: 500; color: var(--muted); font-size: 14px; }
.pack { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); margin-bottom: 7px; }
.pack.on { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.pack[disabled] { opacity: .38; }
.pack .radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid #c9c4c1; flex: none; position: relative; }
.pack.on .radio { border-color: var(--red); }
.pack.on .radio::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--red); }
.pack .v { font-weight: 700; }
.pack .a { font-size: 13px; color: var(--muted); }
.pack .p { margin-left: auto; text-align: right; font-weight: 700; white-space: nowrap; }
.old { display: block; font-size: 13px; font-weight: 500; color: var(--muted); text-decoration: line-through; }

.rowbtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); margin-bottom: 7px; }
.rowbtn .t { flex: 1; min-width: 0; font-weight: 600; }
.rowbtn .t small { display: block; color: var(--muted); font-size: 14px; font-weight: 500; }
.rowbtn > svg { width: 18px; height: 18px; color: #c2bdba; }
.dot { width: 30px; height: 30px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); background: repeating-linear-gradient(45deg, #fff, #fff 5px, #eceae8 5px, #eceae8 10px); }
.alert { font-size: 15px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red-dark); margin: 4px 0 8px; }
.okline { font-size: 14.5px; color: var(--green); margin: 2px 0 8px; }

/* калькулятор */
.calc { border-radius: 14px; background: var(--surface); padding: 12px 13px; margin-bottom: 8px; }
.crow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-height: 50px; }
.crow:last-of-type { border-bottom: 0; }
.crow .lbl { font-size: 15.5px; }
.crow .lbl small { display: block; font-size: 13px; color: var(--muted); }
.crow .val { display: flex; align-items: center; gap: 8px; }
.crow .val b { font-size: 18.5px; }
.crow input { width: 92px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px; font-size: 18.5px; text-align: right; outline: 0; -webkit-appearance: none; }
.crow input:focus { border-color: var(--red); }
.crow input[readonly] { background: transparent; border-color: transparent; font-weight: 700; padding-right: 0; }
.calc-res { padding-top: 10px; font-size: 15.5px; }
.calc-res b { font-size: 18.5px; }
.reco { margin-top: 10px; padding: 11px 12px; border-radius: 12px; background: #fff; border: 1.5px solid var(--red); }
.reco .t { font-weight: 700; margin-bottom: 4px; }
.reco ul { margin: 4px 0 8px; padding-left: 18px; font-size: 15.5px; }
.reco .save { color: var(--green); font-size: 14.5px; font-weight: 600; }
.reco-btn { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 42px; margin-top: 10px; border-radius: 10px; border: 1.5px dashed var(--red); color: var(--red); font-weight: 700; font-size: 16px; background: #fff; }
.reco-btn.hot { border-style: solid; background: var(--red); color: #fff; }

/* счётчик */
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; background: var(--bg); overflow: hidden; }
.stepper button { width: 40px; height: 40px; font-size: 24px; line-height: 1; }
.stepper button:active { background: var(--surface); }
.stepper b { min-width: 32px; text-align: center; font-weight: 700; }
.stepper.sm button { width: 32px; height: 32px; font-size: 20.5px; }
.buybar { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.buybar .btn { flex: 1; }

/* палитра */
.swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin: 12px 0; }
.sw { aspect-ratio: 1 / 1.15; border-radius: 11px; position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.sw span { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.95); font-size: 12.5px; font-weight: 700; text-align: center; padding: 3px 0 2px; line-height: 1.15; }
.sw span em { display: block; font-style: normal; font-weight: 500; font-size: 11.5px; color: var(--muted); }
.sw.nobase span em { color: var(--red); }
.sw.on { outline: 2.5px solid var(--red); outline-offset: 2px; }

/* ---------- заявка ---------- */
.item { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px; margin-bottom: 8px; }
.item .info { flex: 1; min-width: 0; }
.item .nm { font-weight: 700; font-size: 17px; line-height: 1.2; }
.item .mt { font-size: 14px; color: var(--muted); margin: 3px 0 8px; }
.item .line2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.item .sum { font-weight: 700; font-size: 18px; white-space: nowrap; }
.item .rm { align-self: flex-start; color: #b5afac; padding: 2px; }
.item .rm svg { width: 18px; height: 18px; }
.note-rrc { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; color: var(--muted); background: var(--surface); border-radius: 12px; padding: 10px 12px; margin: 12px 0 10px; }
.note-rrc svg { width: 18px; height: 18px; color: var(--ink); }
.totals { border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 14px; }
.totals .r { display: flex; justify-content: space-between; font-size: 16px; padding: 3px 0; color: var(--muted); }
.totals .r.big { color: var(--ink); font-weight: 800; font-size: 24px; padding-top: 10px; margin-top: 8px; border-top: 1px dashed var(--line); align-items: baseline; }
.totals .r.big span:first-child { font-size: 16px; font-weight: 600; }
.stack > * + * { margin-top: 9px; }

/* ---------- заказы ---------- */
.order { display: block; width: 100%; text-align: left; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 14px; margin-bottom: 8px; }
.order .top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.order .num, .order .sum { font-weight: 800; font-size: 18.5px; white-space: nowrap; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-top: 11px; }
.steps i { height: 4px; border-radius: 9px; background: var(--surface-2); }
.steps i.done { background: var(--red); }
.steps-l { display: flex; justify-content: space-between; margin-top: 6px; font-size: 14px; color: var(--muted); }
.steps-l b { color: var(--red-dark); }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.kv:last-of-type { border-bottom: 0; }
.kv .l small { display: block; color: var(--muted); font-size: 14px; }
.kv .v { white-space: nowrap; font-weight: 700; }

/* переключатель (меню ⋮) */
.toggle { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px; border-radius: 14px; background: var(--surface); margin-bottom: 8px; }
.toggle .t { flex: 1; font-weight: 700; }
.toggle .t small { display: block; font-weight: 500; color: var(--muted); font-size: 14px; margin-top: 2px; }
.check { width: 26px; height: 26px; border-radius: 8px; border: 2px solid #c9c4c1; flex: none; display: flex; align-items: center; justify-content: center; background: #fff; }
.toggle.on .check { background: var(--red); border-color: var(--red); }
.toggle.on .check::after { content: ""; width: 7px; height: 12px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* ---------- чат ---------- */
.chat-screen.active { display: flex; flex-direction: column; padding-bottom: 10px; overflow: hidden; }
.chat-head { flex: none; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.chat-head .page-title { margin-bottom: 2px; }
.chat-msgs { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px 0 6px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 86%; padding: 10px 13px; border-radius: 16px; font-size: 16.5px; white-space: pre-wrap; word-wrap: break-word; }
.msg.bot { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 5px; }
.msg.me { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.msg.sys { align-self: center; max-width: 94%; background: var(--red-soft); color: var(--red-dark); font-size: 14.5px; text-align: center; border-radius: 10px; padding: 7px 11px; }
.msg.typing { color: var(--muted); font-style: italic; }
.chips.quick { flex: none; padding-top: 6px; padding-bottom: 8px; }
.chat-input { flex: none; display: flex; gap: 7px; }
.chat-input input { flex: 1; min-width: 0; height: 48px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); padding: 0 14px; font-size: 18.5px; outline: 0; -webkit-appearance: none; }
.chat-input input:focus { border-color: var(--ink); background: #fff; }
.chat-input button { width: 48px; height: 48px; border-radius: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
#chatSend { background: var(--red); color: #fff; }
#chatSend[disabled], .mic[disabled] { opacity: .45; }
.mic { background: var(--surface); color: var(--ink); }
.rec-bar { flex: none; display: flex; align-items: center; gap: 10px; padding: 8px 4px 10px; font-weight: 700; }
.rec-bar .btn { margin-left: auto; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--red); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* ---------- нижнее меню ---------- */
.tabbar { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + var(--safe-b)); }
.tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; font-size: 12px; font-weight: 600; color: #9d9794; }
.tabbar button.active { color: var(--red); }
.badge { position: absolute; top: -2px; left: 50%; margin-left: 5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12.5px; font-style: normal; font-weight: 700; line-height: 18px; text-align: center; }

.toast { position: absolute; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translate(-50%, 16px); max-width: 88%; background: var(--ink); color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 15.5px; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.photo { display: flex; justify-content: center; margin: 4px 0 10px; }
.photo img { height: 200px; max-width: 100%; object-fit: contain; border-radius: 14px; background: var(--surface); padding: 8px; }
.reco .alt { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }

/* --- обновление: вес, инструменты продаж, картинки в чате --- */
.cat-note { font-size: 14px; color: var(--muted); margin: -6px 0 10px; }
.totals .r small { font-weight: 500; color: var(--muted); font-size: 13px; }
.msg .msg-img { margin: 10px 0 0; }
.msg .msg-img img { display: block; width: 100%; max-width: 360px; border-radius: 10px; cursor: zoom-in; }
.msg .msg-img figcaption { font-size: 13.5px; color: var(--muted); margin-top: 6px; line-height: 1.35; }

/* --- голосовой ассистент --- */
.voice-cta { flex: none; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 4px 0 10px;
  padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.voice-cta b { display: block; font-size: 17px; }
.voice-cta small { display: block; font-size: 13.5px; opacity: .75; margin-top: 2px; }
.voice-cta-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--red); display: grid; place-items: center; }
.voice-cta-ic svg, .voice-orb svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; }
body.voice-on { overflow: hidden; }
.voice-view { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
.voice-view[hidden] { display: none; }
.voice-top { flex: none; display: flex; justify-content: space-between; }
.voice-log { flex: 1; overflow-y: auto; padding: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.vmsg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 17px; line-height: 1.4; white-space: pre-wrap; }
.vmsg.me { align-self: flex-end; background: var(--ink); color: #fff; }
.vmsg.bot { align-self: flex-start; background: #f4f2f1; }
.vmsg.sys { align-self: center; max-width: 100%; text-align: center; font-size: 14.5px; color: var(--muted); padding: 2px 6px; }
.vmsg.cart { align-self: center; font-size: 15px; font-weight: 600; color: var(--red-dark, #b81d1a); background: var(--red-soft, #fdecec); }
.voice-bottom { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; padding-top: 6px; }
.voice-bottom .chat-input { width: 100%; }
.voice-orb { width: 96px; height: 96px; border-radius: 50%; background: var(--red); display: grid; place-items: center;
  box-shadow: 0 0 0 0 rgba(225, 39, 35, .35); transition: transform .2s, background .2s; }
.voice-orb svg { width: 38px; height: 38px; }
.voice-view[data-state="listening"] .voice-orb { animation: vpulse 2.2s ease-out infinite; }
.voice-view[data-state="hearing"] .voice-orb { transform: scale(1.08); animation: vpulse .9s ease-out infinite; }
.voice-view[data-state="thinking"] .voice-orb { background: var(--ink); animation: vspin 1.2s linear infinite; }
.voice-view[data-state="speaking"] .voice-orb { background: var(--ink); animation: vtalk .6s ease-in-out infinite alternate; }
.voice-view[data-state="idle"] .voice-orb { background: #b9b4b2; }
.voice-status { font-size: 16px; color: var(--muted); min-height: 22px; }
@keyframes vpulse { 0% { box-shadow: 0 0 0 0 rgba(225, 39, 35, .4); } 100% { box-shadow: 0 0 0 26px rgba(225, 39, 35, 0); } }
@keyframes vspin { 50% { transform: scale(.94); } }
@keyframes vtalk { from { transform: scale(1); } to { transform: scale(1.07); } }
.rowbtn .mini { margin-left: auto; }

/* --- колеровочные карты --- */
.sw.card { background: repeating-linear-gradient(135deg, #f4f2f1 0 8px, #ebe8e6 8px 16px); }
.sw.card b { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: 17px; font-weight: 800; color: var(--ink); }

/* разделы каталога на главной — все видны сразу, в несколько рядов */
.chips.wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; overflow: visible; margin: 0; padding: 12px 0 4px; }
.chips.wrap .chip { white-space: normal; text-align: center; padding: 8px 8px; font-size: 14px; line-height: 1.2; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; min-height: 40px; }

/* голосовой чат: ссылка на заявку — овальная кнопка, крупнее */
#voiceCart { display: inline-flex; align-items: center; justify-content: center; align-self: center; font-size: 17px; font-weight: 700;
  color: var(--red-dark); background: var(--red-soft); border: 2px solid var(--red); border-radius: 99px; padding: 10px 22px; margin-top: 4px; }
#voiceCart:active { background: var(--red); color: #fff; }

/* разделы каталога — контрастнее: серый фон, тёмная рамка, полужирный текст */
.chips.wrap .chip { background: #f3f1ef; border: 1.5px solid #b9b3af; color: var(--ink); font-weight: 600; }
.chips.wrap .chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* --- v7: крестик закрытия панели, закреплённая полоса «В заявку», калькулятор --- */
.sheet-x { position: absolute; top: 10px; right: 12px; z-index: 3; width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: var(--surface); color: var(--ink); }
.sheet-x svg { width: 18px; height: 18px; stroke-width: 2.2; }
.sheet-x:active { background: var(--surface-2); }
.sheet-body > h2:first-child { padding-right: 44px; }
.sheet.has-foot .sheet-body { padding-bottom: 14px; }
.sheet-foot { flex: none; padding: 10px 16px calc(10px + var(--safe-b)); border-top: 1px solid var(--line); background: var(--bg); }
.sheet-foot .buybar { margin-top: 0; }
.combo-lbl { flex: none; max-width: 42%; font-weight: 700; font-size: 14.5px; line-height: 1.25; }
.combo-lbl small { display: block; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.crow .val input#cArea { width: 84px; }
.calc-hint { font-size: 13.5px; color: var(--red-dark); background: var(--red-soft); border-radius: 9px; padding: 7px 10px; margin: 6px 0 2px; }
.calc-res .alert { margin-top: 8px; }
.calc-alts { padding-top: 6px; }
.calc-alts .link-btn { display: block; width: 100%; text-align: left; white-space: normal; font-size: 14.5px; padding: 7px 0; line-height: 1.3; }
.icon-btn.gear svg { width: 21px; height: 21px; color: var(--muted); }

/* --- v8: телефон для панелей, кнопка модели в голосовом экране, цвет в заявке, образец для планшетов --- */
.alert.call-note { font-weight: 600; }
.alert.call-note a { color: var(--red-dark); font-weight: 800; white-space: nowrap; }
.voice-top { align-items: center; }
.voice-top-r { display: flex; gap: 14px; }
#voiceModel { color: var(--ink); }
.cart-color { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--red-dark); margin: -2px 0 8px; padding: 4px 0; }
.dot.sm { width: 20px; height: 20px; }
.sstep { font-size: 14px; font-weight: 700; margin: 10px 0 0; }
.chips.wrap.sample-chips { padding-top: 6px; }
.item .mt .sample-t { color: var(--ink); font-weight: 600; }
.msg-table { margin-top: 10px; white-space: normal; }
.msg-table .tt { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.msg-table .tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.msg-table table { border-collapse: collapse; font-size: 14px; background: #fff; border-radius: 10px; overflow: hidden; min-width: 100%; }
.msg-table th { text-align: left; font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); padding: 7px 9px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.msg-table td { padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.msg-table tr:last-child td { border-bottom: 0; }
.msg-table td span { display: block; color: var(--muted); font-size: 13px; }
.msg-table td b { font-weight: 700; }
.old.nostrike { text-decoration: none; }
.cl-h { font-weight: 700; margin: 14px 0 2px; }

/* --- v10: изменения цен заводом, новости --- */
.card, .pack { position: relative; }
.chg-dot { position: absolute; top: 7px; right: 7px; width: 11px; height: 11px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px #fff; z-index: 1; }
.price-banner { display: flex; align-items: stretch; height: 38px; margin-top: 10px; border: 1.5px solid var(--red); border-radius: 10px; background: var(--red-soft); overflow: hidden; }
.price-banner .marq { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; display: flex; align-items: center; text-align: left; }
.price-banner .marq span { display: inline-block; padding-left: 100%; color: var(--red); font-weight: 800; font-size: 14.5px; letter-spacing: .05em; text-transform: uppercase; animation: marq 11s linear infinite; }
@keyframes marq { to { transform: translateX(-100%); } }
.price-banner .x { flex: none; width: 38px; display: flex; align-items: center; justify-content: center; color: var(--red); border-left: 1.5px solid var(--red); }
.price-banner .x svg { width: 18px; height: 18px; stroke-width: 2.4; }
.seg { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 10px 0 8px; background: var(--surface); border-radius: 12px; }
.seg button { position: relative; height: 38px; border-radius: 9px; font-weight: 700; font-size: 16px; color: var(--muted); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.seg-badge { display: inline-block; min-width: 19px; height: 19px; margin-left: 6px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 12px; font-style: normal; line-height: 19px; vertical-align: 2px; }
.chat-pane { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.news-pane { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 12px; }
.news-item { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 13px; margin-bottom: 9px; }
.news-item.prices { border-color: var(--red); background: #fff8f8; }
.news-meta { font-size: 13px; color: var(--muted); }
.news-new { color: var(--red); }
.news-title { font-weight: 800; font-size: 17.5px; line-height: 1.25; margin: 3px 0 6px; }
.news-body { font-size: 15.5px; white-space: pre-wrap; word-wrap: break-word; }
.news-body.clamp { display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; }
.news-rows { margin-top: 8px; font-size: 14.5px; }
.news-rows div { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-top: 1px dashed var(--line); }
.news-rows b { white-space: nowrap; }
.news-acts { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.news-acts:empty { display: none; }
.news-acts .mini { white-space: normal; text-align: left; }
.link-btn.danger { color: var(--muted); font-weight: 600; }
.news-add { border-style: dashed; border-color: var(--red); }
.news-form { border: 1.5px solid var(--red); border-radius: var(--radius); padding: 10px 12px 12px; margin-bottom: 10px; }
.news-form input:not([type=file]), .news-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: inherit; font-size: 16px; margin-bottom: 8px; outline: 0; background: #fff; resize: vertical; }
.news-form input:focus, .news-form textarea:focus { border-color: var(--red); }
.news-file { display: block; padding: 11px 12px; border: 1.5px dashed #c9c4c1; border-radius: 10px; color: var(--red-dark); font-weight: 600; font-size: 15px; margin-bottom: 10px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-file input { display: none; }
.news-form-btns { display: grid; grid-template-columns: 1.4fr 1fr; gap: 8px; }

/* --- v11: телефон для заказов выкрасов в настройках завода --- */
.phone-row { display: flex; gap: 8px; align-items: center; padding: 4px 0 2px; }
.phone-row input { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px; font-size: 17px; outline: 0; }
.phone-row input:focus { border-color: var(--red); }
/* таблицы расчёта в чате: упаковки переносятся, чтобы Bianco и Trasparente помещались на телефоне */
.msg-table td { white-space: normal; min-width: 64px; }
.msg-table td:first-child { white-space: nowrap; color: var(--muted); }

/* --- v12: технический каталог в карточке --- */
.title-row { display: flex; align-items: center; gap: 10px; margin: 4px 0 4px; }
.title-row h2 { flex: 1; min-width: 0; margin: 0; }
.td-btn { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 7px 10px; border-radius: 10px; border: 1.5px solid #e8892b; background: #fff4e8; color: #a45200; font-size: 13.5px; font-weight: 700; }
.td-btn svg { width: 18px; height: 18px; }
.td-btn:active { background: #ffe3c4; }
.td-page { display: block; width: 100%; height: auto; border-radius: 8px; box-shadow: 0 0 0 1px var(--line); margin-bottom: 10px; background: #fff; cursor: zoom-in; }
.sheet-body > .title-row:first-child { padding-right: 44px; }

/* --- v13: калькулятор пирога на главной --- */
.pie-cta { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin-top: 10px; padding: 11px 13px; border-radius: var(--radius); border: 1.5px solid var(--ink); background: #fff; }
.pie-cta b { display: block; font-size: 16.5px; }
.pie-cta small { display: block; font-size: 13.5px; color: var(--muted); margin-top: 1px; }
.pie-cta > svg { margin-left: auto; width: 18px; height: 18px; color: #c2bdba; }
.pie-ic { flex: none; width: 40px; height: 40px; border-radius: 11px; background: var(--red); color: #fff; display: grid; place-items: center; }
.pie-ic svg { width: 22px; height: 22px; stroke: #fff; }
.pie-main-l { font-size: 15.5px; padding: 10px 0 6px; }
.pie-select { width: 100%; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 0 10px; font-size: 17px; }
.pie-layer { border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; margin: 10px 0; }
.pl-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pl-n { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; display: inline-grid; place-items: center; }
.pl-name { color: var(--red-dark); font-weight: 700; }
.pl-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.pl-chips .chip { padding: 6px 11px; font-size: 14px; }
.pl-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 4px; }
.pl-calc { font-size: 15px; margin-top: 6px; }
.pl-check { display: flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 14.5px; font-weight: 600; text-align: left; }
.pl-check .check { width: 22px; height: 22px; border-radius: 7px; border: 2px solid #c9c4c1; display: flex; align-items: center; justify-content: center; background: #fff; flex: none; }
.pl-check.on .check { background: var(--red); border-color: var(--red); }
.pl-check.on .check::after { content: ""; width: 6px; height: 11px; border: solid #fff; border-width: 0 3px 3px 0; transform: rotate(45deg) translate(-1px, -1px); }

/* --- v14: «Не знаю — выберу цвет» рядом с кнопками баз --- */
.base-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.base-chips .chip { padding: 7px 12px; font-size: 14.5px; }
.pie-layer .okline { margin: 4px 0 0; }

/* ---------- приложение завода: «Заказы дилеров» ---------- */
.tabbar.three { grid-template-columns: repeat(3, 1fr); }
.tabbar button[hidden] { display: none; }
.fo-search { margin-bottom: 8px; }
.fo-chips { margin-bottom: 6px; }
.fo-bar { display: flex; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.fo-more .crow .val input { width: 92px; font-size: 16.5px; }
.fo-dates input[type=date] { width: 132px !important; text-align: left; padding: 0 6px; font-size: 15px !important; }
.fo-dates-row { flex-wrap: wrap; }
.fo-more .pl-check { margin-top: 10px; }
.fo-more .link-btn { display: block; margin-top: 6px; }
.fo-sum { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; font-size: 15.5px; border-top: 1px solid var(--line); margin-top: 4px; }
.fo-sum .new-t { color: var(--red-dark); font-weight: 700; }
.fo-order { padding: 0; overflow: hidden; }
.fo-order.is-new { border-color: var(--red); box-shadow: 0 0 0 1px var(--red) inset; }
.fo-open { display: block; width: 100%; text-align: left; padding: 13px 14px 10px; }
.fo-dealer { font-weight: 600; font-size: 16px; margin-top: 4px; }
.new-pill { font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .03em; color: #fff; background: var(--red); border-radius: 99px; padding: 2px 8px; margin-left: 8px; vertical-align: 3px; }
.fo-1c { display: flex; align-items: center; justify-content: flex-end; gap: 7px; width: 100%; padding: 9px 14px; border-top: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600; }
.fo-1c svg { width: 18px; height: 18px; fill: none; stroke: var(--red); stroke-width: 2; }
.fo-1c[disabled] { opacity: .5; }
.st-btns { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.st-btns button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 9px 2px; border-radius: 11px; border: 1.5px solid var(--line); font-size: 13.5px; font-weight: 700; color: var(--muted); }
.st-btns button b { font-size: 12px; width: 20px; height: 20px; line-height: 20px; border-radius: 50%; background: var(--surface-2); color: var(--muted); }
.st-btns button.done { color: var(--ink); border-color: var(--red-soft); background: var(--red-soft); }
.st-btns button.done b { background: var(--red); color: #fff; }
.st-btns button.on { color: #fff; border-color: var(--red); background: var(--red); }
.st-btns button.on b { background: #fff; color: var(--red); }

/* ---------- ответ менеджера в чате дилера ---------- */
.msg.mgr { align-self: flex-start; background: #fff; border: 1.5px solid var(--red); border-bottom-left-radius: 5px; }
.msg-from { font-size: 12.5px; font-weight: 700; color: var(--red-dark); margin-bottom: 3px; }

/* ---------- приложение завода: «Запросы поддержки» в стиле Telegram ---------- */
.inbox-pane { padding-top: 2px; }
.thread { display: flex; gap: 12px; width: 100%; text-align: left; padding: 10px 2px; border-bottom: 1px solid var(--line); align-items: center; }
.thread .ava { flex: none; width: 50px; height: 50px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; }
.thread.unread .ava { background: var(--red); }
.th-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.th-top, .th-bot { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.th-top b { font-size: 16.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.th-top time { flex: none; font-size: 13px; color: var(--muted); }
.th-last { color: var(--muted); font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread.unread .th-last { color: var(--ink); }
.th-un { flex: none; font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--red); color: #fff; font-size: 13px; font-weight: 700; line-height: 22px; text-align: center; }
.th-flag { align-self: flex-start; font-size: 12px; font-weight: 700; color: var(--red-dark); background: var(--red-soft); border-radius: 6px; padding: 1px 7px; margin-top: 2px; }
.th-flag-t { color: var(--red-dark); }
.sp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-right: 40px; }
.sp-head .lead { margin-bottom: 6px; }
.sp-msgs { display: flex; flex-direction: column; gap: 8px; padding: 8px 0 4px; }
.sp-msgs .msg.sp-d { align-self: flex-start; background: var(--surface); border-bottom-left-radius: 5px; }
.sp-msgs .msg.sp-b { align-self: flex-end; background: #fff; border: 1px solid var(--line); border-bottom-right-radius: 5px; color: #4a4443; }
.sp-msgs .msg.sp-b .msg-from { color: var(--muted); }
.sp-msgs .msg.sp-m { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.sp-msgs .msg.sp-m .msg-from { color: #ffb3b1; }
.msg-time { font-size: 11.5px; opacity: .6; text-align: right; margin-top: 3px; }
#foot1 .chat-input { padding: 2px 0; }
