:root{
  --bg:#f4f6f8;
  --card:#ffffff;
  --line:#d7dde5;
  --text:#111827;
  --muted:#6b7280;

  --ok:#2174b0;
  --action:#023f6b;
  --danger:rgb(255, 21, 0);

  --shadow: 0 10px 26px rgba(0,0,0,.08);
  --r:16px;
  --font: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

*{ box-sizing:border-box; font-family:var(--font); }
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
}

.page{
  max-width: 1200px;
  margin: 16px auto 24px;
  padding: 0 14px;
}

/*.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}*/

.topbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.brand{
  font-size: 20px;
  font-weight: 800;
}

.topbar__actions{
  display:flex;
  gap:10px;
}

.layout{
  display:grid;
  grid-template-columns: 1fr 360px;
}

/* diagram */
.diagram{
  padding: 10px;
  min-height: 520px;
}
.diagram__canvas{
  position:relative;
  border-radius: 12px;
  overflow:hidden;
  background:#f7f7f7;
  border: 1px dashed #cdd6e2;
  height: 520px;
}
.diagram__img{
  width:100%;
  height:100%;
  object-fit: contain;
  display:block;
  background:#fff;
}
.diagram__placeholder{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  text-align:center;
  color: var(--muted);
  pointer-events:none;
}
.diagram__placeholder > img{
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width:100%;
  height:100%;
  object-fit: contain;
  display:none;
}
.diagram__placeholder> img.active{
  display: block;
}
.diagram__ph-title{
  font-size: 22px;
  font-weight: 900;
  color:#374151;
  margin-bottom: 6px;
}
.diagram__ph-text{
  font-size: 14px;
  line-height: 1.3;
}

/* “подсветки” (пример координат) */
.mark{
  position:absolute;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(185,225,26,.9);
  background: rgba(185,225,26,.35);
  box-shadow: 0 0 0 6px rgba(185,225,26,.14);
  opacity: .0;
  transform: scale(.95);
  transition: opacity .15s ease, transform .15s ease;
  pointer-events:none;
}
.mark.is-on{
  opacity: 1;
  transform: scale(1);
}

/* примерные позиции */
.mark[data-mark="supplyFan"]{ left: 52%; top: 42%; }
.mark[data-mark="extractFan"]{ left: 64%; top: 42%; }
.mark[data-mark="heater"]{ left: 36%; top: 45%; }
.mark[data-mark="cooler"]{ left: 44%; top: 45%; }
.mark[data-mark="filters"]{ left: 28%; top: 45%; }

/* right panel */
.right{
  display: none;
  padding: 12px;
  max-height: 620px;
  overflow:auto;
}
.right.active{
  display: block;
}
.right__title{
  font-weight: 900;
  color:#1f2937;
  margin-bottom: 10px;
  font-size: 14px;
  text-transform: none;
  border-left: 4px solid var(--ok);
  padding-left: 10px;
}
.right__section{
  padding: 6px 4px 10px;
}
.divider{
  height:1px;
  background:var(--line);
  margin: 8px 0;
}

.field{
  display:none;
  gap:6px;
  margin: 10px 0;
}.field.active{
  display: grid;
}
.field__label{
  font-size: 12px;
  color: var(--muted);
}
.field > input[type="text"]{
  border-radius: 5px;
  padding: 10px 10px;
  border: solid 1px var(--line);
}
.control{
  width:100%;
  height: 36px;
  border:1px solid var(--line);
  border-radius: 10px;
  padding: 0 10px;
  background:#fff;
}
input[type="range"].control{
  padding:0;
}
.hint{
  font-size: 12px;
  color: var(--muted);
}

.check, .radio{
  display:none;
  align-items:center;
  gap:10px;
  margin: 8px 0;
  font-size: 13px;
  color:#1f2937;
}.check.active{
  display: flex;
}
.check.small{
  margin: 6px 0;
  font-size: 12px;
  color:#374151;
}
.check input, .radio input{
  width: 16px;
  height: 16px;
}

.text{
  display:flex;
  align-items:center;
  gap:10px;
  margin: 8px 0;
  font-size: 13px;
  color:#1f2937;
}

.total{
  display:grid;
  gap:10px;
  padding: 8px 0 0;
}
.total__row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font-size: 13px;
}
.total__row--sum{
  padding-top: 8px;
  border-top:1px solid var(--line);
  font-size: 14px;
}

/* bottom */
.bottom{
  margin-top: 12px;
  display:grid;
  grid-column-start: 1;
  grid-column-end: 3;
  gap: 12px;
}
.bottom__left{
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.group{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.group__title{
  font-weight: 900;
  margin-bottom: 10px;
}
.btn{
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border:1px solid var(--line);
  background:#fff;
  cursor:pointer;
  font-weight: 700;
}
.btn--wide{ width:100%; margin-top: 10px; }
.btn--ok{
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--ok);
  color:#fff;
  border-color: rgba(0,0,0,.12);
  font-size: 12px;
}
.btn--action{
  background: #202fff;
  color:#fff;
  border-color: rgba(0,0,0,.12);
}
.btn--danger{
  background: var(--danger);
  color:#fff;
  border-color: rgba(0,0,0,.12);
}
.btn--ghost{
  background: transparent;
}

.bottom__modules{
  display:grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  gap: 10px;
  flex-wrap:wrap;
  align-items:stretch;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
}
/*.module{
  width: 100%;
  border-radius: 12px;
  padding: 10px;
  background:#fff;
  display:grid;
  gap: 8px;
  text-align: center;
  align-items: center;
}*/
.module{
  position: relative;
  display: grid;
  grid-template-rows: .25fr 1fr;
  width: 100%;
  text-align: center;
  background:var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  padding: 10px;
  align-items: center;
  gap: 10px;
}
.custom_check{
  position: absolute;
  display: flex;
  border-radius: 10px;
  background-color: #6b7280;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  cursor: pointer;
}
.custom_check.active{
  background-color: #1eff00;
}
.custom_check::after{
  position: absolute;
  content: 'Вкл';
  font-size: 9px;
  right: 12px;
  top: -25%;
}
.module > .check{
  display: none;
}
.module div > .check{
  display: none;
}
.module__name{
  font-weight: 900;
  font-size: 12px;
}
.module--price{
  width: 100%;
  border: 2px solid var(--ok);
}
.pricebox{
  font-size: 12px;
  color:#1f2937;
  display:grid;
  gap: 6px;
}
.pricebox__row{
  display:flex;
  justify-content:space-between;
}
.pricebox__row--sum{
  padding-top: 6px;
  border-top:1px solid var(--line);
  font-size: 13px;
}

.actionsFooter{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-column-start: 1;
  grid-column-end: 3;
  gap: 15px;
  background-color: #fff;
  margin-top: 15px;
}
.actionsFooter > button{
  width: 100%;
}

@media (max-width: 980px){
  .layout{ grid-template-columns: 1fr; }
  .right{ max-height: none; }
  .diagram__canvas{ height: 420px; }
  .bottom{ grid-template-columns: 1fr; }
}