/* МиксБай IES-калькулятор — встраивается в шаблон сайта.
   Все стили скоупнуты в #ies-app, классы с префиксом i- (чтобы не конфликтовать с bootstrap). */

#ies-app { font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: #1d1a17; font-size: 15px; line-height: 1.45; }
#ies-app *, #ies-app *::before, #ies-app *::after { box-sizing: border-box; }
#ies-app a { color: #c01f16; }

#ies-app .sub { margin: 0 0 14px; color: #77716c; font-size: 14px; max-width: 900px; }

#ies-app .cols { display: grid; grid-template-columns: 330px 1fr; gap: 14px; align-items: start; }

/* ---- панель ---- */
#ies-app #panel { background: #fff; border: 1px solid #e8e5e2; border-radius: 12px; padding: 14px; }
#ies-app .sec { margin-bottom: 14px; }
#ies-app .sec:last-child { margin-bottom: 0; }
#ies-app .sec h3 {
  margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase;
  letter-spacing: .04em; color: #8a847e; font-family: inherit;
}
#ies-app .irow { display: block; margin: 0 0 7px; }
#ies-app .irow label { font-size: 13.5px; color: #3c3835; display: block; margin: 0 0 2px; font-weight: 400; }
#ies-app .irow .ctl { display: flex; align-items: center; gap: 8px; min-width: 0; }
#ies-app .irow input[type="range"] { flex: 1 1 40px; min-width: 30px; width: auto; accent-color: #c01f16; margin: 0; padding: 0; border: 0; background: transparent; }
#ies-app .irow input[type="number"] {
  flex: 0 0 auto; width: 84px; padding: 4px 6px; border: 1px solid #ddd6cf; border-radius: 12px;
  font-size: 14px; text-align: right; background: #fff; color: #1d1a17; margin: 0; height: auto;
}
#ies-app .igrid2 { min-width: 0; }
#ies-app .igrid2 > div { min-width: 0; }
#ies-app .igrid2 .irow input[type="number"] { width: 58px; font-size: 13px; }
#ies-app .icheck { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; font-size: 13.5px; color: #3c3835; }
#ies-app .icheck input { accent-color: #c01f16; width: 16px; height: 16px; flex: 0 0 16px; margin: 1px 0 0; }
#ies-app .icheck label { flex: 1; line-height: 1.35; cursor: pointer; font-weight: 400; margin: 0; }
#ies-app .igrid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ---- селект пресетов и подсказки ---- */
#ies-app #panel select {
  width: 100%; padding: 7px 8px; border: 1px solid #ddd6cf; border-radius: 12px;
  font-size: 14px; background: #fff; color: #1d1a17; cursor: pointer; height: auto; margin: 0;
}
#ies-app .hint { font-size: 12px; color: #8a847e; line-height: 1.4; margin: 5px 0 8px; }
#ies-app .hint.muted { color: #a49d96; }

/* ---- дополнительные параметры (аккордеон) ---- */
#ies-app #adv { margin: 4px 0 0; border-top: 1px solid #f0ece7; }
#ies-app #adv summary {
  cursor: pointer; padding: 10px 0 8px; font-size: 13px; font-weight: 600; color: #c01f16;
  list-style: none; user-select: none;
}
#ies-app #adv summary::before { content: '▸ '; }
#ies-app #adv[open] summary::before { content: '▾ '; }
#ies-app #adv summary::-webkit-details-marker { display: none; }
#ies-app .adv-body { padding-top: 4px; }

/* ---- файловая зона ---- */
#ies-app #drop {
  border: 2px dashed #c9c2bb; border-radius: 12px; padding: 14px;
  text-align: center; color: #77716c; cursor: pointer; font-size: 13.5px;
  transition: border-color .15s, background .15s; background: #faf9f8;
}
#ies-app #drop.hover { border-color: #c01f16; background: #fdf0ee; }
#ies-app #drop b { color: #c01f16; }
#ies-app #file-name { margin-top: 8px; font-size: 13px; color: #1c6b2a; word-break: break-word; display: none; }
#ies-app #file-name a { color: #c01f16; }

