/* ============ Токены (Apple-like) ============ */
:root{
  --bg:#fafbf9;
  --surface:#ffffff;
  --ink:#1d1d1f;
  --ink-soft:#6e6e73;
  --line:#d2d2d7;
  --hairline:#e8e8ed;
  --fill:#f5f5f7;
  --accent:#1d1d1f;
  --on-accent:#ffffff;
  --danger:#bf1120;
  --ok:#1a7f37;
  --badge-on-bg:#e6f4ea;   --badge-on-fg:#1a7f37;
  --badge-off-bg:var(--fill); --badge-off-fg:var(--ink-soft);
  --badge-danger-bg:#fdeceb; --badge-danger-fg:#bf1120;
  --ease-out:cubic-bezier(.23,1,.32,1);
  --ease-in-out:cubic-bezier(.77,0,.175,1);
  --ease:var(--ease-out);
  --font-display:'Inter',-apple-system,BlinkMacSystemFont,'SF Pro Display','Segoe UI',sans-serif;
  --font-body:'Manrope',-apple-system,BlinkMacSystemFont,'SF Pro Text','Segoe UI',sans-serif;
}

/* Тёмная тема — на весь сайт (витрина + кабинет), auto по prefers-color-scheme,
   тот же визуальный язык, что в richmark-id. Карточки с реальными фото товаров
   (.cat-card/.grille-card/.grille-stage) сюда намеренно НЕ включены — держат
   свой белый фон в любой теме: PNG коврика/решётки на прозрачном фоне рассчитаны
   на белую подложку, на тёмной странице дали бы светящийся ореол вокруг фото.
   Это тот же приём, что у крупных витрин (Apple и т.п.) — карточка товара
   остаётся светлой "плашкой" на тёмной странице, а не тонет в фон. */
@media (prefers-color-scheme: dark){
  :root{
    color-scheme:dark;
    --bg:#1c1c1e;
    --surface:#242426;
    --ink:#f5f5f7;
    --ink-soft:#98989d;
    --line:#48484a;
    --hairline:#333335;
    --fill:#2c2c2e;
    --accent:#f5f5f7;
    --on-accent:#1c1c1e;
    --danger:#ff453a;
    --ok:#32d74b;
    --badge-on-bg:rgba(50,215,75,.16);    --badge-on-fg:#32d74b;
    --badge-off-bg:#2c2c2e;               --badge-off-fg:#98989d;
    --badge-danger-bg:rgba(255,69,58,.16); --badge-danger-fg:#ff453a;
  }
}

/* Локальные шрифты: положите woff2 в /assets/fonts (без CDN) */
@font-face{font-family:'Inter';src:url('/assets/fonts/InterVariable.woff2') format('woff2');font-weight:100 900;font-display:swap}
@font-face{font-family:'Manrope';src:url('/assets/fonts/Manrope-Regular.woff2') format('woff2');font-weight:400;font-display:swap}
@font-face{font-family:'Manrope';src:url('/assets/fonts/Manrope-SemiBold.woff2') format('woff2');font-weight:600;font-display:swap}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 var(--font-body);touch-action:manipulation;-webkit-font-smoothing:antialiased}
img,svg{display:block}
a{color:inherit}
button{font:inherit;color:inherit;cursor:pointer}
/* Единый вид для всех штатных <select> сайта — вместо нативной стрелки
   браузера (разной в каждом ОС/браузере) один и тот же SVG-шеврон поверх уже
   стилизованной рамки. Конкретные рамка/паддинг/размер задаются отдельно по
   месту (.co-form select, .admin-inline select и т.д.) — здесь только то, что
   должно быть одинаковым везде: appearance, сама стрелка и курсор. */
select{
  appearance:none;-webkit-appearance:none;-moz-appearance:none;
  background-image:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="none" stroke="%236e6e73" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M5.5 8 10 12.5 14.5 8"/></svg>');
  background-repeat:no-repeat;
  cursor:pointer;
}
select::-ms-expand{display:none}

/* ===== Единый вид полей формы =====
   Эталон — поля чекаута (.co-form). Любой <input>/<textarea>/<select>, добавленный
   без классов (специфичность нулевая — :where(), любой класс переопределяет), автоматически выглядит так же; локальные классы (.co-form, .ge-row-grid,
   .gp-input, .admin-inline …) при необходимости точечно переопределяют размер.
   Новое поле в админке: <label class="field"><span>Подпись</span><input …><small>подсказка</small></label> */
:where(input:not([type]),input[type=text],input[type=email],input[type=tel],input[type=number],input[type=password],input[type=search],input[type=url],input[type=date],input[type=time],input[type=datetime-local],textarea,select){
  box-sizing:border-box;min-width:0;max-width:100%;
  border:1px solid var(--line);border-radius:12px;padding:12px 14px;
  background-color:var(--surface);color:var(--ink);
  font:15px/1.4 var(--font-body);min-height:46px;
  transition:border-color .25s var(--ease);
}
:where(input:not([type]),input[type=text],input[type=email],input[type=tel],input[type=number],input[type=password],input[type=search],input[type=url],input[type=date],input[type=time],input[type=datetime-local],textarea,select):focus{outline:none;border-color:var(--ink)}
:where(input:not([type]),input[type=text],input[type=email],input[type=tel],input[type=number],input[type=password],input[type=search],input[type=url],input[type=date],input[type=time],input[type=datetime-local],textarea,select):disabled{opacity:.5;cursor:not-allowed}
select{padding-right:40px;background-position:right 14px center;background-size:16px}
select:hover{border-color:var(--ink)}
textarea{min-height:96px;line-height:1.5;resize:vertical}
::placeholder{color:var(--ink-soft);opacity:.75}
input[type=checkbox],input[type=radio]{accent-color:var(--ink);width:18px;height:18px;margin:0;flex:none}
input[type=color]{width:44px;height:44px;padding:2px;border:1px solid var(--line);border-radius:10px;background:var(--surface);cursor:pointer;flex:none}
input[type=file]{max-width:100%;font:inherit;font-size:13px;color:var(--ink-soft)}
input[type=file]::file-selector-button{margin-right:12px;padding:9px 16px;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px;font-weight:600;cursor:pointer;transition:border-color .25s var(--ease)}
input[type=file]::file-selector-button:hover{border-color:var(--ink)}
/* поле внутри <label> растягивается на всю ширину подписи */
label > :where(input:not([type]),input[type=text],input[type=email],input[type=tel],input[type=number],input[type=password],input[type=search],input[type=url],input[type=date],input[type=time],input[type=datetime-local],textarea,select){width:100%}
/* подпись + поле + подсказка */
.field{display:flex;flex-direction:column;gap:6px;margin:0 0 16px;font-size:13px;font-weight:700}
.field small{font-size:12px;font-weight:400;color:var(--ink-soft);line-height:1.4}
:focus-visible{outline:2px solid var(--ink);outline-offset:3px;border-radius:4px}
.container{max-width:1440px;margin:0 auto;padding:0 40px}
.narrow{max-width:860px}
.center{text-align:center}
.center svg{margin:24px auto 0}
.muted{color:var(--ink-soft);font-weight:400;font-size:.85em}

/* ============ Шапка ============ */
.site-header{background:rgba(255,255,255,.92);backdrop-filter:saturate(180%) blur(20px);border-bottom:1px solid var(--hairline);position:sticky;top:0;z-index:20}
.header-row{display:flex;align-items:center;gap:36px;min-height:64px}
.logo{display:flex;align-items:center;text-decoration:none;min-height:44px;padding:9px 0;flex:none}
.logo-img{display:block;height:26px;width:auto}
.main-nav{display:flex;gap:4px;flex:1}
.main-nav a{text-decoration:none;font-size:12px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);padding:12px 14px;border-radius:999px;min-height:44px;display:flex;align-items:center;gap:6px;transition:color .25s var(--ease)}
.nav-cart{color:var(--ink) !important}
.nav-cart-count{display:inline-flex;align-items:center;justify-content:center;min-width:18px;height:18px;padding:0 4px;border-radius:999px;background:var(--ink);color:var(--on-accent);font-size:10px;letter-spacing:0}
.main-nav a:hover{color:var(--ink)}
.header-contacts{text-align:right;margin-left:auto}
.phone{display:block;text-decoration:none;font-weight:700;font-size:16px;padding:2px 0}
.phone-note{font-size:11.5px;color:var(--ink-soft)}

/* Мобильная шапка: гамбургер (каталог + телефон уходят в выпадающую панель —
   этому есть куда расти, когда появятся новые разделы) и две отдельные иконки
   действий справа (корзина/кабинет — обычное место для них в e-commerce).
   На десктопе весь этот блок скрыт (см. .header-row) — там всё то же самое
   текстом внутри .main-nav, ничего не дублируется визуально. */
.menu-toggle{display:none;position:relative;width:44px;height:44px;margin:0;padding:0;border:0;background:none;color:var(--ink);cursor:pointer;flex:none;align-items:center;justify-content:center}
.menu-toggle svg{position:absolute;width:22px;height:22px;transition:opacity .2s var(--ease),transform .2s var(--ease)}
.menu-toggle .icon-close{opacity:0;transform:rotate(-45deg) scale(.7)}
.menu-toggle[aria-expanded="true"] .icon-burger{opacity:0;transform:rotate(45deg) scale(.7)}
.menu-toggle[aria-expanded="true"] .icon-close{opacity:1;transform:rotate(0) scale(1)}

.header-actions{display:none;align-items:center;gap:2px;margin-left:auto}
.header-icon-link{position:relative;display:flex;align-items:center;justify-content:center;width:44px;height:44px;color:var(--ink);text-decoration:none;flex:none}
.header-icon-link svg{width:22px;height:22px}
.header-icon-badge{position:absolute;top:4px;right:4px;display:inline-flex;align-items:center;justify-content:center;min-width:16px;height:16px;padding:0 3px;border-radius:999px;background:var(--ink);color:var(--on-accent);font-size:9.5px;line-height:1}

.mobile-menu{display:none;flex-direction:column;padding:4px 16px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--hairline)}
.mobile-menu a{display:flex;flex-direction:column;justify-content:center;min-height:52px;padding:6px 2px;text-decoration:none;color:var(--ink);font-size:14.5px;font-weight:600;border-bottom:1px solid var(--hairline)}
.mobile-menu a:last-child{border-bottom:0}
.mobile-menu-phone{font-weight:700 !important}
.mobile-menu-phone span{font-size:12px;font-weight:400;color:var(--ink-soft);margin-top:2px}
body.menu-open{overflow:hidden}

