:root{
  --brand:#164c7c; --brand-2:#1d5f99; --brand-soft:#e8f0f7; --ink:#14181f; --muted:#5d6673; --line:#e3e7ec;
  --bg:#f4f6f9; --card:#fff; --ok:#1f8a4c; --warn:#b26b00; --r:14px;
  --font:'Onest',system-ui,-apple-system,'Segoe UI',Roboto,Arial,sans-serif;
}
*{box-sizing:border-box}
html,body{margin:0}
body{font:15px/1.5 var(--font);color:var(--ink);background:var(--bg);-webkit-font-smoothing:antialiased}
a{color:var(--brand)}
button,input,select{font:inherit;color:inherit}
.wrap{max-width:1280px;margin:0 auto;padding:0 24px}

/* демо-плашка */
.demo-bar{background:#14181f;color:#cfd6df;font-size:13px;text-align:center;padding:7px 16px}
.demo-bar b{color:#fff;font-weight:500}

/* шапка */
.top{background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:20}
.top .wrap{display:flex;align-items:center;gap:24px;height:72px}
.logo{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-weight:600;font-size:18px;letter-spacing:-.01em}
.logo i{width:34px;height:34px;border-radius:10px;background:var(--brand);display:grid;place-items:center}
.logo small{display:block;font-weight:400;font-size:12px;color:var(--muted);letter-spacing:0}
.plants{display:flex;gap:20px;margin-left:auto;font-size:13px;color:var(--muted)}
.plants a{display:block;color:var(--ink);text-decoration:none;font-weight:500;font-size:14px}
.mp{display:flex;gap:8px}
.pill{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:#fff;text-decoration:none;color:var(--ink);font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}
.pill:hover{border-color:#c7cfd8}
.pill .dot{width:8px;height:8px;border-radius:50%}
.pill--brand{background:var(--brand);border-color:var(--brand);color:#fff}
.pill--brand:hover{background:var(--brand-2)}
.cart-count{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#fff;color:var(--brand);font-size:12px;display:inline-grid;place-items:center}

/* макет */
.layout{display:grid;grid-template-columns:240px 1fr;gap:28px;padding-top:28px;padding-bottom:80px}
.side{position:sticky;top:100px;align-self:start;background:#fff;border-radius:var(--r);padding:10px}
.side button{display:flex;width:100%;align-items:center;justify-content:space-between;gap:8px;border:0;background:none;text-align:left;padding:10px 12px;border-radius:10px;cursor:pointer;font-size:14px}
.side button:hover{background:var(--bg)}
.side button.on{background:var(--brand-soft);color:var(--brand);font-weight:500}
.side button span{color:var(--muted);font-size:12px}
.side hr{border:0;border-top:1px solid var(--line);margin:8px 4px}

.hero{background:var(--brand);color:#fff;border-radius:20px;padding:36px 40px;display:grid;grid-template-columns:1.3fr 1fr;gap:32px;align-items:end;position:relative;overflow:hidden}
.hero h1{font-size:38px;line-height:1.1;margin:0 0 12px;font-weight:600;letter-spacing:-.02em}
.hero p{margin:0;color:#cfe0ef;max-width:520px}
.hero .cta{display:flex;gap:10px;margin-top:24px;flex-wrap:wrap}
.hero .pill{border-color:rgba(255,255,255,.3);background:rgba(255,255,255,.08);color:#fff}
.hero .pill--white{background:#fff;color:var(--brand)}
.trust{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.trust div{background:rgba(255,255,255,.1);border-radius:12px;padding:14px 16px}
.trust b{display:block;font-size:24px;font-weight:600;line-height:1.1}
.trust span{font-size:13px;color:#cfe0ef}
.bubbles{position:absolute;right:-60px;top:-60px;width:260px;height:260px;opacity:.12;pointer-events:none}

.sec-title{display:flex;align-items:baseline;justify-content:space-between;margin:36px 0 16px}
.sec-title h2{font-size:24px;margin:0;font-weight:600;letter-spacing:-.01em}
.sec-title span{color:var(--muted);font-size:14px}

.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}
.card{background:#fff;border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:10px;border:1px solid transparent;transition:border-color .15s}
.card:hover{border-color:var(--line)}
.card .pic{height:120px;border-radius:10px;background:var(--bg);display:grid;place-items:center}
.card .cat{font-size:12px;color:var(--muted)}
.card h3{font-size:15px;font-weight:500;margin:0;line-height:1.35;min-height:40px}
.price{font-size:20px;font-weight:600;letter-spacing:-.01em}
.price small{font-size:13px;color:var(--muted);font-weight:400}
.card .meta{font-size:12px;color:var(--muted);margin-top:-6px}
.buy{display:flex;gap:8px;margin-top:auto}
.qty{display:flex;align-items:center;border:1px solid var(--line);border-radius:10px;height:40px}
.qty button{width:32px;height:38px;border:0;background:none;cursor:pointer;font-size:18px;color:var(--muted)}
.qty input{width:58px;border:0;text-align:center;outline:none;font-size:14px}
.btn{height:40px;border-radius:10px;border:0;background:var(--brand);color:#fff;font-weight:500;padding:0 16px;cursor:pointer;white-space:nowrap}
.btn:hover{background:var(--brand-2)}
.btn--ghost{background:#fff;color:var(--ink);border:1px solid var(--line)}
.btn--ghost:hover{background:var(--bg)}
.btn--block{width:100%}
.btn:disabled{opacity:.5;cursor:default}

/* калькулятор */
.calc{background:#fff;border-radius:var(--r);padding:24px;display:grid;grid-template-columns:1.4fr 1fr;gap:28px}
.fields{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
.field label{display:block;font-size:12px;color:var(--muted);margin-bottom:4px}
.field input,.field select{width:100%;height:42px;border:1px solid var(--line);border-radius:10px;padding:0 12px;background:#fff;outline:none}
.field input:focus,.field select:focus{border-color:var(--brand)}
.calc-out{background:var(--bg);border-radius:12px;padding:20px;display:flex;flex-direction:column;gap:10px}
.calc-pic{height:150px;display:grid;place-items:center}
.calc-total{font-size:28px;font-weight:600;letter-spacing:-.02em}
.hint{font-size:13px;color:var(--muted)}

/* корзина */
.drawer-bg{position:fixed;inset:0;background:rgba(20,24,31,.35);z-index:60;display:none}
.drawer{position:fixed;top:0;right:0;bottom:0;width:420px;max-width:100%;background:#fff;z-index:61;transform:translateX(100%);transition:transform .25s;display:flex;flex-direction:column}
.drawer.open{transform:none}
.drawer header{display:flex;justify-content:space-between;align-items:center;padding:20px 24px;border-bottom:1px solid var(--line)}
.drawer header h3{margin:0;font-size:20px}
.x{width:36px;height:36px;border-radius:50%;border:0;background:var(--bg);cursor:pointer;font-size:18px}
.drawer .items{flex:1;overflow:auto;padding:8px 24px}
.ci{display:grid;grid-template-columns:1fr auto;gap:4px 12px;padding:14px 0;border-bottom:1px solid var(--line)}
.ci b{font-weight:500}
.ci small{color:var(--muted)}
.ci .rm{border:0;background:none;color:var(--muted);cursor:pointer;font-size:13px;padding:0;text-align:right}
.drawer footer{padding:20px 24px;border-top:1px solid var(--line);display:flex;flex-direction:column;gap:12px}
.sum{display:flex;justify-content:space-between;font-size:18px;font-weight:600}
.empty{color:var(--muted);text-align:center;padding:48px 0}

/* тост */
.toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%) translateY(20px);background:#14181f;color:#fff;padding:12px 18px;border-radius:12px;font-size:14px;opacity:0;transition:.25s;z-index:100;pointer-events:none;max-width:90vw}
.toast.show{opacity:1;transform:translateX(-50%)}

/* ===== чат ===== */
.chat-fab{position:fixed;right:24px;bottom:24px;z-index:50;display:flex;align-items:center;gap:10px;height:56px;padding:0 20px 0 8px;border-radius:999px;border:0;background:var(--brand);color:#fff;font-weight:500;cursor:pointer;box-shadow:0 10px 30px rgba(22,76,124,.35)}
.chat-fab .av{width:40px;height:40px}
.chat{position:fixed;right:24px;bottom:24px;z-index:51;width:400px;height:620px;max-height:calc(100vh - 48px);background:#fff;border-radius:20px;box-shadow:0 20px 60px rgba(20,24,31,.25);display:none;flex-direction:column;overflow:hidden}
.chat.open{display:flex}
.chat-head{display:flex;align-items:center;gap:12px;padding:16px 16px 14px;background:var(--brand);color:#fff}
.chat-head .who b{display:block;font-weight:500}
.chat-head .who span{font-size:12px;color:#cfe0ef;display:flex;align-items:center;gap:6px}
.chat-head .who span::before{content:"";width:7px;height:7px;border-radius:50%;background:#4ade80}
.chat-head .x{margin-left:auto;background:rgba(255,255,255,.14);color:#fff}
.av{width:40px;height:40px;border-radius:50%;flex:none;object-fit:cover;background:#fff}
.av--sm{width:28px;height:28px}
.chat-body{flex:1;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:12px;background:#f7f9fb}
.msg{display:flex;gap:8px;align-items:flex-end;max-width:88%}
.msg .b{padding:10px 14px;border-radius:16px;background:#fff;border:1px solid var(--line);white-space:pre-wrap;word-wrap:break-word}
.msg.user{align-self:flex-end;flex-direction:row-reverse}
.msg.user .b{background:var(--brand);color:#fff;border-color:var(--brand);border-bottom-right-radius:6px}
.msg.bot .b,.msg.manager .b{border-bottom-left-radius:6px}
.msg .nm{font-size:11px;color:var(--muted);margin:0 0 3px 2px}
.sys{align-self:center;font-size:12px;color:var(--muted);background:#eef1f5;padding:6px 12px;border-radius:999px;text-align:center}
.acts{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.acts button{border:1px solid var(--brand);background:#fff;color:var(--brand);border-radius:999px;padding:6px 12px;font-size:13px;cursor:pointer}
.acts button:hover{background:var(--brand-soft)}
.typing{display:inline-flex;gap:4px;padding:12px 14px}
.typing i{width:6px;height:6px;border-radius:50%;background:#9aa4b1;animation:bl 1.2s infinite}
.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}
@keyframes bl{0%,80%,100%{opacity:.25}40%{opacity:1}}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 12px;font-size:13px;cursor:pointer;text-align:left}
.chips button:hover{border-color:var(--brand);color:var(--brand)}
.chat-foot{border-top:1px solid var(--line);padding:10px 12px 8px;background:#fff}
.chat-in{display:flex;gap:8px}
.chat-in textarea{flex:1;resize:none;border:1px solid var(--line);border-radius:12px;padding:10px 12px;height:44px;max-height:120px;outline:none;font:inherit}
.chat-in textarea:focus{border-color:var(--brand)}
.chat-in .btn{height:44px;width:44px;padding:0;display:grid;place-items:center;border-radius:12px}
.legal{font-size:11px;color:var(--muted);margin-top:6px;text-align:center}
.mgr-btn{margin-top:8px;width:100%;border:0;background:none;color:var(--brand);font-size:13px;cursor:pointer}

/* ===== кабинет ===== */
.acc{display:grid;grid-template-columns:240px 1fr;gap:28px;padding:28px 0 80px}
.acc-nav{background:#fff;border-radius:var(--r);padding:10px;align-self:start;position:sticky;top:100px}
.acc-nav .who{padding:12px 12px 14px;border-bottom:1px solid var(--line);margin-bottom:6px}
.acc-nav .who b{display:block;font-weight:500;word-break:break-all}
.acc-nav .who span{font-size:12px;color:var(--muted)}
.panel{background:#fff;border-radius:var(--r);padding:28px}
.panel h2{margin:0 0 4px;font-size:24px;font-weight:600;letter-spacing:-.01em}
.panel .sub{color:var(--muted);margin:0 0 20px}
.order{border:1px solid var(--line);border-radius:12px;padding:18px 20px;margin-bottom:12px}
.order-top{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.order-top b{font-size:16px;font-weight:600}
.badge{font-size:12px;padding:3px 10px;border-radius:999px;background:var(--bg);color:var(--muted)}
.badge.new{background:#e8f0ff;color:#1d4ed8}.badge.work{background:#fff4e0;color:var(--warn)}.badge.done{background:#e7f6ec;color:var(--ok)}
.order-top .t{margin-left:auto;font-size:18px;font-weight:600}
.order ul{margin:12px 0;padding:0;list-style:none;color:var(--muted);font-size:14px}
.order ul li{display:flex;justify-content:space-between;gap:16px;padding:3px 0}
.order .row{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.order .info{font-size:13px;color:var(--muted);margin-right:auto}
.login{max-width:440px;margin:60px auto;background:#fff;border-radius:20px;padding:36px}
.login h1{font-size:28px;margin:0 0 6px;letter-spacing:-.02em}
.login p{color:var(--muted);margin:0 0 22px}
.login .field{margin-bottom:12px}
.check{display:flex;gap:10px;font-size:13px;color:var(--muted);margin:4px 0 16px;align-items:flex-start}
.check input{margin-top:3px}
.code-in{letter-spacing:10px;font-size:24px;text-align:center}
.err{color:#c0362c;font-size:13px;min-height:20px;margin-top:8px}
.devcode{background:#fff6d6;border:1px solid #e8d48a;border-radius:10px;padding:10px 12px;font-size:13px;margin-bottom:12px}
.form2{display:grid;grid-template-columns:1fr 1fr;gap:12px;max-width:640px}
.form2 .wide{grid-column:1/-1}
.doc{display:flex;align-items:center;gap:14px;border:1px solid var(--line);border-radius:12px;padding:14px 16px;margin-bottom:10px}
.doc .ico{width:36px;height:44px;border-radius:6px;background:var(--brand-soft);display:grid;place-items:center;color:var(--brand);font-size:11px;font-weight:600}
.doc div{flex:1}
.doc small{color:var(--muted);display:block}

/* ===== адаптив ===== */
@media (max-width:1100px){.plants{display:none}}
@media (max-width:900px){
  .layout,.acc{grid-template-columns:minmax(0,1fr)}
  .side,.acc-nav{position:static;display:flex;overflow-x:auto;gap:4px;padding:6px}
  .side button,.acc-nav button{width:auto;white-space:nowrap}
  .side hr,.side button span,.acc-nav .who{display:none}
  .hero{grid-template-columns:1fr;padding:28px}
  .hero h1{font-size:30px}
  .calc{grid-template-columns:minmax(0,1fr)}
  .fields{grid-template-columns:repeat(2,minmax(0,1fr))}
  .mp .pill span{display:none}
}
@media (max-width:640px){
  .wrap{padding:0 16px}
  .top .wrap{gap:10px;height:64px}
  .logo small{display:none}
  .mp{display:none}
  .top .pill{padding:0 10px;font-size:13px}
  .chat{right:0;bottom:0;width:100%;height:100%;max-height:none;border-radius:0}
  .chat-fab{right:16px;bottom:16px}
  .chat-fab .lbl{display:none}
  .chat-fab{padding:0 8px}
  .form2{grid-template-columns:1fr}
  .panel{padding:20px}
  .grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .card{padding:12px}
  .card .pic{height:90px}
  .buy{flex-direction:column}
  .qty{width:100%}
  .qty input{flex:1;width:auto;min-width:0}
}
