:root { --header-h: 0px; --m-stage: 340px; }
html { scroll-behavior: auto; scroll-padding-top: calc(var(--m-stage) + 8px); overflow-anchor: none; }
.sh-main, .header { position: relative; z-index: 80; }
.fit-head { padding: 12px 0 8px; }
.fit-head .eyebrow { display: none; }
.fit-head h1 { margin: 0; font-size: 22px; line-height: 1.15; }
.fit { padding-top: 0; }
.fit-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
#frame-risk, #frame-excl { order: 2; margin: 8px 0 0; font-size: 13px; }
#ctl-mat > #frame-risk { margin: 0 0 12px; }
.stage-sticky { justify-self: start; width: 100vw; max-width: none; margin: 0 -16px; padding: 6px 12px 0; background: rgba(246, 245, 242, .97); box-shadow: 0 8px 18px -14px rgba(17, 17, 17, .45); z-index: 30; }
.stage-bar { display: block; margin: 0 0 6px; }
.view-modes { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.view-modes label { min-height: 36px; display: grid; place-items: center; padding: 0 4px; font-size: 13px; white-space: nowrap; }
.rooms { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; gap: 6px; margin: 0; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent); }
.rooms::-webkit-scrollbar { display: none; }
.rooms[hidden] { display: none; }
.room { flex: 0 0 62px; padding: 2px; border-radius: 8px; background: #fff; } .room img { height: 38px; width: 100%; object-fit: cover; border-radius: 6px; } .room span { display: none; }
.stage:has(.rooms:not([hidden])) .stage-hint { display: none; }
.stage { border-radius: 12px; }
.stage canvas { height: 27svh; min-height: 160px; touch-action: pan-y; }
.stage-hint { font-size: 12px; }
.stage-meta { display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 4px; min-height: 40px; margin: 2px 0 0; }
#outer-size { min-width: 0; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 2px; margin: 0; }
.stage-photo-actions, .stage-photo-actions[hidden] { margin: 0; }
.stage-photo-actions { display: flex; flex-wrap: nowrap; gap: 2px; }
.stage-photo-actions[hidden] { display: none; }
.stage-actions .link-btn { display: grid; place-items: center; width: 36px; height: 38px; padding: 0; border-radius: 50%; font-size: 0; text-decoration: none; }
.stage-actions .link-btn svg { width: 19px; height: 19px; margin: 0; }
.stage-actions .link-btn:active { background: rgba(17, 17, 17, .08); }
.m-frame-nav { position: absolute; top: 50%; z-index: 3; display: grid; place-items: center; width: 40px; height: 40px; margin-top: -20px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: #111; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); font: 700 20px/1 var(--sans, sans-serif); }
.m-frame-nav[hidden] { display: none; }
.m-frame-prev { left: 6px; } .m-frame-next { right: 6px; }
.m-steps { display: flex; gap: 4px; margin: 0 -12px; padding: 2px 12px 6px; overflow-x: auto; scrollbar-width: none; }
.m-steps::-webkit-scrollbar { display: none; }
.m-step { flex: 0 0 auto; min-height: 36px; padding: 0 13px; border: 1px solid transparent; border-radius: 999px; background: none; color: #6B6660; font: 700 13px/1 var(--sans, sans-serif); white-space: nowrap; }
.m-step.on { background: #111; color: #fff; }
.m-step.done:not(.on) { color: #111; }
.m-step.done:not(.on)::after { content: " ✓"; }
.fit-controls { display: block; min-height: calc(100svh - var(--m-stage) - 70px); }
.m-off { display: none !important; }
.ctl, .fit-controls .price-box { margin: 0; padding: 14px 14px 18px; border-radius: 16px; }
.ctl-n { display: none; }
.ctl-head { margin-bottom: 10px; font-size: 17px; }
.fit input[type=number], .fit input[type=search], .fit input[type=text], .fit select, .bagcat input, .bagcat select, .modal input, .modal textarea, .modal select { font-size: 16px; min-height: 46px; }
.size-row input { height: 50px; font-size: 18px; }
.lock { width: 44px; height: 50px; }
.presets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.presets button { min-height: 42px; padding: 0 2px; font-size: 13px; }
.seg label { min-height: 40px; display: grid; place-items: center; }
.chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chips label { min-height: 48px; display: grid; place-items: center; padding: 6px 8px; margin: 0; text-align: center; }
.wt-btn { min-height: 50px; }
.wt-menu label { min-height: 46px; }
.wt-pick.open::before { content: ""; position: fixed; inset: 0; z-index: 94; background: rgba(17, 17, 17, .45); }
.wt-menu { position: fixed; z-index: 95; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); max-height: 72svh; overflow-y: auto; overscroll-behavior: contain; border-radius: 18px; box-shadow: 0 -8px 40px rgba(0, 0, 0, .25); }
.opt { min-height: 48px; }
.fa-open { padding: 12px; }
.bag-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.tone-btn { min-height: 48px; font-size: 15px; }
.tones.open::before { content: ""; position: fixed; inset: 0; z-index: 94; background: rgba(17, 17, 17, .45); }
.tone-menu { position: fixed; z-index: 95; left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; max-height: 68svh; padding: 8px; overflow-y: auto; overscroll-behavior: contain; background: #fff; box-shadow: 0 -8px 40px rgba(0, 0, 0, .28); }
.tone-menu .tone { display: flex; align-items: center; width: 100%; min-height: 48px; padding: 8px 10px; font-size: 15px; }
.tone-menu .tone small { margin-left: auto; }
.bag-list, #ctl-frame.is-compact .bag-list { max-height: none; overflow: visible; }
.bag-row { grid-template-columns: 72px 34px minmax(0, 1fr); grid-template-areas: "thumb end main" "thumb end stock"; min-height: 76px; padding: 8px; gap: 2px 12px; align-content: center; }
.bag-thumb { width: 72px; height: 54px; }
.bag-end { width: 34px; height: 48px; }
.bag-row:not(:has(.bag-end)) { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "thumb main" "thumb stock"; }
.bag-thumb.is-photo { height: 62px; }
.bag-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bag-stock { justify-self: start; }
.bag-row.is-new { animation-duration: .2s; }
.bag-more { min-height: 50px; }
.bag-actions .link-btn { display: flex; width: 100%; min-height: 50px; align-items: center; justify-content: center; border: 1px solid #111; border-radius: 999px; font-size: 15px; text-decoration: none; }
.m-filters { border: 1px solid var(--line); border-radius: 12px; }
.m-filters summary { display: flex; align-items: center; justify-content: space-between; min-height: 46px; padding: 0 14px; font-weight: 700; font-size: 14px; list-style: none; }
.m-filters summary::-webkit-details-marker { display: none; }
.m-filters summary::after { content: "+"; font-size: 20px; font-weight: 500; }
.m-filters[open] summary::after { content: "−"; }
.m-filters > *:not(summary) { margin: 0 14px 12px; width: calc(100% - 28px); }
.bag-wrange input[type=number] { min-height: 42px; }
.wr-track input[type=range]::-webkit-slider-thumb { width: 28px; height: 28px; }
.wr-track input[type=range]::-moz-range-thumb { width: 28px; height: 28px; }
.stage-color-note--top { display: none !important; }
.variants { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.hb-grid { grid-template-columns: minmax(0, 1fr); }
.opts--hang { grid-template-columns: minmax(0, 1fr); }
.price-actions { grid-template-columns: minmax(0, 1fr); }
.price-actions .btn { min-height: 52px; }
.mobile-bar { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); grid-template-columns: 48px minmax(0, 1fr) minmax(0, 1.25fr); gap: 8px; padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); }
.mobile-bar a, .mobile-bar button { flex-direction: row; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 8px; border-radius: 999px; font-size: 14px; line-height: 1.1; }
.mobile-bar a { font-size: 0; }
.mobile-bar a svg { width: 21px; height: 21px; }
.mobile-bar .primary { background: #fff; color: #111; border: 1px solid #111; }
.mobile-bar .primary svg { display: none; }
.mobile-bar .m-next { background: #111; color: #fff; border: 1px solid #111; font-weight: 800; }
.mobile-bar.m-last { grid-template-columns: 48px minmax(0, 1fr); }
.mobile-bar.m-last .m-next { display: none; }
.mobile-bar.m-last .primary { background: #111; color: #fff; font-weight: 800; }
body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
.bagcat[open], .cropper[open] { width: 100vw; max-width: 100vw; height: 100svh; max-height: 100svh; margin: 0; border-radius: 0; }
.bagcat-box, .cropper-box { height: 100%; border-radius: 0; }
.bagcat-close { width: 44px; height: 44px; }
.cropper-foot { gap: 8px; }
.cropper-foot .btn { min-height: 46px; }
.cropper-note { display: none; }
.modal-box { max-height: 92svh; overflow-y: auto; }
.modal .btn { min-height: 52px; }
@media (orientation: landscape) and (max-height: 500px) {
  .fit-grid { grid-template-columns: 46% minmax(0, 1fr); align-items: start; gap: 10px; }
  .stage-sticky { grid-column: 1; grid-row: 1 / span 4; order: 0; width: calc(100% + 16px); min-width: 0; margin: 0 0 0 -16px; align-self: start; box-shadow: none; }
  .view-modes label { font-size: 12px; }
  #outer-size .outer-btn b::before { content: none; }
  .fit-controls { grid-column: 2; order: 0; min-height: 0; }
  .variants { grid-column: 2; order: 0; }
  .stage canvas { height: calc(100svh - 236px); min-height: 100px; }
  .fit-head h1 { font-size: 18px; }
}
#outer-size .outer-btn { min-height: 34px; padding: 3px 10px 3px 8px; gap: 5px; font-size: 12px; }
#outer-size .outer-btn > span { display: none; }
#outer-size .outer-btn b::before { content: "Рама "; font-weight: 500; color: var(--muted); }
#outer-size .outer-btn[aria-pressed="true"] b::before { color: rgba(255, 255, 255, .72); }
#outer-size { flex: 1 1 auto; }
#outer-size .outer-note { display: none; }
@media (max-width: 370px) {
  #outer-size .outer-btn b::before { content: none; }
  .stage-actions .link-btn { width: 32px; }
  .view-modes label { font-size: 12px; }
}
.modal-box h2 { padding-right: 44px; font-size: 24px; }
.modal-close { width: 44px; height: 44px; }
.m-typing .mobile-bar { display: none; }
@media (max-height: 640px) and (orientation: portrait) {
  .stage canvas { height: 22svh; min-height: 120px; }
}
.m-keyboard .view-modes, .m-keyboard .stage-bar, .m-keyboard .stage-meta, .m-keyboard .m-steps, .m-keyboard .rooms, .m-keyboard .m-frame-nav { display: none !important; }
.m-keyboard .stage-sticky { padding-bottom: 6px; }
.m-keyboard .stage canvas { height: 92px; min-height: 92px; }
.m-keyboard .fit-controls { min-height: 70svh; }
.bag-suggest { max-height: 42svh; }
.m-keyboard .stage-hint { display: none; }
.fa-dlg-btns { flex-wrap: wrap; }
.fa-dlg-btns .btn { min-height: 48px; }
.fa-reset { width: 100%; min-height: 40px; justify-content: center; }
.m-fullbtn, .m-fullclose { position: absolute; top: 8px; right: 8px; z-index: 4; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: rgba(17, 17, 17, .72); color: #fff; cursor: pointer; }
.m-fullbtn svg, .m-fullclose svg { width: 20px; height: 20px; }
.m-fullclose { display: none; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: #111; box-shadow: 0 2px 12px rgba(0, 0, 0, .3); }
.m-locked, .m-locked body { overflow: hidden; overscroll-behavior: none; }
.m-stage-spacer { order: 1; width: 100vw; margin: 0 -16px; }
.stage-sticky.m-full { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; width: 100vw; max-width: none; height: 100svh; margin: 0; padding: calc(8px + env(safe-area-inset-top)) 10px calc(8px + env(safe-area-inset-bottom)); background: #F6F5F2; box-shadow: none; overscroll-behavior: contain; }
.m-full .stage-bar { flex: none; padding-right: 0; }
.m-full .stage { flex: 1 1 auto; min-height: 0; }
.m-full .stage canvas { height: 100% !important; min-height: 0; touch-action: none; }
.m-full .stage-meta { flex: none; }
.m-full .m-steps { display: none; }
.m-full .m-fullbtn { display: none; }
.m-full .m-fullclose { display: grid; }
@media (orientation: landscape) and (max-height: 500px) {
  .m-stage-spacer { grid-column: 1; grid-row: 1 / span 4; order: 0; width: auto; margin: 0; }
}
*, *::before, *::after { overflow-anchor: none; }
.fa-cards { display: flex; gap: 10px; margin: 0 -14px; padding: 2px 14px 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none; grid-template-columns: none; }
.fa-cards::-webkit-scrollbar { display: none; }
.fa-card { flex: 0 0 84%; min-width: 0; scroll-snap-align: center; }
.fa-why li { font-size: 13px; line-height: 1.35; }
.fa-card { grid-template-columns: minmax(0, 1fr); align-content: start; }
.fa-pic { width: 100%; height: 112px; }
.fa-act { display: grid; grid-template-columns: 1.2fr 1fr; gap: 6px; }
.fa-act .btn { min-height: 44px; padding-inline: 6px; font-size: 13px; }
.fa-more summary { min-height: 40px; }
.fa-pic img, .fa-pic canvas { object-fit: contain; object-position: center; }
.stage-hint:not([hidden]) { animation: mHint 3.5s ease forwards; pointer-events: none; }
@keyframes mHint { 0%, 80% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.fa-cards { align-items: flex-start; }
.photo-adj { position: fixed; left: 0; right: 0; bottom: 0; z-index: 210; margin: 0; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, .35); }
.adj-row { min-height: 42px; grid-template-columns: 104px minmax(0, 1fr) 34px; }
.adj-row input { height: 36px; touch-action: none; }
.adj-row input::-webkit-slider-thumb { width: 26px; height: 26px; }
.adj-btns .link-btn { min-height: 40px; display: inline-flex; align-items: center; }
.adj-btns .btn { min-height: 40px; }
.adj-head b { display: none; }
.adj-btns { width: 100%; justify-content: space-between; }
.stage-card { padding: 0; }
.stage-empty .btn.stage-upload { gap: 7px; padding: 6px 12px; font-size: 14px; }
.stage-empty .stage-upload svg { width: 42px; height: 42px; padding: 12px; }
.m-frame-bar { display: flex; justify-content: center; gap: 12px; margin: 6px 0 0; }
.m-frame-bar[hidden] { display: none; }
.m-frame-bar .m-frame-nav { position: static; margin: 0; width: 44px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: #fff; box-shadow: none; }
.m-frame-bar .m-frame-nav[hidden] { display: none; }
.stage-actions .m-fullbtn { position: static; display: grid; place-items: center; width: 34px; height: 38px; padding: 0; border: 0; border-radius: 50%; background: none; color: inherit; box-shadow: none; opacity: 1; }
.stage-actions .link-btn { width: 32px; }
#outer-size { font-size: 11.5px; }
.stage-sticky > .rooms { position: static; inset: auto; margin: 6px -12px 0; padding: 0 12px; background: none; }
.outer-btn { font-size: 0; gap: 0; padding-left: 8px; padding-right: 8px; }
.outer-btn svg { display: none; }
.outer-btn b { font-size: 11.5px; }
.stage-meta { min-height: 36px; gap: 6px; }
#outer-size .outer-btn { min-height: 36px; }
.stage-actions, .stage-photo-actions { gap: 0; }
.stage-actions .link-btn, .stage-actions .m-fullbtn { display: flex; align-items: center; justify-content: center; gap: 0; width: 34px; height: 36px; margin: 0; padding: 0; }
.stage-actions .link-btn > span { display: none; }
.stage-actions .link-btn svg, .stage-actions .m-fullbtn svg { display: block; flex: none; width: 20px; height: 20px; margin: 0; }
#plate-add { margin-right: 0; }
.m-steps { --fl: 0px; --fr: 0px; -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); mask-image: linear-gradient(90deg, transparent 0, #000 var(--fl), #000 calc(100% - var(--fr)), transparent); }
.m-steps.m-l { --fl: 44px; } .m-steps.m-r { --fr: 44px; }
.bagcat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; }
#bagcat .bagcat-tools { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "q q" "tone prof" "sort sort" "sup sup" "width width" "price price" "stock stock"; gap: 8px; }
#bagcat.bc-compact .bagcat-tools > :not(.search) { display: none !important; }
#bagcat.bc-compact .bagcat-tools { grid-template-areas: "q q"; }
