*{box-sizing:border-box}body{margin:0;font:16px/1.5 system-ui,sans-serif;background:#f4f6fb;color:#1b2333}
header{display:flex;flex-wrap:wrap;gap:12px;align-items:center;justify-content:space-between;padding:10px 20px;background:#fff;box-shadow:0 1px 6px #0001;position:sticky;top:0}
.logo{height:42px}header form{flex:1;min-width:200px;display:flex;gap:6px}header input{flex:1}nav a{margin-left:14px;color:#1b2333;text-decoration:none;font-weight:600}nav a:hover{color:#2563eb}
main{max-width:1100px;margin:20px auto;padding:0 16px;min-height:60vh}footer{text-align:center;padding:20px;color:#667;font-size:14px}
input,select,textarea,button{font:inherit;padding:8px 10px;border:1px solid #cfd6e4;border-radius:8px}button,.btn{background:#2563eb;color:#fff;border:0;cursor:pointer;padding:9px 16px;border-radius:8px;text-decoration:none}
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:16px}.card{background:#fff;border-radius:12px;padding:12px;text-decoration:none;color:inherit;display:flex;flex-direction:column;gap:4px;box-shadow:0 1px 4px #0001}.card:hover{box-shadow:0 4px 14px #0002}.card img{width:100%;aspect-ratio:4/3;object-fit:contain;background:#eef2fb;border-radius:8px}.card h3{margin:6px 0 0;font-size:16px}.card b{color:#2563eb;font-size:18px}small{color:#667}
.cats a{display:inline-block;margin:0 8px 8px 0;padding:6px 14px;background:#fff;border-radius:20px;text-decoration:none;color:#1b2333;box-shadow:0 1px 3px #0001}
.prod{display:grid;grid-template-columns:1fr 1fr;gap:24px;background:#fff;padding:20px;border-radius:12px}.prod img{width:100%;background:#eef2fb;border-radius:10px}.price{font-size:26px;font-weight:700;color:#2563eb}
table{border-collapse:collapse;width:100%}td,th{padding:8px;border-bottom:1px solid #e3e8f2;text-align:left;vertical-align:top}.t{background:#fff;border-radius:10px}
.f2{display:flex;flex-direction:column;gap:10px;background:#fff;padding:18px;border-radius:12px;max-width:560px;margin-bottom:16px}.f2 label{display:flex;flex-direction:column;font-size:14px;color:#445}.two{display:flex;flex-wrap:wrap;gap:20px}.f{margin-bottom:14px}
.err{background:#fde8e8;color:#a11;padding:10px;border-radius:8px}.ok{background:#e3f8ea;color:#165;padding:10px;border-radius:8px}.ord{background:#fff;padding:12px;border-radius:10px;margin-bottom:10px}.badge{background:#e0e8ff;padding:2px 10px;border-radius:12px}
@media(max-width:700px){.prod{grid-template-columns:1fr}}
/* --- каталог: карточки, фильтры, пагинация --- */
.card a{color:inherit;text-decoration:none;display:flex;flex-direction:column;gap:4px}.card .cmp{margin-top:6px;background:#eef2fb;color:#2563eb;padding:6px 10px;font-size:14px}.cmp.on{background:#2563eb;color:#fff}
.cats a small{color:#889}.cats a.on{background:#2563eb;color:#fff}.cats a.on small{color:#dbe5ff}
.flt{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.chk{display:inline-flex;gap:6px;align-items:center;font-size:14px}
.pager a{display:inline-block;margin:0 4px 6px 0;padding:6px 12px;background:#fff;border-radius:8px;text-decoration:none;color:#1b2333;box-shadow:0 1px 3px #0001}.pager a.on{background:#2563eb;color:#fff}
.src{display:block;margin-top:6px;font-size:12px;color:#667;word-break:break-word}.btn2{display:inline-block;background:#eef2fb;color:#2563eb;border:0;padding:9px 16px;border-radius:8px;text-decoration:none;cursor:pointer;font:inherit}
.acts{display:flex;flex-wrap:wrap;gap:8px;align-items:center}h2{margin-top:28px}
button:disabled{opacity:.5;cursor:not-allowed}
#cmpbar{position:fixed;left:50%;bottom:14px;transform:translateX(-50%);background:#fff;padding:10px 16px;border-radius:12px;box-shadow:0 4px 20px #0003;z-index:20;display:flex;gap:12px;align-items:center}
/* --- сравнение --- */
.scroll{overflow-x:auto}.cmpt th{white-space:nowrap;background:#f4f6fb;min-width:140px}.cmpt td{min-width:190px}.cmpt .ch{text-align:center}.cmpt .ch img{width:130px;background:#eef2fb;border-radius:8px}.cmpt .rm{font-size:13px;color:#a11}
.cmpt td.best{background:#e3f8ea}.cmpt .diff td{background:#fff8e1}.cmpt.only .sp:not(.diff){display:none}
/* --- конфигуратор --- */
.bld{display:grid;grid-template-columns:1fr 340px;gap:20px;align-items:start}#sum{position:sticky;top:80px;background:#fff;padding:16px;border-radius:12px;box-shadow:0 1px 4px #0001}#sum h2{margin:0 0 8px}
.slot{background:#fff;padding:12px 14px;border-radius:12px;margin-bottom:10px;box-shadow:0 1px 3px #0001}.slot .sl{margin-bottom:6px}.si{display:flex;gap:12px;align-items:center}.si img{width:64px;height:48px;object-fit:contain;background:#eef2fb;border-radius:6px}.si>div:nth-child(2){flex:1}.sb{white-space:nowrap}
.sumt td{padding:4px 0;font-size:14px;border:0}.sumt .r{text-align:right;white-space:nowrap}
.msg{padding:8px 10px;border-radius:8px;font-size:14px;margin:6px 0}.msg.err{background:#fde8e8;color:#a11}.msg.warn{background:#fff4d6;color:#7a5200}.msg.ok{background:#e3f8ea;color:#165}.msg.info{background:#eef2fb;color:#345}
.modal{position:fixed;inset:0;background:#0008;z-index:50;display:flex;align-items:center;justify-content:center;padding:12px}.modal[hidden]{display:none}.mbox{background:#fff;border-radius:14px;width:min(760px,100%);max-height:90vh;display:flex;flex-direction:column}
.mhead{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;border-bottom:1px solid #e3e8f2}.mtools{display:flex;gap:12px;align-items:center;padding:10px 16px}.mtools input{flex:1}#plist{overflow-y:auto;padding:0 8px 8px}
.pi{display:flex;gap:12px;align-items:center;padding:8px;border-radius:10px;cursor:pointer}.pi:hover{background:#eef2fb}.pi.on{outline:2px solid #2563eb}.pi.dis{opacity:.45;cursor:not-allowed}.pi img{width:72px;height:54px;object-fit:contain;background:#eef2fb;border-radius:6px}.pn{flex:1}.pp{text-align:right;white-space:nowrap;font-weight:600}.bad{color:#a11}
@media(max-width:800px){.bld{grid-template-columns:1fr}#sum{position:static}}
/* --- совместимость --- */
.cb{display:block;font-weight:600}.cb.ok{color:#165}.cb.warn{color:#7a5200}.cb.err{color:#a11}
.msg.ok b,.msg.warn b,.msg.err b{display:block;margin-bottom:2px}
/* --- виджет ИИ + чат --- */
#thw .thfab{position:fixed;right:18px;bottom:18px;width:56px;height:56px;border-radius:50%;font-size:26px;padding:0;box-shadow:0 4px 16px #0004;z-index:40}
#thw .thbadge{position:absolute;top:-4px;right:-4px;background:#e11d48;color:#fff;border-radius:10px;font-size:12px;padding:1px 6px;font-weight:700}
#thw .thp{position:fixed;right:18px;bottom:86px;width:min(380px,calc(100vw - 24px));height:min(560px,calc(100vh - 110px));background:#fff;border-radius:14px;box-shadow:0 8px 32px #0004;z-index:40;display:flex;flex-direction:column;overflow:hidden}
#thw [hidden]{display:none!important}
.thh{display:flex;background:#1b2333}.tht{flex:1;background:none;color:#aab;border-radius:0;padding:12px 6px;font-size:14px}.tht.on{color:#fff;box-shadow:inset 0 -3px #2563eb}.thx{background:none;color:#fff;border-radius:0;padding:0 14px}
.thm{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:8px;background:#f4f6fb}
.thm .b{max-width:88%;padding:8px 11px;border-radius:12px;font-size:14px;white-space:pre-wrap;word-break:break-word}.thm .b small{display:block;color:#667;font-size:11px}
.thm .me{align-self:flex-end;background:#2563eb;color:#fff}.thm .bot{align-self:flex-start;background:#fff;box-shadow:0 1px 3px #0002}.thm .sys{align-self:center;background:#e9edf7;color:#556;font-size:12px;text-align:center}
.thf{display:flex;gap:6px;padding:8px;border-top:1px solid #e3e8f2}.thf input{flex:1;min-width:0}.thtools{padding:4px 8px 0;text-align:right}.thtools .btn2{padding:3px 10px;font-size:12px}
.bc{background:#fff;border-radius:12px;padding:10px;box-shadow:0 1px 4px #0002;font-size:13px;display:flex;flex-direction:column;gap:5px}.bi{display:flex;justify-content:space-between;gap:8px}.bi a{color:#1b2333}.bi span{white-space:nowrap;font-weight:600}
.bt{font-weight:700;color:#2563eb;font-size:15px}.bw{font-size:12px;color:#7a5200}.bw.ok{color:#165}.bc .btn,.bc .btn2{text-align:center;padding:7px 10px;font-size:13px}
