/* Витрина магазина. Тема — data-theme на <html>, акцент — --accent (задаёт JS). */
:root {
  --accent: #111111; --on-accent: #ffffff;
  --bg: #f5f6f8; --card: #ffffff; --text: #121316; --muted: #858a93; --line: #e7e8ec; --chip: #ffffff;
  --tile: color-mix(in srgb, var(--accent) 9%, var(--card));
  --radius: 16px; --r-sm: 12px; --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, sans-serif;
  --head: var(--font); --head-weight: 700; --head-track: -.01em; --caps: none; --caps-track: 0;
  --shadow: 0 1px 2px rgba(16,20,30,.05), 0 6px 20px rgba(16,20,30,.05);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
html[data-theme="editorial"] {
  --bg: #ffffff; --card: #ffffff; --chip: transparent; --line: #e9e7e2; --muted: #8c8c8c; --text: #141414;
  --tile: #f4f3ef; --radius: 0px; --r-sm: 0px; --head-weight: 600; --head-track: .02em; --caps: uppercase; --caps-track: .16em;
  --shadow: none;
}
html[data-theme="dark"] {
  --bg: #0b0b0d; --card: #16161a; --chip: #1c1c21; --text: #f3f3f5; --muted: #8d8e98; --line: #26262c;
  --tile: color-mix(in srgb, var(--accent) 16%, #16161a); --radius: 18px; --shadow: none;
}
html[data-theme="soft"] {
  --bg: #f4ede3; --card: #fffaf3; --chip: #fffaf3; --text: #2a2017; --muted: #8b7b69; --line: #e8dccb;
  --tile: color-mix(in srgb, var(--accent) 12%, #fffaf3); --radius: 24px; --r-sm: 16px;
  --head: "Iowan Old Style", "Palatino Linotype", Georgia, serif; --head-weight: 600; --shadow: 0 8px 24px rgba(90,60,20,.07);
}
html[data-theme="telegram"] {
  --bg: var(--tg-theme-secondary-bg-color, #f1f1f4); --card: var(--tg-theme-bg-color, #fff); --chip: var(--tg-theme-bg-color, #fff);
  --text: var(--tg-theme-text-color, #111); --muted: var(--tg-theme-hint-color, #8a8a8f);
  --line: color-mix(in srgb, var(--tg-theme-hint-color, #8a8a8f) 22%, transparent);
  --tile: color-mix(in srgb, var(--accent) 12%, var(--card)); --radius: 14px; --shadow: none;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.4 var(--font); }
body { min-height: 100vh; padding-bottom: calc(96px + var(--safe-b)); overflow-x: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }
.caps { text-transform: var(--caps); letter-spacing: var(--caps-track); }

/* ---------- шапка ---------- */
.top { padding: 18px 16px 6px; display: flex; gap: 12px; align-items: center; }
.logo { flex: none; width: 46px; height: 46px; border-radius: 50%; overflow: hidden; background: var(--tile); box-shadow: 0 0 0 1px var(--line); }
.logo img { width: 100%; height: 100%; object-fit: cover; }
html[data-theme="editorial"] .logo { border-radius: 0; }
.top-txt { min-width: 0; flex: 1; }
.top h1 { margin: 0; font: var(--head-weight) 20px/1.15 var(--head); letter-spacing: var(--head-track);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-theme="editorial"] .top h1 { font-size: 15px; text-transform: uppercase; letter-spacing: .28em; }
.top p { margin: 3px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.manage { flex: none; height: 36px; padding: 0 14px; border-radius: 18px; background: var(--chip); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; }
html[data-theme="editorial"] .manage { border-radius: 0; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }

.note { margin: 8px 16px 0; padding: 10px 14px; border-radius: var(--r-sm); background: var(--tile); font-size: 13px; }

.search { display: block; margin: 12px 16px 0; position: relative; }
.search input { width: 100%; height: 44px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card);
  padding: 0 14px 0 40px; outline: none; font-size: 15px; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
html[data-theme="editorial"] .search input { border: 0; border-bottom: 1px solid var(--text); padding-left: 30px; background: transparent; }
html[data-theme="editorial"] .search svg { left: 2px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 34px; padding: 0 14px; border-radius: 17px; background: var(--chip); border: 1px solid var(--line);
  font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
html[data-theme="editorial"] .chip { border: 0; border-bottom: 1.5px solid transparent; border-radius: 0; padding: 0 2px; margin-right: 10px;
  text-transform: uppercase; letter-spacing: .14em; font-size: 11px; color: var(--muted); background: transparent; }
html[data-theme="editorial"] .chip.on { color: var(--text); border-bottom-color: var(--text); background: transparent; }

/* ---------- сетка ---------- */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px; }
html[data-theme="editorial"] .grid { gap: 26px 12px; }
.card { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); text-align: left;
  display: flex; flex-direction: column; }
html[data-theme="dark"] .card { border: 1px solid var(--line); }
html[data-theme="editorial"] .card { background: transparent; }
.ph { position: relative; aspect-ratio: 1; background: var(--tile); display: grid; place-items: center; overflow: hidden; }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .emo { font-size: 64px; line-height: 1; filter: saturate(1.05); }
.badge { position: absolute; left: 8px; top: 8px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700;
  padding: 3px 7px; border-radius: 8px; }
html[data-theme="editorial"] .badge { border-radius: 0; letter-spacing: .08em; }
.badge.off { background: #6b7280; color: #fff; }
.cb { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
html[data-theme="editorial"] .cb { padding: 10px 0 0; }
.ct { font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cp { margin-top: auto; display: flex; align-items: baseline; gap: 6px; font-weight: 700; font-size: 15px; }
.cp s, .pp s { color: var(--muted); font-weight: 400; font-size: 12.5px; }
html[data-theme="editorial"] .cp { font-size: 13px; font-weight: 600; }
.add { margin-top: 2px; height: 34px; border-radius: calc(var(--r-sm) - 2px); background: var(--tile); font-weight: 600; font-size: 13px; color: var(--text); }
.add.in { background: var(--accent); color: var(--on-accent); }
html[data-theme="editorial"] .add { border: 1px solid var(--text); background: transparent; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
html[data-theme="editorial"] .add.in { background: var(--text); color: var(--bg); }

.empty { text-align: center; color: var(--muted); padding: 60px 30px; }
.empty b { display: block; font-size: 44px; margin-bottom: 8px; }
.closed { padding: 80px 30px; text-align: center; }
.closed h2 { font: var(--head-weight) 22px/1.2 var(--head); margin: 10px 0 6px; }
.closed p { color: var(--muted); margin: 0; }

/* ---------- корзина ---------- */
.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 20; height: 56px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent); display: flex; align-items: center; justify-content: space-between; padding: 0 18px;
  font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: up .25s ease; }
.cartbar span { opacity: .85; font-weight: 500; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* ---------- шторки ---------- */
.veil { position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 40; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow-y: auto; background: var(--card);
  border-radius: calc(var(--radius) + 6px) calc(var(--radius) + 6px) 0 0; padding: 0 0 calc(18px + var(--safe-b));
  animation: sheet .28s cubic-bezier(.2,.8,.2,1); overscroll-behavior: contain; }
html[data-theme="editorial"] .sheet { border-radius: 0; }
@keyframes sheet { from { transform: translateY(100%); } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; position: relative; }
.grab::after { content: ""; position: absolute; left: -60px; right: -60px; top: -10px; bottom: -12px; }  /* за ручку легко взяться пальцем */
.veil { transition: opacity .2s; }
.x { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.35); color: #fff;
  font-size: 20px; line-height: 34px; z-index: 2; }
.gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--tile); }
.gal::-webkit-scrollbar { display: none; }
.gal > * { flex: none; width: 100%; aspect-ratio: 1; scroll-snap-align: start; object-fit: cover; display: grid; place-items: center; }
.gal .emo { font-size: 120px; }
.dots { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--accent); width: 16px; }
.pad { padding: 16px 18px 0; }
.pt { margin: 0; font: var(--head-weight) 21px/1.22 var(--head); letter-spacing: var(--head-track); }
.pp { margin-top: 8px; display: flex; gap: 8px; align-items: baseline; font-size: 20px; font-weight: 700; }
.pd { margin-top: 12px; color: var(--muted); white-space: pre-line; font-size: 14.5px; }
.lbl { margin: 18px 0 8px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opts button { min-width: 48px; height: 40px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); font-weight: 500; }
.opts button.on { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn { width: 100%; height: 52px; border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; margin-top: 18px; }
html[data-theme="editorial"] .btn { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; }
.btn.ghost { background: var(--tile); color: var(--text); }
.btn.danger { background: transparent; color: #d93025; border: 1px solid color-mix(in srgb, #d93025 30%, transparent); }
.btn:disabled { opacity: .5; }
.h2 { margin: 18px 18px 4px; font: var(--head-weight) 20px/1.2 var(--head); }
.line { display: flex; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.line .ph { width: 56px; flex: none; border-radius: var(--r-sm); }
.line .ph .emo { font-size: 28px; }
.line .t { flex: 1; min-width: 0; font-size: 14px; }
.line .t small { display: block; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 2px; background: var(--tile); border-radius: 18px; }
.qty button { width: 32px; height: 32px; font-size: 18px; font-weight: 600; }
.qty b { min-width: 18px; text-align: center; font-size: 14px; }
.sum { display: flex; justify-content: space-between; padding: 14px 18px 0; font-size: 17px; font-weight: 700; }
.form { padding: 0 18px; }
.field { display: block; margin-top: 12px; }
.field span { display: block; font-size: 12.5px; color: var(--muted); margin: 0 0 5px 2px; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm);
  padding: 12px 13px; outline: none; font-size: 15px; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.err { color: #d93025; font-size: 13.5px; margin-top: 10px; }
.ok { text-align: center; padding: 34px 24px 8px; }
.ok b { font-size: 56px; display: block; }
.ok h3 { font: var(--head-weight) 22px/1.2 var(--head); margin: 10px 0 6px; }
.ok p { color: var(--muted); margin: 0; }
.info { margin: 14px 18px 0; padding: 12px 14px; background: var(--tile); border-radius: var(--r-sm); font-size: 13.5px; }

/* ---------- управление ---------- */
.tabs { display: flex; gap: 6px; padding: 12px 16px 4px; }
.tabs button { flex: 1; height: 38px; border-radius: var(--r-sm); background: var(--chip); border: 1px solid var(--line); font-weight: 600; font-size: 13.5px; }
.tabs button.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.list { padding: 8px 16px; display: grid; gap: 10px; }
.row { display: flex; gap: 12px; align-items: center; background: var(--card); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); text-align: left; width: 100%; }
html[data-theme="dark"] .row, html[data-theme="editorial"] .row { border: 1px solid var(--line); }
.row .ph { width: 58px; flex: none; border-radius: var(--r-sm); }
.row .ph .emo { font-size: 30px; }
.row .t { flex: 1; min-width: 0; }
.row .t b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .t small { color: var(--muted); font-size: 13px; }
.pill { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 10px; background: var(--tile); white-space: nowrap; }
.pill.new { background: var(--accent); color: var(--on-accent); }
.plus { margin: 4px 16px 0; height: 50px; width: calc(100% - 32px); border-radius: var(--radius); border: 1.5px dashed var(--line); font-weight: 600; color: var(--accent); background: var(--card); }
.photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.photos > * { aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; position: relative; background: var(--tile); }
.photos img { width: 100%; height: 100%; object-fit: cover; }
.photos .del { position: absolute; right: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; font-size: 13px; line-height: 22px; }
.photos .main { position: absolute; left: 3px; bottom: 3px; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; padding: 1px 5px; border-radius: 6px; }
.photos label { display: grid; place-items: center; font-size: 26px; color: var(--muted); border: 1.5px dashed var(--line); background: transparent; cursor: pointer; }
.toggle { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding: 12px 2px; font-weight: 500; }
.toggle input { width: 46px; height: 28px; appearance: none; border-radius: 14px; background: var(--line); position: relative; transition: background .2s; }
.toggle input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(18px); }
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.th { border: 2px solid var(--line); border-radius: 14px; padding: 8px; text-align: left; background: var(--card); }
.th.on { border-color: var(--accent); }
.th i { display: block; height: 46px; border-radius: 8px; margin-bottom: 6px; }
.th span { font-size: 12.5px; font-weight: 600; }
.sw { display: flex; gap: 10px; flex-wrap: wrap; }
.sw button { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 1px var(--line); }
.sw button.on { box-shadow: 0 0 0 2px var(--text); }
.sub { margin: 12px 16px 0; padding: 14px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); font-size: 13.5px; }
.sub b { display: block; font-size: 15px; margin-bottom: 4px; }
.sub button { margin-top: 10px; color: var(--accent); font-weight: 700; }
.toast { position: fixed; left: 50%; bottom: calc(84px + var(--safe-b)); transform: translateX(-50%); background: #111; color: #fff; padding: 10px 16px;
  border-radius: 12px; font-size: 14px; z-index: 60; animation: up .2s ease; max-width: 90vw; }

/* вкладки управления — 4 штуки в ряд */
.tabs { gap: 5px; }
.tabs button { font-size: 12.5px; padding: 0 4px; white-space: nowrap; }

/* режим приёма заказов */
.modes { display: grid; gap: 8px; }
.mode { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); }
.mode.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mode em { font-style: normal; font-size: 22px; line-height: 1.2; }
.mode b { display: block; font-size: 14.5px; }
.mode small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; line-height: 1.35; }

/* статистика */
.muted { color: var(--muted); font-size: 12.5px; margin: 0; }
.period { display: flex; gap: 6px; padding: 12px 16px 0; }
.period button { flex: 1; height: 34px; border-radius: 17px; border: 1px solid var(--line); background: var(--chip); font-size: 13px; font-weight: 600; }
.period button.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.period.small { padding: 0 0 12px; }
.period.small button { height: 30px; font-size: 12px; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 0; }
.kpi { background: var(--card); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); position: relative; }
html[data-theme="dark"] .kpi, html[data-theme="editorial"] .kpi { border: 1px solid var(--line); }
.kpi span { display: block; color: var(--muted); font-size: 12px; }
.kpi b { display: block; font-size: 20px; margin-top: 2px; letter-spacing: -.01em; }
.kpi i { position: absolute; right: 12px; top: 12px; font-style: normal; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.kpi i.up { color: #16a34a; } .kpi i.down { color: #e5484d; }
.panel { margin: 10px 16px 0; background: var(--card); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
html[data-theme="dark"] .panel, html[data-theme="editorial"] .panel { border: 1px solid var(--line); }
.panel h3 { margin: 0 0 10px; font: var(--head-weight) 16px/1.2 var(--head); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding-bottom: 18px; position: relative; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; min-width: 0; }
.bar i { display: block; background: var(--accent); border-radius: 4px 4px 1px 1px; min-height: 2px; opacity: .9; }
.bar span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--muted); white-space: nowrap; }
.fun { margin-top: 10px; }
.fun div { display: flex; justify-content: space-between; font-size: 13.5px; margin-bottom: 4px; }
.fun i { display: block; height: 8px; border-radius: 4px; background: var(--tile); overflow: hidden; }
.fun s { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.toprow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.toprow:first-of-type { border-top: 0; }
.toprow span { width: 20px; color: var(--muted); font-weight: 700; }
.toprow b { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toprow em { font-style: normal; color: var(--muted); white-space: nowrap; }
.stat-pills { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== новые темы ===== */
html[data-theme="mono"] {
  --bg: #ffffff; --card: #ffffff; --chip: #ffffff; --text: #0a0a0a; --muted: #6b6b6b; --line: #0a0a0a;
  --tile: #f2f2f2; --radius: 0px; --r-sm: 0px; --head-weight: 900; --head-track: -.03em; --shadow: none;
}
html[data-theme="mono"] .card, html[data-theme="mono"] .row, html[data-theme="mono"] .kpi, html[data-theme="mono"] .panel { border: 2px solid #0a0a0a; }
html[data-theme="mono"] .top h1 { font-size: 24px; text-transform: uppercase; }
html[data-theme="mono"] .chip, html[data-theme="mono"] .search input, html[data-theme="mono"] .add, html[data-theme="mono"] .manage { border: 2px solid #0a0a0a; border-radius: 0; }
html[data-theme="mono"] .ct { font-weight: 700; text-transform: uppercase; font-size: 12.5px; letter-spacing: .02em; }
html[data-theme="ocean"] {
  --bg: #eaf2fb; --card: #ffffff; --chip: #ffffff; --text: #0d2238; --muted: #6a7f96; --line: #d6e3f1;
  --tile: color-mix(in srgb, var(--accent) 10%, #f4f8fd); --radius: 22px; --r-sm: 14px;
  --shadow: 0 6px 22px rgba(30,80,140,.08);
}
html[data-theme="luxe"] {
  --bg: #12100d; --card: #1b1814; --chip: #1b1814; --text: #f2eadb; --muted: #9d9282; --line: #2e2922;
  --tile: #221e18; --radius: 6px; --r-sm: 4px; --head: "Didot", "Bodoni 72", "Playfair Display", Georgia, serif;
  --head-weight: 500; --head-track: .01em; --shadow: none;
}
html[data-theme="luxe"] .card { border: 1px solid var(--line); }
html[data-theme="luxe"] .top h1 { font-size: 23px; }
html[data-theme="luxe"] .add, html[data-theme="luxe"] .chip { text-transform: uppercase; letter-spacing: .12em; font-size: 11px; }

/* ===== шапка ===== */
.cover { display: none; }
html[data-header="simple"] .top { padding-top: 20px; }
html[data-header="center"] .top { flex-direction: column; text-align: center; padding: 28px 16px 8px; position: relative; gap: 10px; }
html[data-header="center"] .top-txt { width: 100%; }
html[data-header="center"] .top h1 { font-size: 26px; white-space: normal; }
html[data-header="center"] .logo { width: 64px; height: 64px; }
html[data-header="center"] .manage, html[data-header="banner"] .manage { position: absolute; right: 12px; top: 12px; }
html[data-header="banner"] .top { display: block; position: relative; padding: 0; margin: 0 0 6px; }
html[data-header="banner"] .cover { display: block; height: 210px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #000)) center/cover; }
html[data-header="banner"] .cover::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 210px; background: linear-gradient(180deg, rgba(0,0,0,0) 35%, rgba(0,0,0,.6)); }
html[data-header="banner"] .top-txt { position: absolute; left: 16px; right: 16px; top: 132px; color: #fff; z-index: 1; }
html[data-header="banner"] .top h1 { font-size: 25px; color: #fff; white-space: normal; }
html[data-header="banner"] .top p { color: rgba(255,255,255,.85); }
html[data-header="banner"] .logo { position: absolute; left: 16px; top: 74px; z-index: 1; width: 52px; height: 52px; box-shadow: 0 0 0 2px #fff; }
html[data-header="banner"] .manage { background: rgba(0,0,0,.45); color: #fff; border-color: transparent; z-index: 2; backdrop-filter: blur(8px); }
html[data-header="banner"] .logo[hidden] + .top-txt { top: 140px; }

/* ===== карточки ===== */
html[data-layout="big"] .grid { grid-template-columns: 1fr; gap: 16px; }
html[data-layout="big"] .ph { aspect-ratio: 4 / 3; }
html[data-layout="big"] .ph .emo { font-size: 96px; }
html[data-layout="big"] .ct { font-size: 16px; -webkit-line-clamp: 2; }
html[data-layout="big"] .cp { font-size: 18px; }
html[data-layout="big"] .add { height: 42px; font-size: 14px; }
html[data-layout="three"] .grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
html[data-layout="three"] .cb { padding: 7px 8px 9px; gap: 4px; }
html[data-layout="three"] .ct { font-size: 12px; }
html[data-layout="three"] .cp { font-size: 13px; }
html[data-layout="three"] .cp s { display: none; }
html[data-layout="three"] .ph .emo { font-size: 40px; }
html[data-layout="three"] .add { height: 28px; font-size: 11px; }
html[data-layout="three"] .badge { font-size: 9.5px; padding: 2px 5px; }
html[data-layout="list"] .grid { grid-template-columns: 1fr; gap: 10px; }
html[data-layout="list"] .card { flex-direction: row; }
html[data-layout="list"] .ph { width: 116px; flex: none; aspect-ratio: 1; }
html[data-layout="list"] .ph .emo { font-size: 48px; }
html[data-layout="list"] .cb { padding: 12px 14px; }
html[data-layout="list"] .ct { font-size: 15px; }
html[data-layout="list"] .add { align-self: flex-start; padding: 0 16px; }

/* ===== выбор вида в настройках ===== */
.variants { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.vr { border: 2px solid var(--line); border-radius: 12px; padding: 7px; background: var(--card); text-align: center; }
.vr.on { border-color: var(--accent); }
.vr span { display: block; font-size: 11.5px; font-weight: 600; margin-top: 6px; line-height: 1.2; }
.vr i { display: block; height: 54px; border-radius: 6px; background: var(--bg); position: relative; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.hv s, .hv b, .hv u { position: absolute; display: block; text-decoration: none; }
.hv b { height: 6px; border-radius: 3px; background: var(--text); opacity: .8; width: 50%; }
.hv u { height: 4px; border-radius: 2px; background: var(--muted); opacity: .6; width: 34%; }
.hv-simple b { left: 8px; top: 14px; } .hv-simple u { left: 8px; top: 25px; }
.hv-logo s { left: 7px; top: 11px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); }
.hv-logo b { left: 30px; top: 13px; width: 40%; } .hv-logo u { left: 30px; top: 24px; }
.hv-banner s { left: 0; right: 0; top: 0; height: 34px; background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 40%, #000)); }
.hv-banner b { left: 7px; top: 21px; background: #fff; width: 45%; } .hv-banner u { left: 7px; top: 40px; }
.hv-center s { left: 50%; top: 7px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%; background: var(--accent); }
.hv-center b { left: 25%; top: 28px; } .hv-center u { left: 33%; top: 39px; }
.lv { display: grid !important; gap: 3px; padding: 5px; }
.lv b { background: color-mix(in srgb, var(--accent) 35%, var(--tile)); border-radius: 3px; }
.lv-grid { grid-template-columns: 1fr 1fr; } .lv-three { grid-template-columns: repeat(3, 1fr); }
.lv-big { grid-template-columns: 1fr; } .lv-list { grid-template-columns: 1fr; }
.lv-list b { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 35%, var(--tile)) 0 32%, var(--tile) 32%); }
.uploads { display: grid; gap: 8px; margin-top: 10px; }
.up { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); }
.up-img { width: 56px; height: 56px; flex: none; border-radius: 50%; background: var(--tile); display: grid; place-items: center; color: var(--muted); overflow: hidden; font-size: 20px; }
.up-img.wide { width: 84px; border-radius: 10px; }
.up-img img { width: 100%; height: 100%; object-fit: cover; }
.up b { display: block; font-size: 14px; }
.up small { display: block; color: var(--muted); font-size: 12px; margin: 2px 0 6px; }
.up-btn { color: var(--accent); font-weight: 700; font-size: 13.5px; cursor: pointer; }
html[data-theme="dark"] .up-btn, html[data-theme="luxe"] .up-btn { color: var(--text); }
.up-del { color: var(--muted); font-size: 13px; margin-left: 10px; }

/* ссылки в настройках */
.links { display: grid; gap: 10px; }
.links > div { padding: 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); display: grid; gap: 6px; }
.links small { color: var(--muted); font-size: 12px; }
.links code { font: 12.5px/1.4 ui-monospace, Menlo, monospace; word-break: break-all; user-select: all; -webkit-user-select: all; }
.links button { justify-self: start; color: var(--accent); font-weight: 700; font-size: 13.5px; }
html[data-theme="dark"] .links button, html[data-theme="luxe"] .links button { color: var(--text); }

/* ===== полноэкранный режим Telegram =====
   В fullscreen контент уходит под строку состояния и кнопки Telegram; их высоту Telegram отдаёт в переменных.
   В обычном режиме переменные равны 0 — витрина выглядит как раньше. */
:root {
  --safe-top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
}
.top { padding-top: calc(18px + var(--safe-top)); }
html[data-header="simple"] .top { padding-top: calc(20px + var(--safe-top)); }
html[data-header="center"] .top { padding-top: calc(28px + var(--safe-top)); }
html[data-header="center"] .manage { top: calc(12px + var(--safe-top)); }
/* обложка уходит под строку состояния (красиво), текст и кнопки — ниже безопасной зоны */
html[data-header="banner"] .cover { height: calc(210px + var(--safe-top)); }
html[data-header="banner"] .cover::after { height: calc(210px + var(--safe-top)); }
html[data-header="banner"] .top-txt { top: calc(132px + var(--safe-top)); }
html[data-header="banner"] .logo { top: calc(74px + var(--safe-top)); }
html[data-header="banner"] .logo[hidden] + .top-txt { top: calc(140px + var(--safe-top)); }
html[data-header="banner"] .manage { top: calc(12px + var(--safe-top)); }
/* шторки не заезжают под кнопки Telegram */
.sheet { max-height: calc(100vh - var(--safe-top) - 12px); }
.closed { padding-top: calc(80px + var(--safe-top)); }

/* выбор раздела из уже созданных */
.catpick { margin-top: 8px; }
.catpick small { display: block; color: var(--muted); font-size: 12px; margin: 0 0 6px 2px; }
.catpick div { display: flex; flex-wrap: wrap; gap: 6px; }
.catpick button { height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); font-size: 13px; font-weight: 500; }
.catpick button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
/* переключатель языка для покупателей */
.langsw { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px 0 6px; }
.langsw button { color: var(--muted); font-size: 12.5px; padding: 4px 2px; }
.langsw button.on { color: var(--text); font-weight: 700; }

/* «Сделано в @бот» — у бесплатных магазинов */
.madewith { display: block; text-align: center; font-size: 11.5px; color: var(--muted); text-decoration: none; padding: 22px 0 0; opacity: .75; letter-spacing: .01em; }
.madewith:active { opacity: 1; }

/* ---------- контакты продавца (витрина вне Telegram и для всех) ---------- */
.contacts { margin: 26px 16px 0; text-align: center; }
.contacts small { display: block; color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.contacts .cl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.contacts a { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--card);
  color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; box-shadow: inset 0 0 0 1px var(--line, rgba(0,0,0,.08)); }
.contacts a:active { opacity: .7; }
.via { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.via button { border: 0; padding: 8px 12px; border-radius: 999px; background: var(--bg); color: var(--text); font: 600 13.5px var(--font);
  box-shadow: inset 0 0 0 1px var(--line, rgba(0,0,0,.1)); cursor: pointer; }
.via button.on { background: var(--accent); color: var(--on-accent); box-shadow: none; }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.okbtns { display: grid; gap: 8px; margin-top: 4px; }

/* ---------- обычный браузер на компьютере: витрина шириной с телефон по центру ---------- */
@media (min-width: 700px) {
  body { max-width: 520px; margin: 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 20px 60px rgba(0,0,0,.06); }
  .cartbar { left: calc(50% - 248px); right: calc(50% - 248px); }
  .sheet { left: calc(50% - 260px); right: calc(50% - 260px); }
}

/* ---------- плавность во встроенных браузерах (Instagram, WhatsApp, VK) и в Telegram ---------- */
html, body { overscroll-behavior-y: none; }                 /* без «резинки» и случайного обновления страницы */
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; }
.sheet { max-height: 92vh; max-height: 92dvh; touch-action: pan-y; -webkit-overflow-scrolling: touch; }
.gal { touch-action: pan-x pan-y; }
.veil { touch-action: none; }
.card, .add, .cartbar, .chips button { touch-action: manipulation; } /* без задержки и двойного касания для зума */
@media (min-width: 1px) { .sheet { max-height: calc(100dvh - var(--safe-top, 0px) - 12px); } }
@supports not (height: 100dvh) { .sheet { max-height: calc(100vh - var(--safe-top, 0px) - 12px); } }

/* ---------- листание фото прямо в карточке витрины ---------- */
.ph > .cg { position: absolute; inset: 0; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory;
  scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.cg::-webkit-scrollbar { display: none; }
.cg img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: start; scroll-snap-stop: always;
  -webkit-user-drag: none; user-select: none; }
.cdots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 4px; pointer-events: none; z-index: 1; }
.cdots i { width: 5px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.6); box-shadow: 0 0 3px rgba(0,0,0,.35); transition: width .2s, background .2s; }
.cdots i.on { width: 12px; background: #fff; }
html[data-layout="three"] .cdots { bottom: 5px; gap: 3px; }
html[data-layout="three"] .cdots i { width: 4px; height: 4px; }
html[data-layout="three"] .cdots i.on { width: 9px; }