/* ---- инфо о светильнике ---- */
#ies-app .lum-main { font-size: 13.5px; font-weight: 600; color: #1d1a17; line-height: 1.35; }
#ies-app .lum-chips { font-size: 13px; color: #77716c; margin-top: 3px; }
#ies-app .lum-more { margin-top: 8px; }
#ies-app .lum-more summary { cursor: pointer; color: #c01f16; font-size: 12.5px; list-style: none; user-select: none; }
#ies-app .lum-more summary::before { content: '▸ '; }
#ies-app .lum-more[open] summary::before { content: '▾ '; }
#ies-app .lum-more summary::-webkit-details-marker { display: none; }
#ies-app #lum-info { font-size: 13px; color: #3c3835; }
#ies-app #lum-info table { width: 100%; border-collapse: collapse; margin-top: 6px; }
#ies-app #lum-info td { padding: 2.5px 0; vertical-align: top; border: 0; }
#ies-app #lum-info td:first-child { color: #8a847e; width: 46%; padding-right: 6px; }
#ies-app .warn {
  margin-top: 8px; padding: 7px 10px; background: #fff7e6; color: #8a5a00;
  border-radius: 12px; font-size: 12.5px; display: none;
}

/* ---- вьюпорт ---- */
#ies-app #viz { position: relative; }
#ies-app #three-wrap {
  position: relative; background: #e8e5e2; border: 1px solid #e8e5e2;
  border-radius: 12px; overflow: hidden; height: 560px;
}
#ies-app #three-wrap canvas { display: block; }
#ies-app #fatal {
  display: none; position: absolute; inset: auto 10px 10px 10px; z-index: 30;
  background: #fdecea; color: #b81d14; padding: 8px 12px; border-radius: 12px; font-size: 13px;
}
#ies-app #hint {
  position: absolute; top: 10px; left: 10px; z-index: 5;
  background: rgba(255,255,255,.88); border-radius: 12px; padding: 5px 10px;
  font-size: 12.5px; color: #77716c; pointer-events: none;
}
#ies-app #legend-box {
  position: absolute; right: 10px; bottom: 10px; z-index: 5;
  background: rgba(255,255,255,.92); border-radius: 12px; padding: 8px 10px 6px;
}
#ies-app #legend-box .t { font-size: 11.5px; color: #77716c; margin-bottom: 4px; }
#ies-app #flat-view { display: none; padding: 12px; background: #fff; border: 1px solid #e8e5e2; border-radius: 12px; margin-top: 10px; }
#ies-app #flat-view canvas { width: 100%; border-radius: 12px; }

/* ---- главный результат ---- */
#ies-app #summary {
  margin-top: 14px; background: #fff; border: 1px solid #e8e5e2; border-left: 4px solid #c01f16;
  border-radius: 12px; padding: 14px 16px 12px;
}
#ies-app .hero { display: flex; gap: 34px; align-items: center; flex-wrap: wrap; }
#ies-app .hero-item .hv { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: #1d1a17; }
#ies-app .hero-item .hv small { font-size: 16px; font-weight: 400; color: #8a847e; }
#ies-app .hero-item .hv.ok { color: #1c6b2a; }
#ies-app .hero-item .hv.low { color: #b81d14; }
#ies-app .hero-item .hl { font-size: 12.5px; color: #8a847e; margin-top: 3px; }
#ies-app #pdf-btn {
  margin-left: auto; align-self: center; border: 1px solid #d3251b; background: #d3251b;
  color: #fff; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600;
}
#ies-app #pdf-btn:hover { background: #b81d14; }
#ies-app #more-btn {
  align-self: center; border: 1px solid #ddd6cf; background: #fff;
  color: #3c3835; padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
#ies-app #more-btn:hover { border-color: #c01f16; color: #c01f16; }
#ies-app .hero-sub { margin-top: 8px; font-size: 13px; color: #8a847e; }
#ies-app .sum-warn { margin-top: 7px; color: #b81d14; font-size: 13.5px; }

/* ---- карточка товара с корзиной ---- */
#ies-app #buy-card {
  margin-top: 10px; background: #fff; border: 1px solid #e8e5e2;
  padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
#ies-app #buy-card img { width: 72px; height: 72px; object-fit: contain; flex: 0 0 72px; }
#ies-app #buy-card .bc-mid { flex: 1; min-width: 220px; }
#ies-app #buy-card .bc-name {
  font-size: 14px; font-weight: 600; color: #1d1a17; text-decoration: none; line-height: 1.35; display: block;
}
#ies-app #buy-card .bc-name:hover { color: #d3251b; }
#ies-app #buy-card .bc-price { font-size: 13.5px; color: #3c3835; margin-top: 3px; }
#ies-app #buy-card .bc-total { font-size: 12.5px; color: #8a847e; margin-top: 2px; }
#ies-app #bc-add {
  border: 1px solid #d3251b; background: #d3251b; color: #fff; font-weight: 600;
  padding: 10px 18px; border-radius: 8px; cursor: pointer; font-size: 14px; white-space: nowrap;
}
#ies-app #bc-add:hover { background: #b81d14; }
#ies-app #bc-add.done { background: #1c6b2a; border-color: #1c6b2a; }
#ies-app #bc-add:disabled { opacity: .7; cursor: default; }
#ies-app #bc-go { font-size: 13.5px; color: #c01f16; white-space: nowrap; }

