:root{
  --bg:#f6f4fa; --card:#ffffff; --ink:#1f1530; --muted:#6c6480; --line:#e9e4f0;
  --brand:#a10fc0; --brand-ink:#ffffff; --brand-soft:#f4e7fb; --brand-dark:#6c0fa3;
  --sun:#f5197f; --grad:linear-gradient(100deg,#6a11cb 0%,#a10fc0 50%,#f0177e 100%); --sun-soft:#ffe7f2; --danger:#d64545; --danger-soft:#fde8e8; --blue:#2f6fde; --blue-soft:#e6eefc;
  --r:16px; --shadow:0 1px 2px rgba(31,21,48,.06),0 4px 16px rgba(31,21,48,.06);
  --font:'Golos Text',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--font);font-size:16px;-webkit-tap-highlight-color:transparent}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--brand-dark)}
.splash{position:fixed;inset:0;z-index:100;background:linear-gradient(160deg,#faf6ff 0%,#efe3fb 55%,#ffe0ef 100%);display:flex;flex-direction:column;align-items:center;justify-content:center;transition:opacity .4s ease}
.splash.out{opacity:0;pointer-events:none}
.sp-in{display:flex;flex-direction:column;align-items:center;animation:spUp .6s ease both}
.sp-mark{width:104px;height:104px;filter:drop-shadow(0 10px 24px rgba(161,15,192,.28))}
.sp-name{margin-top:18px;font-size:44px;font-weight:800;letter-spacing:.5px;color:#2a1540;line-height:1}
.sp-name b{color:#f5197f;margin-left:1px}
.sp-tag{margin-top:8px;font-size:15px;color:#5e5275}
.sp-dev{position:absolute;bottom:max(28px,env(safe-area-inset-bottom));display:flex;align-items:center;gap:7px;color:#2a1540;animation:spUp .6s .25s ease both}
.sp-dev span{font-size:12px;color:#7d7290;margin-right:4px}
.sp-dev svg{width:24px;height:24px}
.sp-dev b{font-weight:800;letter-spacing:2px;font-size:17px}
.sp-dev i{font-style:normal;font-size:15px;color:#5e5275}
@keyframes spUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.logo-mark b{color:var(--sun)}
.login h1 .plus{color:var(--sun)}
.logo-mark{width:40px;height:40px;border-radius:12px;background:var(--brand);color:#fff;display:grid;place-items:center;font-weight:800;letter-spacing:-.5px;box-shadow:inset 0 -4px 0 rgba(0,0,0,.12)}
.logo-mark.big{width:72px;height:72px;font-size:28px;border-radius:20px}

/* layout */
.top{position:sticky;top:0;z-index:20;background:var(--grad);color:#fff;box-shadow:0 2px 12px rgba(108,15,163,.25)}
.top .icon-btn{background:rgba(255,255,255,.18);color:#fff;border-color:transparent}
.top .btn.ghost,.top .btn.light{background:rgba(255,255,255,.18);color:#fff}
.top .logo-svg svg{border-radius:12px;box-shadow:0 0 0 2px rgba(255,255,255,.85)}
.top-in{max-width:1100px;margin:0 auto;padding:12px 16px;display:flex;align-items:center;gap:12px}
.top h1{font-size:18px;margin:0;line-height:1.15}
.top .sub{font-size:13px;color:rgba(255,255,255,.85)}
.top .grow{flex:1;min-width:0}
.main{max-width:1100px;margin:0 auto;padding:16px 16px 100px}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:30;background:#fff;border-top:1px solid var(--line);display:flex;justify-content:center;padding-bottom:env(safe-area-inset-bottom)}
.tabs-in{display:flex;width:100%;max-width:640px}
.tab{flex:1;border:0;background:none;padding:10px 4px 9px;display:flex;flex-direction:column;align-items:center;gap:3px;font-size:12px;color:var(--muted);cursor:pointer;position:relative}
.tab svg{width:24px;height:24px}
.tab.on{color:var(--brand-dark);font-weight:600}
.tab .dot{position:absolute;top:5px;left:calc(50% + 6px);background:var(--sun);color:#fff;font-size:11px;font-weight:700;border-radius:10px;padding:1px 6px;min-width:18px}
@media(min-width:900px){
  .tabs{top:0;bottom:auto;left:0;right:auto;width:96px;height:100vh;border-top:0;border-right:1px solid var(--line);flex-direction:column;justify-content:flex-start;padding-top:76px}
  .tabs-in{flex-direction:column}
  .tab{padding:14px 4px}
  body.has-tabs .top,body.has-tabs .main{margin-left:96px}
  body.has-tabs .top-in,body.has-tabs .main{max-width:1100px}
  .main{padding-bottom:40px}
}

/* atoms */
.card{background:var(--card);border-radius:var(--r);box-shadow:var(--shadow);padding:16px}
.btn{text-decoration:none;border:0;border-radius:12px;padding:12px 16px;font-weight:600;cursor:pointer;background:var(--grad);color:var(--brand-ink);display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:46px;transition:transform .05s}
.btn:active{transform:scale(.98)}
.btn.ghost{background:var(--brand-soft);color:var(--brand-dark)}
.btn.line{background:#fff;border:1px solid var(--line);color:var(--ink)}
.btn.sun{background:var(--sun);color:#fff}
.btn.danger{background:var(--danger-soft);color:var(--danger)}
.btn.sm{min-height:36px;padding:7px 12px;font-size:14px;border-radius:10px}
.btn.block{width:100%}
.btn[disabled]{opacity:.5;pointer-events:none}
.icon-btn{border:0;background:#fff;border:1px solid var(--line);width:40px;height:40px;border-radius:12px;display:grid;place-items:center;cursor:pointer}
.field{display:block;margin-bottom:12px}
.field span{display:block;font-size:13px;color:var(--muted);margin-bottom:5px}
.input{width:100%;border:1px solid var(--line);background:#fff;border-radius:12px;padding:12px 14px;min-height:46px;outline:none}
.input:focus{border-color:var(--brand);box-shadow:0 0 0 3px var(--brand-soft)}
textarea.input{min-height:80px;resize:vertical}
.row{display:flex;gap:10px;align-items:center}
.row.wrap{flex-wrap:wrap}
.grow{flex:1;min-width:0}
.muted{color:var(--muted)}
.small{font-size:13px}
.h2{font-size:20px;font-weight:700;margin:4px 0 12px}
.badge{display:inline-flex;align-items:center;gap:4px;padding:3px 9px;border-radius:999px;font-size:12px;font-weight:600;background:var(--brand-soft);color:var(--brand-dark);white-space:nowrap}
.badge.sun{background:var(--sun-soft);color:#b0115c}
.badge.blue{background:var(--blue-soft);color:var(--blue)}
.badge.grey{background:#f1eef5;color:var(--muted)}
.badge.red{background:var(--danger-soft);color:var(--danger)}
.stack>*+*{margin-top:12px}
.empty{text-align:center;color:var(--muted);padding:40px 16px}
.empty b{display:block;color:var(--ink);font-size:17px;margin-bottom:6px}

/* login */
.login{min-height:100vh;display:grid;grid-template-columns:1fr;background:linear-gradient(160deg,#f2e6fb 0%,#f6f4fa 55%)}
.login-in{width:100%;max-width:420px;margin:auto;padding:24px 16px}
.login h1{font-size:26px;margin:18px 0 6px;letter-spacing:-.3px}
.login p{margin:0 0 22px;color:var(--muted)}
.login .card{padding:20px}
.demo-hint{margin-top:16px;font-size:13px;color:var(--muted);line-height:1.5}
.demo-hint code{background:#fff;border:1px solid var(--line);padding:1px 6px;border-radius:6px;cursor:pointer}

/* catalog */
.search{position:relative}
.search input{padding-left:42px;border-radius:14px}
.search svg{position:absolute;left:13px;top:50%;transform:translateY(-50%);width:20px;height:20px;color:var(--muted)}
.chips{display:flex;gap:8px;overflow-x:auto;padding:12px 0 4px;margin:0 -16px;padding-left:16px;padding-right:16px;scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{flex:none;border:1px solid var(--line);background:#fff;border-radius:999px;padding:8px 14px;font-size:14px;cursor:pointer;white-space:nowrap}
.chip.on{background:var(--brand);border-color:var(--brand);color:#fff}
.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
@media(min-width:640px){.grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(min-width:1000px){.grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
.prod{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column}
.prod .ph{aspect-ratio:1/1;background:#faf8fc;display:grid;place-items:center;position:relative}
.prod .ph img{width:100%;height:100%;object-fit:contain;padding:10px;mix-blend-mode:multiply}
.prod .ph .noimg{width:56px;height:56px;border-radius:16px;background:var(--brand-soft);color:var(--brand-dark);display:grid;place-items:center;font-weight:800;font-size:20px}
.prod .ph .badge{position:absolute;left:8px;top:8px}
.prod .body{padding:10px 12px 12px;display:flex;flex-direction:column;gap:6px;flex:1}
.prod .name{font-size:14px;line-height:1.3;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;min-height:3.9em}
.prod .meta{font-size:12px;color:var(--muted)}
.prod .price{font-size:19px;font-weight:800;letter-spacing:-.3px}
.prod .price small{font-size:12px;font-weight:500;color:var(--muted)}
.stepper{display:flex;align-items:center;background:var(--brand-soft);border-radius:12px;overflow:hidden;height:40px}
.stepper button{border:0;background:none;width:40px;height:40px;font-size:22px;color:var(--brand-dark);cursor:pointer;font-weight:600}
.stepper input{flex:1;min-width:0;border:0;background:none;text-align:center;font-weight:700;font-size:16px;outline:none;-moz-appearance:textfield}
.stepper input::-webkit-outer-spin-button,.stepper input::-webkit-inner-spin-button{-webkit-appearance:none}
.add{height:40px;border:0;border-radius:12px;background:var(--brand);color:#fff;font-weight:600;cursor:pointer}
.more{display:block;margin:16px auto 0}

/* list rows */
.list{background:#fff;border-radius:var(--r);box-shadow:var(--shadow);overflow:hidden}
.li{display:flex;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
.li:last-child{border-bottom:0}
.li.click{cursor:pointer}
.li.click:hover{background:#fbfafd}
.li .thumb{width:48px;height:48px;border-radius:10px;background:#faf8fc;flex:none;display:grid;place-items:center;overflow:hidden}
.li .thumb img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}
.li .t{font-size:15px;line-height:1.3}
.li .s{font-size:13px;color:var(--muted);margin-top:2px}
.li .r{text-align:right;flex:none}
.li .stepper{width:120px;height:36px}
.li .stepper button{width:34px;height:36px}
.total-bar{position:sticky;bottom:72px;margin-top:16px;background:var(--grad);color:#fff;border-radius:var(--r);padding:14px 16px;display:flex;align-items:center;gap:12px;box-shadow:0 8px 24px rgba(31,21,48,.25)}
@media(min-width:900px){.total-bar{bottom:16px}}
.total-bar .sum{font-size:22px;font-weight:800}
.total-bar .btn{background:var(--sun);color:#fff}

/* shops */
.shop-card{display:block;background:#fff;border-radius:var(--r);box-shadow:var(--shadow);padding:14px 16px;cursor:pointer;border:2px solid transparent}
.shop-card.ready{border-color:var(--sun)}
.shop-card .nm{font-weight:700;font-size:16px}
.cols{display:grid;gap:12px}
@media(min-width:760px){.cols{grid-template-columns:repeat(2,1fr)}}
.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}
.kpi{background:#fff;border-radius:14px;padding:12px;box-shadow:var(--shadow)}
.kpi b{display:block;font-size:22px}
.kpi span{font-size:12px;color:var(--muted)}
.lvl-pick{display:grid;grid-template-columns:repeat(2,1fr);gap:8px}
.lvl-pick label{border:1px solid var(--line);border-radius:12px;padding:10px 12px;cursor:pointer;background:#fff}
.lvl-pick input{margin-right:6px;accent-color:var(--brand)}
.lvl-pick label:has(input:checked){border-color:var(--brand);background:var(--brand-soft)}
.secret{background:var(--sun-soft);border:1px dashed #f27bb0;border-radius:12px;padding:12px 14px;font-size:15px}
.secret code{font-size:17px;font-weight:700}
table.tbl{width:100%;border-collapse:collapse;font-size:14px}
.tbl th,.tbl td{padding:8px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.tbl th{font-size:12px;color:var(--muted);font-weight:600;position:sticky;top:0;background:#fff}
.tbl td.n,.tbl th.n{text-align:right;white-space:nowrap}
.tbl-wrap{overflow:auto;max-height:65vh;background:#fff;border-radius:var(--r);box-shadow:var(--shadow)}

/* modal */
.sheet-bg{position:fixed;inset:0;background:rgba(31,21,48,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet{background:var(--bg);width:100%;max-width:640px;max-height:92vh;overflow:auto;border-radius:22px 22px 0 0;padding:16px 16px calc(20px + env(safe-area-inset-bottom))}
@media(min-width:700px){.sheet-bg{align-items:center}.sheet{border-radius:22px}}
.sheet-head{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.sheet-head h3{margin:0;font-size:19px;flex:1}
.toast{position:fixed;left:50%;bottom:90px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:11px 16px;border-radius:12px;z-index:60;font-size:14px;max-width:90vw;box-shadow:0 8px 24px rgba(0,0,0,.2)}
.toast.err{background:var(--danger)}
.drop{border:2px dashed #d8c4ea;border-radius:var(--r);padding:22px;text-align:center;background:#fdfbff;cursor:pointer}
.drop.over{background:var(--brand-soft)}
.print-only{display:none}
@media print{
  .tabs,.top,.no-print{display:none!important}
  body.has-tabs .main{margin:0}
  .print-only{display:block}
  .card,.list{box-shadow:none;border:1px solid #ccc}
}
.total-bar .grow{min-width:0}
.total-bar .btn{flex:none}
@media(max-width:480px){.total-bar .sum{font-size:19px}.li .stepper{width:104px}.li .stepper button{width:30px}}


/* карта и маршрут */
.map-box{border-radius:16px;overflow:hidden;border:1px solid var(--line);margin-bottom:14px;background:#eee9f3}
.map-box #map{height:min(56vh,520px)}
.map-box.small-map #pmap{height:320px}
.pin{width:30px;height:30px;border-radius:50%;background:#a10fc0;color:#fff;font-weight:800;font-size:14px;display:grid;place-items:center;border:3px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.35)}
.pin.wh{background:#f5197f;color:#fff}
.stop .num{flex:none;width:34px;height:34px;border-radius:50%;background:#a10fc0;color:#fff;font-weight:800;display:grid;place-items:center;margin-right:4px}
.leaflet-container{font:inherit}
/* на компьютере категории переносятся на новую строку, а не уезжают за край */
@media (min-width:700px){.chips{flex-wrap:wrap;overflow:visible;margin:0;padding-left:0;padding-right:0}}
.best-time{margin-bottom:12px;background:var(--sun-soft)}
.best-time .bt{font-size:34px;font-weight:800;line-height:1.1;margin:2px 0 4px}
.tbars{display:flex;gap:3px;align-items:flex-end;height:70px;margin-top:12px}
.tb{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;position:relative}
.tb i{display:block;width:100%;background:#e2d3ef;border-radius:4px 4px 0 0;min-height:4px}
.tb.on i{background:#a10fc0}
.tb span{position:absolute;bottom:-16px;font-size:10px;color:var(--muted,#667)}
.tbars{margin-bottom:16px}
.logo-svg{width:40px;height:40px;flex:none}.logo-svg svg{width:100%;height:100%;display:block}.logo-svg.big{width:72px;height:72px}
.imp-list{display:grid;gap:8px;margin-top:10px}
.imp-row{display:flex;gap:10px;align-items:center;padding:10px;border:1px solid var(--line,#e9e3f1);border-radius:12px;background:#fff}
.imp-row select{width:auto;max-width:190px;flex:none}
.imp-row .bar{height:4px;border-radius:4px;background:#ece6f3;margin-top:6px;overflow:hidden}.imp-row .bar i{display:block;height:100%;width:0;background:var(--brand,#a10fc0);transition:width .3s}
.imp-row.ok{border-color:#d7a8ee;background:#faf6fe}.imp-row.err{border-color:#f0b4ad;background:#fff6f5}
.imp-row b{word-break:break-word}
@media (max-width:520px){.imp-row{flex-wrap:wrap}.imp-row select{max-width:none;width:100%}}
