/* ============================================================
   Фабрика Качества — прототип v2.2.1
   Бренд: красный #E30016 (акцент/CTA), тёмно-красный #B60E1A (промо),
   чёрный #121009, белый. Фон приложения — светлый нейтральный.
   Шрифт интерфейса — системный. Шрифт логотипа только в логотипе.
   ============================================================ */

:root{
  --red: #E30016;
  --red-dark: #B60E1A;
  --red-press: #C40013;
  --ink: #121009;
  --ink-70: rgba(18,16,9,.70);
  --ink-55: rgba(18,16,9,.55);
  --ink-40: rgba(18,16,9,.40);
  --ink-18: rgba(18,16,9,.12);
  --ink-08: rgba(18,16,9,.06);

  --app-bg: #F3F4F2;
  --surface: #FFFFFF;
  --surface-2: #F7F7F5;
  --border: #E7E7E3;

  --amber: #8A5A00;
  --amber-bg: #FFF4DC;
  --amber-bd: #F1D28A;
  --green: #1E7A3D;
  --green-bg: #E9F6EC;
  --err: #C8102E;
  --err-bg: #FDEAEA;

  --link: #2454A6;

  --radius-s: 10px;
  --radius-m: 14px;
  --radius-l: 20px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  --header-h: 56px;
  --tabbar-h: 58px;
  --cta-h: 64px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*{ box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden]{ display:none !important; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
img{ max-width:100%; display:block; }
button{ font-family: inherit; color: inherit; }
a{ color: var(--link); }
ul{ margin:0; padding:0; list-style:none; }
h1,h2,h3,p{ margin:0; }

/* ---------- Stage / phone frame ---------- */
.stage{
  min-height: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 28px;
  padding: 0;
  background: var(--surface);
}

.phone{
  position:relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: var(--app-bg);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  isolation:isolate;
}

.phone-notch{ display:none; }

/* Annotation panel hidden by default (phone/standalone) */
.annot{ display:none; }

/* ---------- Desktop / annotation mode (≥900px, not standalone) ---------- */
@media (min-width: 900px){
  body{ background: var(--ink); }
  .stage{
    background: var(--ink);
    padding: 40px 24px;
    align-items:flex-start;
    justify-content:center;
  }
  .phone{
    width: 390px;
    height: 844px;
    margin-top: 12px;
    border-radius: 46px;
    box-shadow: 0 0 0 10px #060504, 0 0 0 12px #2b2924, 0 30px 70px rgba(0,0,0,.55);
    flex: 0 0 390px;
    /* Браузер отдаёт env(safe-area-inset-top)=0 — реального выреза нет.
       В режиме аннотаций рисуем чёлку декоративно, поэтому подкладываем
       под неё безопасную зону вручную, иначе шапка экрана рисуется под неё. */
    --safe-t: 32px;
  }
  .phone-notch{
    display:block;
    position:absolute;
    top:0; left:50%; transform: translateX(-50%);
    width: 126px; height: 32px;
    background: #060504;
    border-radius: 0 0 18px 18px;
    z-index: 50;
  }
  .annot{
    display:flex;
    flex-direction:column;
    width: 380px;
    max-height: calc(100vh - 80px);
    margin-top: 12px;
    background: var(--surface);
    border-radius: var(--radius-l);
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
    overflow:hidden;
  }
}
@media (min-width: 1180px){
  .annot{ width: 420px; }
}

.annot-head{
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.annot-brand{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.annot-logo{ height: 26px; width:auto; }
.annot-ver{ font-size:12px; color:var(--ink-55); font-weight:600; white-space:nowrap; }

.annot-current{ padding: 18px 22px; overflow-y:auto; flex: 1 1 auto; border-bottom: 1px solid var(--border); }
.annot-row{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.annot-tag{
  font-size:11px; font-weight:800; letter-spacing:.02em; text-transform:uppercase;
  padding: 3px 8px; border-radius:6px; background: var(--ink-08); color: var(--ink-70);
}
.annot-tag.must{ background:#FDE7E9; color:#9A0E22; }
.annot-tag.should{ background:#FFF4DC; color:#8A5A00; }
.annot-tag.new{ background:#E9F6EC; color:#1E7A3D; }
.annot-section{ font-size:12px; color: var(--ink-55); font-weight:600; }
.annot-title{ font-size:21px; font-weight:800; letter-spacing:-.01em; margin-bottom:14px; }
.annot-block{ margin-bottom: 16px; }
.annot-block h3{ font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-40); margin-bottom:8px; }
.annot-block ul{ display:flex; flex-direction:column; gap:7px; }
.annot-block li{ font-size:13.5px; line-height:1.45; color: var(--ink-70); padding-left:14px; position:relative; }
.annot-block li::before{ content:""; position:absolute; left:0; top:7px; width:5px; height:5px; border-radius:50%; background: var(--ink-18); }
.annot-block#annotChangesBlock li::before{ background: var(--red); }
.annot-block#annotChanges2Block li::before{ background: var(--red); }
.annot-reset{
  margin-top: 4px;
  width:100%; padding:10px; border-radius:10px; border:1px solid var(--border);
  background: var(--surface-2); color: var(--ink-70); font-size:13px; font-weight:700; cursor:pointer;
}
.annot-reset:hover{ background: var(--ink-08); }

.annot-map{ padding: 16px 22px 22px; overflow-y:auto; flex: 1 1 auto; }
.annot-map h3{ font-size:12px; font-weight:800; text-transform:uppercase; letter-spacing:.03em; color:var(--ink-40); margin-bottom:10px; }
.amap-group{ margin-bottom:12px; }
.amap-group-title{ font-size:11px; font-weight:800; color: var(--ink-40); text-transform:uppercase; margin: 10px 0 6px; }
.amap-item{
  display:flex; align-items:center; gap:8px;
  width:100%; text-align:left; padding:7px 9px; border-radius:8px; border:none; background:transparent;
  font-size:13px; color: var(--ink-70); cursor:pointer;
}
.amap-item:hover{ background: var(--ink-08); }
.amap-item.active{ background:#FDE7E9; color:#9A0E22; font-weight:700; }
.amap-dot{ width:6px; height:6px; border-radius:50%; background: var(--ink-18); flex:0 0 auto; }
.amap-item.active .amap-dot{ background: var(--red); }

/* ---------- Header ---------- */
.app-header{
  flex: 0 0 auto;
  height: calc(var(--header-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display:flex; align-items:center; gap:8px;
  padding-left:10px; padding-right:10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position:relative; z-index:20;
}
.hdr-btn{
  appearance:none; border:none; background:transparent; cursor:pointer;
  width:40px; height:40px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color: var(--ink); flex: 0 0 auto; position:relative;
}
.hdr-btn:active{ background: var(--ink-08); }
.hdr-back svg{ color: var(--ink); }
.mark-flag{
  display:block; width:26px; height:26px; border-radius:7px; object-fit:cover;
}
.hdr-mark{ border-radius:9px; }

.hdr-search{
  flex:1 1 auto; height:38px; border-radius:12px; background: var(--surface-2);
  border:1px solid var(--border);
  display:flex; align-items:center; gap:7px; padding:0 12px;
  color: var(--ink-55); font-size:14.5px; cursor:pointer; min-width:0;
}
.hdr-search span{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hdr-search:active{ background: var(--ink-08); }

.hdr-title{
  flex:1 1 auto; font-size:17px; font-weight:800; letter-spacing:-.01em;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}

.hdr-actions{ display:flex; align-items:center; gap:2px; flex:0 0 auto; }
.badge{
  position:absolute; top:3px; right:3px; min-width:16px; height:16px; padding:0 4px;
  border-radius:9px; background: var(--red); color:#fff; font-size:10px; font-weight:800;
  display:flex; align-items:center; justify-content:center; line-height:1;
  border: 1.5px solid var(--surface);
}

/* ---------- Screen viewport ---------- */
.screen-viewport{
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--app-bg);
  position:relative;
}
.screen{
  min-height: 100%;
  padding: 14px 16px calc(22px + var(--safe-b));
  display:flex; flex-direction:column; gap:12px;
  animation: screenIn .22s ease both;
}
@keyframes screenIn{
  from{ opacity:0; transform: translateY(6px); }
  to{ opacity:1; transform:none; }
}
.screen.bare{ padding-top: max(18px, calc(var(--safe-t) + 6px)); }

/* ---------- Bottom tabbar ---------- */
.tabbar{
  flex: 0 0 auto;
  display:flex;
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding-bottom: var(--safe-b);
  position:relative; z-index:20;
}
.tab{
  flex:1 1 0; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:3px; padding:8px 2px 7px; background:transparent; border:none; cursor:pointer;
  color: var(--ink-55); position:relative; min-height:52px;
}
.tab svg{ width:23px; height:23px; }
.tab span{ font-size:10.5px; font-weight:700; }
.tab.active{ color: var(--red); }
.tab .tab-badge{
  position:absolute; top:2px; right: calc(50% - 20px);
  min-width:16px; height:16px; padding:0 4px; border-radius:9px;
  background: var(--red); color:#fff; font-size:10px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}

/* ---------- Sticky CTA ---------- */
.cta-bar{
  flex: 0 0 auto;
  display:flex; align-items:center; gap:12px;
  padding: 10px 16px; background: var(--surface);
  border-top: 1px solid var(--border);
  position:relative; z-index:15;
}
.cta-sum{ flex:1 1 auto; min-width:0; }
.cta-sum .amt{ font-size:16px; font-weight:800; letter-spacing:-.01em; display:block; }
.cta-sum .lbl{ font-size:11.5px; color: var(--ink-55); font-weight:600; }
.cta-btn{
  flex: 0 0 auto; appearance:none; border:none; cursor:pointer;
  background: var(--red); color:#fff; font-size:15px; font-weight:800;
  padding: 13px 22px; border-radius: 12px; min-height:44px;
  transition: transform .08s ease, background .12s ease;
  white-space:nowrap;
}
.cta-btn:active{ background: var(--red-press); transform: scale(.97); }
.cta-btn:disabled{ background: var(--ink-18); color: var(--ink-40); cursor:default; }
.cta-bar.no-sum .cta-btn{ width:100%; }

/* ============================================================
   Row types
   ============================================================ */

.row-logo{ display:flex; justify-content:center; padding: 26px 0 6px; }
.row-logo img{ height: 40px; width:auto; }

.row-hero{
  position:relative;
  min-height: 220px;
  border-radius: var(--radius-l);
  overflow:hidden;
  background: var(--red-dark) url('./brand/ornament-bg.jpg') center/cover no-repeat;
  display:flex; align-items:center; justify-content:center;
}
.row-hero::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(18,9,9,.12) 0%, rgba(18,9,9,.34) 100%);
}
.row-hero .hero-logo{
  position:relative; z-index:1; height:46px; width:auto;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,.35));
}

.row-ph2{
  border-radius: var(--radius-l);
  overflow:hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 1.15/1;
}
.row-ph2 img{ width:100%; height:100%; object-fit:cover; }

.row-h{ font-size:19px; font-weight:800; letter-spacing:-.01em; margin-top:4px; }
.row-tx{ font-size:15px; line-height:1.5; color: var(--ink-70); }
.row-sm{ font-size:13px; line-height:1.4; color: var(--ink-55); }

.row-fd{
  height:48px; border-radius:12px; background: var(--surface);
  border: 1.5px solid var(--border); display:flex; align-items:center; padding:0 14px;
  font-size:15px; color: var(--ink-40); gap:8px; cursor:text;
}
.row-fd.filled{ color: var(--ink); border-color: var(--ink-18); }
.row-fd input{
  border:none; outline:none; background:transparent; font-size:15px; width:100%;
  font-family:inherit; color: var(--ink);
}
.row-fd input::placeholder{ color: var(--ink-40); }

.row-btn{
  appearance:none; border:none; cursor:pointer; width:100%;
  background: var(--red); color:#fff; font-size:15.5px; font-weight:800;
  padding:15px; border-radius:12px; min-height:44px;
}
.row-btn:active{ background: var(--red-press); }

.row-a{
  display:inline-flex; align-items:center; gap:6px;
  font-size:14.5px; font-weight:700; color: var(--link); text-decoration:underline;
  text-underline-offset:2px; background:none; border:none; padding:6px 0; cursor:pointer;
  min-height:44px;
}

.row-er, .row-ok, .row-wr{
  display:flex; gap:10px; align-items:flex-start; padding:13px 14px; border-radius:12px; font-size:13.5px; line-height:1.45;
}
.row-er{ background: var(--err-bg); color:#8E0F26; }
.row-ok{ background: var(--green-bg); color:#155C2C; }
.row-wr{ background: var(--amber-bg); color:#6B4600; cursor:default; }
.row-wr.linkable{ cursor:pointer; }
.row-er .ic, .row-ok .ic, .row-wr .ic{ flex:0 0 auto; width:18px; height:18px; margin-top:1px; }

.row-cut{
  display:flex; align-items:center; gap:9px;
  background: var(--ink); color:#fff; border-radius:12px; padding:11px 14px;
  font-size:13px; font-weight:700;
}
.row-cut .ic{ flex:0 0 auto; color: #FFB74D; }

.row-pt{
  display:flex; align-items:center; gap:10px; width:100%; text-align:left;
  background: var(--surface); border:1px solid var(--border); border-radius:12px; padding:12px 14px;
  cursor:pointer;
}
.row-pt .ic{ flex:0 0 auto; color: var(--red); }
.row-pt .tx{ flex:1 1 auto; min-width:0; font-size:14px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.row-pt .chev{ flex:0 0 auto; color: var(--ink-40); }

.row-qa{
  background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m);
  padding:14px; display:flex; flex-direction:column; gap:10px;
}
.row-qa-top{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:none; border:none; cursor:pointer; padding:0; }
.row-qa-top .ic{ flex:0 0 auto; width:38px; height:38px; border-radius:10px; background:#FDE7E9; color:var(--red); display:flex; align-items:center; justify-content:center; }
.row-qa-top .tx{ flex:1 1 auto; font-size:14.5px; font-weight:700; }
.row-qa-top .chev{ color: var(--ink-40); }
.row-qa-line{ height:1px; background: var(--border); }
.row-qa-bottom{
  display:flex; align-items:center; justify-content:center; gap:7px; width:100%;
  background: var(--surface-2); border:none; border-radius:9px; padding:11px; cursor:pointer;
  font-size:13.5px; font-weight:700; color: var(--ink-70);
}

.row-bn{
  position:relative; border-radius: var(--radius-l); overflow:hidden; min-height:96px;
  background: var(--red-dark) url('./brand/ornament-bg.jpg') center/cover no-repeat;
  display:flex; align-items:center; padding:16px;
}
.row-bn::after{ content:""; position:absolute; inset:0; background: linear-gradient(100deg, rgba(15,7,7,.72) 20%, rgba(15,7,7,.18) 100%); }
.row-bn .tx{ position:relative; z-index:1; color:#fff; font-size:15.5px; font-weight:800; line-height:1.35; max-width:80%; }

.row-cd{
  width:100%; text-align:left; background: var(--surface); border:1px solid var(--border);
  border-radius:12px; padding:13px 14px; font-size:14px; font-weight:600; cursor:pointer;
  display:flex; align-items:center; gap:8px; color: var(--ink);
}
.row-cd .tx{ flex:1 1 auto; line-height:1.4; }
.row-cd .chev{ flex:0 0 auto; color: var(--ink-40); }
.row-cd.static{ cursor:default; }

.row-rw{
  width:100%; text-align:left; background:none; border:none; border-bottom:1px solid var(--border);
  padding:14px 2px; font-size:14.5px; font-weight:600; cursor:pointer; color: var(--ink);
  display:flex; align-items:center; gap:8px; min-height:44px;
}
.row-rw .tx{ flex:1 1 auto; }
.row-rw .chev{ flex:0 0 auto; color: var(--ink-40); }
.rows-rw-wrap{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); padding:0 12px; }
.rows-rw-wrap .row-rw:last-child{ border-bottom:none; }

.row-su{
  width:100%; text-align:left; background:none; border:none; padding:6px 2px;
  font-size:13.5px; color: var(--ink-55); cursor:pointer; text-decoration:underline; text-underline-offset:2px;
}

.row-ch{ display:flex; flex-wrap:wrap; gap:8px; }
.chip{
  appearance:none; border:1.5px solid var(--border); background: var(--surface); color: var(--ink-70);
  font-size:13.5px; font-weight:700; padding:9px 14px; border-radius:999px; cursor:pointer; min-height:38px;
}
.chip.sel{ background: var(--red); border-color: var(--red); color:#fff; }
.chip.empty-sel{ border-style:dashed; }

.row-tgl{
  display:flex; align-items:center; gap:10px; padding:12px 2px; border-bottom:1px solid var(--border);
}
.row-tgl .tx{ flex:1 1 auto; font-size:14.5px; font-weight:600; }
.row-tgl .cnt{ font-size:13px; color: var(--ink-40); font-weight:600; }
.switch{ flex:0 0 auto; width:44px; height:26px; border-radius:14px; background: var(--ink-18); position:relative; border:none; cursor:pointer; padding:0; }
.switch::after{ content:""; position:absolute; top:2px; left:2px; width:22px; height:22px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition: transform .16s ease; }
.switch.on{ background: var(--red); }
.switch.on::after{ transform: translateX(18px); }
.rows-tgl-wrap{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); padding:2px 12px; }
.rows-tgl-wrap .row-tgl:last-child{ border-bottom:none; }

.row-rd{
  display:flex; align-items:center; gap:12px; width:100%; text-align:left; background: var(--surface);
  border:1.5px solid var(--border); border-radius:12px; padding:14px; cursor:pointer; margin-bottom:8px;
}
.row-rd:last-child{ margin-bottom:0; }
.row-rd.sel{ border-color: var(--red); }
.radio-dot{ flex:0 0 auto; width:20px; height:20px; border-radius:50%; border:2px solid var(--ink-18); position:relative; }
.row-rd.sel .radio-dot{ border-color: var(--red); }
.row-rd.sel .radio-dot::after{ content:""; position:absolute; inset:3px; border-radius:50%; background: var(--red); }
.row-rd .tx{ font-size:14.5px; font-weight:600; }

.row-pi{
  display:flex; align-items:center; gap:12px; background: var(--surface); border:1px solid var(--border);
  border-radius: var(--radius-m); padding:10px; position:relative; overflow:hidden;
}
.pi-swipe{
  display:flex; align-items:center; gap:12px; width:100%; transition: transform .18s ease; touch-action: pan-y;
  position:relative; z-index:2; background: var(--surface);
}
.pi-del{
  position:absolute; z-index:1; right:0; top:0; bottom:0; width:76px; background: var(--err);
  color:#fff; border:none; display:flex; align-items:center; justify-content:center; cursor:pointer;
}
.pi-thumb{ flex:0 0 auto; width:64px; height:64px; border-radius:10px; overflow:hidden; background: var(--surface-2); }
.pi-thumb img{ width:100%; height:100%; object-fit:cover; }
.pi-body{ flex:1 1 auto; min-width:0; text-align:left; background:none; border:none; padding:0; cursor:pointer; }
.pi-name{ font-size:14.5px; font-weight:700; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; color: var(--ink); }
.pi-sub{ font-size:12.5px; color: var(--ink-55); margin-top:3px; }
.pi-sub.oos{ color:#8A5A00; font-weight:600; }
.pi-ctrl{ flex:0 0 auto; }
.pi-add{
  width:38px; height:38px; border-radius:10px; border:none; background: var(--red); color:#fff;
  font-size:22px; font-weight:400; cursor:pointer; display:flex; align-items:center; justify-content:center; line-height:1;
}
.stepper{ display:flex; align-items:center; gap:0; background: var(--surface-2); border-radius:10px; overflow:hidden; }
.stepper button{
  width:32px; height:34px; border:none; background:none; color: var(--red); font-size:18px; font-weight:700; cursor:pointer;
}
.stepper button:disabled{ color: var(--ink-18); cursor:default; }
.stepper .qty{ min-width:26px; text-align:center; font-size:14px; font-weight:800; }
.pi-oos-lbl{ font-size:11.5px; font-weight:700; color:#8A5A00; background:var(--amber-bg); padding:6px 9px; border-radius:8px; }
.pi-none-lbl{ font-size:12px; color: var(--ink-40); padding: 8px 2px; }

.row-pr2{ display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.row-pr2 .price{ font-size:30px; font-weight:800; letter-spacing:-.02em; }
.row-pr2 .cap{ font-size:12.5px; color: var(--ink-55); }

.row-stp{
  display:flex; align-items:center; justify-content:space-between; background: var(--surface);
  border:1px solid var(--border); border-radius: var(--radius-m); padding:12px 14px;
}
.row-stp .wt{ font-size:13.5px; color: var(--ink-55); font-weight:600; }
.stepper-lg{ display:flex; align-items:center; gap:14px; }
.stepper-lg button{
  width:36px; height:36px; border-radius:10px; border:1.5px solid var(--border); background: var(--surface);
  color: var(--ink); font-size:19px; font-weight:700; cursor:pointer;
}
.stepper-lg button:active{ background: var(--ink-08); }
.stepper-lg .qty{ min-width:44px; text-align:center; font-size:16px; font-weight:800; }

.row-bl{
  display:flex; align-items:center; gap:10px; padding:11px 2px; border-bottom:1px solid var(--border);
}
.row-bl:last-child{ border-bottom:none; }
.row-bl .tx{ flex:1 1 auto; font-size:14px; font-weight:600; }
.row-bl .bl-qty{ font-size:13px; color: var(--ink-55); font-weight:700; min-width:44px; text-align:right; }
.row-bl .bl-qty.none{ color: var(--ink-40); font-weight:600; }
.bl-stepper{ display:flex; align-items:center; gap:2px; }
.bl-stepper button{ width:26px; height:26px; border-radius:7px; border:none; background: var(--surface-2); color: var(--red); font-size:15px; font-weight:700; cursor:pointer; }
.bl-wrap{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); padding:2px 12px; }

.row-st{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); padding:18px 14px; }
.st-track{ display:flex; align-items:center; }
.st-step{ flex:1 1 0; display:flex; flex-direction:column; align-items:center; gap:8px; position:relative; }
.st-step .dot{ width:22px; height:22px; border-radius:50%; background: var(--ink-18); display:flex; align-items:center; justify-content:center; z-index:1; }
.st-step.done .dot{ background: var(--red); }
.st-step .dot svg{ width:12px; height:12px; color:#fff; }
.st-step .lbl{ font-size:10.5px; font-weight:700; color: var(--ink-55); text-align:center; }
.st-step.done .lbl{ color: var(--ink); }
.st-line{ position:absolute; top:11px; left:-50%; width:100%; height:2px; background: var(--ink-18); z-index:0; }
.st-step.done .st-line{ background: var(--red); }
.st-step:first-child .st-line{ display:none; }

.row-os{
  display:flex; align-items:center; gap:12px; width:100%; text-align:left; background: var(--surface);
  border:1px solid var(--border); border-radius: var(--radius-m); padding:13px 14px; cursor:pointer;
}
.os-dot{ flex:0 0 auto; width:10px; height:10px; border-radius:50%; }
.os-dot.a{ background:#2454A6; }
.os-dot.w{ background:#B4790A; }
.os-dot.s{ background:#1E7A3D; }
.os-body{ flex:1 1 auto; min-width:0; }
.os-top{ display:flex; align-items:center; gap:8px; margin-bottom:3px; }
.os-num{ font-size:14.5px; font-weight:800; }
.os-status{ font-size:11.5px; font-weight:800; padding:2px 8px; border-radius:6px; }
.os-status.a{ background:#E7EFFC; color:#2454A6; }
.os-status.w{ background:#FFF4DC; color:#8A5A00; }
.os-status.s{ background: var(--green-bg); color:#1E7A3D; }
.os-sub{ font-size:12.5px; color: var(--ink-55); }
.os-chev{ flex:0 0 auto; color: var(--ink-40); }

.row-pg{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); padding:13px 14px; }
.pg-lbl{ font-size:13px; font-weight:700; margin-bottom:8px; }
.pg-track{ height:7px; border-radius:4px; background: var(--ink-08); overflow:hidden; }
.pg-fill{ height:100%; background: var(--red); border-radius:4px; transition: width .25s ease; }
.pg-fill.full{ background: var(--green); }

.row-mg{
  display:flex; align-items:center; gap:12px; width:100%; text-align:left; background: var(--surface);
  border:1px solid var(--border); border-radius: var(--radius-m); padding:12px 14px; cursor:pointer;
}
.mg-avatar{ flex:0 0 auto; width:42px; height:42px; border-radius:50%; background: var(--red); color:#fff; display:flex; align-items:center; justify-content:center; font-weight:800; font-size:15px; }
.mg-body{ flex:1 1 auto; display:flex; flex-direction:column; gap:2px; min-width:0; }
.mg-name{ font-size:14.5px; font-weight:700; }
.mg-role{ font-size:12px; color: var(--ink-55); }
.mg-actions{ display:flex; gap:8px; flex:0 0 auto; }
.mg-actions a, .mg-actions button{
  width:34px; height:34px; border-radius:50%; background: var(--surface-2); border:none; color: var(--ink);
  display:flex; align-items:center; justify-content:center; cursor:pointer;
}

.row-sk{ display:flex; flex-direction:column; gap:10px; }
.sk-block{ height:64px; border-radius: var(--radius-m); background: linear-gradient(90deg, var(--ink-08) 25%, var(--ink-18) 37%, var(--ink-08) 63%); background-size:400% 100%; animation: shimmer 1.4s ease infinite; }
@keyframes shimmer{ 0%{ background-position:100% 0; } 100%{ background-position:0 0; } }

.row-mi, .row-mo{ display:flex; }
.row-mi{ justify-content:flex-start; }
.row-mo{ justify-content:flex-end; }
.bubble{ max-width:78%; padding:11px 13px; border-radius:16px; font-size:14.5px; line-height:1.4; }
.row-mi .bubble{ background: var(--surface); border:1px solid var(--border); border-bottom-left-radius:4px; }
.row-mo .bubble{ background: var(--red-dark); color:#fff; border-bottom-right-radius:4px; }

/* Catalog accordion (cat screen) */
.acc-wrap{ background: var(--surface); border:1px solid var(--border); border-radius: var(--radius-m); overflow:hidden; }
.acc-head{
  width:100%; display:flex; align-items:center; gap:8px; padding:14px; background:none; border:none;
  border-bottom:1px solid var(--border); cursor:pointer; text-align:left;
}
.acc-head .tx{ flex:1 1 auto; font-size:14.5px; font-weight:700; }
.acc-head .chev{ transition: transform .18s ease; color: var(--ink-40); }
.acc-head.open .chev{ transform: rotate(90deg); }
.acc-body{ padding: 2px 14px 10px 14px; display:flex; flex-direction:column; }
.acc-wrap > *:last-child .acc-head, .acc-wrap .row-rw:last-child{ border-bottom:none; }

/* Empty state (cartEmpty visual, uses cd) */
.empty-illust{ display:flex; justify-content:center; padding:18px 0 4px; opacity:.5; }

/* Toast */
.toast{
  position:fixed; left:50%; bottom:120px; transform: translateX(-50%) translateY(14px);
  background: var(--ink); color:#fff; font-size:13.5px; font-weight:700; padding:11px 18px;
  border-radius:999px; opacity:0; pointer-events:none; transition: opacity .18s ease, transform .18s ease;
  z-index:999; white-space:nowrap; max-width:88vw; overflow:hidden; text-overflow:ellipsis;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

/* Icon color helpers */
.ic-amber{ color:#B4790A; }
.ic-err{ color:#C8102E; }
.ic-green{ color:#1E7A3D; }

/* ============================================================
   Карточка товара v2.2.2 — галерея, аккордеоны, «с этим берут»
   ============================================================ */

/* ---------- Галерея фото ---------- */
.pgallery{
  position:relative; border-radius: var(--radius-l); overflow:hidden;
  background: var(--surface); border:1px solid var(--border); aspect-ratio: 1.15/1;
}
.pgallery-track{
  display:flex; width:100%; height:100%; overflow-x:auto; overflow-y:hidden;
  scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
}
.pgallery-track::-webkit-scrollbar{ display:none; }
.pgallery-slide{ flex:0 0 100%; scroll-snap-align:center; cursor:zoom-in; }
.pgallery-slide img{ width:100%; height:100%; object-fit:cover; display:block; }
.pgallery-dots{
  position:absolute; left:0; right:0; bottom:10px;
  display:flex; justify-content:center; gap:6px; pointer-events:none;
}
.pgallery-dot{
  width:6px; height:6px; border-radius:50%; background:rgba(255,255,255,.6);
  border:1px solid rgba(18,16,9,.15); padding:0; pointer-events:auto; cursor:pointer;
  transition: width .15s ease, background .15s ease;
}
.pgallery-dot.active{ background:#fff; width:16px; border-radius:3px; }
.pgallery-expand{
  position:absolute; right:10px; top:10px; width:34px; height:34px; border-radius:9px;
  background:rgba(18,16,9,.55); color:#fff; border:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}

/* ---------- Категория/ГОСТ под названием ---------- */
.card-catline{ margin-top:-4px; }

/* ---------- Аккордеоны карточки ---------- */
.card-acc-wrap .acc-head .tx{ font-weight:700; }
.card-acc-wrap > .acc-head:last-child{ border-bottom:none; }
.acc-head-val{ font-weight:600; color: var(--ink-55); }
.src-pending{ color: var(--ink-40); font-style:italic; }

/* ---------- «С этим обычно берут» ---------- */
.xsell{ display:flex; flex-direction:column; gap:10px; }
.xsell-strip{
  display:flex; gap:10px; overflow-x:auto; padding-bottom:2px; -webkit-overflow-scrolling:touch;
}
.xsell-strip::-webkit-scrollbar{ display:none; }
.xsell-card{
  position:relative; flex:0 0 132px; text-align:left; background: var(--surface);
  border:1px solid var(--border); border-radius: var(--radius-m); padding:10px; cursor:pointer;
  display:flex; flex-direction:column; gap:6px;
}
.xsell-thumb{ width:100%; aspect-ratio:1/1; border-radius:10px; overflow:hidden; background: var(--surface-2); }
.xsell-thumb img{ width:100%; height:100%; object-fit:cover; }
.xsell-name{ font-size:12.5px; font-weight:700; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.xsell-price{ font-size:12px; color: var(--ink-55); font-weight:700; }
.xsell-plus{
  position:absolute; right:8px; top:8px; width:28px; height:28px; border-radius:8px;
  background: var(--red); color:#fff; border:none; font-size:18px; line-height:1; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}

/* ---------- Бланк заказа: кликабельное название товара ---------- */
.bl-head{
  display:flex; align-items:center; gap:10px; flex:1 1 auto; min-width:0;
  background:none; border:none; padding:0; text-align:left; cursor:pointer;
}

/* ---------- Лайтбокс: просмотр фото на весь экран ---------- */
.lightbox{
  position:absolute; inset:0; z-index:200; background:#0B0A08;
  display:flex; flex-direction:column;
}
.lb-top{
  flex:0 0 auto; display:flex; align-items:center; gap:8px;
  padding: max(14px, var(--safe-t)) 12px 10px;
}
.lb-close{
  width:38px; height:38px; border-radius:50%; background:rgba(255,255,255,.12);
  border:none; color:#fff; display:flex; align-items:center; justify-content:center; cursor:pointer; flex:0 0 auto;
}
.lb-counter{
  flex:1 1 auto; text-align:center; color:#fff; font-size:13px; font-weight:600;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; padding:0 6px;
}
.lb-top-spacer{ width:38px; flex:0 0 auto; }
.lb-track{
  flex:1 1 auto; display:flex; overflow-x:auto; overflow-y:hidden;
  scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; touch-action: pan-x;
}
.lb-track::-webkit-scrollbar{ display:none; }
.lb-slide{
  flex:0 0 100%; scroll-snap-align:center; display:flex; flex-direction:column;
  align-items:center; justify-content:center; position:relative; min-width:0;
}
.lb-imgwrap{
  width:100%; flex:1 1 auto; display:flex; align-items:center; justify-content:center;
  overflow:hidden; touch-action: pan-y; min-height:0;
}
.lb-imgwrap.zoomed{ touch-action:none; }
.lb-img{
  max-width:100%; max-height:100%; width:auto; height:auto; object-fit:contain;
  touch-action:none; will-change:transform; user-select:none; -webkit-user-drag:none;
}
.lb-caption{
  flex:0 0 auto; color:rgba(255,255,255,.75); font-size:12.5px; text-align:center;
  padding:10px 20px 4px; max-width:88%;
}
.lb-thumbs{
  flex:0 0 auto; display:flex; gap:8px; padding: 10px 14px calc(14px + var(--safe-b));
  overflow-x:auto; -webkit-overflow-scrolling:touch;
}
.lb-thumbs::-webkit-scrollbar{ display:none; }
.lb-thumb{
  flex:0 0 auto; width:46px; height:46px; border-radius:9px; overflow:hidden;
  border:2px solid transparent; opacity:.55; padding:0; background:none; cursor:pointer;
}
.lb-thumb img{ width:100%; height:100%; object-fit:cover; display:block; }
.lb-thumb.active{ border-color:#fff; opacity:1; }

/* Focus visibility for keyboard use */
button:focus-visible, .row-cd:focus-visible, .row-rw:focus-visible{ outline:2px solid var(--red); outline-offset:2px; }

/* Utility */
.mt-4{ margin-top:4px; }
.grow{ flex:1 1 auto; }
