/* Адмінка й редактор: графіт і акцент сайту. Акцент задає config.theme.accent, тут — типовий. */
:root {
  --bg: #121211;
  --panel: #1c1b19;
  --panel-2: #262522;
  --line: rgb(251 247 239 / .1);
  --text: #fbf7ef;
  --muted: rgb(251 247 239 / .58);
  --faint: rgb(251 247 239 / .4);
  --accent: #f4d94e;
  --accent-rgb: 244 217 78;
  --accent-ink: #b38f00;
  --on-accent: #1c1b19;
  --accent-hover: #f5c02e;
  --ok: #5fd39a;
  --warn: #f5c02e;
  --bad: #ff6f61;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--text); font: 500 14px/1.5 "Montserrat", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3, p, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
code { font-size: 12px; color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.brand { display: flex; align-items: center; gap: 9px; margin: 0; font-size: 17px; font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.brand span { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

.shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; padding: 20px 14px 14px; border-right: 1px solid var(--line); background: #0d0d0c; }
.side > .brand { padding: 0 10px 18px; }
.btn.side__toggle { display: none; }
.nav a { display: block; padding: 8px 12px; border-radius: 12px; color: var(--muted); text-decoration: none; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a[aria-current] { background: rgb(var(--accent-rgb) / .12); color: var(--accent); }
.nav p { margin: 14px 12px 4px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgb(251 247 239 / .32); }
.side__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

.main { min-width: 0; max-width: 1180px; padding: 28px 32px 80px; display: flex; flex-direction: column; gap: 16px; }
.head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 16px; }
.head h1 { font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
.head p { color: var(--muted); margin-top: 4px; max-width: 70ch; }
.crumbs a { color: var(--muted); }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 15px; margin-bottom: 14px; }
.card h2 small, .card h2 .link { font-weight: 500; color: var(--muted); margin-left: 6px; font-size: 12px; }
.card--table { padding: 14px 10px; overflow-x: auto; }
.grid { display: grid; gap: 16px; align-items: start; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: stretch; }
.stat { display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.stat:hover { border-color: rgb(var(--accent-rgb) / .5); }
.stat span, .stat small { color: var(--muted); font-size: 12px; }
.stat b { font-size: 30px; letter-spacing: -.02em; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px; border-radius: 40px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: rgb(251 247 239 / .28); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .42; pointer-events: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { color: var(--bad); }
.btn-sm { min-height: 30px; padding: 0 12px; font-size: 12px; }
.link { padding: 0; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

.form { display: flex; flex-direction: column; gap: 14px; }
.card + .form, .form > .card + .card { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field__label { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text); }
.field__label .link { margin-left: auto; }
.field__label em { font-style: normal; }
/* пояснення напівпрозорі, щоб не зливалися з назвами полів */
.field small, .hint { color: var(--faint); font-size: 12px; line-height: 1.55; }
.input { width: 100%; min-height: 40px; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: #111110; outline: none; }
.input:focus { border-color: rgb(var(--accent-rgb) / .65); }
.input--sm { min-height: 32px; padding: 5px 10px; font-size: 13px; width: auto; }
textarea.input { resize: vertical; line-height: 1.5; }
.mono { font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.toolbar { display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 10px; }

.table { width: 100%; border-collapse: collapse; }
.table th { padding: 0 10px 10px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.table td { padding: 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.table td small { display: block; color: var(--muted); font-size: 12px; }
.table td a { text-decoration: none; }
.table .num { text-align: right; white-space: nowrap; }
.link-row { cursor: pointer; }
.link-row:hover td { background: rgb(251 247 239 / .025); }
.thumb { width: 46px; height: 46px; min-width: 46px; border-radius: 10px; object-fit: contain; background: #fff; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; margin: 2px 4px 2px 0; border-radius: 20px; border: 1px solid var(--line); background: var(--panel-2); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); }
.badge.warn { color: var(--warn); }
.badge.bad { color: var(--bad); }
.badge.muted { color: var(--muted); }

.record { display: flex; flex-direction: column; gap: 10px; }
.record__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.record__head time { margin-left: auto; color: var(--muted); font-size: 12px; }
.record__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.record__foot input { flex: 1; min-width: 180px; }

/* ───────────── список, як у Shopify: вкладки, фільтри, масові дії ───────────── */
.view { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.head__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.nav__sub { padding-left: 28px !important; font-size: 13px; }
.nav a b { margin-left: auto; padding: 0 7px; border-radius: 20px; background: var(--accent); color: var(--on-accent); font-size: 11px; }
.nav a b:empty { display: none; }
.nav a { display: flex; align-items: center; gap: 8px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 0 4px 10px; border-bottom: 1px solid var(--line); }
.tabs button { padding: 6px 12px; border: 0; border-radius: 20px; background: none; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; }
.tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.tabs small { color: var(--muted); font-weight: 500; }
.card--table .toolbar { padding: 10px 4px; }
.toolbar { grid-template-columns: minmax(0, 1fr); }
.toolbar--products { grid-template-columns: minmax(200px, 1.6fr) repeat(4, minmax(0, 1fr)); }
.bulk { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 10px 12px; border-radius: 12px; background: rgb(var(--accent-rgb) / .1); }
.bulk__actions { margin-left: auto; }
.table-scroll { overflow-x: auto; }
.cell-check { width: 34px; }
.cell-check input, .table th input { width: 16px; height: 16px; accent-color: var(--accent); }
.cell-image { width: 56px; }
.table--products .cell-title { min-width: 240px; }
.table--products .cell-stock, .table--products .cell-category, .table--products .cell-brand { font-size: 13px; white-space: nowrap; }
.table .num s { display: block; color: var(--muted); font-size: 12px; }
.is-selected td { background: rgb(var(--accent-rgb) / .07); }
.is-bad { color: var(--bad); }
.quick td { background: #151513; }
.quick__form { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.quick__form .input { width: 140px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 6px 2px; color: var(--muted); font-size: 13px; }

/* ───────────── картка товару й категорії ───────────── */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.editor__main, .editor__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.editor__main > .card + .card, .editor__side > .card + .card { margin-top: 0; }
.editor__lang { display: flex; align-items: center; gap: 10px; }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.steps { display: inline-flex; gap: 4px; }
.btn.is-off { opacity: .35; pointer-events: none; }
.media { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; }
.media li { position: relative; cursor: grab; }
.media img { width: 118px; height: 118px; object-fit: contain; border-radius: 12px; background: #fff; }
.media li:first-child img { width: 160px; height: 160px; }
.media em { position: absolute; left: 6px; bottom: 6px; padding: 1px 8px; border-radius: 20px; background: var(--accent); color: var(--on-accent); font-size: 10px; font-style: normal; font-weight: 700; }
.media button { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgb(0 0 0 / .65); color: #fff; cursor: pointer; font-size: 12px; }
.media__empty { color: var(--muted); font-size: 13px; cursor: default !important; }
.card.is-over { border-color: var(--accent); border-style: dashed; }
.specs { display: flex; flex-direction: column; gap: 14px; }
.specs__group { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.specs__head, .specs__row { display: grid; align-items: center; gap: 6px; }
.specs__head { grid-template-columns: minmax(0, 1fr) 28px 28px 28px; }
.specs__head .input { font-weight: 700; }
.specs__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 28px 28px 28px; }
.specs__group .link { align-self: flex-start; margin-top: 4px; }
.specs button:not(.btn):not(.link), .linked button, .sortable button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.specs button:not(.btn):not(.link):hover, .linked button:hover, .sortable button:hover { background: rgb(251 247 239 / .1); color: var(--text); }
.specs button:disabled, .linked button:disabled, .sortable button:disabled { opacity: .25; pointer-events: none; }
.facet { margin-bottom: 14px; }
.facet .field__label { margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-button { min-height: 30px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 20px; background: none; cursor: pointer; font-size: 12px; text-align: left; }
.chip-button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.chip-button--add { border-style: dashed; color: var(--muted); }
.linked, .sortable { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; padding: 0; list-style: none; }
.linked li, .sortable li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 12px; }
.linked li.hint, .sortable li.hint { border: 0; padding: 0; }
.linked a, .sortable a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: none; font-size: 13px; }
.sortable li { cursor: grab; }
.sortable li.is-dragging { opacity: .4; }
.sortable__grip { color: rgb(251 247 239 / .3); letter-spacing: -3px; }
.sortable button[data-star][aria-pressed="true"] { color: var(--accent); }
.serp { padding: 12px 14px; border-radius: 12px; background: #fff; color: #1c1b19; font-family: Arial, sans-serif; }
.serp small { display: block; color: #4d5156; font-size: 12px; }
.serp b { display: block; color: #1a0dab; font-size: 17px; font-weight: 400; line-height: 1.35; }
.serp p { color: #4d5156; font-size: 13px; line-height: 1.5; }
.savebar { position: fixed; z-index: 50; top: 10px; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 20px); padding: 8px 8px 8px 18px; border: 1px solid rgb(var(--accent-rgb) / .5); border-radius: 40px; background: #25241f; box-shadow: 0 12px 40px rgb(0 0 0 / .55); font-weight: 600; font-size: 13px; white-space: nowrap; }
.picker { max-height: 480px; overflow-y: auto; margin: 10px 0 0; padding: 0; list-style: none; }
.picker button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 1px solid transparent; border-radius: 12px; background: none; cursor: pointer; text-align: left; }
.picker button:hover { background: var(--panel-2); }
.picker button[aria-pressed="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.picker small { display: block; color: var(--muted); font-size: 12px; }
.log { max-height: 260px; overflow-y: auto; margin: 0; padding-left: 18px; font-size: 13px; }

/* ───────────── редактор форматованого тексту ───────────── */
.rich { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); border-radius: 12px; background: #111110; }
.rich:focus-within { border-color: #4d90ff; box-shadow: 0 0 0 3px rgb(47 125 255 / .28); }
.rich__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border-bottom: 1px solid var(--line); }
.rich__group { display: inline-flex; gap: 1px; padding-right: 4px; border-right: 1px solid var(--line); }
.rich__group:last-child { border-right: 0; }
.rich__bar button { display: grid; place-items: center; min-width: 28px; height: 28px; padding: 0 5px; border: 0; border-radius: 7px; background: none; cursor: pointer; font-size: 13px; }
.rich__bar button:hover { background: rgb(251 247 239 / .1); }
.rich__bar button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.rich__bar button:disabled, .rich__bar .is-off { opacity: .3; pointer-events: none; }
.rich__bar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.rich__bar select { height: 28px; max-width: 108px; padding: 0 4px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); font-size: 12px; }
/* поле «папірець»: кольори тексту видно такими, як на світлих секціях сайту */
.rich__area { min-height: 120px; max-height: 420px; overflow: auto; padding: 12px 14px; border-radius: 0 0 11px 11px; background: #fbf7ef; color: #1c1b19; line-height: 1.55; outline: none; overflow-wrap: anywhere; }
.rich__area > :first-child { margin-top: 0; }
.rich__area > :last-child { margin-bottom: 0; }
.rich__area p, .rich__area ul, .rich__area ol, .rich__area blockquote { margin: 0 0 .6em; }
.rich__area h2 { margin: .8em 0 .4em; font-size: 1.35em; }
.rich__area h3 { margin: .8em 0 .4em; font-size: 1.15em; }
.rich__area ul, .rich__area ol { padding-left: 1.4em; }
.rich__area blockquote { padding-left: .9em; border-left: 3px solid #c9c4ba; }
.rich__area a { color: #1456c7; }
.rich__area rt-c.rt-accent { color: var(--accent-ink); }
.rich__area rt-c.rt-dark { color: #1c1b19; }
.rich__area rt-c.rt-muted { opacity: .6; }
.rich__area rt-c.rt-light { color: #fbf7ef; background: #6b6860; }
.rich__area rt-c.rt-mark { background: var(--accent); color: var(--on-accent); }
.rich__area rt-c.rt-big { font-size: 1.2em; }
.rich__area rt-c.rt-small { font-size: .82em; }
.rich__area .rt-center { text-align: center; }
.rich__area .rt-right { text-align: right; }
.rich__code { width: 100%; min-height: 160px; padding: 12px; border: 0; border-radius: 0 0 11px 11px; background: #0d0d0c; font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; outline: none; resize: vertical; }
.rich--wide { position: fixed; z-index: 80; inset: 24px max(24px, calc(50vw - 480px)); box-shadow: 0 0 0 100vmax rgb(0 0 0 / .7); }
.rich--wide .rich__area, .rich--wide .rich__code { flex: 1; min-height: 0; max-height: none; font-size: 16px; }
.field__tools { display: inline-flex; gap: 10px; margin-left: auto; }
.field__tools:empty { display: none; }
.field__tools .link { margin-left: 0; }
.ed-panel .rich__area { max-height: 300px; font-size: 13px; }
.ed-panel .rich--wide .rich__area { max-height: none; font-size: 16px; }

/* ───────────── головна й замовлення ───────────── */
.chart { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; align-items: end; gap: 3px; height: 120px; }
.chart span { height: max(2px, calc(var(--h) * 100%)); border-radius: 4px 4px 0 0; background: var(--accent); }
.stat b.small { font-size: 18px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.timeline time { color: var(--muted); }
.timeline small { display: block; color: var(--muted); }
@media print {
  .side, .editor__side, .head__actions, .savebar { display: none !important; }
  .shell, .editor { display: block; }
  body { background: #fff; color: #000; }
  .card { border-color: #ddd; background: #fff; }
}

.library { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.library figure { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
.library img { width: 100%; height: 150px; object-fit: contain; border-radius: 10px; background: #0d0d0c; }
.library figcaption { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.library figcaption span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library figcaption small { color: var(--muted); white-space: nowrap; }
.og { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; }

.modal { width: min(860px, calc(100vw - 32px)); max-height: min(720px, calc(100vh - 32px)); padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); }
.modal--small { width: min(480px, calc(100vw - 32px)); }
/* вибір, куди веде посилання */
.links__tabs { align-self: flex-start; margin-bottom: 3px; }
.links__list { height: 240px; margin: 3px 0 0; border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.links__list b { display: block; font-size: 13px; font-weight: 600; }
.links__list li.hint { padding: 8px; }
.links__list span { min-width: 0; }
.links__list small { overflow-wrap: anywhere; }
.field__pick { align-self: flex-start; }
.modal::backdrop { background: rgb(0 0 0 / .65); }
.modal h3 { margin: 18px 0 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.modal__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.modal__head h2 { margin-right: auto; font-size: 18px; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shot { padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: #0d0d0c; cursor: pointer; }
.shot:hover { border-color: var(--accent); }
.shot img { width: 100%; height: 104px; object-fit: contain; }
.history { margin: 12px 0 0; padding: 0; list-style: none; }
.history li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.history small { display: block; color: var(--muted); }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 22px; translate: -50% 0; max-width: calc(100vw - 32px); padding: 11px 18px; border-radius: 40px; background: var(--accent); color: var(--on-accent); font-weight: 600; box-shadow: 0 10px 40px rgb(0 0 0 / .45); }
.toast.is-bad { background: var(--bad); }
.flash { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); }
.flash.is-bad { color: var(--bad); border-color: rgb(255 111 97 / .4); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(360px, 100%); }

/* вужче вікно: спершу ховається бренд, далі категорія — ціна лишається на місці */
@media (max-width: 1320px) {
  .table--products th:nth-child(7), .table--products .cell-brand { display: none; }
  .table--products .cell-title { min-width: 200px; }
}
@media (max-width: 1100px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .toolbar--products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .table--products th:nth-child(6), .table--products .cell-category, .table--products th:nth-child(9), .table--products .cell-quick { display: none; }
}
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line); }
  .side > .brand { padding: 0; }
  .btn.side__toggle { display: inline-flex; }
  .side .nav, .side__foot { display: none; width: 100%; }
  .side.is-open .nav { display: block; }
  .side.is-open .side__foot { display: flex; margin-top: 10px; }
  .main { padding: 18px 14px 60px; }
  .table thead { display: none; }
  .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .head h1 { font-size: 21px; }
  /* товари: рядок складається в картку, щоб ціна не тікала за край */
  .table--products, .table--products tbody { display: block; }
  .table--products tr[data-code] { display: grid; grid-template-columns: 24px 46px minmax(0, 1fr) auto; column-gap: 10px; align-items: center; padding: 10px 4px; border-top: 1px solid var(--line); }
  .table--products td { padding: 0; border: 0; }
  .table--products .cell-check { grid-area: 1 / 1; }
  .table--products .cell-image { grid-area: 1 / 2; width: auto; }
  .table--products .cell-title { grid-area: 1 / 3; min-width: 0; }
  .table--products .cell-price { grid-area: 1 / 4; }
  .table--products .cell-status { grid-area: 2 / 3; }
  .table--products .cell-stock { grid-area: 2 / 4; text-align: right; }
  .table--products .cell-category, .table--products .cell-brand, .table--products .cell-quick { display: none; }
  .specs__row { grid-template-columns: minmax(0, 1fr) 28px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .specs__row [data-spec="key"] { grid-area: 1 / 1; }
  .specs__row [data-spec="value"] { grid-area: 2 / 1; }
  .specs__row button[data-spec-remove] { grid-area: 1 / 2 / 3 / 3; }
  .specs__row button[data-spec-move] { display: none; }
  .savebar span { display: none; }
}

/* ───────────── доставка, оплата, знижки ───────────── */
.method summary { min-height: 44px; }
.method__meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.method .item__fields { gap: 14px; padding: 8px 12px 14px; }
.method__lang { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.table--discounts .input--sm { width: 100%; min-width: 90px; }
.table--discounts .code-input { min-width: 150px; text-transform: uppercase; }
.table--discounts input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); }
.pre { white-space: pre-line; overflow-wrap: anywhere; }
@media (max-width: 760px) { .method__meta { display: none; } }

/* ───────────── Візуальний редактор ───────────── */
body.ed { height: 100vh; overflow: hidden; display: flex; flex-direction: column; }
.ed-top { flex: none; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #0d0d0c; flex-wrap: wrap; }
.ed-page { width: auto; min-height: 36px; padding: 6px 10px; font-size: 13px; }
.seg { display: inline-flex; padding: 3px; border-radius: 40px; background: var(--panel-2); border: 1px solid var(--line); }
.seg button { height: 28px; padding: 0 11px; border: 0; border-radius: 30px; background: none; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 700; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.ed-motion { font-size: 12px; color: var(--muted); }
.ed-status { margin-left: auto; min-width: 0; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--muted); }
.ed-status.is-dirty { color: var(--warn); }
.ed-status.is-error { color: var(--bad); }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 380px minmax(0, 1fr); }
.ed-panel { min-height: 0; overflow-y: auto; border-right: 1px solid var(--line); background: var(--panel); }
.ed-view { display: flex; flex-direction: column; gap: 12px; padding: 14px; }
.ed-label { margin: 0 2px; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgb(251 247 239 / .4); }
.ed-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ed-row { display: flex; align-items: center; gap: 6px; padding: 5px 6px 5px 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.ed-row:hover { border-color: rgb(251 247 239 / .24); }
.ed-row.is-off .ed-row__title { opacity: .45; text-decoration: line-through; }
.ed-row.is-dragging { opacity: .4; }
.ed-row__grip { width: 14px; letter-spacing: -3px; color: rgb(251 247 239 / .3); cursor: grab; user-select: none; }
.ed-row__open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; padding: 3px 0; border: 0; background: none; cursor: pointer; text-align: left; }
.ed-row__title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 13px; }
.ed-row__open small { color: var(--muted); font-size: 11px; }
.ed-row__moves { display: inline-flex; }
.ed-row__moves button, .item__tools button { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.ed-row__moves button:hover, .item__tools button:hover { background: rgb(251 247 239 / .1); color: var(--text); }
.item__tools button:disabled { opacity: .25; pointer-events: none; }
.ed-eye { min-width: 62px; height: 26px; border: 1px solid var(--line); border-radius: 20px; background: none; cursor: pointer; font-size: 11px; font-weight: 600; }
.ed-eye[aria-pressed="false"] { color: var(--bad); }
.ed-tip { color: var(--muted); font-size: 12px; line-height: 1.6; }
.ed-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; margin: -14px -14px 0; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.ed-head b { font-size: 13px; }
.ed-hint { padding: 9px 12px; border: 1px solid rgb(var(--accent-rgb) / .24); border-radius: 12px; background: rgb(var(--accent-rgb) / .07); font-size: 12px; line-height: 1.55; }
.ed-panel .field { border-radius: 12px; }
/* синє — те саме, що підсвічено на сторінці */
.ed-panel .field.is-active .input, .ed-panel .field.is-active .picture, .ed-panel .input:focus { border-color: #4d90ff; box-shadow: 0 0 0 3px rgb(47 125 255 / .35); }
.ed-panel .field.is-active .field__label { color: #8ab6ff; }
.ed-note { position: fixed; z-index: 90; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; width: 300px; padding: 14px 16px; border: 1px solid rgb(var(--accent-rgb) / .55); border-radius: 14px; background: #25241f; box-shadow: 0 16px 50px rgb(0 0 0 / .6); font-size: 13px; line-height: 1.5; }
.ed-note b { color: var(--accent); }
.chip { padding: 1px 7px; border-radius: 20px; background: rgb(251 247 239 / .1); color: var(--text); font-size: 10px; font-weight: 600; }
.chip--new { background: rgb(var(--accent-rgb) / .16); color: var(--accent); }
.picture { display: flex; align-items: center; gap: 12px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #111110; }
.picture img { width: 108px; height: 72px; object-fit: cover; border-radius: 8px; }
.list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; min-width: 0; }
.list legend { padding: 0 6px; font-size: 12px; font-weight: 700; }
.item { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.item summary { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; cursor: pointer; list-style: none; }
.item summary::-webkit-details-marker { display: none; }
.item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.item__tools { display: inline-flex; }
.item__fields { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 12px; }
/* посилання (пункт меню, кнопка): папка з його назвою, всередині текст і адреса */
.linkbox { flex: none; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.linkbox[open] { border-color: rgb(251 247 239 / .24); }
.linkbox + .linkbox { margin-top: -6px; }
.linkbox > summary { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 600; }
.linkbox > summary::-webkit-details-marker { display: none; }
.linkbox > summary::before { content: "›"; flex: none; width: 10px; color: var(--muted); text-align: center; transition: transform .15s; }
.linkbox[open] > summary::before { transform: rotate(90deg); }
.linkbox__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linkbox > summary small { flex: none; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--faint); font-size: 11px; font-weight: 500; }
.linkbox__fields { display: flex; flex-direction: column; gap: 10px; padding: 4px 10px 12px; }
/* поля секції складені в групи за блоками сторінки */
.group { flex: none; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.group[open] { border-color: rgb(251 247 239 / .24); background: none; }
.group > summary { display: flex; align-items: center; gap: 8px; padding: 11px 12px; cursor: pointer; list-style: none; font-size: 13px; font-weight: 700; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary::before { content: "›"; flex: none; width: 10px; color: var(--muted); text-align: center; transition: transform .15s; }
.group[open] > summary::before { transform: rotate(90deg); }
.group[open] > summary { border-bottom: 1px solid var(--line); }
.group__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group > summary small { color: var(--faint); font-size: 11px; font-weight: 500; }
.group__fields { display: flex; flex-direction: column; gap: 12px; padding: 12px 10px; }
.ed-canvas { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: repeating-conic-gradient(#101010 0 25%, #141413 0 50%) 0 0 / 24px 24px; }
.ed-frame { position: absolute; top: 8px; left: 50%; transform-origin: top center; background: #eeeeec; box-shadow: 0 0 0 1px var(--line), 0 20px 60px rgb(0 0 0 / .55); }
.ed-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.ed-loading { position: absolute; right: 14px; top: 14px; padding: 6px 12px; border-radius: 20px; background: rgb(0 0 0 / .82); color: var(--accent); font-size: 12px; opacity: 0; pointer-events: none; transition: opacity .2s; }
.ed-loading.is-on { opacity: 1; }
@media (max-width: 860px) {
  .ed-body { grid-template-columns: minmax(0, 1fr); grid-template-rows: 46% minmax(0, 1fr); }
  .ed-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .ed-devices, .ed-motion, .ed-status { display: none; }
}
@media (prefers-reduced-motion: reduce) { .btn, .ed-loading { transition: none; } }

/* ───────────── редактор фото (imageedit.js): розміщення й кадрування ───────────── */
.modal--image { width: min(980px, calc(100vw - 24px)); max-height: calc(100vh - 24px); }
.modal--image .modal__head { flex-wrap: wrap; }
.modal--image .modal__head h2 { margin-right: 8px; }
.imged__space { margin-left: auto; }
.imged__place { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
.imged__focus { position: relative; width: fit-content; max-width: 100%; margin: 14px auto 8px; cursor: crosshair; touch-action: none; user-select: none; line-height: 0; }
.imged__focus > img { max-width: 100%; max-height: 48vh; border-radius: 8px; background: repeating-conic-gradient(#2a2a27 0 25%, #1f1f1d 0 50%) 0 / 16px 16px; }
.imged__dot { position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: rgb(47 125 255 / .35); box-shadow: 0 0 0 2px rgb(0 0 0 / .55); cursor: grab; }
.imged__dot::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: #fff; }
.imged__screens { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 4px; }
/* крапка — екран зі своїм налаштуванням */
.seg button.has-own::after { content: ""; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.imged__views { display: flex; flex-direction: column; gap: 8px; }
.imged__card { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: none; cursor: pointer; text-align: left; }
.imged__card[aria-pressed="true"] { border-color: var(--accent); background: rgb(var(--accent-rgb) / .1); }
.imged__view { display: block; overflow: hidden; border-radius: 6px; background: repeating-conic-gradient(#2a2a27 0 25%, #1f1f1d 0 50%) 0 / 16px 16px; }
.imged__view img { display: block; width: 100%; height: 100%; }
.imged__caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 12px; }
.imged__caption small { color: var(--muted); }
.imged__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.imged__stage { display: flex; justify-content: center; padding: 12px; border-radius: 12px; background: #0d0d0c; }
.imged__canvas { position: relative; overflow: hidden; line-height: 0; touch-action: none; user-select: none; background: repeating-conic-gradient(#2a2a27 0 25%, #1f1f1d 0 50%) 0 / 16px 16px; }
.imged__crop { position: absolute; border: 1px solid #fff; outline: 1px solid rgb(0 0 0 / .7); cursor: move; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .62);
  background: linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 33.33% 0 / 1px 100% no-repeat, linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 66.66% 0 / 1px 100% no-repeat,
    linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 0 33.33% / 100% 1px no-repeat, linear-gradient(rgb(255 255 255 / .35), rgb(255 255 255 / .35)) 0 66.66% / 100% 1px no-repeat; }
/* темний ореол, щоб білі ручки було видно й на білому фото */
.imged__crop i { position: absolute; width: 18px; height: 18px; filter: drop-shadow(0 0 2px rgb(0 0 0 / .9)) drop-shadow(0 0 1px rgb(0 0 0 / .9)); }
.imged__crop i[data-handle*="n"] { top: -1px; border-top: 4px solid #fff; }
.imged__crop i[data-handle*="s"] { bottom: -1px; border-bottom: 4px solid #fff; }
.imged__crop i[data-handle*="w"] { left: -1px; border-left: 4px solid #fff; }
.imged__crop i[data-handle*="e"] { right: -1px; border-right: 4px solid #fff; }
.imged__crop i[data-handle="n"], .imged__crop i[data-handle="s"] { left: calc(50% - 12px); width: 24px; cursor: ns-resize; }
.imged__crop i[data-handle="e"], .imged__crop i[data-handle="w"] { top: calc(50% - 12px); height: 24px; cursor: ew-resize; }
.imged__crop i[data-handle="nw"], .imged__crop i[data-handle="se"] { cursor: nwse-resize; }
.imged__crop i[data-handle="ne"], .imged__crop i[data-handle="sw"] { cursor: nesw-resize; }
.imged__foot { position: sticky; bottom: -20px; display: flex; justify-content: flex-end; gap: 8px; margin: 14px -20px -20px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--panel); }
.picture__tools { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.media button[data-crop-shot] { right: auto; left: 6px; }
.library__actions { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 760px) {
  .imged__place { grid-template-columns: minmax(0, 1fr); }
  .imged__views { flex-direction: row; flex-wrap: wrap; align-items: flex-end; }
  .imged__card { width: auto; }
}
