/* Токены и компоненты по DESIGN.md (Nike commerce): ink/white/soft-cloud, пилюльные кнопки, hairline вместо теней, карточки без радиуса. */
:root {
  --ink: #111111;
  --canvas: #ffffff;
  --cloud: #f5f5f5;
  --charcoal: #39393b;
  --mute: #707072;
  --stone: #9e9ea0;
  --hairline: #cacacb;
  --hairline-soft: #e5e5e5;
  --sale: #d30005;
  --success: #007d48;
  --info: #1151ff;

  --font-ui: 'Inter', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Oswald', 'Arial Narrow', Impact, sans-serif;

  --sp-xs: 4px; --sp-sm: 8px; --sp-md: 12px; --sp-lg: 18px; --sp-xl: 24px; --sp-xxl: 30px; --sp-section: 48px;
  --r-field: 24px;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1440px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 16px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img, canvas, svg { max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- типографика ---------- */
.display { font: 700 clamp(56px, 10vw, 128px)/0.9 var(--font-display); text-transform: uppercase; letter-spacing: 0; }
.display-hero { font: 700 clamp(32px, 13cqw, 128px)/0.92 var(--font-display); text-transform: uppercase; letter-spacing: 0; }
.h-xl { font: 500 clamp(26px, 3.4vw, 32px)/1.2 var(--font-ui); }
.h-lg { font: 500 24px/1.2 var(--font-ui); }
.h-md { font: 500 16px/1.75 var(--font-ui); }
.h-caps { font: 600 clamp(32px, 4.4vw, 56px)/0.95 var(--font-display); text-transform: uppercase; }
.caption { font: 500 14px/1.5 var(--font-ui); }
.muted { color: var(--mute); }
.hint { display: block; color: var(--mute); font-size: 12px; line-height: 1.4; margin-top: 6px; }

/* ---------- кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 32px; border-radius: 9999px; border: 1px solid transparent; font: 500 16px/1 var(--font-ui); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, color .15s, border-color .15s, opacity .15s; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--charcoal); }
.btn-secondary { background: var(--cloud); color: var(--ink); }
.btn-secondary:hover { background: var(--hairline-soft); }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--hairline); }
.btn-outline:hover { border-color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--cloud); }
.btn-danger { background: #fff; color: var(--sale); border-color: var(--hairline); }
.btn-danger:hover { border-color: var(--sale); }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 56px; padding: 0 40px; font-size: 18px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 50%; background: var(--cloud); border: 0; display: inline-grid; place-items: center; cursor: pointer; font-size: 18px; }
.btn-icon:hover { background: var(--hairline-soft); }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-weight: 500; text-decoration: underline; cursor: pointer; color: var(--ink); }

/* ---------- шапка / подвал ---------- */
.utility-bar { background: var(--cloud); font: 500 12px/36px var(--font-ui); height: 36px; }
.utility-inner { display: flex; justify-content: space-between; gap: 16px; overflow: hidden; white-space: nowrap; }
.utility-inner a { text-decoration: none; }
.utility-inner a:hover { text-decoration: underline; }
.nav { height: 56px; background: #fff; box-shadow: inset 0 -1px 0 var(--hairline-soft); position: sticky; top: 0; z-index: 20; }
.nav-inner { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font: 700 24px/1 var(--font-display); letter-spacing: .04em; text-decoration: none; text-transform: uppercase; }
.brand-mark { display: block; height: 1.15em; width: auto; flex: none; }
.brand-sm { font-size: 18px; }
.nav-links { display: flex; gap: 4px; flex: 1; }
.nav-links a { padding: 8px 14px; border-radius: 9999px; text-decoration: none; font-weight: 500; }
.nav-links a:hover { background: var(--cloud); }
.nav-links a[aria-current] { box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }
.nav-actions { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.footer { margin-top: var(--sp-section); border-top: 1px solid var(--hairline-soft); padding-top: 32px; color: var(--mute); font-size: 14px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; }
.footer-inner p { max-width: 360px; margin-top: 8px; }
.footer-inner strong { color: var(--ink); }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer h4 { color: var(--ink); font-weight: 500; margin-bottom: 8px; font-size: 14px; }
.footer a { display: block; text-decoration: none; padding: 2px 0; }
.footer a:hover { color: var(--ink); text-decoration: underline; }
.footer-legal { padding-block: 32px; font-size: 12px; }

/* ---------- формы ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.field label, .label { display: block; font: 500 14px/1.4 var(--font-ui); margin-bottom: 6px; }
input, select, textarea { width: 100%; font: 400 16px/1.5 var(--font-ui); color: var(--ink); background: var(--cloud); border: 1px solid transparent; border-radius: var(--r-field); padding: 0 20px; height: 48px; transition: background-color .15s, border-color .15s; }
textarea { height: auto; min-height: 96px; padding: 12px 20px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23111' stroke-width='2'%3E%3Cpath d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 20px center; padding-right: 44px; }
input:focus, select:focus, textarea:focus { background-color: #fff; border-color: var(--ink); outline: none; }
input::placeholder, textarea::placeholder { color: var(--stone); }
input[aria-invalid=true], .invalid { border-color: var(--sale); }
.form-error { color: var(--sale); font-size: 14px; font-weight: 500; }
.form-ok { color: var(--success); font-size: 14px; font-weight: 500; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row-2 { grid-template-columns: 1fr; } }

/* чипы-радио (размеры, ориентация, доставка) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.chip span { display: inline-flex; align-items: center; gap: 8px; min-width: 56px; justify-content: center; height: 44px; padding: 0 20px; border-radius: 9999px; border: 1px solid var(--hairline); background: #fff; font: 500 16px/1 var(--font-ui); transition: border-color .15s, background-color .15s, color .15s; }
.chip:hover span { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.chip .ori { display: inline-block; border: 1.5px solid currentColor; border-radius: 2px; }
.chip-lg span { height: 56px; padding: 0 24px; }
.chips-block { display: grid; gap: 8px; }
.opt { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 18px; cursor: pointer; }
.opt:hover { border-color: var(--ink); }
.opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.opt input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--ink); flex: none; padding: 0; }
.opt b { font-weight: 500; display: block; }
.opt small { color: var(--mute); }
.opt .opt-price { margin-left: auto; font-weight: 500; white-space: nowrap; }

/* ползунки */
input[type=range] { -webkit-appearance: none; appearance: none; height: 24px; padding: 0; background: transparent; border: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--hairline); border-radius: 2px; }
input[type=range]::-moz-range-track { height: 2px; background: var(--hairline); border-radius: 2px; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); margin-top: -9px; cursor: grab; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); cursor: grab; }
input[type=range]:focus { background: transparent; }
input[type=range]:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 12px; }
.num { width: 88px; height: 40px; padding: 0 12px; text-align: right; border-radius: 12px; font-variant-numeric: tabular-nums; }
.slider-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; }
.slider-row label { grid-column: 1 / -1; display: flex; justify-content: space-between; font: 500 14px/1.4 var(--font-ui); }
.unit { display: inline-flex; align-items: center; gap: 6px; color: var(--mute); font-size: 14px; }

