/* Инь-Янь · админка. Кремовая бумага, чернила, красная точка бренда. Слева навигация, в центре редактор, справа живой телефон. */
:root {
  --paper: #F4F1EA; --card: #FFFFFF; --card-2: #F8F6F1; --ink: #1E1B18; --ink-2: #6A655E; --ink-3: #9C968C; --rule: #E6E1D7; --rule-2: #D9D3C6; --dot: #C81810; --ok: #3C7A4B;
  --display: 'Nunito', 'Golos Text', sans-serif; --text: 'Golos Text', -apple-system, 'Segoe UI', sans-serif;
  --r: 14px; --shadow: 0 10px 30px -18px rgba(30,27,24,.45); --ease: cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
input, select, textarea { min-width: 0; max-width: 100%; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--text); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p { margin: 0; }
h2 { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
h3 { font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; margin-bottom: 14px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
svg { display: block; }
i[data-icon] { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: none; }
i[data-icon] svg { width: 20px; height: 20px; }
.hint { color: var(--ink-3); font-size: 12.5px; margin: 6px 0 0; line-height: 1.45; }
.lead { color: var(--ink-2); font-size: 14px; margin-top: 4px; max-width: 80ch; }
.err { color: var(--dot); font-size: 13px; min-height: 18px; margin: 6px 0; }
.grow { flex: 1; }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 6px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px; border-radius: 11px; background: var(--ink); color: #fff; font-weight: 600; white-space: nowrap; transition: transform .12s var(--ease), background-color .15s, box-shadow .15s; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--rule-2); }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.big { height: 48px; font-size: 15px; border-radius: 13px; }
.btn.danger { color: var(--dot); }
.btn.primary.danger { background: var(--dot); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-row.right { justify-content: flex-end; }
.icon-btn { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--ink-2); }
.icon-btn:hover { background: var(--rule); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }
.linkbtn { font-size: 12.5px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--rule-2); }
.linkbtn:hover { color: var(--ink); }

/* login */
.login { position: fixed; inset: 0; display: grid; place-items: center; background: var(--paper); z-index: 100; padding: 20px; }
.login-box { width: 100%; max-width: 380px; padding: 34px 30px 30px; background: var(--card); border-radius: 22px; box-shadow: 0 30px 80px -40px rgba(30,27,24,.5); display: flex; flex-direction: column; gap: 8px; }
.login-logo { width: 72px; height: 72px; border-radius: 50%; object-fit: contain; padding: 4px; background: #171413; margin-bottom: 6px; }
.login-box h1 { font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; }
.login-sub { color: var(--ink-3); margin-bottom: 14px; }
.login-box .btn { margin-top: 4px; }

/* forms */
label { display: block; font-size: 12.5px; color: var(--ink-2); }
label > input, label > select, label > textarea { display: block; width: 100%; margin-top: 5px; height: 40px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 14px; transition: border-color .15s, box-shadow .15s; }
label > textarea { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.4; }
label > input:focus, label > select:focus, label > textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(30,27,24,.08); }
label > input[type=range] { padding: 0; border: 0; height: 28px; accent-color: var(--ink); background: none; box-shadow: none; }
label > input[type=color] { padding: 3px; width: 44px; height: 36px; border-radius: 9px; }
label output { float: right; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.form fieldset { border: 0; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 12px; }
.form legend { font-family: var(--display); font-weight: 800; font-size: 15px; margin-bottom: 6px; padding: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; align-items: end; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.row2 + .row2, .row3 + .row3, .row2 + .row3, .lang-grid + .lang-grid, .lang-grid + .row2, .row3 + .lang-grid { margin-top: 12px; }
.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.lang-grid .lg-label { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-2); margin-bottom: -4px; }
.lang-grid label span.l { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-bottom: 10px; }
.check-row label, .chips label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); cursor: pointer; font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips label { padding: 7px 12px; border-radius: 999px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 13px; }
.chips label:has(input:checked) { background: var(--ink); box-shadow: none; color: #fff; }
.chips input { display: none; }
label > .seg, label > .spicy-seg { display: flex; width: fit-content; margin-top: 6px; }
.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-2); margin-top: 5px; }
.seg label { padding: 7px 13px; border-radius: 8px; color: var(--ink-2); cursor: pointer; font-size: 13px; font-weight: 600; margin: 0; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }
.seg input { display: none; }
.seg.small { margin: 0; }
.seg.small label { padding: 5px 10px; font-size: 12.5px; }
.switch { display: inline-flex; align-items: center; min-height: 32px; gap: 9px; cursor: pointer; font-size: 13.5px; color: var(--ink); user-select: none; }
.switch input { appearance: none; width: 38px; height: 22px; border-radius: 11px; background: var(--rule-2); position: relative; transition: background .2s; margin: 0; flex: none; }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--ink); }
.switch input.stop:checked { background: var(--dot); }
.switch input:checked::after { transform: translateX(16px); }
.photo-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-field { display: flex; align-items: center; gap: 16px; }
.photo-field img { width: 132px; height: 99px; object-fit: cover; border-radius: 12px; background: var(--rule); flex: none; }
.photo-field { position: relative; }
.photo-field.empty > img { display: none; }
.ph-empty { display: none; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 128px; border-radius: 12px; background: var(--card-2); box-shadow: inset 0 0 0 1.5px var(--rule-2); color: var(--ink-3); font-size: 13px; cursor: pointer; text-align: center; padding: 16px; }
.ph-empty:hover { box-shadow: inset 0 0 0 1.5px var(--ink-3); color: var(--ink-2); }
.photo-field.empty .ph-empty { display: flex; }
.photo-field:not(.empty) .ph-empty { display: none; }
.photo-field.wide .ph-empty { min-height: 150px; }
.ph-empty svg { width: 22px; height: 22px; flex: none; opacity: .6; }
.gp-ph .none svg { width: 30px; height: 30px; opacity: .5; }
.promo-row .photo-field .ph-empty { min-height: 60px; font-size: 11.5px; padding: 6px; }
.photo-field.wide { flex-direction: column; align-items: stretch; }
.photo-field.wide img { width: 100%; height: 170px; }
.photo-field .stack { display: flex; flex-direction: column; gap: 8px; }
.asset-field { display: flex; align-items: center; gap: 14px; }
.asset-field img { width: 88px; height: 88px; object-fit: contain; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--rule); padding: 8px; flex: none; }
.asset-field img.dark { background: #171413; }
.asset-field b { display: block; margin-bottom: 2px; }
.asset-field .photo-actions { margin-top: 8px; flex-wrap: wrap; }
.asset-field .btn { flex: 0 1 auto; }
.asset-field > div { min-width: 0; }
.hours-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.hours-row .days { display: flex; gap: 4px; }
.hours-row .days label { width: 34px; height: 32px; display: grid; place-items: center; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-2); font-size: 12px; cursor: pointer; margin: 0; }
.hours-row .days label:has(input:checked) { background: var(--ink); box-shadow: none; color: #fff; }
.hours-row .days input { display: none; }
.hours-row input[type=time] { height: 34px; padding: 0 8px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--card); }