/* ---- карточки деталей ---- */
#ies-app #results {
  display: none; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px; margin-top: 14px;
}
#ies-app .icard { background: #fff; border: 1px solid #e8e5e2; border-radius: 12px; padding: 10px 12px; }
#ies-app .icard .v { font-size: 21px; font-weight: 650; letter-spacing: -.01em; color: #1d1a17; }
#ies-app .icard .v small { font-size: 13px; font-weight: 400; color: #8a847e; }
#ies-app .icard .l { font-size: 12px; color: #8a847e; margin-top: 2px; line-height: 1.3; }
#ies-app .icard.good .v { color: #1c6b2a; }
#ies-app .icard.bad .v { color: #b81d14; }

/* ---- кнопка-заглушка и текст ---- */
#ies-app #demo-btn {
  margin-top: 8px; border: 1px solid #ddd6cf; background: #fff; color: #3c3835;
  padding: 6px 12px; border-radius: 12px; cursor: pointer; font-size: 13px;
}
#ies-app #about { background: #fff; border: 1px solid #e8e5e2; border-radius: 12px; padding: 12px 20px; margin-top: 16px; font-size: 14.5px; }
#ies-app #about summary {
  font-size: 14px; font-weight: 600; color: #c01f16; cursor: pointer;
  list-style: none; user-select: none; padding: 4px 0;
}
#ies-app #about summary::before { content: '▸ '; }
#ies-app #about[open] summary::before { content: '▾ '; }
#ies-app #about summary::-webkit-details-marker { display: none; }
#ies-app #about p { margin: 8px 0 12px; color: #3c3835; }
#ies-app #about h2 {
  font-size: 15.5px; font-weight: 700; color: #1d1a17; margin: 18px 0 6px;
  padding: 0; border: 0; font-family: inherit; line-height: 1.3; text-transform: none;
}
#ies-app #about table {
  width: auto; min-width: 420px; border-collapse: collapse; margin: 8px 0 12px; font-size: 13.5px;
}
#ies-app #about table th, #ies-app #about table td {
  border: 1px solid #dfe6ec; padding: 6px 12px; text-align: left; color: #3c3835;
}
#ies-app #about table th { background: #f4f7fa; font-weight: 600; color: #1d1a17; }
#ies-app #about table td:last-child { white-space: nowrap; }

/* ---- IES-ридер ---- */
#ies-app .reader-cols { display: grid; grid-template-columns: 360px 1fr; gap: 14px; align-items: start; }
#ies-app #rpanel { background: #fff; border: 1px solid #e8e5e2; padding: 14px; }
#ies-app #rinfo { font-size: 13px; color: #3c3835; margin-top: 10px; }
#ies-app #rinfo table { width: 100%; border-collapse: collapse; margin-top: 6px; }
#ies-app #rinfo td { padding: 3px 0; vertical-align: top; border: 0; border-bottom: 1px solid #f0f4f7; }
#ies-app #rinfo td:first-child { color: #8a847e; width: 46%; padding-right: 8px; }
#ies-app #solid3d {
  position: relative; height: 440px; border: 1px solid #e8e5e2; overflow: hidden; background: #1d1a17;
}
#ies-app #solid3d canvas { display: block; }
#ies-app .solid-hint {
  position: absolute; top: 8px; left: 10px; z-index: 5; font-size: 12px; color: #c9c2bb; pointer-events: none;
}
#ies-app #polar-wrap {
  margin-top: 14px; background: #fff; border: 1px solid #e8e5e2; padding: 12px; text-align: center;
}
#ies-app #polar-wrap .pt { font-size: 12.5px; color: #8a847e; text-align: left; margin-bottom: 4px; }
#ies-app #to-calc {
  display: none; margin-top: 14px; background: #d3251b; color: #fff; padding: 11px 20px;
  text-decoration: none; font-weight: 600; font-size: 14px; border-radius: 8px; text-align: center;
}
#ies-app #to-calc:hover { background: #b81d14; }

@media (max-width: 960px) {
  #ies-app .cols { grid-template-columns: 1fr; }
  #ies-app .reader-cols { grid-template-columns: 1fr; }
  #ies-app #three-wrap { height: 420px; }
  #ies-app #solid3d { height: 340px; }
  #ies-app #about table { min-width: 0; width: 100%; }
}