/* ---------- бейджи, статусы ---------- */
.badge { display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border-radius: 9999px; font: 500 12px/1 var(--font-ui); background: var(--cloud); color: var(--ink); white-space: nowrap; }
.badge-neutral { background: var(--cloud); }
.badge-info { background: #e6edff; color: var(--info); }
.badge-success { background: #e1f4ea; color: var(--success); }
.badge-done { background: var(--ink); color: #fff; }
.badge-sale { background: #fde7e7; color: var(--sale); }

/* ---------- диалог ---------- */
dialog { border: 0; padding: 0; background: #fff; color: var(--ink); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); overflow: auto; }
dialog::backdrop { background: rgba(17, 17, 17, .55); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 24px 24px 0; }
.dlg-body { padding: 24px; }
.dlg-foot { padding: 0 24px 24px; display: grid; gap: 12px; }
dialog.wide { width: min(760px, calc(100vw - 24px)); }

/* ---------- тосты ---------- */
#toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 9999px; font: 500 14px/1.4 var(--font-ui); transition: opacity .4s, transform .4s; }
.toast-error { background: var(--sale); }
.toast-ok { background: var(--success); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- лендинг ---------- */
.campaign { background: var(--ink); color: #fff; overflow: hidden; }
.campaign-inner { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); min-height: min(78vh, 720px); }
/* Размер заголовка считается от ширины колонки: самая длинная строка «ТВОЯ ФУТБОЛКА.» = 7,39 em, берём 13cqw — всегда две строки. */
.campaign-copy { container-type: inline-size; padding: clamp(32px, 6vw, 80px) var(--gutter); display: flex; flex-direction: column; justify-content: flex-end; gap: 28px; }
.campaign-copy p { max-width: 460px; font-size: 18px; color: var(--hairline); }
.campaign-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-on-dark { background: #fff; color: var(--ink); }
.btn-on-dark:hover { background: var(--hairline-soft); }
.btn-line-dark { background: transparent; color: #fff; border-color: #4b4b4d; }
.btn-line-dark:hover { border-color: #fff; }
.campaign-stage { background: var(--cloud); display: grid; place-items: center; position: relative; min-height: 360px; }
.campaign-stage canvas { width: 100%; height: 100%; display: block; }
@media (max-width: 880px) { .campaign-inner { grid-template-columns: 1fr; } .campaign-stage { order: -1; aspect-ratio: 1 / 1; min-height: 0; } .campaign-copy { padding-block: 40px; } }
.section { padding-top: var(--sp-section); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.step { background: var(--cloud); padding: 24px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }
.step b { font: 700 56px/1 var(--font-display); }
.step h3 { font-weight: 500; font-size: 20px; margin-bottom: 4px; }
.step p { color: var(--charcoal); font-size: 14px; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .steps { grid-template-columns: 1fr; } .step { min-height: 0; } }
.feature-band { background: var(--ink); color: #fff; padding: clamp(32px, 5vw, 64px); display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.feature-band ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.feature-band li { border-top: 1px solid #4b4b4d; padding-top: 16px; }
.feature-band li b { display: block; font-weight: 500; font-size: 18px; }
.feature-band li span { color: var(--stone); font-size: 14px; }
@media (max-width: 780px) { .feature-band { grid-template-columns: 1fr; } }
.price-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.price-card { background: var(--cloud); padding: 32px; }
.price-card .price { font: 700 clamp(48px, 6vw, 72px)/1 var(--font-display); margin: 8px 0 12px; }
.price-card .price small { font: 500 16px var(--font-ui); color: var(--mute); }
.tiers { width: 100%; border-collapse: collapse; }
.tiers td { padding: 12px 0; border-top: 1px solid var(--hairline); }
.tiers td:last-child { text-align: right; font-weight: 500; }
@media (max-width: 780px) { .price-grid { grid-template-columns: 1fr; } }
.faq { border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary { list-style: none; cursor: pointer; padding: 24px 0; font: 500 16px/1.75 var(--font-ui); display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-size: 24px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { padding: 0 0 24px; color: var(--charcoal); max-width: 720px; }

/* ---------- страницы с формой ---------- */
.auth-page { display: grid; place-items: center; padding: 64px var(--gutter); }
.auth-card { width: min(440px, 100%); }
.auth-card h1 { margin-bottom: 8px; }
.auth-card > p { color: var(--mute); margin-bottom: 24px; }
.auth-switch { text-align: center; color: var(--mute); font-size: 14px; }

/* ---------- быстрый вход через сервисы ---------- */
.auth > * + * { margin-top: 16px; }
.social-title { font: 500 16px/1.5 var(--font-ui); margin: 0 0 12px; }
.social-list { display: grid; gap: 8px; }
.btn-social { height: 52px; min-height: 44px; justify-content: flex-start; gap: 12px; padding: 0 20px 0 12px; }
.social-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9999px; background: var(--canvas); color: var(--ink); font: 700 13px/1 var(--font-ui); }
.social-hint { margin-top: 12px; }
.auth-toggle { height: 48px; min-height: 44px; background: transparent; border-color: var(--hairline); }
.cart-auth { background: var(--cloud); padding: 24px; margin-top: 24px; }
.cart-auth > p { margin: 4px 0 16px; }
.cart-auth .btn-secondary { background: var(--canvas); }
.cart-auth .social-ico { background: var(--cloud); }

/* ---------- конструктор ---------- */
.designer { display: grid; grid-template-columns: minmax(0, 1fr) 440px; gap: 0; align-items: start; max-width: var(--max); margin: 0 auto; }
.stage-col { padding: 16px 0 16px var(--gutter); position: sticky; top: 56px; }
.stage { position: relative; background: var(--cloud); height: min(calc(100vh - 56px - 32px - 36px - 44px), 900px); min-height: 480px; overflow: hidden; }
.stage canvas { display: block; outline: none; }
.stage.dragover::after { content: 'Отпустите, чтобы загрузить'; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(17,17,17,.72); color: #fff; font: 700 clamp(28px, 4vw, 48px)/1 var(--font-display); text-transform: uppercase; }
.stage-bar { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.seg { display: inline-flex; background: #fff; border-radius: 9999px; padding: 3px; border: 1px solid var(--hairline-soft); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 9999px; font: 500 13px/1 var(--font-ui); }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { opacity: .35; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
.stage-note { padding: 8px 0 0; font-size: 12px; color: var(--mute); display: flex; gap: 16px; flex-wrap: wrap; }
.panel { padding: 16px var(--gutter) 48px 32px; }
.p-row { padding: 20px 0; border-bottom: 1px solid var(--hairline); }
.p-row:first-child { padding-top: 8px; }
.p-row h2 { font: 500 16px/1.75 var(--font-ui); display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.p-row h2 small { font-weight: 400; color: var(--mute); font-size: 14px; }
.dropzone { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--cloud); border: 1px dashed var(--hairline); border-radius: 18px; cursor: pointer; }
.dropzone:hover { border-color: var(--ink); }
.dropzone .thumb { width: 56px; height: 56px; background: #fff; flex: none; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--hairline-soft); }
.dropzone .thumb img { width: 100%; height: 100%; object-fit: contain; }
.dropzone b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.dropzone small { color: var(--mute); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.quality { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; padding: 12px 14px; border-radius: 12px; background: var(--cloud); margin-top: 12px; line-height: 1.4; }
.quality i { flex: none; width: 10px; height: 10px; border-radius: 50%; margin-top: 4px; background: var(--success); }
.quality.ok i { background: #e0a100; }
.quality.low i { background: var(--sale); }
.sum { display: grid; gap: 6px; font-size: 14px; }
.sum div { display: flex; justify-content: space-between; gap: 16px; }
.sum .total { font: 500 24px/1.2 var(--font-ui); padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--hairline); }
.sale-text { color: var(--sale); font-weight: 500; }
.qty { display: inline-flex; align-items: center; gap: 4px; }
.qty input { width: 64px; text-align: center; padding: 0; }
@media (max-width: 1020px) {
  .designer { grid-template-columns: 1fr; }
  .stage-col { position: static; padding: 12px var(--gutter) 0; }
  .stage { height: min(112vw, 72vh, 760px); min-height: 360px; }
  .panel { padding: 8px var(--gutter) 48px; }
}

/* ---------- кабинет ---------- */
.page-head { padding: 40px 0 24px; }
.tabs { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.orders { display: grid; gap: 8px; }
.order-card { display: grid; grid-template-columns: 112px 1fr auto; gap: 20px; align-items: center; background: #fff; border: 1px solid var(--hairline-soft); padding: 12px; text-decoration: none; transition: border-color .15s; }
.order-card:hover { border-color: var(--ink); }
.order-card .thumb { width: 112px; aspect-ratio: 1 / 1; background: var(--cloud); display: block; object-fit: cover; }
.order-card .meta { display: grid; gap: 4px; min-width: 0; }
.order-card .num-id { font: 500 18px/1.2 var(--font-ui); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.order-card .price { font: 500 18px/1 var(--font-ui); text-align: right; display: grid; gap: 8px; justify-items: end; }
@media (max-width: 560px) { .order-card { grid-template-columns: 84px 1fr; } .order-card .thumb { width: 84px; } .order-card .price { grid-column: 1 / -1; justify-items: start; text-align: left; } }
.empty { background: var(--cloud); padding: 64px 24px; text-align: center; display: grid; gap: 16px; justify-items: center; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 32px; align-items: start; }
@media (max-width: 960px) { .detail { grid-template-columns: 1fr; } }
.detail-media { background: var(--cloud); }
.detail-media img { display: block; width: 100%; }
.thumb-row { display: flex; gap: 8px; padding: 8px 0 0; flex-wrap: wrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li { position: relative; padding: 0 0 20px 28px; }
.timeline li::before { content: ''; position: absolute; left: 4px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.timeline li::after { content: ''; position: absolute; left: 8.5px; top: 18px; bottom: -4px; width: 1px; background: var(--hairline); }
.timeline li:last-child::after { display: none; }
.timeline li b { font-weight: 500; }
.timeline li small { display: block; color: var(--mute); }
.steps-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 8px 0 4px; }
.steps-bar i { height: 4px; background: var(--hairline-soft); display: block; }
.steps-bar i.on { background: var(--ink); }
.callout { background: #e1f4ea; color: var(--success); padding: 16px 20px; font-weight: 500; margin-bottom: 24px; }

/* ---------- админка ---------- */
.admin-wrap { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter) 64px; }
.admin-bar { display: flex; align-items: center; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 16px; }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.admin-filters .chip span { height: 36px; padding: 0 16px; font-size: 14px; }
.admin-filters .chip em { font-style: normal; opacity: .6; margin-left: 4px; }
.admin-search { width: 260px; height: 40px; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr) 520px; gap: 24px; align-items: start; }
@media (max-width: 1180px) { .admin-grid { grid-template-columns: 1fr; } }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 500; color: var(--mute); padding: 8px 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap; }
.table td { padding: 12px; border-bottom: 1px solid var(--hairline-soft); vertical-align: middle; }
.table tr[data-id] { cursor: pointer; }
.table tr[data-id]:hover td { background: var(--cloud); }
.table tr.sel td { background: var(--cloud); box-shadow: inset 2px 0 0 var(--ink); }
.table td:first-child, .table th:first-child { padding-left: 12px; width: 68px; }
.table-scroll { overflow-x: auto; }
.table img { width: 44px; min-width: 44px; max-width: none; height: 44px; object-fit: cover; background: var(--cloud); display: block; }
.table tr[data-id]:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.table tr[data-id]:focus:not(:focus-visible) { outline: none; }
.admin-detail { position: sticky; top: 72px; border: 1px solid var(--hairline-soft); padding: 20px; max-height: calc(100vh - 96px); overflow: auto; }
.print-preview { background-color: #fff; background-image: linear-gradient(45deg, #e5e5e5 25%, transparent 25%, transparent 75%, #e5e5e5 75%), linear-gradient(45deg, #e5e5e5 25%, transparent 25%, transparent 75%, #e5e5e5 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; border: 1px solid var(--hairline-soft); padding: 12px; display: grid; place-items: center; }
.print-preview img { max-width: 100%; max-height: 360px; display: block; }
.status-form { display: grid; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 24px; }
.stat { background: var(--cloud); padding: 16px 20px; }
.stat b { display: block; font: 700 36px/1.1 var(--font-display); }
.stat span { color: var(--mute); font-size: 13px; }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }
.pager { display: flex; gap: 8px; justify-content: center; padding-top: 16px; }
.note-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.kbd { font: 500 12px var(--font-ui); background: var(--cloud); padding: 2px 8px; border-radius: 9999px; }

@media (max-width: 720px) {
  .hide-sm { display: none !important; }
  .utility-inner a { display: none; }
  .nav-inner { gap: 12px; }
}
@media (max-width: 560px) {
  /* ссылки разделов — второй строкой шапки, чтобы «Магазин» и «Конструктор» были доступны с телефона */
  .nav, .nav-inner { height: auto; }
  .nav-inner { flex-wrap: wrap; row-gap: 0; }
  .nav-inner > .brand, .nav-actions { min-height: 52px; display: flex; align-items: center; }
  .nav-links { order: 3; flex: 1 0 100%; padding-bottom: 6px; overflow-x: auto; }
  .nav-links a { padding: 6px 12px; }
  .nav-actions { margin-left: auto; }
  .brand { font-size: 20px; }
  .seg span { padding: 0 11px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ---------- оформление заказа: Ozon ---------- */
.co-preview { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: center; background: var(--cloud); padding: 12px; }
.co-preview img { width: 120px; display: block; }
fieldset.bare { border: 0; padding: 0; margin: 0; min-width: 0; }
textarea.short { min-height: 72px; }
.inline-row { display: flex; gap: 8px; }
.inline-row input { flex: 1; min-width: 0; }
/* Карта пунктов выдачи Ozon */
.pvz { margin-top: 8px; display: grid; gap: 8px; }
.pvz-stage { position: relative; }
.pvz-map { position: relative; z-index: 0; height: 380px; border-radius: 18px; overflow: hidden; background: var(--cloud); border: 1px solid var(--hairline); }
.pvz-map.is-busy { cursor: progress; }
.pvz-note { position: absolute; z-index: 1; top: 12px; left: 12px; max-width: calc(100% - 80px); padding: 8px 16px; border-radius: 9999px; background: #fff; border: 1px solid var(--hairline); font-size: 14px; font-weight: 500; text-align: center; pointer-events: none; }
.pvz-note[hidden] { display: none; }
.pvz-geo { position: absolute; z-index: 1; left: 12px; bottom: 28px; height: 40px; padding: 0 16px; font-size: 14px; }
.pvz-zoom { position: absolute; z-index: 1; top: 12px; right: 12px; display: grid; border: 1px solid var(--hairline); border-radius: 9999px; overflow: hidden; background: #fff; }
.pvz-zoom button { width: 40px; height: 40px; border: 0; background: none; font: 500 20px/1 var(--font-ui); color: var(--ink); cursor: pointer; }
.pvz-zoom button + button { border-top: 1px solid var(--hairline-soft); }
.pvz-zoom button:hover { background: var(--cloud); }
.pvz-pin { width: 32px; height: 32px; cursor: pointer; } /* позицию задаёт Leaflet */
.pvz-cluster { display: grid; place-items: center; cursor: pointer; }
.pvz-cluster span { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--ink); color: #fff; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); font: 500 13px/1 var(--font-ui); transition: transform .12s; }
.pvz-cluster:hover span { transform: scale(1.1); }
.pvz-map .leaflet-control-attribution { font: 11px/1.4 var(--font-ui); }
.pvz-pin span { display: block; width: 18px; height: 18px; margin: 7px; border-radius: 50%; background: var(--ink); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--ink); transition: transform .12s; }
.pvz-pin.is-postamat span { border-radius: 5px; }
.pvz-pin:hover span, .pvz-pin:focus-visible span { transform: scale(1.25); }
.pvz-pin.is-active span { transform: scale(1.4); }
.pvz-pin.is-chosen span { position: relative; transform: scale(1.5); }
.pvz-pin.is-chosen span::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font: 700 10px/1 var(--font-ui); }
.pvz-card { display: flex; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--ink); border-radius: 18px; }
.pvz-card[hidden] { display: none; }
.pvz-info { display: grid; gap: 2px; min-width: 0; flex: 1; }
.pvz-info b { font-weight: 500; }
.pvz-info small { color: var(--mute); }
.pvz-card .btn { flex: none; height: 44px; }
@media (max-width: 599px) {
  .pvz-map { height: 320px; }
  .pvz-card { flex-direction: column; align-items: stretch; }
  .pvz-geo { bottom: 36px; }
}
.opt:has(input:disabled) { opacity: .5; }
.notice { background: var(--cloud); padding: 12px 16px; font-size: 14px; margin-top: 12px; }
.pay-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ozon-box { background: var(--cloud); padding: 14px 16px; display: grid; gap: 8px; }

/* ---------- магазин: витрина и карточка товара (DESIGN.md: product-card, PLP, PDP) ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; font: 500 14px/1.5 var(--font-ui); color: var(--mute); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); }

.shop-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; padding-bottom: 16px; box-shadow: inset 0 -1px 0 var(--hairline-soft); }
.shop-sort select { height: 40px; width: auto; min-width: 200px; border-radius: 9999px; background-color: var(--cloud); }

.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 8px; }
@media (max-width: 1023px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .product-grid { grid-template-columns: minmax(0, 1fr); gap: 32px 4px; } }

.pcard { display: block; text-decoration: none; background: var(--canvas); }
.pcard-media { position: relative; aspect-ratio: 1 / 1; background: var(--cloud); overflow: hidden; }
.pcard-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pcard.is-out .pcard-media img { opacity: .55; }
.pcard-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--stone); font: 500 14px/1 var(--font-ui); }
.badge-promo { position: absolute; top: 12px; left: 12px; background: var(--canvas); color: var(--ink); border: 1px solid var(--hairline); border-radius: 9999px; padding: 4px 12px; font: 500 12px/1.5 var(--font-ui); }
.pcard-body { display: grid; gap: 4px; padding-top: 12px; }
.pcard-body h3 { font: 500 16px/1.5 var(--font-ui); }
.pcard-price { font: 500 16px/1.5 var(--font-ui); margin-top: 4px; }
.pcard:focus-visible { outline-offset: 4px; }
.price-old { color: var(--mute); font-weight: 400; }
.price-card .price .price-old { font-size: .4em; font-weight: 400; margin-right: 4px; }
.sum .price-old { font-size: 14px; margin-right: 4px; }
.total .price-old { font-size: 14px; font-family: var(--font-ui); }
.sale { color: var(--sale); }

.pdp { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
@media (max-width: 900px) { .pdp { grid-template-columns: minmax(0, 1fr); } }
.pdp-gallery { display: grid; gap: 8px; }
.pdp-gallery.has-thumbs { grid-template-columns: 72px minmax(0, 1fr); }
.pdp-thumbs { display: flex; flex-direction: column; gap: 8px; }
.pdp-thumbs button { padding: 0; border: 0; background: var(--cloud); cursor: pointer; aspect-ratio: 1 / 1; width: 72px; box-shadow: inset 0 0 0 0 var(--ink); outline-offset: 2px; }
.pdp-thumbs button[aria-current] { box-shadow: inset 0 0 0 2px var(--ink); }
.pdp-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-main { position: relative; aspect-ratio: 1 / 1; background: var(--cloud); overflow: hidden; grid-column: -2; }
.pdp-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-nav { position: absolute; top: 50%; transform: translateY(-50%); background: var(--canvas); font-size: 24px; line-height: 1; }
.pdp-nav.prev { left: 12px; }
.pdp-nav.next { right: 12px; }
@media (max-width: 599px) {
  .pdp-gallery.has-thumbs { grid-template-columns: minmax(0, 1fr); }
  .pdp-thumbs { flex-direction: row; order: 2; overflow-x: auto; }
  .pdp-thumbs button { flex: none; width: 64px; }
  .pdp-main { grid-column: auto; }
}
.pdp-info { display: grid; gap: 24px; align-content: start; }
.pdp-price { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.stock { font: 500 14px/1.5 var(--font-ui); }
.stock.in { color: var(--success); }
.stock.out { color: var(--mute); }
.size-tags { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.size-tags li { min-width: 56px; height: 44px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--hairline); border-radius: 9999px; font: 500 16px/1 var(--font-ui); }
.pdp-desc { white-space: pre-line; color: var(--charcoal); }

/* админка: вкладки и фото товара */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ph-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-bottom: 12px; }
.ph-grid:empty { display: none; }
.ph-item { position: relative; aspect-ratio: 1 / 1; background: var(--cloud); overflow: hidden; }
.ph-item > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-item .badge { position: absolute; top: 6px; left: 6px; background: var(--ink); color: #fff; }
.ph-tools { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 4px; padding: 6px; background: rgba(17, 17, 17, .35); }
.ph-tools .btn-icon { width: 32px; height: 32px; font-size: 16px; background: var(--canvas); }
.ph-tools .btn-icon:disabled { opacity: .35; cursor: default; }

/* ---------- корзина и заказы магазина ---------- */
.cart-link { position: relative; text-decoration: none; color: var(--ink); }
.cart-link[aria-current] { box-shadow: inset 0 0 0 2px var(--ink); }
.cart-count { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9999px; background: var(--ink); color: #fff; font: 600 11px/18px var(--font-ui); text-align: center; }

.buy { display: grid; gap: 12px; }
.added { font: 500 14px/1.5 var(--font-ui); color: var(--success); }
.added a { color: inherit; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .cart-grid { grid-template-columns: minmax(0, 1fr); } }
.cart-main { display: grid; gap: 40px; min-width: 0; }
.cart-sum { background: var(--cloud); padding: 24px; display: grid; gap: 16px; position: sticky; top: 72px; }
@media (max-width: 900px) { .cart-sum { position: static; } }
.cart-lines { list-style: none; margin: 0; padding: 0; }
.cart-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; padding: 16px 0; box-shadow: inset 0 -1px 0 var(--hairline-soft); }
.cart-line:first-child { padding-top: 0; }
.cart-thumb { position: relative; display: block; width: 96px; aspect-ratio: 1 / 1; background: var(--cloud); overflow: hidden; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-info { display: grid; gap: 4px; align-content: start; min-width: 0; }
.cart-title { font: 500 16px/1.5 var(--font-ui); text-decoration: none; }
.cart-title:hover { text-decoration: underline; }
.cart-price { font: 400 14px/1.5 var(--font-ui); }
.cart-ctl { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 8px; }
.cart-ctl .link-btn { font-size: 14px; color: var(--mute); }
.cart-line-total { font: 500 16px/1.5 var(--font-ui); white-space: nowrap; }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty output { min-width: 28px; text-align: center; font-weight: 500; }
.qty .btn-icon { width: 36px; height: 36px; }
.qty .btn-icon:disabled { opacity: .35; cursor: default; }
@media (max-width: 560px) {
  .cart-line { grid-template-columns: 80px minmax(0, 1fr); }
  .cart-thumb { width: 80px; }
  .cart-line-total { grid-column: 2; }
}

.shop-items { list-style: none; margin: 0; padding: 0; }
.shop-items li { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; box-shadow: inset 0 -1px 0 var(--hairline-soft); }
.shop-items li:first-child { padding-top: 0; }
.shop-item-thumb { display: block; width: 64px; height: 64px; background: var(--cloud); overflow: hidden; }
.shop-item-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shop-item-info { display: grid; gap: 2px; min-width: 0; font-weight: 500; }
.shop-item-info a { text-decoration: none; }
.shop-item-info a:hover { text-decoration: underline; }
.shop-item-info small { font-weight: 400; font-size: 13px; }

/* вторичные ссылки шапки прячутся раньше, чем остальное: рядом корзина и кнопки входа */
@media (max-width: 1000px) { .hide-md { display: none !important; } }
/* на телефоне «Выйти» уходит из шапки в профиль: иначе шапка занимает три строки */
@media (max-width: 560px) { .hide-xs { display: none !important; } }

/* ---------- конструктор: две стороны и телефонная раскладка ---------- */
.stage-bar { align-items: center; }
.stage-bar-end { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.seg-sides span { height: 34px; padding: 0 18px; font-size: 14px; }
.seg .dot { display: inline-block; width: 6px; height: 6px; margin-left: 8px; border-radius: 50%; background: currentColor; }
.seg-btn { height: 38px; padding: 0 16px; border-radius: 9999px; border: 1px solid var(--hairline-soft); background: #fff; color: var(--ink); font: 500 13px/1 var(--font-ui); cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.seg-btn:hover { border-color: var(--ink); }
.seg-btn[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.seg-btn .sm { display: none; }
.dock { display: none; }
.cam-only { display: none; }
@media (pointer: coarse) { .cam-only { display: inline-flex; } }
.p-row h2 #side-name, .p-row h2 #ori-side { font-weight: 500; }

.btn, .chip, .seg-btn, .dock-tab, .btn-icon { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Два превью заказа (спереди и на спине) в оформлении. */
.co-previews { display: flex; gap: 8px; }
.co-previews figure { margin: 0; width: 104px; }
.co-previews img { width: 104px; display: block; background: #fff; }
.co-previews figcaption { font: 500 12px/1.4 var(--font-ui); color: var(--mute); margin-top: 4px; text-align: center; }
.co-preview.two { grid-template-columns: auto 1fr; }

/* Файлы сторон в админке и кабинете. */
.side-files { display: grid; gap: 20px; }
.side-files + .side-files { margin-top: 20px; }
.side-title { font: 500 14px/1.4 var(--font-ui); margin: 0 0 8px; }
.print-preview + .thumb-row { margin-top: 8px; }
.mock-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px; }
.mock-pair figure { margin: 0; background: var(--cloud); }
.mock-pair img { width: 100%; display: block; }
.mock-pair figcaption { font: 500 12px/1.4 var(--font-ui); color: var(--mute); padding: 6px 8px; }
/* Админка: раздел «Цены». Плоские карточки с тонкой рамкой, пилюльные кнопки, без теней. */
.pricing { max-width: 720px; }
.pr-card { border: 1px solid var(--hairline-soft); padding: 20px; display: grid; gap: 16px; }
.pr-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 16px; border-top: 1px solid var(--hairline-soft); }
.pr-row:first-of-type { border-top: 0; padding-top: 0; }
.pr-name { grid-column: 1 / -1; display: grid; gap: 2px; }
.pr-title { font: 500 15px/1.4 var(--font-ui); }
.pr-note { font-size: 12px; line-height: 1.4; color: var(--mute); }
.pr-row .field label { font-size: 12px; color: var(--mute); }
.pr-tiers { display: grid; gap: 12px; }
.pr-tier { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 12px; align-items: end; }
.pr-tier-f { display: grid; gap: 4px; font-size: 12px; color: var(--mute); }
.pr-tier .btn-icon { width: 44px; height: 44px; margin-bottom: 2px; }
.pr-formula { display: grid; gap: 6px; font-size: 14px; }
.pr-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pr-table th, .pr-table td { text-align: left; padding: 10px 8px 10px 0; border-top: 1px solid var(--hairline-soft); vertical-align: top; }
.pr-table thead th { border-top: 0; font: 500 12px/1.4 var(--font-ui); color: var(--mute); }
.pr-table tbody th { font-weight: 500; white-space: nowrap; }
.pr-table th small { display: block; font-weight: 500; font-size: 12px; }
.pr-table td { display: table-cell; }
.pr-table td b { display: block; font-weight: 500; }
.pr-unit { display: block; color: var(--mute); font-size: 12px; }
.pr-save { display: grid; gap: 8px; justify-items: start; }
@media (min-width: 720px) {
  .pr-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); align-items: end; }
  .pr-name { grid-column: auto; }
  .pr-tier { grid-template-columns: 160px 160px 44px; }
}
@media (max-width: 720px) {
  .pr-card { padding: 16px; }
  .pr-save .btn { width: 100%; }
  .pr-save { justify-items: stretch; }
}

@media (max-width: 820px) {
  .desk-only { display: none !important; }
  body.page-designer { height: var(--app-h, 100dvh); min-height: 0; overflow: hidden; }
  .page-designer .utility-bar, .page-designer .footer, .page-designer .nav-links { display: none; }
  .page-designer .nav { height: 52px; }
  .page-designer .nav-inner { height: 52px; flex-wrap: nowrap; }
  .page-designer .nav-inner > .brand, .page-designer .nav-actions { min-height: 0; }
  .designer { display: flex; flex-direction: column; align-items: stretch; height: calc(var(--app-h, 100dvh) - 52px); max-width: none; margin: 0; }
  .stage-col { position: static; flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; padding: 8px 0 0; }
  .stage-bar { flex-wrap: nowrap; gap: 8px; margin: 0 var(--gutter) 8px; }
  .seg-sides { flex: 1; min-width: 0; }
  .seg-sides label { flex: 1; }
  .seg-sides span { width: 100%; justify-content: center; height: 44px; font-size: 15px; }
  .seg-btn { height: 52px; padding: 0 14px; }
  .seg-btn .lg { display: none; }
  .seg-btn .sm { display: inline; }
  .stage { flex: 1 1 0; height: auto; min-height: 0; }
  .stage-note { display: none; }

  .panel { flex: none; max-height: 44dvh; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--gutter); border-top: 1px solid var(--hairline-soft); background: #fff; -webkit-overflow-scrolling: touch; }
  .panel::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--hairline); margin: 8px auto 0; position: sticky; top: 8px; }
  .panel.sheet-closed { display: none; }
  .panel-intro { display: none; }
  .panel [data-sheet] { display: none; }
  .panel[data-open=layers] [data-sheet=layers],
  .panel[data-open=edit] [data-sheet=edit],
  .panel[data-open=shirt] [data-sheet=shirt],
  .panel[data-open=order] [data-sheet=order] { display: block; }
  .p-row, .p-row:first-child { padding: 12px 0 16px; border-bottom: 0; }

  .dock { display: block; flex: none; background: #fff; box-shadow: inset 0 1px 0 var(--hairline-soft); padding-bottom: env(safe-area-inset-bottom, 0); padding-inline: env(safe-area-inset-left, 0) env(safe-area-inset-right, 0); }
  .panel.sheet-closed + .dock { box-shadow: inset 0 1px 0 var(--hairline-soft); }
  .dock-tabs { display: grid; grid-template-columns: repeat(4, 1fr); }
  .dock-tab { position: relative; min-height: 56px; border: 0; background: transparent; color: var(--mute); display: grid; justify-items: center; align-content: center; gap: 4px; font: 500 11px/1 var(--font-ui); cursor: pointer; }
  .dock-tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .dock-tab.on { color: var(--ink); box-shadow: inset 0 2px 0 var(--ink); }
  .dock-tab .dot { position: absolute; top: 9px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--ink); border: 2px solid #fff; box-sizing: content-box; }

  /* крупные цели касания: не меньше 44 px */
  .tools .btn-sm, .tools .btn { height: 44px; padding: 0 18px; font-size: 14px; }
  .chip span { height: 44px; }
  .num { height: 44px; width: 84px; }
  .qty { gap: 8px; }
  .qty .btn-icon { width: 48px; height: 48px; font-size: 22px; }
  .qty input { height: 48px; width: 72px; }
  input[type=range] { height: 44px; }
  input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; margin-top: -13px; }
  input[type=range]::-moz-range-thumb { width: 22px; height: 22px; }
  .dropzone { padding: 12px; }
  dialog { max-height: calc(100dvh - 16px); }
}
@media (max-width: 820px) and (max-height: 520px) {
  .panel { max-height: 60dvh; }
}
@media (max-width: 360px) {
}

@media (max-width: 560px) {
  .co-preview.two { grid-template-columns: 1fr; }
  .co-previews figure { width: calc(50% - 4px); }
  .co-previews img { width: 100%; }
}
@media (max-width: 820px) { .page-designer #toasts { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); } }

/* Телефон: лист инструментов компактный, чтобы эскиз оставался на виду при настройке. */
@media (max-width: 820px) {
  .panel { max-height: 36dvh; }
  .page-designer #toasts { top: 116px; bottom: auto; }
  .slider-row { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 0 8px; }
  .slider-row label { grid-column: auto; display: block; margin: 0; }
  .slider-row label .muted { display: none; }
  #pos-controls { gap: 4px; }
  #pos-tools { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  #pos-tools::-webkit-scrollbar { display: none; }
  #pos-tools .btn { flex: none; }
  .quality:not(.ok):not(.low) { display: none; }
  [data-sheet=edit] h2 { display: none; }
  .p-row, .p-row:first-child { padding: 8px 0 12px; }
}
@media (max-width: 820px) { .slider-row .unit { min-width: 104px; justify-content: flex-start; } .slider-row .num { margin-left: auto; } }
@media (max-width: 820px) {
  .page-designer .nav .btn-sm { height: 44px; }
  .page-designer .nav .btn-icon { width: 44px; height: 44px; }
  .page-designer .nav .brand { min-height: 44px; display: inline-flex; align-items: center; }
}

/* Экранная клавиатура (или альбомная ориентация телефона): видимой высоты мало — лист сжимается, а не наезжает на холст. */
@media (max-width: 820px) {
  .panel { flex: 0 1 auto; min-height: 0; }
  .stage-col { min-height: 116px; }
}
@media (max-width: 820px) and (max-height: 460px) {
  .dock-tabs { display: none; }
}

/* ---------- слои, тексты, выбор шрифта ---------- */
.stage-empty { position: absolute; inset: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; pointer-events: none; }
.stage-empty .btn { pointer-events: auto; min-width: 220px; }
.add-row { display: flex; flex-wrap: wrap; gap: 8px; }
.add-row .btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.layers { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.layers:empty { display: none; }
.layer { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; border: 1px solid var(--hairline-soft); border-radius: 18px; background: #fff; }
.layer.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.layer-eye { width: 44px; height: 52px; border: 0; background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; border-radius: 18px 0 0 18px; }
.layer-eye[aria-pressed=false] { color: var(--stone); }
.layer-eye svg, .layer-actions svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.layer-main { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 4px 12px 4px 4px; border: 0; background: transparent; text-align: left; cursor: pointer; min-width: 0; font: inherit; color: inherit; border-radius: 0 18px 18px 0; }
.layer.off .layer-main { opacity: .5; }
.layer-thumb { width: 40px; height: 40px; flex: none; background: var(--cloud); display: grid; place-items: center; overflow: hidden; }
.layer-thumb img { width: 100%; height: 100%; object-fit: contain; }
.layer-aa { font-size: 22px; line-height: 1; font-weight: 400; }
.layer-name { display: grid; min-width: 0; line-height: 1.25; }
.layer-name b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-name small { color: var(--mute); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.layer-actions { grid-column: 1 / -1; display: flex; gap: 8px; padding: 0 8px 8px 8px; }
.layer-actions .btn-icon { width: 44px; height: 44px; }
.layer-actions .btn-icon:disabled { opacity: .3; cursor: not-allowed; }
.layer-actions .danger { color: var(--sale); }
.layers-empty { margin-top: 12px; }

.text-props { display: grid; gap: 16px; margin-bottom: 16px; }
.text-props > * { min-width: 0; }
.text-props textarea { min-height: 72px; }
.font-btn { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 8px 16px 8px 20px; border: 1px solid transparent; border-radius: var(--r-field); background: var(--cloud); color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.font-btn:hover { border-color: var(--ink); }
.font-btn-sample { flex: 1; min-width: 0; font-size: 28px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-btn-name { display: grid; text-align: right; line-height: 1.25; max-width: 40%; }
.font-btn-name small { color: var(--mute); font-size: 12px; }
.font-btn-name b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-btn svg { width: 12px; height: 8px; fill: none; stroke: currentColor; stroke-width: 2; flex: none; }
.swatches { display: flex; flex-wrap: wrap; gap: 4px; margin: -4px; }
.swatch { position: relative; width: 44px; height: 44px; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 50%; }
.swatch::before { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--c, #fff); border: 1px solid var(--hairline); }
.swatch.on::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--ink); }
.swatch-custom { display: block; }
.swatch-custom::before { background: conic-gradient(#d30005, #ffc400, #1aa34a, #1151ff, #7b2cff, #ed1aa0, #d30005); border: 0; }
.swatch-custom input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.text-row .seg span { width: 56px; justify-content: center; height: 38px; }
.text-row .seg svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

.font-dlg { width: min(520px, calc(100vw - 24px)); height: min(680px, calc(100vh - 48px)); padding: 0; overflow: hidden; }
.font-dlg[open] { display: flex; flex-direction: column; }
.font-head { flex: none; padding: 16px 16px 8px; display: grid; gap: 8px; }
.dlg-head-row { display: flex; justify-content: space-between; align-items: center; }
.font-q { height: 44px; }
.font-q::placeholder { color: var(--mute); }
.font-cats { display: flex; gap: 8px; overflow-x: auto; margin-inline: -16px; padding: 0 16px 4px; scrollbar-width: none; }
.font-cats::-webkit-scrollbar { display: none; }
.fchip { flex: none; height: 40px; padding: 0 16px; border-radius: 9999px; border: 1px solid var(--hairline); background: #fff; color: var(--ink); font: 500 14px/1 var(--font-ui); cursor: pointer; white-space: nowrap; }
.fchip[aria-selected=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.font-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--hairline-soft); -webkit-overflow-scrolling: touch; }
.font-row { display: grid; width: 100%; gap: 2px; min-height: 68px; padding: 10px 20px; border: 0; border-bottom: 1px solid var(--hairline-soft); background: #fff; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.font-row:hover { background: var(--cloud); }
.font-row[aria-selected=true] { background: var(--ink); color: #fff; }
.font-row-sample { font-size: 28px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 35px; }
.font-row.is-loading .font-row-sample { color: transparent; background: var(--cloud); border-radius: 8px; width: 55%; }
.font-row[aria-selected=true].is-loading .font-row-sample { background: var(--charcoal); }
.font-row-name { font-size: 12px; color: var(--mute); }
.font-row[aria-selected=true] .font-row-name { color: var(--stone); }
.tag { font-style: normal; background: var(--cloud); color: var(--ink); border-radius: 9999px; padding: 1px 8px; font-size: 11px; }
.font-empty { padding: 24px 20px; }

/* админка: шрифты */
.fn-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 16px; align-items: end; margin-top: 16px; }
.fn-form input[type=file] { padding: 10px 16px; height: auto; min-height: 48px; }
.fn-list { display: grid; gap: 12px; margin-top: 12px; }
.fn-card { border: 1px solid var(--hairline); padding: 16px; display: grid; gap: 12px; }
.fn-card.is-hidden { background: var(--cloud); }
.fn-sample { font-size: 32px; line-height: 1.3; overflow-wrap: anywhere; min-height: 42px; }
.fn-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fn-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.fn-toggle { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-right: auto; cursor: pointer; font-weight: 500; }
.fn-toggle input { width: 20px; height: 20px; padding: 0; accent-color: var(--ink); }
@media (max-width: 720px) {
  .fn-form, .fn-fields { grid-template-columns: 1fr; }
  .fn-actions .btn { height: 44px; flex: 1; }
  .fn-toggle { flex-basis: 100%; }
}
@media (max-width: 820px) {
  .add-row { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .add-row::-webkit-scrollbar { display: none; }
  .add-row .btn { height: 44px; padding: 0 18px; flex: none; }
  .panel[data-open=edit] { max-height: 40dvh; }
  .panel[data-open=layers] { max-height: 40dvh; }
  .text-props textarea { min-height: 52px; height: 52px; field-sizing: content; max-height: 112px; padding-block: 12px; }
  .font-btn { min-height: 52px; padding-block: 4px; }
  .font-btn-sample { font-size: 24px; }
  .swatches { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .swatches::-webkit-scrollbar { display: none; }
  .swatch { flex: none; }
  .font-dlg { width: 100vw; max-width: 100vw; height: 84dvh; margin: auto 0 0; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0); }
  .text-props { gap: 12px; }
  .text-row .seg span { height: 44px; }
  .layers-empty { display: none; }
}

/* ---------- мобильный конструктор (как в редакторах-референсах): холст на весь экран, сверху цена и «Оформить», снизу одна панель ---------- */
.onboard, .top-buy, .side-flip, .zoom, .panel [data-sheet=add] { display: none; }
@media (max-width: 820px) {
  .page-designer .nav, .page-designer .nav-inner { height: 48px; }
  .designer { height: calc(var(--app-h, 100dvh) - 48px); padding: 0; gap: 0; }
  .stage-col { position: relative; top: 0; padding: 0; }
  /* верхняя строка лежит поверх холста, чтобы футболка занимала весь экран */
  .stage-bar { position: absolute; z-index: 5; top: 8px; left: var(--gutter); right: var(--gutter); margin: 0; pointer-events: none; align-items: flex-start; }
  .stage-bar > *, .top-buy { pointer-events: auto; }
  .stage-bar-end { display: none; }
  .seg-sides { display: none; }
  .side-flip { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 12px; border: 0; border-radius: 9999px; background: rgba(255,255,255,.92); color: var(--ink); font: 500 15px/1 var(--font-ui); cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .side-flip svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .side-flip:active { background: var(--cloud); }
  .seg-sides span { height: 40px; font-size: 13px; padding-inline: 0; }
  .top-buy { display: flex; align-items: center; gap: 6px; min-width: 0; margin-left: auto; background: rgba(255,255,255,.92); border-radius: 9999px; padding: 2px 2px 2px 14px; }
  .top-buy b { font: 600 15px/1 var(--font-ui); white-space: nowrap; cursor: pointer; }
  .top-buy .btn { height: 44px; padding: 0 14px; flex: none; }
  #dock-order.is-wait { background: #fff; color: var(--ink); border: 1px solid var(--hairline); }
  .top-buy:has(#dock-total:empty) { padding: 0; background: none; }
  .stage { margin: 0; }

  .panel[data-open=add] [data-sheet=add] { display: block; }
  [data-sheet=layers] .add-row { display: none; }
  [data-sheet=add] h2 { font: 500 18px/1.3 var(--font-ui); margin: 0 0 12px; }
  .add-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .add-tile { min-height: 84px; border: 1px solid var(--hairline); border-radius: 18px; background: #fff; color: var(--ink); display: grid; justify-items: start; align-content: center; gap: 2px; padding: 10px 14px; text-align: left; cursor: pointer; font: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .add-tile:active { background: var(--cloud); }
  .add-tile svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .add-tile b { font-weight: 500; font-size: 16px; }
  .add-tile small { color: var(--mute); font-size: 12px; line-height: 1.3; }
  .stage-col > #preview-btn { position: absolute; z-index: 5; left: var(--gutter); bottom: 12px; height: 44px; padding: 0 16px; background: rgba(255,255,255,.92); }
  .zoom { display: grid; gap: 8px; position: absolute; z-index: 5; right: var(--gutter); bottom: 12px; }
  .zoom-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); display: grid; place-items: center; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
  .zoom-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
  .zoom-btn:disabled { color: var(--stone); }
  .zoom-btn:active:not(:disabled) { background: var(--cloud); }
  .stage-col > #preview-btn[aria-pressed=true] { background: var(--ink); }

  .dock-tabs { grid-template-columns: repeat(5, 1fr); }
  .dock-tab span { font-size: 11px; }
  .dock-fab b { width: 46px; height: 46px; margin-top: -14px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; border: 4px solid #fff; box-sizing: content-box; }
  .dock-fab b svg { width: 26px; height: 26px; stroke-width: 2.2; }
  .dock-fab { color: var(--ink); align-content: end; padding-bottom: 8px; }
  .dock-fab.on { box-shadow: none; }
  .dock-fab .dot { top: 2px; left: calc(50% + 12px); background: var(--sale); }

  /* подсказка при первом входе: компактная плашка над кнопкой «+», как в референсе */
  .onboard { display: block; position: fixed; z-index: 60; left: var(--gutter); right: var(--gutter); bottom: calc(76px + env(safe-area-inset-bottom, 0px)); background: #fff; border: 1px solid var(--hairline); border-radius: 20px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.16); font-size: 13px; line-height: 1.4; }
  .onboard[hidden] { display: none; }
  .onboard b { font-weight: 600; }
  .onboard p { margin: 4px 0 8px; }
  .onboard .btn { height: 44px; margin-left: auto; display: flex; }
  #h-ori small { display: none; }
  #h-size small { display: block; font-size: 12px; font-weight: 400; }
}