/* shell */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr) var(--pv); min-height: 100vh; --pv: 480px; }
body.no-preview .app { grid-template-columns: 232px minmax(0, 1fr); --pv: 0px; }
body.no-preview .preview { position: fixed; right: 0; top: 0; z-index: 55; width: 480px; transform: translateX(100%); transition: transform .3s var(--ease); box-shadow: -20px 0 60px -30px rgba(30,27,24,.6); }
body.no-preview .preview.on { transform: none; }
body.no-preview .preview-toggle { display: grid; }
.side { position: sticky; top: 0; height: 100vh; padding: 22px 14px 18px; display: flex; flex-direction: column; gap: 22px; border-right: 1px solid var(--rule); }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.brand img { width: 40px; height: 40px; border-radius: 50%; object-fit: contain; padding: 2px; background: #171413; }
.brand b { display: block; font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: -0.01em; line-height: 1.1; }
.brand span { font-size: 11.5px; color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 9px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 500; transition: background-color .15s, color .15s; }
.nav button:hover { background: rgba(30,27,24,.05); color: var(--ink); }
.nav button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(30,27,24,.06), inset 0 0 0 1px var(--rule); font-weight: 600; }
.nav button i { color: var(--ink-3); }
.nav button.on i { color: var(--ink); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; color: var(--ink-2); font-size: 13px; text-align: left; }
.side-link:hover { background: rgba(30,27,24,.05); color: var(--ink); }
.side-link.dim { color: var(--ink-3); font-size: 12.5px; }
.side-link i { width: 18px; height: 18px; }
.side-link i svg { width: 18px; height: 18px; }
.content { padding: 26px 36px 80px; min-width: 0; }
.page { display: none; }
.page.on { display: block; animation: pageIn .25s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.head-actions { display: flex; gap: 8px; flex: none; }
.cardbox { background: var(--card); border-radius: 18px; padding: 20px 22px; margin-bottom: 14px; box-shadow: 0 1px 2px rgba(30,27,24,.05), inset 0 0 0 1px var(--rule); }
.cardbox > .switch { margin-top: 12px; }
.cardbox .row3 .switch { align-self: center; padding-top: 10px; }

/* save bar */
.savebar { position: fixed; left: calc(232px + (100vw - 232px - var(--pv, 0px)) / 2); bottom: 20px; z-index: 45; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 20px 50px -18px rgba(30,27,24,.9); animation: saveIn .25s var(--ease); transform: translateX(-50%); }
@keyframes saveIn { from { opacity: 0; transform: translate(-50%, 12px); } }
.savebar span { flex: 1; display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; }
.savebar span i { width: 8px; height: 8px; border-radius: 50%; background: var(--dot); }
.savebar .btn.ghost { background: transparent; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.3); }
.savebar .btn.primary { background: #fff; color: var(--ink); }

/* home builder */
.blocks { display: flex; flex-direction: column; gap: 10px; }
.blk { background: var(--card); border-radius: 18px; box-shadow: 0 1px 2px rgba(30,27,24,.05), inset 0 0 0 1px var(--rule); transition: box-shadow .15s; }
.blk.off { opacity: .6; }
.blk.dragging { opacity: .35; }
.blk.over { box-shadow: 0 -3px 0 0 var(--ink), inset 0 0 0 1px var(--rule); }
.blk-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 10px; cursor: pointer; user-select: none; }
.blk-head .handle { color: var(--ink-3); cursor: grab; width: 22px; height: 30px; display: grid; place-items: center; }
.blk-head .handle svg { width: 16px; height: 16px; }
.blk-head .bt { flex: 1; min-width: 0; }
.blk-head .bt b { display: block; font-family: var(--display); font-weight: 800; font-size: 15px; }
.blk-head .bt span { font-size: 12px; color: var(--ink-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-head .thumb { width: 54px; height: 40px; border-radius: 9px; object-fit: cover; background: var(--card-2); flex: none; }
.blk-head .caret { color: var(--ink-3); transition: transform .2s var(--ease); }
.blk.open .blk-head .caret { transform: rotate(180deg); }
.blk-body { display: none; padding: 4px 18px 18px 44px; border-top: 1px solid var(--rule); margin-top: -1px; }
.blk.open .blk-body { display: block; padding-top: 16px; }
.blk-body .foot { display: flex; justify-content: flex-end; margin-top: 14px; }
.cardbox.fixed .blk-head { padding-left: 4px; }
.cardbox.fixed { padding: 10px 14px; }
.cardbox.fixed .blk-body { padding-left: 38px; }
.menu-wrap { position: relative; }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 260px; padding: 6px; border-radius: 14px; background: var(--card); box-shadow: 0 20px 50px -20px rgba(30,27,24,.5), inset 0 0 0 1px var(--rule); }
.dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 9px; }
.dropdown button:hover { background: var(--card-2); }
.dropdown button b { display: block; font-weight: 600; }
.dropdown button span { font-size: 12px; color: var(--ink-3); }
.promo-list { display: flex; flex-direction: column; gap: 8px; }
.promo-row { display: grid; grid-template-columns: 96px 1fr auto; gap: 12px; align-items: start; padding: 10px; border-radius: 14px; background: var(--card-2); }
.promo-row img { width: 96px; height: 60px; border-radius: 9px; object-fit: cover; background: var(--rule); }
.promo-row .fld { display: grid; gap: 8px; }
.promo-row .fld .lang-grid { gap: 8px; }
.promo-row .acts { display: flex; flex-direction: column; gap: 4px; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cat-tile { position: relative; aspect-ratio: 3 / 2; border-radius: 12px; overflow: hidden; background: var(--card-2); cursor: pointer; box-shadow: inset 0 0 0 1px var(--rule); }
.cat-tile img { width: 100%; height: 100%; object-fit: cover; }
.cat-tile b { position: absolute; left: 10px; right: 10px; bottom: 9px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff; font-family: var(--display); font-weight: 800; font-size: 13px; text-shadow: 0 1px 8px rgba(0,0,0,.7); }
.cat-tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.6), transparent 60%); }
.cat-tile .chg { position: absolute; top: 8px; right: 8px; z-index: 2; height: 26px; padding: 0 9px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink); font-size: 11.5px; font-weight: 600; opacity: 0; transition: opacity .15s; }
.cat-tile:hover .chg { opacity: 1; }
.cat-tile.empty::after { display: none; }
.cat-tile.empty b { color: var(--ink-2); text-shadow: none; }