/* ============ Сцена конструктора ============ */
.stage{padding:56px 0 72px}
.board{position:relative}
.board-h1{font-family:var(--font-display);font-weight:600;font-size:clamp(21px,2.1vw,30px);letter-spacing:.1em;text-align:center;margin:0 0 10px}
.board-title{font-family:var(--font-body);font-weight:700;font-size:13px;letter-spacing:.22em;text-transform:uppercase;color:var(--ink-soft);text-align:center;margin:0 0 30px;min-height:1.4em}

.board-grid{
  display:grid;grid-template-columns:280px minmax(0,1fr) 340px;gap:48px;align-items:stretch;min-height:600px;
  grid-template-areas:"steps canvas options" "steps info options";
}
.board-grid > *{min-width:0}

/* --- левая дуга: шаги --- */
.steps{grid-area:steps;position:relative;padding:44px 0 0}
.arc{position:absolute;top:0;bottom:0;height:100%;width:90px;pointer-events:none}
.arc-left{right:-100px}
.arc-right{left:-100px}
.arc path{stroke:var(--line)}
.step-list{list-style:none;margin:0;padding:0;position:relative;display:flex;flex-direction:column;gap:20px}
.step{display:flex;align-items:center;justify-content:flex-start;min-height:56px}
.step-btn{display:flex;align-items:center;justify-content:space-between;gap:16px;background:none;border:0;padding:6px 0;min-height:44px;text-align:left;width:100%}
.step-btn[disabled]{cursor:default}
.step-btn[disabled] .step-name{color:var(--ink-soft)}
.step-name{font-size:12.5px;font-weight:600;letter-spacing:.01em;line-height:1.3;color:var(--ink-soft)}
.step-value{display:block;font-size:15.5px;color:var(--ink);font-weight:700;max-width:180px;line-height:1.35;margin-top:2px}
.step-dot{width:38px;height:38px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;background:var(--fill);border:1px solid var(--line);color:var(--ink-soft);transition:transform .3s var(--ease),background .3s var(--ease),border-color .3s var(--ease),box-shadow .3s var(--ease)}
.step-dot svg{width:16px;height:16px}
.step.is-done .step-dot{background:var(--ink);border-color:var(--ink);color:var(--on-accent)}
.step.is-active .step-dot{background:var(--surface);border-color:var(--ink);color:var(--ink);box-shadow:0 0 0 5px rgba(29,29,31,.06);transform:scale(1.15)}
.step.is-active .step-name{color:var(--ink)}

.save-later{display:flex;align-items:center;gap:8px;background:none;border:0;color:var(--ink-soft);font-size:13px;margin:14px auto 0;padding:10px 12px;min-height:44px;transition:color .25s var(--ease)}
.save-later:hover{color:var(--ink)}

/* --- центр --- */
.preview{grid-area:info;display:flex;flex-direction:column;align-items:center;min-width:0}
.preview-canvas{grid-area:canvas;width:min(520px,100%);aspect-ratio:1.15;display:flex;align-items:center;justify-content:center}
.preview-canvas svg{width:100%;height:100%}

.kit-thumbs{display:flex;gap:26px;margin:10px 0 4px;flex-wrap:wrap;justify-content:center}
.kit-thumb{display:flex;flex-direction:column;align-items:center;gap:6px;font-size:11.5px;color:var(--ink-soft);opacity:.3;transition:opacity .35s var(--ease);min-width:64px}
.kit-thumb.is-on{opacity:1}
.kit-thumb svg{width:56px;height:40px}

.history-controls{display:flex;gap:24px;margin:16px 0 6px}
.history-controls button{display:flex;flex-direction:column;align-items:center;gap:3px;background:none;border:0;color:var(--ink-soft);font-size:11px;padding:8px 10px;min-width:44px;min-height:44px;transition:color .25s var(--ease)}
.history-controls button:not([disabled]):hover{color:var(--ink)}
.history-controls button[disabled]{opacity:.35;cursor:default}

.buy-row{display:flex;align-items:center;gap:32px;margin-top:20px;flex-wrap:wrap;justify-content:center}
.price-box{text-align:right}
.price{font-family:var(--font-display);font-weight:600;font-size:32px;letter-spacing:.01em}
.price-note{display:block;font-size:12.5px;color:var(--ink-soft);margin-top:2px}
.buy-btn{background:var(--accent);color:var(--on-accent);border:0;border-radius:2px;padding:15px 44px;min-height:58px;font-family:var(--font-display);font-weight:600;font-size:15px;letter-spacing:.22em;display:flex;flex-direction:column;align-items:center;gap:2px;transition:opacity .25s var(--ease),transform .25s var(--ease)}
.buy-btn small{font-family:var(--font-body);font-weight:400;font-size:11px;letter-spacing:.04em;text-transform:none;opacity:.72}
.buy-btn:hover:not([disabled]){opacity:.86}
.buy-btn:active:not([disabled]){transform:scale(.985)}
.buy-btn[disabled]{opacity:1;background:var(--fill);color:var(--ink-soft);cursor:default}
.buy-btn.wide{width:100%}
.order-error{color:var(--danger);font-size:13.5px;text-align:center;margin:12px 0 0}
/* Origin-aware reveal вместо мгновенного [hidden]→показан — сами элементы переключаются через
   .hidden в JS без изменений; @starting-style анимирует именно появление/исчезание display:none. */
.order-error,.nudge,.pickup-confirm,.pickup-results{transition:opacity .2s var(--ease-out),transform .2s var(--ease-out),display .2s allow-discrete}
.order-error[hidden],.nudge[hidden],.pickup-confirm[hidden]{opacity:0;transform:translateY(-4px)}
.pickup-results[hidden]{opacity:0;transform:scale(.97)}
@starting-style{
  .order-error:not([hidden]),.nudge:not([hidden]),.pickup-confirm:not([hidden]){opacity:0;transform:translateY(-4px)}
  .pickup-results:not([hidden]){opacity:0;transform:scale(.97)}
}

/* --- правая дуга: опции --- */
.options{grid-area:options;position:relative;padding:44px 0 0}
.option-list{position:relative;display:flex;flex-direction:column;gap:8px;max-height:600px;overflow-y:auto;padding:6px 8px 6px 24px;scrollbar-width:thin;scrollbar-color:var(--line) transparent}
.option-list::-webkit-scrollbar{width:4px}
.option-list::-webkit-scrollbar-thumb{background:var(--line);border-radius:4px}

.swatch{display:flex;align-items:center;gap:16px;background:none;border:0;padding:6px 10px;min-height:50px;border-radius:12px;text-align:left;transition:background .25s var(--ease)}
.swatch:hover{background:var(--fill)}
.swatch-chip{width:36px;height:36px;border-radius:50%;flex:none;border:1px solid var(--line);transition:transform .3s var(--ease),box-shadow .3s var(--ease);background-size:cover}
.swatch.is-selected .swatch-chip{transform:scale(1.34);box-shadow:0 0 0 3px var(--bg),0 0 0 4.5px var(--ink)}
.swatch-name{font-size:14px;font-weight:600;line-height:1.3}
.swatch-sub{display:block;font-size:12px;color:var(--ink-soft);font-weight:400;margin-top:1px}

.opt-row{display:flex;align-items:center;justify-content:space-between;gap:16px;border:1px solid var(--hairline);border-radius:14px;padding:14px 16px;transition:border-color .25s var(--ease)}
.opt-row.is-on{border-color:var(--ink)}
.opt-info{min-width:0;flex:1}
.opt-name{font-size:14px;font-weight:700;line-height:1.35}
.opt-price{font-size:13px;color:var(--ink-soft);margin-top:2px}
.opt-price .num{white-space:nowrap}
.opt-price .old{text-decoration:line-through;margin-left:8px;opacity:.65;white-space:nowrap}
.opt-desc{font-size:12px;color:var(--ink-soft);margin-top:2px;line-height:1.4}
.qty{display:flex;align-items:center;gap:4px;flex:none}
.qty button{width:36px;height:36px;border:1px solid var(--line);background:var(--surface);border-radius:999px;font-size:18px;font-weight:600;display:flex;align-items:center;justify-content:center;transition:border-color .25s var(--ease),background .25s var(--ease)}
.qty button:hover{border-color:var(--ink)}
.qty output{min-width:28px;text-align:center;font-weight:700;font-size:15px;font-variant-numeric:tabular-nums}

.next-hint{margin-top:10px;border:0;background:var(--ink);color:var(--on-accent);border-radius:999px;padding:14px;min-height:48px;font-weight:700;font-size:13px;letter-spacing:.08em;transition:opacity .25s var(--ease)}
.next-hint:hover{opacity:.86}

.admin-preview-bar{display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;background:var(--fill);border-bottom:1px solid var(--hairline);padding:12px 20px;font-size:13px;color:var(--ink-soft);text-align:center}
.admin-preview-bar a{font-weight:700;color:var(--ink);text-decoration:none;border-bottom:1.5px solid var(--ink)}
.admin-shot-thumb{width:72px;height:44px;object-fit:cover;border:1px solid var(--hairline);border-radius:8px;background:var(--fill);display:block;margin-bottom:4px}

/* ============ Конструктор коврика произвольной формы (custom.php/custom.js) ============ */
.shape-panel{display:flex;flex-direction:column;gap:14px}
.shape-len-input{width:100%;border:1px solid var(--line);border-radius:12px;padding:12px 14px;font:16px/1.3 var(--font-body);min-height:46px;background:var(--surface);color:var(--ink);font-variant-numeric:tabular-nums}
.shape-len-input:focus{outline:none;border-color:var(--ink)}

.sp-mode-toggle{display:flex;gap:6px}
.sp-mode-btn{flex:1;padding:9px 4px;background:var(--fill);border:1px solid var(--hairline);border-radius:10px;color:var(--ink-soft);font-size:12.5px;font-weight:600;cursor:pointer;transition:background .2s var(--ease),color .2s var(--ease)}
.sp-mode-btn.is-on{background:var(--ink);color:var(--on-accent);border-color:var(--ink)}
.shape-panel-manual{display:flex;flex-direction:column;gap:10px}

.dirpad{display:grid;grid-template-columns:52px 52px 52px;grid-template-rows:52px 52px 52px;gap:6px;justify-content:center;margin:2px 0}
.dir-btn{border:1px solid var(--line);border-radius:12px;background:var(--surface);display:flex;align-items:center;justify-content:center;color:var(--ink);font-size:20px;font-weight:600;transition:border-color .25s var(--ease),background .25s var(--ease),transform .2s var(--ease)}
.dir-btn svg{width:20px;height:20px}
.dir-btn:hover:not([disabled]){border-color:var(--ink);background:var(--fill)}
.dir-btn:active:not([disabled]){transform:scale(.94)}
.dir-btn[disabled]{opacity:.28;cursor:default}
.dir-up{grid-column:2;grid-row:1}
.dir-left{grid-column:1;grid-row:2}
.dir-right{grid-column:3;grid-row:2}
.dir-down{grid-column:2;grid-row:3}
.dir-center{grid-column:2;grid-row:2;border-radius:50%;background:var(--fill)}