/* theme */
.presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.preset { text-align: left; padding: 10px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--rule); transition: box-shadow .15s; }
.preset:hover { box-shadow: inset 0 0 0 1px var(--ink-3); }
.preset.on { box-shadow: inset 0 0 0 2px var(--ink); }
.preset .sw { display: flex; gap: 4px; margin-bottom: 8px; }
.preset .sw i { flex: 1; height: 26px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.preset b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preset span { font-size: 11.5px; color: var(--ink-3); }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 10px; }
.color { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--card-2); }
.color input[type=color] { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.color input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.color input[type=color]::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.1); border-radius: 10px; }
.color div { flex: 1; min-width: 0; }
.color b, .color span { overflow: hidden; text-overflow: ellipsis; }
.color input[type=text] { flex: none; }
.color b { display: block; font-size: 13px; font-weight: 600; }
.color span { display: block; font-size: 11.5px; color: var(--ink-3); }
.color input[type=text] { width: 76px; height: 30px; padding: 0 8px; border: 1px solid var(--rule-2); border-radius: 8px; background: var(--card); font-size: 12px; font-family: ui-monospace, monospace; text-transform: uppercase; }
.font-demo { margin-top: 14px; padding: 16px 18px; border-radius: 14px; background: #F5EFE5; }
.font-demo b { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.font-demo span { display: block; margin-top: 4px; color: #6F6961; font-size: 14px; }

/* menu editor */
.menu-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
.cats-col, .items-col { min-width: 0; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 40px; flex-wrap: nowrap; }
.cat-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.cat-title h2 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-title img { width: 44px; height: 34px; border-radius: 8px; object-fit: cover; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px 8px 6px; border-radius: 11px; cursor: pointer; color: var(--ink-2); }
.cat-list li:hover { background: rgba(30,27,24,.04); }
.cat-list li.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(30,27,24,.06), inset 0 0 0 1px var(--rule); }
.cat-list li.hidden-cat .cn { text-decoration: line-through; color: var(--ink-3); }
.cat-list .cn { flex: 1; font-weight: 500; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-list .cc { font-size: 12px; color: var(--ink-3); }
.cat-list .ct { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; background: var(--rule); flex: none; }
/* подразделы выбранного раздела: ветка под ним, отступ под миниатюрой раздела */
.cat-list li.subs { display: block; padding: 2px 0 8px 22px; cursor: default; }
.cat-list li.subs:hover { background: none; }
.cat-list li.on.part { box-shadow: none; background: rgba(30,27,24,.04); }
.sub-list { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 1px solid var(--rule); }
.cat-list .sub-list li, .cat-list .sub-loose { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 4px; border-radius: 9px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.cat-list .sub-loose { margin-left: 11px; padding-left: 28px; color: var(--ink-3); }
.cat-list .sub-list li:hover, .cat-list .sub-loose:hover { background: rgba(30,27,24,.04); }
.cat-list .sub-list li.on, .cat-list .sub-loose.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(30,27,24,.06), inset 0 0 0 1px var(--rule); }
.cat-list .sub-list li.dragging { opacity: .5; }
.cat-list .sub-list .cn { font-weight: 500; }
.sub-acts { display: flex; gap: 14px; padding: 6px 0 0 11px; }
.sub-acts .lnk { border: 0; background: none; padding: 4px 0; font: inherit; font-size: 12.5px; font-weight: 500; color: var(--ink-2); cursor: pointer; }
.sub-acts .lnk:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.cat-list:has(> li.dragging) li.subs { display: none; }
.handle { color: var(--ink-3); cursor: grab; user-select: none; display: grid; place-items: center; width: 18px; }
.handle svg { width: 14px; height: 14px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar input { flex: 1; height: 38px; padding: 0 12px; border: 1px solid var(--rule-2); border-radius: 10px; background: var(--card); }
.toolbar input:focus { outline: none; border-color: var(--ink); }
.item-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.item-grid li { position: relative; background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: 0 1px 2px rgba(30,27,24,.05), inset 0 0 0 1px var(--rule); cursor: pointer; transition: transform .15s var(--ease), box-shadow .15s; }
.item-grid li:hover { box-shadow: 0 10px 24px -14px rgba(30,27,24,.5), inset 0 0 0 1px var(--rule-2); }
.item-grid li.dragging { opacity: .35; }
.item-grid li.over { box-shadow: inset 0 0 0 2px var(--ink); }
.item-grid .th { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--card-2); display: block; }
.item-grid .th.empty { display: grid; place-items: center; color: var(--ink-3); font-family: var(--display); font-weight: 800; font-size: 26px; }
.item-grid .in { padding: 9px 11px 10px; }
.item-grid { align-items: start; }
.item-grid li { display: flex; flex-direction: column; }
.item-grid .in { display: flex; flex-direction: column; flex: 1; }
.item-grid .in b { font-weight: 600; font-size: 13.5px; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: calc(2 * 1.25em); }
.item-grid .in .cat { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.item-grid .pr { margin-top: auto; padding-top: 4px; }
.item-grid .pr { font-family: var(--display); font-weight: 800; font-size: 14px; margin-top: 4px; }
.item-grid .pr small { font-family: var(--text); font-weight: 500; color: var(--ink-3); font-size: 11px; margin-left: 4px; }
.item-grid .miss { display: inline-block; color: var(--dot); font-size: 11px; margin-top: 3px; }
.item-grid .sw { display: flex; gap: 4px; position: absolute; top: 8px; left: 8px; }
.item-grid .sw label { opacity: 0; transition: opacity .15s; height: 24px; padding: 0 8px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 11px; font-weight: 600; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; cursor: pointer; margin: 0; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.item-grid li:hover .sw label, .item-grid .sw label:has(input:checked), .item-grid .sw label.on, .item-grid.list .sw label { opacity: 1; }
.item-grid .sw label:has(input:checked) { background: var(--ink); color: #fff; }
.item-grid .sw label:has(input.stop:checked) { background: var(--dot); color: #fff; }
.item-grid .sw input { display: none; }
.item-grid li.is-hidden .th { opacity: .45; }
.item-grid li.is-hidden .in b, .item-grid li.is-hidden .pr { color: var(--ink-3); }
.item-grid .handle { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink-2); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.item-grid.list { display: flex; flex-direction: column; gap: 6px; }
.item-grid.list { align-items: stretch; }
.item-grid.list li { display: grid; grid-template-columns: 22px 64px minmax(110px, 1fr) auto auto; gap: 12px; align-items: center; padding: 6px 12px 6px 8px; }
.item-grid.list .in { flex-direction: row; align-items: baseline; }
.item-grid.list .in b { min-height: 0; }
.item-grid.list .pr { margin-top: 0; padding-top: 0; }
.item-grid.list .in .cat { margin-top: 0; white-space: nowrap; }
.item-grid.list .handle { order: 0; }
.item-grid.list .th { order: 1; }
.item-grid.list .in { order: 2; display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.item-grid.list .in b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; -webkit-line-clamp: unset; }
.item-grid.list .in .pr { margin: 0; white-space: nowrap; }
.item-grid.list .in .miss { margin: 0; white-space: nowrap; }
.item-grid.list .sw { order: 3; }
.item-grid.list li.is-hidden .th { opacity: .45; }
.item-grid.list .th { width: 64px; height: 48px; aspect-ratio: auto; border-radius: 9px; }
.item-grid.list .th.empty { font-size: 18px; }
.item-grid.list .in { padding: 0; }
.item-grid.list .sw { position: static; }
.item-grid.list .handle { position: static; width: 22px; height: 22px; background: none; box-shadow: none; }
.item-grid .empty-note { grid-column: 1 / -1; padding: 40px 0; text-align: center; color: var(--ink-3); }

/* drawer */
.drawer-back { position: fixed; inset: 0; background: rgba(30,27,24,.35); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 60; }
.drawer-back.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 100%; max-width: 700px; background: var(--paper); z-index: 61; transform: translateX(100%); transition: transform .3s var(--ease); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.15); }
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--rule); background: var(--card); }
.drawer-head h2 { font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 20px 22px; }
.drawer-foot { display: flex; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--rule); background: var(--card); }
.opt-row { display: grid; grid-template-columns: 46px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.opt-row input { min-width: 0; }
.o-phw { position: relative; width: 46px; height: 46px; }
.o-ph { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--card-2); border: 1px solid var(--rule-2); color: var(--ink-3); }
.o-ph.empty { border-style: dashed; }
.o-ph:hover { border-color: var(--ink); }
.o-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.o-ph svg { width: 20px; height: 20px; }
.o-phx { position: absolute; top: -7px; right: -7px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: var(--card); font-size: 11px; line-height: 22px; padding: 0; cursor: pointer; }
.o-phx[hidden] { display: none; }
.o-ph small { font-size: 10px; line-height: 1.1; text-align: center; color: var(--ink-3); }
.opt-row.main .o-ph:not(.empty) { box-shadow: 0 0 0 2px var(--ink); border-color: transparent; }
.o-star { position: absolute; left: -7px; bottom: -7px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--rule-2); background: var(--card); color: var(--ink-3); font-size: 12px; line-height: 20px; padding: 0; cursor: pointer; }
.o-star:hover { color: var(--ink); border-color: var(--ink); }
.o-star.on { background: var(--ink); color: var(--card); border-color: var(--ink); cursor: default; }
.o-star[hidden] { display: none; }
.opt-row input { height: 38px; padding: 0 11px; border: 1px solid var(--rule-2); border-radius: 9px; background: var(--card); font-size: 14px; }
.opt-row input:focus { outline: none; border-color: var(--ink); }
/* переводы названия размера (KZ / EN) второй строкой под названием, цена и вес остаются в первой */
.opt-row .o-phw { grid-row: span 2; align-self: start; }
.opt-row .o-tr { grid-column: 2 / 5; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: -2px; }
.opt-row .o-tr:has(input[hidden]) { grid-template-columns: 1fr; }
.opt-row .o-tr:has(input[hidden] + input[hidden]) { display: none; }
.opt-row .o-tr input { height: 32px; font-size: 13px; color: var(--ink-2); }
.ai-table .opt { font-size: 12px; color: var(--ink-2); margin-top: 4px; }

/* texts */
.text-row { display: grid; grid-template-columns: 200px repeat(var(--tcols, 3), minmax(0, 1fr)); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.text-row:last-child { border-bottom: 0; }
.text-row .k b { display: block; font-size: 13px; font-weight: 600; }
.text-row .k span { font-size: 11.5px; color: var(--ink-3); }
.text-row input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--rule-2); border-radius: 9px; background: var(--card); font-size: 13px; }
.text-row input:focus { outline: none; border-color: var(--ink); }
.text-row input::placeholder { color: var(--ink-3); }
.text-head { display: grid; grid-template-columns: 200px repeat(var(--tcols, 3), minmax(0, 1fr)); gap: 10px; padding-bottom: 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); }