.segment-chips{display:flex;flex-wrap:wrap;gap:6px}
.segment-chip{display:inline-flex;align-items:center;gap:4px;background:var(--fill);border-radius:999px;padding:6px 12px;font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums}
.segment-chip small{color:var(--ink-soft);font-weight:400}

.shape-status{font-size:12.5px;color:var(--ink-soft);line-height:1.5;margin:0}
.shape-status b{color:var(--ink);font-weight:700}

.shape-actions{display:flex;gap:8px;flex-wrap:wrap}
.shape-actions .next-hint{flex:1;margin-top:0}

.sheet-count-row{display:flex;gap:8px}
.sheet-count-btn{width:44px;height:44px;font-weight:700;font-size:15px}
.sheet-count-btn.is-selected{border-color:var(--ink);background:var(--ink);color:var(--on-accent)}
.swatch.is-warn .swatch-sub{color:var(--danger)}

/* ---- шаг «Форма»: рисование перетаскиванием по канве (вместо число+стрелки) ---- */
.sp-hint{position:absolute;left:50%;top:50%;transform:translate(-50%,calc(-50% + 34px));color:var(--ink-soft);font-size:12.5px;text-align:center;width:200px;pointer-events:none;line-height:1.55}
.sp-drag-label{position:absolute;transform:translate(-50%,-135%);background:var(--ink);color:var(--bg);font-weight:700;font-size:12.5px;padding:4px 9px;border-radius:8px;pointer-events:none;white-space:nowrap;display:none;box-shadow:0 4px 10px rgba(0,0,0,.18);z-index:2}
.sp-warn{display:flex;align-items:center;gap:8px;margin:0 0 14px;padding:10px 12px;background:var(--badge-danger-bg,#fdeceb);color:var(--danger);font-size:12.5px;font-weight:600;line-height:1.4;border-radius:10px}
.sp-warn[hidden]{display:none}
.sp-warn svg{width:16px;height:16px;flex:none}
.sp-toolbar{display:flex;align-items:stretch;gap:8px;margin-bottom:10px}
.sp-tool-btn{flex:none;width:44px;display:flex;align-items:center;justify-content:center;background:var(--fill);border:1px solid var(--hairline);border-radius:11px;color:var(--ink);cursor:pointer}
.sp-tool-btn svg{width:18px;height:18px}
.sp-tool-btn:hover:not(:disabled){background:var(--line)}
.sp-tool-btn:disabled{opacity:.35;cursor:default}
.sp-readout{flex:1;display:flex;align-items:center;justify-content:center;gap:7px;border-radius:11px;border:1px solid var(--hairline);background:var(--fill);font-size:13px;color:var(--ink-soft);text-align:center;padding:0 10px;min-height:44px}
.sp-readout b{font-weight:700;color:var(--ink);font-size:14.5px}
.sp-readout.is-close{background:var(--badge-on-bg,#e6f4ea);border-color:var(--ok);color:var(--ink);cursor:pointer;font-weight:600}
.sp-readout.is-done{background:var(--badge-on-bg,#e6f4ea);border-color:var(--ok)}
.sp-readout.is-edit{background:var(--surface);border-color:var(--ink);color:var(--ink)}
.sp-precise{display:flex;gap:8px;margin-bottom:14px}
.sp-precise[hidden]{display:none}
.sp-precise button.sp-axis{flex:none;width:44px;background:var(--fill);border:1px solid var(--hairline);border-radius:10px;color:var(--ink);font-size:16px;cursor:pointer}
.sp-precise button.sp-axis.is-on{border-color:var(--ink);background:var(--ink);color:var(--bg)}
.sp-precise input{flex:1;min-width:0;border:1px solid var(--line);border-radius:10px;background:var(--surface);color:var(--ink);font:700 16px/1 var(--font-body);text-align:center;padding:0 6px}
.sp-precise .sp-apply{flex:none;padding:0 14px;background:var(--ink);color:var(--bg);border:0;border-radius:10px;font-weight:700;font-size:12.5px;cursor:pointer}
.sp-precise .sp-cancel{flex:none;width:36px;background:none;border:0;color:var(--ink-soft);cursor:pointer}
.sp-seg-empty{margin:0 0 8px;font-size:13px;color:var(--ink-soft);line-height:1.5}
.sp-seg-list{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column;gap:6px}
.sp-seg-list li{display:flex;align-items:center;gap:10px;padding:9px 10px;border:1px solid var(--hairline);border-radius:10px;cursor:pointer;font-size:13.5px;background:var(--surface)}
.sp-seg-list li:hover{border-color:var(--line);background:var(--fill)}
.sp-seg-list li.is-editing{border-color:var(--ink);background:var(--fill)}
.sp-seg-list li .n{width:18px;height:18px;border-radius:50%;background:var(--fill);color:var(--ink-soft);font-size:10.5px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:none}
.sp-seg-list li .dir{color:var(--ink-soft);font-weight:700;flex:none}
.sp-seg-list li .len{flex:1;font-weight:700}
.sp-seg-list li .edit-ic{width:14px;height:14px;color:var(--ink-soft);flex:none}
.sp-seg-list li.is-close{border-color:var(--ok);background:var(--badge-on-bg,#e6f4ea)}
.sp-seg-hint{margin:0;font-size:12px;line-height:1.55;color:var(--ink-soft)}
.shape-canvas-wrap{position:relative;width:100%;height:100%;box-sizing:border-box;padding:9% 9%}
.shape-canvas-wrap svg{touch-action:none;display:block;width:100%;height:100%;user-select:none;-webkit-user-select:none}

.guide-trigger{display:flex;align-items:center;gap:6px;margin:0 auto 14px;background:none;border:1px solid var(--line);border-radius:999px;padding:7px 14px 7px 10px;min-height:34px;font-size:12px;font-weight:600;color:var(--ink-soft);transition:border-color .25s var(--ease),color .25s var(--ease)}
.guide-trigger:hover{border-color:var(--ink);color:var(--ink)}

.guide-overlay{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:rgba(20,20,22,.5);padding:20px;backdrop-filter:blur(2px)}
.guide-overlay[hidden]{display:none}
/* Карточка остаётся белой в любой теме (не var(--surface)) — внутри
   .guide-diagram зашитые цвета своей SVG-схемы (#1d1d1f/#fff), которые не
   переключаются вместе со страницей; на тёмном фоне тёмные линии схемы стали
   бы попросту не видны. Поэтому и все дочерние цвета ниже — фиксированные,
   не токены темы, тот же приём, что у .cat-card/.grille-card. */
.guide-card{position:relative;background:#fff;color:#1d1d1f;border-radius:22px;padding:36px 32px 28px;max-width:440px;width:100%;max-height:90vh;overflow-y:auto;box-shadow:0 24px 60px rgba(0,0,0,.25)}
.guide-close{position:absolute;top:16px;right:16px;width:34px;height:34px;border-radius:50%;background:#f5f5f7;color:#1d1d1f;display:flex;align-items:center;justify-content:center;transition:background .25s var(--ease)}
.guide-close:hover{background:#e8e8ed}
.guide-title{font-family:var(--font-display);font-weight:600;font-size:19px;letter-spacing:.01em;margin:0 0 18px;padding-right:30px;line-height:1.35}
.guide-diagram{display:block;width:100%;max-width:280px;height:auto;margin:0 auto 20px}
.guide-steps{list-style:none;margin:0 0 22px;padding:0;display:flex;flex-direction:column;gap:12px;counter-reset:guide}
.guide-steps li{counter-increment:guide;position:relative;padding-left:34px;font-size:13.5px;line-height:1.5;color:#3f4043}
.guide-steps li::before{content:counter(guide);position:absolute;left:0;top:0;width:24px;height:24px;border-radius:50%;background:#1d1d1f;color:#fff;font-size:12px;font-weight:700;display:flex;align-items:center;justify-content:center}
.guide-steps b{color:#1d1d1f}
/* .buy-btn внутри карточки использует var(--accent)/var(--on-accent) — токены,
   а .guide-card зафиксирована светлой (см. её докблок), поэтому здесь тоже
   фиксированные цвета, иначе в тёмной теме кнопка станет блёклой светлой на
   белом вместо контрастной тёмной. */
.guide-card .buy-btn{background:#1d1d1f;color:#fff}

/* ============ Trust row ============ */
.trust-row{list-style:none;display:flex;gap:44px;justify-content:center;flex-wrap:wrap;margin:52px 0 0;padding:36px 0 0;border-top:1px solid var(--hairline);color:var(--ink-soft);font-size:14px}
.trust-row li{display:flex;align-items:center;gap:10px}

/* ============ Страницы ============ */
.page{padding:56px 0 80px}
.page-title{font-family:var(--font-display);font-weight:600;font-size:clamp(20px,2vw,26px);letter-spacing:.14em;margin:0 0 26px}
.legal h2{font-size:16px;margin:28px 0 8px}
.legal p,.legal li{font-size:14.5px;color:#3f4043;line-height:1.6}
.text-link{font-weight:700;text-decoration:none;border-bottom:1.5px solid var(--ink)}
button.text-link{background:none;border:0;border-bottom:1.5px solid var(--ink);padding:0;border-radius:0}
.order-number{font-size:18px}

/* checkout */
.checkout-grid{display:grid;grid-template-columns:1fr 1.2fr;gap:48px;border:1px solid var(--hairline);border-radius:20px;padding:40px}
.co-summary h2{font-size:14px;letter-spacing:.12em;text-transform:uppercase;margin:0 0 16px}
.co-car{font-weight:700;margin:0 0 4px}
.co-cfg{font-size:13px;color:var(--ink-soft);margin:0 0 18px;line-height:1.5}
.co-items{list-style:none;margin:0;padding:0;border-top:1px solid var(--hairline)}
.co-items li{display:flex;justify-content:space-between;align-items:center;gap:16px;font-size:14px;padding:10px 0;border-bottom:1px solid var(--hairline)}
.co-item-right{display:flex;align-items:center;gap:10px;white-space:nowrap;font-variant-numeric:tabular-nums}
.co-item-remove-form{margin:0}
.co-item-remove{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:1px solid var(--hairline);border-radius:999px;background:none;color:var(--ink-soft);transition:border-color .2s var(--ease),color .2s var(--ease)}
.co-item-remove:hover{border-color:var(--danger);color:var(--danger)}
.co-total{display:flex;justify-content:space-between;font-weight:800;font-size:17px;padding-top:16px}
.co-free{font-size:12.5px;color:var(--ink-soft);margin-top:8px;line-height:1.5}
.co-form{display:flex;flex-direction:column;gap:16px}
.co-form label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700}
.co-form input,.co-form textarea{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:var(--surface);color:var(--ink);font:15px/1.4 var(--font-body);min-height:46px;transition:border-color .25s var(--ease)}
.co-form input:focus,.co-form textarea:focus{outline:none;border-color:var(--ink)}
.co-two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.co-pay{border:1px solid var(--hairline);border-radius:14px;padding:12px 16px}
.co-pay legend{font-size:13px;font-weight:700;padding:0 6px}

/* Блок цены решётки (/admin/grilles/{id}/edit) — цена с Ozon слева, переключатель+своя цена справа */
.price-two-col{align-items:stretch}
.price-ozon-card,.price-custom-card{border:1px solid var(--hairline);border-radius:16px;padding:20px;display:flex;flex-direction:column;gap:10px}
.price-ozon-card{background:var(--fill)}
.price-ozon-amount{font-family:var(--font-display);font-weight:600;font-size:32px;letter-spacing:-.01em}
.price-ozon-date{margin:0;font-size:11.5px;color:var(--ink-soft)}
.price-ozon-card form{margin-top:auto}
.price-mode-toggle{display:flex;gap:8px;flex-wrap:wrap}
.price-mode-opt{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:600;border:1px solid var(--line);border-radius:999px;padding:8px 14px;cursor:pointer;transition:border-color .15s var(--ease),background .15s var(--ease)}
.price-mode-opt:has(input:checked){border-color:var(--ink);background:var(--fill)}
.price-mode-opt input{margin:0;width:auto;min-height:0;padding:0;border-radius:50%}
.price-custom-card > label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700}
.price-custom-card > label input[type="text"]{border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:var(--surface);color:var(--ink);font:15px/1.4 var(--font-body);min-height:46px;transition:border-color .25s var(--ease)}
.price-custom-card > label input[type="text"]:focus{outline:none;border-color:var(--ink)}
.price-custom-card > label input[type="text"]:disabled{opacity:.4;cursor:not-allowed}

@media (max-width: 640px){
  .price-two-col{grid-template-columns:1fr}
  .price-real-kit{flex-direction:column;gap:10px}
  .price-real-kit > div + div{margin-left:0;padding-left:0;border-left:0;padding-top:10px;border-top:1px solid var(--hairline)}
}

.price-real-kit{display:flex;padding:14px 18px;border:1px solid var(--hairline);border-radius:12px;background:var(--fill);margin-bottom:12px;font-size:14px}
.price-real-kit > div{flex:1;display:flex;flex-direction:column;gap:3px}
.price-real-kit > div + div{margin-left:18px;padding-left:18px;border-left:1px solid var(--hairline)}
.price-real-kit b{font-size:22px;font-family:var(--font-display)}
.price-real-parts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:340px;overflow-y:auto}
.price-real-parts li{display:flex;align-items:center;gap:10px;padding:9px 12px;border:1px solid var(--hairline);border-radius:10px;font-size:13.5px}
.price-real-num{font-weight:700;min-width:24px;flex:none}
.price-real-title{flex:1;color:var(--ink-soft);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.price-real-value{font-weight:700;font-variant-numeric:tabular-nums;flex:none}

.pickup-field{position:relative;margin-top:10px}
.pickup-results{position:absolute;left:0;right:0;top:calc(100% + 4px);z-index:5;max-height:260px;overflow:auto;background:var(--bg);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 32px rgba(0,0,0,.12);padding:4px;transform-origin:top center}
.pickup-option{display:block;width:100%;text-align:left;font:inherit;font-size:13px;padding:8px 10px;border:0;background:none;border-radius:8px;cursor:pointer;color:var(--ink)}
.pickup-option:hover{background:var(--fill)}
.pickup-confirm{font-size:12.5px;color:var(--ok);font-weight:600;margin:6px 0 0}
.radio{flex-direction:row !important;align-items:center;gap:10px !important;font-weight:400 !important;font-size:14px !important;min-height:38px}
.radio input{min-height:0;width:18px;height:18px;accent-color:var(--ink)}
.radio.is-disabled{opacity:.45}
.consent{flex-direction:row !important;align-items:flex-start;gap:10px !important;font-weight:400 !important;font-size:13px !important;color:var(--ink-soft);line-height:1.5}
.consent input{width:18px;height:18px;margin-top:2px;accent-color:var(--ink);flex:none}
.co-empty{color:var(--ink-soft)}

/* ============ Футер (в стиле Apple: #f5f5f7, мелкий кегль) ============ */
.site-footer{background:var(--fill);border-top:1px solid var(--hairline);margin-top:32px}
.footer-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:40px;padding:44px 40px 24px;font-size:12px;color:var(--ink-soft);line-height:1.55}
.f-title{font-family:var(--font-body);font-weight:700;font-size:12px;letter-spacing:.02em;color:var(--ink);margin:0 0 12px}
.f-links{list-style:none;margin:0;padding:0}
.f-links a{display:inline-block;text-decoration:none;padding:5px 0;min-height:28px}
.f-links a:hover{text-decoration:underline}
.f-small{font-size:11.5px;color:var(--ink-soft)}
.f-col a{color:inherit}
.pay-badges{display:flex;gap:8px;margin:12px 0}
.pay{width:54px;height:21px}
.footer-bottom{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;border-top:1px solid var(--line);padding:16px 40px 24px;font-size:11.5px;color:var(--ink-soft)}
.footer-bottom p{margin:0}

/* ============ Главная-заглушка ============ */
.home{padding:clamp(48px,7vw,96px) 0 clamp(64px,8vw,110px)}
.home-hero{text-align:center;margin:0 0 clamp(40px,6vw,80px)}
.home-brand{font-family:var(--font-display);font-weight:700;font-size:clamp(34px,10.5vw,128px);line-height:1;letter-spacing:-.03em;margin:0;white-space:nowrap}
.home-brand-img{display:block;width:100%;max-width:640px;height:auto;margin:0 auto}
.home-tagline{font-family:var(--font-body);font-weight:600;font-size:clamp(13px,1.6vw,18px);letter-spacing:.22em;text-transform:uppercase;color:var(--ink-soft);margin:clamp(14px,2vw,24px) 0 0}

.home-cats{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(6,1fr);gap:16px}
.home-features{grid-template-columns:repeat(2,1fr);margin-bottom:clamp(32px,5vw,56px)}
.home-features:has(li:only-child){grid-template-columns:1fr;max-width:360px}
.home-features .cat-title{font-size:16px}
@keyframes card-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
.home-cats>li,.grille-cards>li{animation:card-enter .4s var(--ease-out) backwards}
.home-cats>li:nth-child(n+1),.grille-cards>li:nth-child(n+1){animation-delay:0ms}
.home-cats>li:nth-child(n+2),.grille-cards>li:nth-child(n+2){animation-delay:40ms}
.home-cats>li:nth-child(n+3),.grille-cards>li:nth-child(n+3){animation-delay:80ms}
.home-cats>li:nth-child(n+4),.grille-cards>li:nth-child(n+4){animation-delay:120ms}
.home-cats>li:nth-child(n+5),.grille-cards>li:nth-child(n+5){animation-delay:160ms}
.home-cats>li:nth-child(n+6),.grille-cards>li:nth-child(n+6){animation-delay:200ms}
.home-cats>li:nth-child(n+7),.grille-cards>li:nth-child(n+7){animation-delay:240ms}
.home-cats>li:nth-child(n+8),.grille-cards>li:nth-child(n+8){animation-delay:280ms}
.home-cats>li:nth-child(n+9),.grille-cards>li:nth-child(n+9){animation-delay:320ms}
.home-cats>li{list-style:none}
/* Граница — фиксированный нейтральный тон, не токен --hairline: карточка
   умышленно остаётся белой в любой теме (см. докблок тёмной темы выше), а
   --hairline в тёмном режиме становится почти чёрным — на белой карточке
   он был бы едва виден. */
.cat-card{display:flex;flex-direction:column;gap:20px;min-height:196px;height:100%;padding:24px 20px;border:1px solid rgba(0,0,0,.08);border-radius:18px;background:#fff;color:#1d1d1f;text-decoration:none;transition:border-color .3s var(--ease),transform .3s var(--ease),box-shadow .3s var(--ease)}
.cat-card:hover{border-color:rgba(0,0,0,.16);transform:translateY(-3px);box-shadow:0 12px 32px rgba(0,0,0,.06)}
/* Фикс-цвета, не токены — .cat-card всегда белая (см. её докблок), поэтому
   всё внутри тоже должно остаться в её собственной (светлой) палитре, а не
   переключаться на тёмную вместе со страницей. */
.cat-icon{width:44px;height:44px;border-radius:12px;background:#f5f5f7;display:flex;align-items:center;justify-content:center;color:#1d1d1f;flex:none}
.cat-icon svg{width:24px;height:24px;stroke-width:1.75}
.cat-body{margin-top:auto}
.cat-title{font-weight:700;font-size:16px;line-height:1.3}
.cat-sub{display:block;font-size:12.5px;color:#6e6e73;margin-top:6px;line-height:1.4}

.grille-cards{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.grille-cards>li{list-style:none}
/* Та же логика, что у .cat-card — карточка товара всегда белая, поэтому
   и здесь фиксированные цвета вместо токенов темы. */
.grille-card{display:flex;flex-direction:column;height:100%;border:1px solid rgba(0,0,0,.08);border-radius:18px;overflow:hidden;background:#fff;color:#1d1d1f;text-decoration:none;transition:border-color .25s var(--ease),transform .25s var(--ease),box-shadow .25s var(--ease)}
.grille-card:hover{border-color:rgba(0,0,0,.16);transform:translateY(-3px);box-shadow:0 12px 32px rgba(0,0,0,.06)}
.grille-card:active{transform:translateY(-1px) scale(.99)}
.grille-card-thumb{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;background:#f5f5f7}
.grille-card-thumb--empty{display:flex;align-items:center;justify-content:center;padding:0 16px;text-align:center;color:#6e6e73;font-size:12.5px}
.grille-card-body{padding:16px 18px 18px;display:flex;flex-direction:column;gap:4px;flex:1}
.grille-card-eyebrow{font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:#6e6e73}
.grille-card-title{font-weight:700;font-size:15.5px;line-height:1.35}
.grille-card-sub{font-size:12.5px;color:#6e6e73;line-height:1.4}
.grille-card-variants{display:inline-flex;align-self:flex-start;margin-top:2px;font-size:11px;font-weight:600;color:#6e6e73;background:#f5f5f7;border-radius:999px;padding:3px 9px}
.grille-card-price{margin-top:auto;padding-top:10px;font-weight:700;font-size:14.5px}

.grille-filters{display:flex;flex-direction:column;gap:16px;margin-top:32px}
.grille-search{display:flex;gap:8px;max-width:420px}
.grille-search input{flex:1;min-width:0;border:1px solid var(--line);border-radius:999px;padding:10px 16px;font:inherit;font-size:14px;background:var(--surface);color:var(--ink)}
.grille-search input:focus{outline:none;border-color:var(--ink)}
.grille-chips{display:flex;flex-wrap:wrap;gap:8px}
.grille-chip{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:999px;border:1px solid var(--line);font-size:13px;font-weight:600;color:var(--ink);text-decoration:none;background:var(--surface);transition:border-color .15s var(--ease),background .15s var(--ease),color .15s var(--ease),transform .1s var(--ease-out)}
.grille-chip:hover{border-color:var(--ink)}
.grille-chip:active{transform:scale(.97)}
.grille-chip.is-on{background:var(--ink);color:var(--on-accent);border-color:var(--ink)}
.grille-chip span{opacity:.6;font-weight:400}
.grille-chip.is-on span{opacity:.8}

.home-cta{display:flex;justify-content:center;flex-wrap:wrap;gap:16px;margin-top:clamp(48px,7vw,80px)}
.home-btn{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;min-height:56px;padding:16px 40px;border-radius:999px;font-family:var(--font-display);font-weight:600;font-size:14px;letter-spacing:.1em;border:1px solid transparent;transition:opacity .25s var(--ease),background .25s var(--ease),color .25s var(--ease),transform .25s var(--ease)}
.home-btn:active{transform:scale(.985)}
.home-btn--primary{background:var(--accent);color:var(--on-accent)}
.home-btn--primary:hover{opacity:.86}
.home-btn--secondary{background:var(--bg);color:var(--ink);border-color:var(--line)}
.home-btn--secondary:hover{border-color:var(--ink);background:var(--fill)}

/* ============ Конструктор вставок в решётку ============ */
.variant-switch{display:flex;flex-wrap:wrap;justify-content:start;gap:10px;margin:0 0 10px 0}
.variant-thumb{display:flex;flex-direction:column;align-items:center;gap:6px;width:76px;text-decoration:none;color:var(--ink-soft);flex:none}
.variant-thumb img,.variant-thumb-empty{width:64px;height:64px;border-radius:14px;object-fit:cover;background:var(--fill);border:1.5px solid var(--hairline);transition:border-color .2s var(--ease),box-shadow .2s var(--ease)}
.variant-thumb:hover img,.variant-thumb:hover .variant-thumb-empty{border-color:var(--line)}
.variant-thumb.is-on img,.variant-thumb.is-on .variant-thumb-empty{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.variant-thumb-label{font-size:11.5px;line-height:1.25;text-align:center;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.variant-thumb.is-on .variant-thumb-label{color:var(--ink);font-weight:700}

/* .grille-stage и .cfg-stage-info — прямые дети .cfg (не вложены в общий
   .cfg-stage), по тому же принципу, что .preview-canvas в .board-grid (см.
   комментарий там): sticky-позиционирование ограничено высотой СВОЕГО
   родителя, и на мобильном фото должно оставаться приклеенным, пока
   прокручивается не только текст под ним, но и вся панель заказа справа —
   а для этого их общий родитель обязан быть один и тот же элемент, .cfg. */
.cfg{display:grid;grid-template-columns:minmax(0,1fr) 380px;grid-template-areas:"stage panel" "info panel";gap:32px;margin:32px 0}
.grille-stage{grid-area:stage;min-width:0;animation:card-enter .5s var(--ease-out) backwards}
.cfg-stage-info{grid-area:info;min-width:0}
.cfg-panel{grid-area:panel;animation:card-enter .5s var(--ease-out) .08s backwards}
.parts>li{animation:card-enter .35s var(--ease-out) backwards}
.parts>li:nth-child(n+1){animation-delay:0ms}
.parts>li:nth-child(n+2){animation-delay:35ms}
.parts>li:nth-child(n+3){animation-delay:70ms}
.parts>li:nth-child(n+4){animation-delay:105ms}
.parts>li:nth-child(n+5){animation-delay:140ms}
.parts>li:nth-child(n+6){animation-delay:175ms}
.parts>li:nth-child(n+7){animation-delay:210ms}
.parts>li:nth-child(n+8){animation-delay:245ms}
.parts>li:nth-child(n+9){animation-delay:280ms}
.grille-stage{position:relative;aspect-ratio:var(--ratio, 16/9);border-radius:20px;overflow:hidden;background:#fff;box-shadow:0 24px 60px -20px rgba(0,0,0,.35)}
.stage-photo{display:block;width:100%;height:100%;object-fit:contain}
.stage-map{position:absolute;inset:0;width:100%;height:100%}
.hot{cursor:pointer}
.hot polygon{fill:var(--hot,#e0761f);fill-opacity:.08;stroke:var(--hot,#e0761f);stroke-width:2.5;stroke-opacity:.7;transition:fill-opacity .25s var(--ease),stroke-opacity .25s var(--ease)}
.hot:hover polygon,.hot:focus-visible polygon{fill-opacity:.2;stroke-opacity:1}
.hot.is-on polygon{fill-opacity:.34;stroke-opacity:1}
.hot-badge{fill:#fff;stroke:none;filter:drop-shadow(0 2px 5px rgba(0,0,0,.35));transition:fill .25s var(--ease)}
.hot.is-on .hot-badge{fill:#1d1d1f}
.hot text{fill:#1d1d1f;font-weight:700;text-anchor:middle;dominant-baseline:central;pointer-events:none;transition:fill .25s var(--ease)}
.hot.is-on text{fill:#fff}
.stage-hint{margin:12px 0 0;font-size:13px;color:var(--ink-soft);text-align:center}

.cfg-panel{display:flex;flex-direction:column;gap:16px;min-width:0}
.cfg-panel-sticky{display:flex;flex-direction:column;gap:16px;min-width:0}
/* Десктоп: цена комплекта, счётчик и кнопка «В корзину» всегда остаются в
   зоне видимости при скролле — тянется весь блок «kit и ниже», а не панель
   целиком (шапка товара и список фактов прокручиваются как обычно). Если
   высота экрана не даёт места на всё, сжимается и скроллится список ячеек —
   он один во flex-колонке умеет ужиматься (flex+min-height:0+overflow), у
   соседей flex-shrink:0, чтобы их не пришлось трогать. */
@media (min-width: 961px){
  /* отступ сверху — высота .site-header (sticky, ~57px) + зазор, иначе прилипающий
     блок стартует под шапкой и часть его (обычно верх .kit) уезжает ей за корешок */
  .cfg-panel-sticky{position:sticky;top:73px;max-height:calc(100vh - 73px - 24px);overflow-y:auto}
  .cfg-panel-sticky .cfg-kits,
  .cfg-panel-sticky .parts-head,
  .cfg-panel-sticky .panel-sep,
  .cfg-panel-sticky .nudge,
  .cfg-panel-sticky .panel-total,
  .cfg-panel-sticky > .buy-btn,
  .cfg-panel-sticky .order-error,
  .cfg-panel-sticky .panel-note{flex-shrink:0}
  /* Комплектов может быть несколько (целиком + по названиям). Раньше "по
     названиям" шли стопкой широких кнопок и либо давили список ячеек, либо
     прятались в свой скролл — там нижние комплекты были не видны и никак не
     подсказывали, что они вообще есть. Теперь это компактные плитки в
     .kit-sets (flex-wrap) — любое их число просто переносится строками, все
     видны сразу целиком, без скролла и гаданий "сколько их там ещё". */
  .cfg-panel-sticky .cfg-kits{display:flex;flex-direction:column;gap:12px}
  .cfg-panel-sticky .parts{flex:1 1 auto;min-height:240px;max-height:none;overflow-y:auto}
}
.panel-head .eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.14em;margin:0}
.product-title{font-family:var(--font-display);font-weight:700;font-size:clamp(26px,2.4vw,34px);letter-spacing:-.02em;line-height:1.05;margin:6px 0 8px}
.panel-head .muted{font-size:14px;line-height:1.4}
.facts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;font-size:13.5px;color:var(--ink-soft)}
.facts li{display:flex;align-items:flex-start;gap:8px}
.facts li::before{content:'';flex:none;width:16px;height:16px;margin-top:1px;background:var(--ink);-webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>') center/contain no-repeat;mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M20 6 9 17l-5-5"/></svg>') center/contain no-repeat}

.kit{border:1px solid var(--hairline);border-radius:16px;padding:16px}
.kit-top{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:4px;gap:12px}
.kit-label{font-weight:700}
.kit-price{font-weight:700;font-size:18px;white-space:nowrap}
.kit-sub{font-size:12.5px;color:var(--ink-soft);margin:0 0 12px}

.kit-sets{display:flex;flex-wrap:wrap;gap:10px}
.kit-set{flex:1 1 150px;display:flex;flex-direction:column;gap:12px;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);text-align:left;font:inherit;color:inherit;cursor:pointer;transition:border-color .2s var(--ease),box-shadow .2s var(--ease)}
.kit-set:hover{border-color:var(--ink);box-shadow:0 1px 0 var(--ink)}
.kit-set:active{transform:scale(.985)}
.kit-set[disabled]{opacity:.55;cursor:default}
.kit-set-name{font-size:14px;font-weight:700;line-height:1.25;color:var(--ink)}
.kit-set-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px}
.kit-set-price{font-size:17px;font-weight:700;white-space:nowrap}
.kit-set-cta{padding:5px 11px;border:1px solid var(--ink);border-radius:999px;font-size:11.5px;font-weight:600;white-space:nowrap;transition:background .2s var(--ease),color .2s var(--ease)}
.kit-set:hover:not([disabled]) .kit-set-cta{background:var(--ink);color:var(--bg)}

.panel-sep{height:1px;background:var(--hairline);margin:4px 0}

.parts-head,.sets-head{display:flex;flex-direction:column;gap:2px}
.parts-title{margin:0;font-size:16px;font-weight:700}
.parts-head .muted,.sets-head .muted{margin:0;font-size:12.5px}
.parts{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;max-height:420px;overflow:auto}
.part{display:flex;align-items:center;gap:12px;padding:13px 14px;border:1px solid var(--hairline);border-radius:12px;cursor:pointer;transition:border-color .2s var(--ease),background .2s var(--ease),box-shadow .2s var(--ease)}
.part:hover{border-color:var(--line)}
.part.is-on{border-color:var(--ink);background:var(--fill);box-shadow:0 1px 0 var(--ink) inset}
.part input{flex:none}
.part-num{font-weight:700;min-width:22px}
.part-name{flex:1;font-size:14.5px}
.part-price{font-size:14.5px;font-weight:600;white-space:nowrap}

.nudge{font-size:12.5px;color:var(--ink-soft);background:var(--fill);border-radius:10px;padding:8px 12px;margin:0}

.panel-total{display:flex;justify-content:space-between;align-items:baseline;padding-top:8px;border-top:1px solid var(--hairline)}
.panel-total b{font-size:20px}

.panel-note{font-size:12px;color:var(--ink-soft);margin:0}

.sticky-bar{display:none}

/* Конструктор страницы решётки — блоки под главным фото, /admin/grilles/{id}/page */
.gp-page{max-width:100%;margin:20px 0 0;display:flex;flex-direction:column;gap:22px}
.gp-subtitle{font-family:var(--font-display);font-weight:600;font-size:clamp(19px,2vw,24px);margin:10px 0 0}
.gp-text{font-size:15.5px;line-height:1.7;color:var(--ink)}
.gp-text p{margin:0 0 12px}
.gp-text p:last-child{margin-bottom:0}
.gp-text ul,.gp-text ol{margin:0 0 12px;padding-left:22px}
.gp-text a{color:inherit;text-decoration-color:var(--line)}
.gp-image{margin:0}
.gp-image img{width:100%;height:auto;border-radius:16px;display:block}
.gp-image figcaption{font-size:12.5px;color:var(--ink-soft);text-align:center;margin-top:8px}
.gp-list{margin:0;padding-left:22px;font-size:15.5px;line-height:1.7;display:flex;flex-direction:column;gap:4px}

/* ============ Адаптив ============ */
@media (max-width: 1280px){
  .board-grid{grid-template-columns:230px minmax(0,1fr) 300px;gap:32px}
  .container{padding:0 28px}
}
@media (max-width: 960px){
  .container{padding:0 16px}
  .home-cats{grid-template-columns:repeat(3,1fr)}
  .cat-card{min-height:0;gap:16px;padding:18px 16px}
  .cat-icon{width:40px;height:40px}
  .stage{padding:20px 0 120px} /* запас под липкую панель заказа */
  .board-h1{font-size:19px;letter-spacing:.06em;margin-bottom:6px}
  .board-title{margin-bottom:14px;font-size:11px}
  .board-grid{display:flex;flex-direction:column;gap:14px;min-height:0}
  .board-grid > *{min-width:0}
  .arc{display:none}

  /* превью — первым экраном и приклеено под шапкой. .preview-canvas — теперь
     ПРЯМОЙ ребёнок .board-grid (не вложен в .preview) по двум причинам:
     1) position:sticky ограничен высотой СВОЕГО родителя, а .preview сама по
        себе высотой всего в кнопку "Начать заново" — приклеенный элемент тут
        же "отклеился" бы, не доехав до конца .steps/.options ниже;
     2) порядок теперь: канва → .options (реальный пульт ввода — длина,
        стрелки/свотчи) сразу под ней, и только потом .steps (табы навигации
        по шагам) и .preview (кнопка "Начать заново"). Пульт — рабочая
        область, ему место рядом со схемой; табы — просто навигация, их можно
        и полистать вниз. */
  .preview-canvas{order:-3;position:sticky;top:56px;z-index:15;background:var(--bg);padding-bottom:10px;border-bottom:1px solid var(--hairline)}
  .preview-canvas.doormat{width:100%}
  .options{order:-2}
  .steps{order:-1}
  .preview{order:0}
  .canvas-hint{padding:0 4px}

  /* шаги — компактная горизонтальная лента чипов: во время рисования формы это
     чистая навигация, а не рабочая область, поэтому съедать высоту экрана она
     не должна */
  .steps{padding:0}
  .step-list{flex-direction:row;overflow-x:auto;gap:5px;padding:2px 2px 6px;-webkit-overflow-scrolling:touch;scrollbar-width:none;mask-image:linear-gradient(to right,#000 92%,transparent 100%);-webkit-mask-image:linear-gradient(to right,#000 92%,transparent 100%)}
  .step-list::-webkit-scrollbar{display:none}
  .step{min-height:0;flex:none}
  .step-btn{flex-direction:row-reverse;justify-content:flex-start;gap:7px;padding:5px 10px 5px 6px;border:1px solid var(--hairline);border-radius:999px;text-align:left;width:auto}
  .step.is-active .step-btn{border-color:var(--ink)}
  .step.is-done .step-btn{background:var(--fill)}
  .step-dot{width:20px;height:20px}
  .step-dot svg{width:10px;height:10px}
  .step-name{font-size:10px;white-space:nowrap;color:var(--ink-soft)}
  .step-value{max-width:130px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12.5px;font-weight:700;color:var(--ink)}
  .save-later{margin:6px auto 0}

  /* опции: сетка на всю ширину */
  .options{padding:0}
  .option-list{max-height:none;overflow:visible;display:grid;grid-template-columns:repeat(1,minmax(0,1fr));gap:6px;padding:0}
  .swatch{border:1px solid var(--hairline);border-radius:14px;padding:8px 10px;min-height:56px}
  .swatch:hover{background:none}
  .swatch.is-selected{border-color:var(--ink)}
  .swatch.is-selected .swatch-chip{transform:scale(1.12);box-shadow:0 0 0 2px var(--bg),0 0 0 3.2px var(--ink)}
  .cell-swatch,.opt-row,.next-hint,.size-panel{grid-column:1/-1}
  .size-inputs input{font-size:16px} /* без зума iOS */

  /* липкая панель цены и заказа */
  .buy-row{position:fixed;left:0;right:0;bottom:0;z-index:30;margin:0;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.94);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-top:1px solid var(--hairline);flex-wrap:nowrap;justify-content:space-between;gap:14px}
  .price-box{text-align:left;min-width:0}
  .price{font-size:22px}
  .price-note{font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .buy-btn{flex:none;padding:12px 26px;min-height:52px;font-size:13px;letter-spacing:.16em}
  .order-error{position:fixed;left:16px;right:16px;bottom:calc(84px + env(safe-area-inset-bottom));z-index:31;background:var(--surface);border:1px solid var(--danger);border-radius:12px;padding:10px 14px;margin:0;box-shadow:0 8px 30px rgba(0,0,0,.12)}

  .checkout-grid{grid-template-columns:1fr;padding:20px;gap:24px}

  .cfg{grid-template-columns:1fr;grid-template-areas:"stage" "info" "panel";gap:20px;margin:20px 0 96px}
  /* Фото решётки приклеено под шапкой, пока пролистывается всё остальное —
     подсказка, доп. блоки страницы, Комплекты и список ячеек. Раньше между
     фото и списком ячеек оказывалось много контента (Комплекты и т.д.), и
     чтобы свериться с фото при выборе ячейки поштучно, приходилось скроллить
     туда-обратно. top:56px — высота мобильной .header-row, тот же приём и то
     же значение, что у .preview-canvas в конструкторе коврика. */
  .grille-stage{position:sticky;top:56px;z-index:5}
  .parts{max-height:none}
  .sticky-bar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:30;align-items:center;justify-content:space-between;gap:12px;padding:10px 16px calc(10px + env(safe-area-inset-bottom));background:rgba(255,255,255,.94);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);border-top:1px solid var(--hairline);transform:translateY(100%);opacity:0;visibility:hidden;pointer-events:none;transition:transform .25s var(--ease-out),opacity .25s var(--ease-out),visibility 0s linear .25s}
  .sticky-bar:not([hidden]){transform:translateY(0);opacity:1;visibility:visible;pointer-events:auto;transition:transform .25s var(--ease-out),opacity .25s var(--ease-out),visibility 0s linear 0s}
  .sticky-bar [data-sticky-count]{font-size:13px;color:var(--ink-soft)}
  .footer-grid{grid-template-columns:1fr 1fr;padding:32px 16px 18px}
  .footer-bottom{padding:16px 16px 24px}
  .header-row{gap:4px;min-height:56px}
  .logo-img{height:22px}
  /* Каталог и телефон переезжают в .mobile-menu (открывается гамбургером) —
     в шапке остаются только корзина и кабинет, обычное место для них. */
  .main-nav,.header-contacts{display:none}
  .menu-toggle,.header-actions{display:flex}
  .mobile-menu.is-open{display:flex}
  .trust-row{gap:10px 22px;margin-top:28px;padding-top:20px;font-size:12.5px}
}
@media (max-width: 560px){
  .home-cats{grid-template-columns:repeat(2,1fr)}
  .home-cats.home-features{grid-template-columns:repeat(1,1fr)}
  .home-features .cat-title {font-size: 16px;width: 200px;display: block;}
  .home-cta{flex-direction:column}
  .home-btn{width:100%}
  .footer-grid{grid-template-columns:1fr}
  .co-two{grid-template-columns:1fr}
  .preset-grid{grid-template-columns:1fr 1fr}
  .kit-thumbs{gap:14px}
}
@media (prefers-reduced-motion: reduce){
  /* Не transition:none — часть transition/animation здесь несёт состояние, а не
     только украшение: .ge-toggle держит позицию галочки на transform, .sticky-bar
     держит показ/скрытие на transform+visibility. Обнулять transform целиком
     сломало бы обе. Вместо этого делаем анимации неощутимо быстрыми — движение
     пропадает, но конечное состояние остаётся корректным. */
  *{transition-duration:.001ms !important;animation-duration:.001ms !important;animation-iteration-count:1 !important}
  html{scroll-behavior:auto}
}

/* ============ EVADOOR: конструктор придверных ковриков ============ */
.preview-canvas.doormat{width:min(760px,100%);aspect-ratio:920/560}

.preset-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.preset-chip{border:1px solid var(--line);border-radius:16px;background:var(--surface);padding:14px 8px 11px;min-height:74px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;transition:border-color .25s var(--ease),background .25s var(--ease),color .25s var(--ease),transform .25s var(--ease)}
.preset-chip .pv{font-family:var(--font-display);font-weight:600;font-size:19px;letter-spacing:.01em;line-height:1;display:flex;align-items:center;gap:7px;font-variant-numeric:tabular-nums}
.preset-chip .pv i{font-style:normal;font-family:var(--font-body);font-weight:400;font-size:13px;color:var(--ink-soft);transition:color .25s var(--ease)}
.preset-chip small{font-family:var(--font-body);font-weight:600;font-size:10px;letter-spacing:.16em;text-transform:uppercase;color:var(--ink-soft);transition:color .25s var(--ease)}
.preset-chip:hover{border-color:var(--ink)}
.preset-chip:active{transform:scale(.97)}
.preset-chip.is-selected{background:var(--ink);border-color:var(--ink);color:var(--on-accent)}
.preset-chip.is-selected .pv i,.preset-chip.is-selected small{color:color-mix(in srgb,var(--on-accent) 65%,transparent)}

.custom-size{margin-top:20px}
.panel-label{font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-soft);margin:0 0 10px}
.size-inputs{display:flex;align-items:flex-end;gap:10px}
.size-inputs label{flex:1;display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:700}
.size-inputs input{border:1px solid var(--line);border-radius:12px;padding:11px 12px;font:16px/1.3 var(--font-body);min-height:46px;width:100%;background:var(--surface);color:var(--ink);font-variant-numeric:tabular-nums}
.size-inputs input:focus{outline:none;border-color:var(--ink)}
.size-inputs .x{color:var(--ink-soft);padding-bottom:13px}
.panel-hint{font-size:12px;color:var(--ink-soft);line-height:1.5;margin:10px 0 0}
.panel-hint.important{border:1px solid var(--hairline);border-radius:12px;padding:10px 12px;background:var(--fill)}
.panel-error{color:var(--danger);font-size:12.5px;margin:10px 0 0}
.size-panel .next-hint{width:100%;margin-top:14px}

.cell-swatch{align-items:center}
.cell-chip{width:72px;height:48px;border-radius:10px;overflow:hidden;flex:none;border:1px solid rgba(0,0,0,.12);transition:transform .3s var(--ease),box-shadow .3s var(--ease)}
.cell-chip svg{width:100%;height:100%}
.swatch.is-selected .cell-chip{transform:scale(1.08);box-shadow:0 0 0 3px var(--bg),0 0 0 4.5px var(--ink)}

/* админка */
.admin-login{max-width:380px}
.admin-form{border:1px solid var(--hairline);border-radius:20px;padding:28px}
.admin-ok{color:var(--ok);font-weight:700}
.admin-inline{display:inline}
.admin-inline select{font:inherit;font-size:12.5px;padding:6px 26px 6px 8px;border:1px solid var(--line);border-radius:8px;background-color:var(--surface);color:var(--ink);background-position:right 8px center;background-size:12px;transition:border-color .2s var(--ease)}
.admin-inline select:hover,.admin-inline select:focus{outline:none;border-color:var(--ink)}
.admin-h2{margin-top:48px}
.admin-btn{border:1px solid var(--hairline);border-radius:16px;padding:18px 20px;margin:0 0 16px;display:flex;flex-direction:column;gap:14px;min-width:0}
.admin-btn legend,label.admin-toggle{font-size:14px;font-weight:700}
label.admin-toggle{display:flex;flex-direction:row;align-items:center;gap:10px;cursor:pointer}
.admin-toggle input{width:18px;height:18px;accent-color:var(--ink);flex:none;min-height:0}

/* Переключатель-пилюля (изначально из редактора ячеек, .ge-toggle) — общий компонент для булевых настроек в админке */
.ge-toggle{position:relative;flex:none;width:34px;height:20px;border-radius:999px;background:var(--line);cursor:pointer;transition:background .15s var(--ease)}
.ge-toggle input{-webkit-appearance:none;appearance:none;position:absolute;inset:0;width:100%;height:100%;opacity:0;margin:0;cursor:pointer}
.ge-toggle::after{content:'';position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s var(--ease);pointer-events:none}
.ge-toggle:has(input:checked){background:var(--ok)}
.ge-toggle:has(input:checked)::after{transform:translateX(14px)}
.admin-subrow{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px}
.admin-subrow p{flex:1 1 auto;min-width:220px}
.admin-subrow .ge-btn{flex:none}
.admin-subrow .order-error{flex-basis:100%;text-align:left;margin:0}
.admin-h2-flat{font-size:15px;font-weight:700;margin:0 0 16px}
summary.admin-h2-flat{cursor:pointer;list-style:none;margin:0}
summary.admin-h2-flat::-webkit-details-marker{display:none}
.admin-details[open] summary.admin-h2-flat{margin:0 0 4px}
.admin-h2-flat--row{display:flex;align-items:center;justify-content:space-between;gap:16px}
.ge-toggle-label{display:flex;align-items:center;gap:10px;font-size:13px;font-weight:600;color:var(--ink-soft);cursor:pointer}
/* Пилюльная кнопка — общий компонент, используется в редакторе ячеек (grille-admin.css),
   в настройках доставки (admin.php) и в карточках решёток (admin_grilles.php). */
.ge-btn{font:inherit;font-size:13px;font-weight:600;padding:9px 16px;border-radius:999px;border:1px solid var(--line);background:var(--bg);color:var(--ink);cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:6px;transition:background .15s var(--ease),border-color .15s var(--ease),color .15s var(--ease),transform .1s var(--ease-out)}
.ge-btn svg{width:15px;height:15px;flex:none}
.ge-btn[hidden]{display:none}
.ge-btn:hover{border-color:var(--ink)}
.ge-btn:active{transform:scale(.97)}
.ge-btn.is-active{background:var(--ink);color:var(--on-accent);border-color:var(--ink)}
.ge-btn--accent{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.ge-btn--accent:hover{opacity:.88;border-color:var(--accent)}
.ge-btn--danger{background:none;color:var(--danger);border-color:var(--danger)}
.ge-btn--danger:hover{background:var(--danger);color:#fff}

/* Основная кнопка отправки формы в кабинетах (richmark_main admin +
   richmark-id admin — один и тот же визуальный стандарт: см.
   button[type=submit] в richmark-id/app/Views/admin-shell-layout.php).
   Раньше админ-формы занимали .buy-btn.wide — кнопку витринного
   конструктора коврика, чужую по смыслу и по факту (растянутая на всю
   ширину, другой padding/высота). Здесь — тот же приём, что и в richmark-id:
   кнопка по содержимому, не на всю ширину формы. */
.admin-submit-btn{
  margin-top:24px;border:0;border-radius:2px;padding:15px 20px;min-height:52px;
  background:var(--accent);color:var(--on-accent);font-family:var(--font-display);font-weight:600;
  font-size:13px;letter-spacing:.16em;text-transform:uppercase;
  display:inline-flex;align-items:center;justify-content:center;
  transition:opacity .25s var(--ease);
}
.admin-submit-btn:hover{opacity:.86}

/* Аннотация по наведению/фокусу для icon-only кнопок в кабинете — тот же
   компонент, что в richmark-id/app/Views/admin-shell-layout.php (там же и
   обоснование: нативный title медленный и не стилизуется). */
[data-tip]{position:relative}
[data-tip]::after{
  content:attr(data-tip);position:absolute;bottom:calc(100% + 9px);left:50%;
  transform:translateX(-50%) translateY(4px);
  background:var(--ink);color:var(--bg);font-size:11px;font-weight:600;
  padding:6px 10px;border-radius:6px;white-space:nowrap;
  opacity:0;pointer-events:none;transition:opacity .15s var(--ease),transform .15s var(--ease);
  z-index:30;
}
[data-tip]::before{
  content:'';position:absolute;bottom:calc(100% + 4px);left:50%;transform:translateX(-50%);
  border:5px solid transparent;border-top-color:var(--ink);
  opacity:0;pointer-events:none;transition:opacity .15s var(--ease);z-index:30;
}
[data-tip]:hover::after,[data-tip]:focus-visible::after{opacity:1;transform:translateX(-50%) translateY(0)}
[data-tip]:hover::before,[data-tip]:focus-visible::before{opacity:1}
.color-manage-list{list-style:none;margin:0 0 16px;padding:0;display:flex;flex-direction:column;gap:2px}
.color-manage-row{display:flex;align-items:center;gap:12px;padding:8px 4px;border-bottom:1px solid var(--hairline)}
.color-manage-row:last-child{border-bottom:0}
.color-manage-name{font-size:14px;font-weight:600;flex:1;min-width:0}
.color-manage-hex{font-size:12px;font-variant-numeric:tabular-nums;text-transform:uppercase}
.color-add-form{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.color-add-form input[type="color"]{width:44px;height:44px;padding:2px;border:1px solid var(--line);border-radius:10px;background:var(--surface);cursor:pointer;flex:none}
.color-add-form input[type="text"]{flex:1;min-width:200px;border:1px solid var(--line);border-radius:12px;padding:12px 14px;background:var(--surface);color:var(--ink);font:15px/1.4 var(--font-body)}
.color-add-form input[type="text"]:focus{outline:none;border-color:var(--ink)}

.admin-danger{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 16px;border:1px solid var(--danger);border-radius:16px;padding:16px 20px;margin-top:20px}
.admin-danger p{margin:0;font-size:13px;color:var(--ink-soft);flex:1 1 240px}
.admin-danger form{flex:none}
.badge{display:inline-flex;align-items:center;font-size:11px;font-weight:700;letter-spacing:.02em;padding:4px 10px;border-radius:999px;flex:none}
.badge-on{background:var(--badge-on-bg);color:var(--badge-on-fg)}
.badge-off{background:var(--fill);color:var(--ink-soft)}
.grille-admin-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:16px}
.grille-admin-card{border:1px solid var(--hairline);border-radius:16px;overflow:hidden;background:var(--surface);display:flex;flex-direction:column;transition:border-color .25s var(--ease),box-shadow .25s var(--ease)}
.grille-admin-card:hover{border-color:var(--line);box-shadow:0 10px 28px rgba(0,0,0,.06)}
.grille-admin-thumb{width:100%;aspect-ratio:4/3;object-fit:cover;display:block;background:var(--fill)}
.grille-admin-thumb--empty{display:flex;align-items:center;justify-content:center;color:var(--ink-soft);font-size:12.5px}
.grille-admin-body{padding:14px 16px;display:flex;flex-direction:column;gap:4px;flex:1}
.grille-admin-brand{font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-soft)}
.grille-admin-title{font-weight:700;font-size:14.5px;line-height:1.35}
.grille-admin-foot{margin-top:12px;padding-top:12px;border-top:1px solid var(--hairline);display:flex;flex-direction:column;align-items:flex-start;gap:10px}
.grille-admin-actions{display:flex;flex-wrap:wrap;gap:6px}
.admin-action-btn{display:inline-flex;align-items:center;gap:5px;padding:6px 10px 6px 8px;border:1px solid var(--hairline);border-radius:999px;background:none;font:inherit;font-size:12px;font-weight:600;color:var(--ink-soft);text-decoration:none;cursor:pointer;transition:border-color .15s var(--ease),color .15s var(--ease),background .15s var(--ease)}
.admin-action-btn svg{flex:none;opacity:.75;transition:opacity .15s var(--ease)}
.admin-action-btn:hover{border-color:var(--ink);color:var(--ink);background:var(--fill)}
.admin-action-btn:hover svg{opacity:1}

/* ============ /admin/grilles — дашборд (справочник марок/моделей + добавление + список) ============ */
/* ============ Админка: общий каркас (сайдбар + контент) — на всех /admin* страницах ============ */
/* background/color явно на .admin-shell, не только на body — переменные
   темы переопределены СКОУПЛЕНО на .admin-shell (а не на :root, см. блок
   токенов выше), а body{color:var(--ink)} выше по дереву вычисляется ДО
   входа в этот скоуп и просто наследуется вниз уже готовым (светлым)
   значением. Без явного color здесь все заголовки без своего color оставались
   бы тёмным текстом на тёмном фоне в dark mode. */
.admin-shell{display:flex;align-items:stretch;min-height:100vh;background:var(--bg);color:var(--ink)}
.admin-sidebar{width:240px;flex:none;border-right:1px solid var(--hairline);padding:24px 16px;display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto}
.admin-brand{display:block;margin:4px 0 24px}
.admin-brand img{display:block;height:22px;width:auto}
.admin-nav{display:flex;flex-direction:column;gap:2px;flex:1}
.admin-nav-link{padding:10px 12px;border-radius:10px;font-size:13.5px;font-weight:600;color:var(--ink-soft);text-decoration:none;transition:background .15s var(--ease),color .15s var(--ease)}
.admin-nav-link:hover{background:var(--fill);color:var(--ink)}
.admin-nav-link.is-active{background:var(--ink);color:var(--bg)}
.admin-sidebar-foot{display:flex;flex-direction:column;gap:2px;padding-top:16px;margin-top:16px;border-top:1px solid var(--hairline)}
.admin-sidebar-foot a{padding:10px 12px;border-radius:10px;font-size:13px;color:var(--ink-soft);text-decoration:none}
.admin-sidebar-foot a:hover{background:var(--fill);color:var(--ink)}
.admin-main{flex:1;min-width:0;padding:40px 48px}
.admin-main .container{margin:0;padding:0}
.admin-main .container:not(.narrow){max-width:1240px}
@media (max-width:860px){
  .admin-shell{flex-direction:column}
  .admin-sidebar{position:static;height:auto;width:auto;flex-direction:row;flex-wrap:wrap;align-items:center;border-right:0;border-bottom:1px solid var(--hairline)}
  .admin-brand{margin:0 12px 0 0}
  .admin-nav{flex-direction:row;flex-wrap:wrap;flex:none}
  .admin-sidebar-foot{flex-direction:row;margin:0 0 0 auto;padding:0;border-top:0}
  .admin-main{padding:24px 16px}
}

.dash-head{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:12px 24px;margin-bottom:24px}
.dash-stats{display:flex;flex-wrap:wrap;gap:6px 20px;font-size:13px;color:var(--ink-soft)}
.dash-stats b{color:var(--ink);font-weight:700}
.dash-grid{display:grid;grid-template-columns:300px minmax(0,1fr);gap:32px;align-items:start}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:32px;align-items:start;max-width:900px}
@media (max-width:860px){ .two-col{grid-template-columns:1fr} }
.dash-panel-title{font-size:13px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;margin:0 0 4px}
.dash-panel-hint{font-size:12.5px;margin:0 0 16px;line-height:1.5}
/* не sticky: рядом в той же колонке теперь второй блок (преимущества под кнопкой
   «В корзину») — прилипающий список наезжал бы на него при скролле, т.к. sticky
   не резервирует место под соседей, а лишь не выходит за пределы своего контейнера */
.dash-directory{border:1px solid var(--hairline);border-radius:20px;padding:20px;max-height:70vh;overflow-y:auto}
.dash-main{min-width:0}

.cat-tree{display:flex;flex-direction:column;gap:4px}
.cat-brand{border-top:1px solid var(--hairline);padding-top:10px;margin-top:10px}
.cat-brand:first-child{border-top:0;padding-top:0;margin-top:0}
.cat-row{display:flex;align-items:center;gap:8px;min-height:32px;border-radius:8px;padding:2px 4px 2px 0}
.cat-row--brand{font-weight:700;font-size:14px}
.cat-row--model{font-size:13px;color:var(--ink);padding-left:14px}
.cat-label{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cat-model-years,.cat-model-count{font-size:11.5px;flex:none}
.cat-model-count{min-width:1.4em;text-align:right}
.cat-models{list-style:none;margin:2px 0 0;padding:0}
.cat-row-actions{display:flex;gap:2px;flex:none;opacity:0;transition:opacity .15s var(--ease)}
.cat-row:hover .cat-row-actions,.cat-row:focus-within .cat-row-actions{opacity:1}
.cat-icon-btn{display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:0;background:none;border-radius:7px;color:var(--ink-soft);transition:background .15s var(--ease),color .15s var(--ease)}
.cat-icon-btn:hover{background:var(--fill);color:var(--ink)}
.cat-icon-btn--danger:hover{background:var(--badge-danger-bg);color:var(--danger)}

.cat-edit-form{flex:1;display:flex;align-items:center;gap:4px;min-width:0}
.cat-edit-input{flex:1;min-width:0;font:inherit;font-size:inherit;font-weight:inherit;padding:3px 6px;border:1px solid var(--ink);border-radius:6px;background:var(--surface);color:var(--ink)}
.cat-edit-input:focus{outline:none}
.cat-edit-save,.cat-edit-cancel{display:flex;align-items:center;justify-content:center;width:22px;height:22px;padding:0;border:0;background:none;border-radius:6px;flex:none}
.cat-edit-save{color:var(--ok)}
.cat-edit-save:hover{background:var(--badge-on-bg)}
.cat-edit-cancel{color:var(--ink-soft)}
.cat-edit-cancel:hover{background:var(--fill)}

.grille-group{margin-top:20px;padding-top:20px;border-top:1px solid var(--hairline)}
.grille-group:first-of-type{margin-top:16px}
.grille-group-title{font-size:15px;font-weight:700;margin:0 0 14px}
@media (max-width: 960px){
  .dash-grid{grid-template-columns:1fr}
  .dash-directory{max-height:none}
}
.co-form select{border:1px solid var(--line);border-radius:12px;padding:12px 40px 12px 14px;font:15px/1.4 var(--font-body);min-height:46px;background-color:var(--surface);color:var(--ink);background-position:right 14px center;background-size:16px;transition:border-color .25s var(--ease)}
.co-form select:focus{outline:none;border-color:var(--ink)}
.co-form select:hover{border-color:var(--ink)}
.admin-orders{overflow-x:auto;border:1px solid var(--hairline);border-radius:16px}
.admin-orders table{border-collapse:collapse;width:100%;font-size:13px;min-width:760px}
.admin-orders th,.admin-orders td{text-align:left;padding:10px 12px;border-bottom:1px solid var(--hairline);vertical-align:top}
.admin-orders th{font-size:11px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-soft);background:var(--fill)}
.admin-orders tr:last-child td{border-bottom:0}
.order-comment{display:inline-block;margin-top:6px;padding:6px 8px;border-radius:8px;background:var(--fill);font-size:12.5px;line-height:1.4;max-width:280px;overflow-wrap:anywhere}
.nowrap{white-space:nowrap}

/* количество в оформлении */
.co-qty{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--hairline);font-size:14px;font-weight:700}

/* Тёмная тема — прямые (не через var(--токен)) переопределения свойств.
   ВАЖНО: этот блок должен идти В КОНЦЕ файла, после обычных правил для тех же
   селекторов — при равной специфичности CSS решает конфликт по порядку в
   файле, а не по тому, что внутри @media. Блок токенов в самом начале файла
   этой проблемы не имеет (там всё решается через переменные), но прямые
   свойства вроде background у .site-header — уже нет, у них своя обычная
   декларация есть ниже по файлу, и она бы победила, стой этот блок раньше. */
@media (prefers-color-scheme: dark){
  /* Лого — чёрные заливки в SVG, инвертируем в белый вместо инлайна ради
     currentColor (общий бренд-ассет с richmark-id). */
  .admin-brand img,.logo-img{filter:brightness(0) invert(1)}
  /* rgba(255,255,255,.92) зашит отдельно от токенов (нужна полупрозрачность
     для backdrop-filter), переопределяем целиком. */
  .site-header{background:rgba(28,28,30,.92)}
}
/* Те же самые два "полупрозрачно-белых" фона, но у мобильных липких панелей —
   они объявлены внутри @media(max-width:960px) (строки ~496/507), поэтому
   переопределение тоже должно матчить ширину, иначе более поздний по файлу,
   но более узкий по медиа-условию блок не победит на десктопе, а тут наоборот
   нужно именно на мобильной ширине. */
@media (max-width:960px) and (prefers-color-scheme: dark){
  .buy-row,.sticky-bar{background:rgba(28,28,30,.94)}
}

/* SEO-блоки: крошки, текст и FAQ страниц (тексты — из админки /admin/seo) */
.breadcrumbs{margin:0 0 14px;font-size:13px;color:var(--ink-soft)}
.breadcrumbs ol{display:flex;flex-wrap:wrap;gap:4px 8px;list-style:none;margin:0;padding:0}
.breadcrumbs li+li::before{content:"/";margin-right:8px;opacity:.5}
.breadcrumbs a{color:inherit;text-decoration:underline;text-underline-offset:3px}
.seo-body{max-width:820px;margin:clamp(32px,5vw,64px) auto 0;padding-bottom:clamp(24px,4vw,48px)}
.seo-text h2,.seo-faq h2{font-family:var(--font-display);font-size:clamp(18px,2vw,22px);font-weight:600;margin:28px 0 10px}
.seo-text h3{font-size:16px;margin:20px 0 8px}
.seo-text p,.seo-text li,.seo-faq p{font-size:15px;line-height:1.65;color:var(--ink-soft);margin:0 0 12px}
.seo-text ul,.seo-text ol{padding-left:20px;margin:0 0 12px}
.seo-faq details{border-bottom:1px solid var(--line);padding:12px 0}
.seo-faq summary{cursor:pointer;font-weight:600;font-size:15px;color:var(--ink)}
.seo-faq details p{margin:10px 0 0}
.pickup-field input{width:100%}
/* компактные поля: своя высота вместо базовых 46px */
.cat-edit-input,.admin-inline select,.sp-precise input{min-height:0}