/* qr */
.qr-layout { display: grid; grid-template-columns: 1fr 280px; gap: 28px; }
.qr-layout label { margin-bottom: 12px; }
.qr-preview { text-align: center; }
.qr-preview img { width: 240px; height: 240px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--rule); }
.qr-link { font-size: 12px; color: var(--ink-3); margin-top: 10px; word-break: break-all; }

/* preview phone */
.preview { position: sticky; top: 0; height: 100vh; padding: 18px 30px 14px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 12px; align-items: center; background: var(--paper); }
.preview-head { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.phone { position: relative; width: 100%; max-width: 420px; height: min(calc(100vh - 118px), 900px); border-radius: 40px; background: #111; padding: 9px; box-shadow: 0 30px 70px -30px rgba(30,27,24,.7), inset 0 0 0 2px #2a2a2a; }
.phone .notch { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 100px; height: 26px; border-radius: 16px; background: #111; z-index: 2; }
.phone iframe { width: 100%; height: 100%; border: 0; border-radius: 32px; background: #F5EFE5; display: block; }
.preview-foot { display: flex; gap: 16px; }
.preview-toggle { display: none; position: fixed; right: 18px; bottom: 18px; width: 54px; height: 54px; border-radius: 50%; background: var(--ink); color: #fff; box-shadow: 0 14px 30px -10px rgba(30,27,24,.7); z-index: 60; place-items: center; }
.preview-toggle .x { display: none; font-size: 22px; font-weight: 600; }
.preview-toggle.on i { display: none; }
.preview-toggle.on .x { display: block; }
.preview-toggle svg { width: 24px; height: 24px; }

/* ---------- dish drawer: guest-true preview + fields ---------- */
.drawer { max-width: 1060px; }
.drawer-body.two { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 28px; align-items: start; }
.gp { position: sticky; top: 0; }
.gp-note { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.gp-stage { padding: 16px; border-radius: 18px; background: #F5EFE5; }
.gp-tile { width: 168px; }
.gp-ph { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 8px 22px -12px rgba(30,27,24,.45); }
.gp-ph img { width: 100%; height: 100%; object-fit: cover; }
.gp-ph .none { width: 100%; height: 100%; display: grid; place-items: center; gap: 6px; color: #9C958B; font-size: 12px; text-align: center; padding: 0 14px; line-height: 1.35; cursor: pointer; }
.gp-ph.empty { background: #EFE7DA; box-shadow: inset 0 0 0 1.5px rgba(30,27,24,.14); cursor: pointer; }
.gp-ph.empty:hover { box-shadow: inset 0 0 0 1.5px rgba(30,27,24,.3); }
.gp-ph.empty .plus, .gp-ph.empty .badge { display: none; }
.gp-card.empty { display: none; }
.gp-ph .plus { position: absolute; right: 8px; bottom: 8px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.95); color: #1E1B18; display: grid; place-items: center; box-shadow: 0 8px 20px -8px rgba(30,27,24,.7); font-size: 22px; line-height: 1; padding-bottom: 2px; }
.gp-ph .badge { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 10px; border-radius: 999px; background: #C81810; color: #fff; font-size: 11px; font-weight: 800; line-height: 26px; }
.gp-n { font-size: 14px; font-weight: 600; line-height: 1.25; margin-top: 10px; color: #1E1B18; }
.gp-w { font-size: 11.5px; color: #9C958B; margin-top: 3px; }
.gp-p { font-size: 15px; font-weight: 800; margin-top: 4px; color: #1E1B18; }
.gp-p .old { color: #9C958B; font-weight: 600; text-decoration: line-through; margin-right: 6px; font-size: 12px; }
.gp-card { margin-top: 14px; border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 8px 22px -14px rgba(30,27,24,.5); }
.gp-card .ph { aspect-ratio: 4 / 3; background: #EBE2D4; }
.gp-card .ph img { width: 100%; height: 100%; object-fit: cover; }
.gp-card .tx { padding: 10px 12px 12px; }
.gp-card .tx b { display: block; font-size: 14px; font-weight: 800; color: #1E1B18; }
.gp-card .tx span { display: block; font-size: 11.5px; color: #6F6961; margin-top: 3px; }
.gp-cap { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; text-align: center; }
.gp-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.gp-acts .btn { flex: 1 1 auto; min-width: 0; padding: 0 10px; font-size: 12.5px; }
.gp-acts .btn:disabled { opacity: .4; }

.fgroup { margin-bottom: 22px; }
.fgroup > h4 { font-family: var(--display); font-weight: 800; font-size: 13px; letter-spacing: .01em; color: var(--ink-2); margin: 0 0 10px; display: flex; align-items: center; gap: 10px; }
.fgroup > h4 .lnk { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.fgroup > h4 .lnk:hover { color: var(--ink); }
.chips .add { border-style: dashed; box-shadow: inset 0 0 0 1px var(--rule-2); color: var(--ink-2); }
.spicy-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--card); box-shadow: inset 0 0 0 1px var(--rule-2); }
.spicy-seg label { padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; margin: 0; color: var(--ink-2); }
.spicy-seg label:has(input:checked) { background: var(--ink); color: #fff; }
.spicy-seg input { display: none; }
.flags { display: flex; gap: 20px; flex-wrap: wrap; padding: 14px 16px; border-radius: 12px; background: var(--card-2); }

/* ---------- cropper ---------- */
.cropback { position: fixed; inset: 0; z-index: 80; background: rgba(20,17,15,.72); display: none; place-items: center; padding: 24px; }
.cropback.on { display: grid; }
.cropbox { width: min(880px, 100%); background: var(--card); border-radius: 20px; padding: 20px 22px 18px; box-shadow: 0 40px 100px -40px rgba(0,0,0,.7); }
.cropbox h3 { margin-bottom: 4px; }
.cropbox .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 14px; }
.cropframe { position: relative; width: 100%; max-height: 54vh; margin: 0 auto; overflow: hidden; border-radius: 14px; background: #17140F; touch-action: none; cursor: grab; user-select: none; }
.cropframe.drag { cursor: grabbing; }
.cropstage { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.cropstage img { position: absolute; left: 50%; top: 50%; max-width: none; }
.cropframe .safe { position: absolute; top: 0; bottom: 0; left: 12.5%; right: 12.5%; border: 1.5px dashed rgba(255,255,255,.85); border-radius: 4px; pointer-events: none; }
.cropframe .safe::after { content: 'плитка в меню'; position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); font-size: 10.5px; letter-spacing: .04em; color: #fff; background: rgba(0,0,0,.45); padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.cropframe .thirds { position: absolute; inset: 0; pointer-events: none; background-image: linear-gradient(to right, transparent 33.33%, rgba(255,255,255,.18) 33.33%, rgba(255,255,255,.18) 33.5%, transparent 33.5%, transparent 66.66%, rgba(255,255,255,.18) 66.66%, rgba(255,255,255,.18) 66.83%, transparent 66.83%), linear-gradient(to bottom, transparent 33.33%, rgba(255,255,255,.18) 33.33%, rgba(255,255,255,.18) 33.5%, transparent 33.5%, transparent 66.66%, rgba(255,255,255,.18) 66.66%, rgba(255,255,255,.18) 66.83%, transparent 66.83%); }
.croptools { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.croptools .zoom { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.croptools .zoom input { flex: 1; accent-color: var(--ink); }
.cropfoot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.cropfoot .hint { margin: 0; flex: 1; }

/* ---------- list editor sheet ---------- */
.sheetback { position: fixed; inset: 0; z-index: 85; background: rgba(20,17,15,.55); display: none; place-items: center; padding: 24px; }
.sheetback.on { display: grid; }
.sheet { width: min(720px, 100%); max-height: 84vh; overflow: auto; background: var(--card); border-radius: 20px; padding: 22px 24px; box-shadow: 0 40px 100px -40px rgba(0,0,0,.6); }
.sheet h3 { margin-bottom: 4px; }
.sheet .sub { font-size: 12.5px; color: var(--ink-3); margin-bottom: 16px; }
.mrow { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.mrow input { height: 38px; padding: 0 11px; border: 1px solid var(--rule-2); border-radius: 9px; background: var(--card); font-size: 13.5px; }
.mrow input:focus { outline: none; border-color: var(--ink); }
.mrow .bdg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink-2); cursor: pointer; white-space: nowrap; margin: 0; }
.mhead { display: grid; grid-template-columns: 1fr 1fr 1fr auto auto; gap: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 6px; }
/* редактор подразделов: колонки одной ширины во всех строках, иначе «5 блюд» / «3 блюда» / пусто двигают поля */
.mrow.fixed, .mhead.fixed { grid-template-columns: repeat(3, minmax(0, 1fr)) 62px 28px; }
.mrow input { width: 100%; min-width: 0; }

/* modal + toast */
.modal-back { position: fixed; inset: 0; z-index: 90; background: rgba(30,27,24,.4); display: none; place-items: center; padding: 20px; }
.modal-back.on { display: grid; }
.modal { width: 100%; max-width: 380px; background: var(--card); border-radius: 18px; padding: 22px; font-size: 15px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 11px 16px; background: var(--ink); color: #fff; border-radius: 11px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease); z-index: 95; box-shadow: 0 16px 34px -16px rgba(30,27,24,.9); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
body.drawer-open .toast { bottom: 84px; }
body.drawer-open .savebar { display: none; }
.toast.bad { background: var(--dot); }

.cat-list li.empty { padding: 30px 0; text-align: center; color: var(--ink-3); cursor: default; }
.cat-list li.empty:hover { background: none; }

@media (max-width: 1360px) {
  .app, body.no-preview .app { grid-template-columns: 232px minmax(0, 1fr); --pv: 0px; }
  .preview { position: fixed; right: 0; top: 0; z-index: 55; width: 480px; transform: translateX(100%); transition: transform .3s var(--ease); box-shadow: -20px 0 60px -30px rgba(30,27,24,.6); }
  .preview.on { transform: none; }
  .preview-toggle { display: grid; }
}
@media (max-width: 900px) {
  .app, body.no-preview .app { grid-template-columns: minmax(0, 1fr); --pv: 0px; }
  .side { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .brand { flex: 1; }
  .nav { order: 3; flex-direction: row; flex: 1 1 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav button { white-space: nowrap; flex: none; }
  .side-foot { margin: 0; flex-direction: row; flex: none; }
  .side-link.dim { display: none; }
  .side-link span, .side-link { font-size: 12.5px; }
  .content { padding: 16px; overflow-x: hidden; }
  .page-head { flex-direction: column; }
  .head-actions { flex-wrap: wrap; }
  .col-head { flex-wrap: wrap; }
  .menu-layout { grid-template-columns: 1fr; }
  .cat-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
  .cat-list li { flex: none; }
  .cat-list li.subs { display: none; } /* в горизонтальной ленте ветке места нет, подразделы правятся в карточке раздела */
  .lang-grid, .row3, .row4, .row2, .presets, .colors, .cat-tiles { grid-template-columns: 1fr 1fr; }
  .nav { flex-wrap: wrap; overflow: visible; }
  .opt-row { grid-template-columns: 46px minmax(0, 1fr) minmax(0, 1fr) auto; }
  .opt-row .o-phw { grid-row: span 2; align-self: start; }
  .opt-row .o-weight { grid-column: 2 / 4; }
  .opt-row .o-tr { grid-column: 2 / 4; }
  .text-row, .text-head { grid-template-columns: 1fr; }
  .text-head { display: none; }
  .qr-layout { grid-template-columns: 1fr; }
  .hours-row { grid-template-columns: 1fr; }
  .blk-body, .cardbox.fixed .blk-body { padding-left: 14px; }
  .drawer-body.two { grid-template-columns: 1fr; gap: 18px; }
  .gp { position: static; }
  .gp-stage { display: flex; gap: 14px; align-items: flex-start; }
  .gp-card, .gp-cap { display: none; }
  .mrow, .mhead { grid-template-columns: 1fr auto auto; }
  .mrow.fixed, .mhead.fixed { grid-template-columns: repeat(3, minmax(0, 1fr)) 28px; } .mrow.fixed .hint, .mhead.fixed span:nth-child(4) { display: none; } /* на телефоне три поля важнее счётчика блюд */
  .preview, body.no-preview .preview { width: 100%; }
  .savebar { left: 50%; }
  .phone { max-width: 100%; }
}

@media (max-width: 560px) {
  .item-grid.list li { grid-template-columns: 56px minmax(0, 1fr); grid-template-areas: "th in" "th sw"; row-gap: 6px; padding: 8px 10px; }
  .item-grid.list .handle { display: none; }
  .item-grid.list .th { grid-area: th; width: 56px; height: 56px; }
  .item-grid.list .in { grid-area: in; flex-direction: column; align-items: flex-start; gap: 2px; }
  .item-grid.list .sw { grid-area: sw; flex-wrap: wrap; }
  .item-grid.list .in b { white-space: normal; -webkit-line-clamp: 2; display: -webkit-box; }
  .btn { white-space: normal; height: auto; min-height: 40px; padding: 9px 14px; text-align: center; line-height: 1.25; }
  .btn.small { min-height: 34px; }
  .lang-grid, .row2, .row3, .row4, .presets, .colors, .cat-tiles, .qr-layout { grid-template-columns: 1fr; }
  .opt-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .opt-row .o-weight { grid-column: auto; }
  .opt-row .o-tr { grid-column: 2 / -1; }
  .content { padding: 14px 12px 90px; }
  .cardbox { padding: 16px 14px; border-radius: 16px; }
  .drawer-head, .drawer-body, .drawer-foot { padding-left: 14px; padding-right: 14px; }
  .gp-stage { flex-direction: column; }
  .savebar { left: 12px; right: 12px; transform: none; margin: 0; }
  .savebar span { font-size: 12.5px; }
  .toast { left: 12px; right: 12px; transform: translateY(20px); white-space: normal; }
  .toast.on { transform: none; }
  .sheet, .cropbox { padding: 16px 14px; }
}
.hint .lnk { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.hint .lnk:hover { color: var(--ink); }
/* ИИ-перевод */
.ai-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.ai-bar .hint { margin: 0; flex: 1 1 220px; }
@keyframes aiFlash { from { background: color-mix(in srgb, var(--ink) 9%, var(--card)); } to { background: var(--card); } }
.ai-filled { animation: aiFlash 2.4s var(--ease); }
.sheet.wide { width: min(1180px, 100%); }
.ai-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 14px; }
.ai-opts h4 { font-size: 12px; font-weight: 700; color: var(--ink-3); margin-bottom: 8px; }
.ai-opts label { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; cursor: pointer; }
.ai-prog { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; font-size: 13px; color: var(--ink-2); }
.ai-prog .bar { flex: 1; height: 6px; border-radius: 3px; background: var(--rule-2); overflow: hidden; }
.ai-prog .bar i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .3s var(--ease); }
.ai-sum { font-size: 13.5px; margin: 6px 0 10px; }
.ai-sum .bad { color: #B5322A; }
.ai-table { overflow: auto; max-height: 52vh; border: 1px solid var(--rule-2); border-radius: 12px; }
.ai-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ai-table th { position: sticky; top: 0; background: var(--card); text-align: left; font-size: 10.5px; letter-spacing: .08em; color: var(--ink-3); padding: 9px 12px; border-bottom: 1px solid var(--rule-2); }
.ai-table td { vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--rule); min-width: 150px; }
.ai-table tr[data-id] { cursor: pointer; }
.ai-table tr[data-id]:hover td { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.ai-table .desc, .ai-table td .desc { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.ai-table td > div.name { font-weight: 600; }
.ai-table td > div.new { color: var(--ink); }
.ai-table td > div.new.name { box-shadow: inset 2px 0 0 var(--ink); padding-left: 7px; }
.ai-table td > div.old { color: var(--ink-3); }
.ai-table td > div + div { margin-top: 4px; }
.ai-table td > div.desc { font-size: 12px; }
.ai-table s { display: block; color: var(--ink-3); font-size: 11.5px; font-weight: 400; margin-top: 2px; }
.ai-table .st { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--ink-3); }
.ai-table tr.st-error .st { color: #B5322A; font-weight: 700; }
.ai-table td.note { font-size: 12px; color: var(--ink-2); min-width: 180px; }
.ai-skip { margin-top: 10px; font-size: 13px; }
.ai-skip summary { cursor: pointer; color: var(--ink-2); margin-bottom: 8px; }
@media (max-width: 700px) { .ai-opts { grid-template-columns: 1fr; } }
.ai-opts label > input { display: inline-block; width: 16px; height: 16px; margin: 0; padding: 0; flex: none; border: 0; box-shadow: none; accent-color: var(--ink); }
.ai-opts label { color: var(--ink); }
.ai-table .st { display: block; }
/* бейдж пометки у названия, кнопки справа одной ширины (23.09) */
.item-grid .in .bdg { align-self: flex-start; height: 20px; padding: 0 8px; border-radius: 999px; background: var(--dot); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; white-space: nowrap; margin-top: 4px; }
.item-grid.list .in .bdg { align-self: center; margin-top: 0; }
.item-grid.list .in b { flex: 0 1 auto; }
.item-grid.list .in .pr { margin-left: auto; }
.item-grid.list .sw label { min-width: 70px; justify-content: center; }
@media (max-width: 560px) {
  .item-grid.list .in .bdg { align-self: flex-start; }
  .item-grid.list .in .pr { margin-left: 0; }
}

/* размеры блюда: при наличии размеров общие цена, старая цена и вес не нужны */
.opts-block { margin-top: 16px; }
.opts-head { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.opts-head span { font-weight: 400; color: var(--ink-3); margin-left: 6px; }
.drawer-body:not(.has-opts) .opts-head, .drawer-body:not(.has-opts) .opts-on { display: none; }
.drawer-body.has-opts .opts-off { display: none; }
.drawer-body.has-opts .lb-price, .drawer-body.has-opts .lb-old, .drawer-body.has-opts .lb-weight { display: none; }
/* цена, старая цена, штук, вес, единица */
.row4.pw { grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.3fr); }
@media (max-width: 900px) { .row4.pw { grid-template-columns: 1fr 1fr; } }
.drawer-body.has-opts .row4.pw { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 2fr); }
.opt-cols { display: grid; grid-template-columns: 46px minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) 34px; gap: 8px; font-size: 12px; color: var(--ink-3); margin: 0 0 4px; }
.drawer-body:not(.has-opts) .opt-cols { display: none; }
@media (max-width: 900px) { .opt-cols { display: none !important; } .drawer-body.has-opts .row4.pw { grid-template-columns: 1fr 1fr; } }
/* заголовки подразделов в списке блюд раздела */
.item-grid li.sec-head { grid-column: 1 / -1; display: flex; flex-direction: row; align-items: baseline; gap: 8px; padding: 14px 4px 2px; background: none; box-shadow: none; border-radius: 0; overflow: visible; cursor: default; }
.item-grid li.sec-head:first-child { padding-top: 0; }
.item-grid li.sec-head:hover { box-shadow: none; }
.item-grid li.sec-head b { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-2); }
.item-grid li.sec-head span { font-size: 12px; color: var(--ink-3); }
.item-grid.list li.sec-head { display: flex; padding: 14px 4px 2px; }
.item-grid.list li.sec-head:first-child { padding-top: 0; }
.ai-h { margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.ai-h:first-child { margin-top: 4px; }
/* страница «Добавки» */
.ex-card.off { opacity: .6; }
.ex-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.ex-top h3 { margin: 0; }
.ex-names { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ex-card input:not([type=checkbox]) { width: 100%; min-width: 0; height: 38px; padding: 0 11px; border: 1px solid var(--rule-2); border-radius: 9px; background: var(--card); font-size: 13.5px; }
.ex-card input:focus { outline: none; border-color: var(--ink); }
.ex-h { margin: 20px 0 8px; font-size: 13px; font-weight: 700; color: var(--ink); }
.ex-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 96px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.ex-row.head { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 6px; }
.ex-rules { display: grid; grid-template-columns: 180px 220px 1fr; gap: 12px; align-items: end; }
.ex-rules label:not(.switch) { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.ex-rules .switch { align-self: center; padding-top: 18px; }
.ex-rule { margin-top: 8px; }
.ex-where { display: grid; gap: 8px; }
.ex-lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); margin-top: 6px; }
.ex-grp { display: grid; grid-template-columns: 150px 1fr; gap: 8px; align-items: start; }
.ex-grp > span { font-size: 12.5px; color: var(--ink-3); padding-top: 7px; }
.ex-picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ex-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 6px 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; }
.ex-chip button { width: 20px; height: 20px; border-radius: 50%; color: #fff; opacity: .7; font-size: 11px; }
.ex-chip button:hover { opacity: 1; }
.ex-picked select { height: 34px; border-radius: 999px; border: 1px dashed var(--rule-2); background: var(--card); padding: 0 12px; font-size: 13px; color: var(--ink-2); max-width: 260px; }
.ex-reach { margin: 16px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--card-2, rgba(30,27,24,.04)); font-size: 13px; color: var(--ink-2); }
@media (max-width: 900px) {
  .ex-names { grid-template-columns: 1fr; }
  .ex-row { grid-template-columns: minmax(0, 1fr) 84px 34px; }
  .ex-row input[data-af="kz"], .ex-row input[data-af="en"], .ex-row.head span:nth-child(2), .ex-row.head span:nth-child(3) { display: none; }
  .ex-rules { grid-template-columns: 1fr 1fr; }
  .ex-rules .switch { grid-column: 1 / -1; padding-top: 0; }
  .ex-grp { grid-template-columns: 1fr; }
}
