.factory-block { border-top: 1px solid #dce4ec; background: #f4f7fa; scroll-margin-top: 96px; }
.factory-section { padding-block: clamp(28px, 5vw, 58px); }
.factory-catalog { margin-top: 18px; }
.factory-catalog summary { width: fit-content; padding: 8px 0; color: #203b5b; font-weight: 700; cursor: pointer; }
.factory-catalog .machine-grid { margin-top: 12px; }
.factory-heading { margin-bottom: 18px; }
.factory-heading h2 { margin: 0; font-size: clamp(24px, 3vw, 36px); letter-spacing: -.04em; }
.factory-heading p { margin: 5px 0 0; color: #516178; }

.factory-map {
  margin: 0;
  border: 1px solid #29445f;
  border-radius: 12px;
  background: #0c1a2a;
  box-shadow: 0 12px 26px #142b481a;
}

.factory-floor { position: relative; }
.factory-plan { display: block; width: 100%; height: auto; border-radius: 11px 11px 0 0; }
.factory-map > figcaption { padding: 9px 15px; color: #d1e1f1; font-size: 12px; }

.factory-marker {
  position: absolute;
  z-index: 1;
  width: max(26px, 8.2%);
  height: max(26px, 4.9%);
  transform: translate(-50%, -50%);
  border: 1px solid transparent;
  border-radius: 6px;
  touch-action: manipulation;
  cursor: pointer;
}

.factory-marker[href="#dgs-650a"],
.factory-marker[href="#igm-15nc"],
.factory-marker[href="#t-125nc"] { width: max(26px, 10%); height: max(26px, 6.2%); }
.factory-marker[href="#dc-18"] { width: max(26px, 10%); }
.factory-marker[href="#overhead-crane"] { width: max(26px, 20%); }

.factory-marker::after {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 11px;
  height: 11px;
  box-sizing: border-box;
  border: 2px solid #0a2139;
  border-radius: 50%;
  background: #9de6ff;
  box-shadow: 0 0 0 1px #deefff, 0 0 9px #28bcff;
  content: "";
}

.factory-marker.is-previewed,
.factory-marker:hover,
.factory-marker:focus-visible { border-color: #c5edff; outline: 2px solid #126797; outline-offset: 0; }

.factory-hover {
  position: absolute;
  z-index: 3;
  width: min(320px, calc(100% - 20px));
  max-height: calc(100vh - 100px);
  overflow: auto;
  border-radius: 8px;
  color: #101e31;
  box-shadow: 0 10px 30px #06132288;
}

.machine-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.machine-card { min-width: 0; border: 1px solid #ccd5df; border-radius: 6px; background: #fff; overflow: clip; }
.machine-photo { height: 200px; margin: 0; background: #fff; overflow: hidden; }
.machine-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.machine-photo--gu-32 img,
.machine-photo--gu-35 img,
.machine-photo--gu-55 img { object-fit: cover; object-position: center bottom; }
.machine-info { padding: 16px; }
.machine-kind { color: #4e6c86; font-size: 12px; font-weight: 700; margin: 0 0 4px; }
.machine-info h3 { font-size: clamp(17px, 3vw, 24px); margin: 0 0 12px; overflow-wrap: anywhere; }
.machine-location { margin: -7px 0 10px; color: #4e6c86; font-size: 13px; }
.machine-specs { margin: 0; }
.machine-specs > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 1.2fr); gap: 10px; border-top: 1px solid #e2e8ee; padding: 7px 0; }
.machine-specs dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.machine-specs dt, .machine-specs dd { font-size: 13px; line-height: 1.45; }
.machine-source { margin: 8px 0 0; color: #536477; font-size: 12px; }
.machine-source a { text-decoration: underline; text-underline-offset: 2px; }
.factory-hover .machine-photo { height: 130px; }
.factory-hover .machine-info { padding: 12px; }
.factory-hover .machine-specs > div { padding-block: 5px; }

.factory-dialog {
  width: min(560px, calc(100vw - 28px));
  max-height: 88vh;
  scroll-padding: 40px;
  padding: 9px;
  border: 1px solid #c7d3df;
  border-radius: 10px;
  background: #f6f8fa;
  color: #101e31;
}

.factory-dialog::backdrop { background: #061223b3; }
.factory-dialog form { display: flex; justify-content: end; margin-bottom: 8px; }
.factory-dialog button {
  padding: 7px 12px;
  border: 1px solid #bccad8;
  border-radius: 5px;
  background: #fff;
  color: #162b41;
  font: inherit;
  cursor: pointer;
}
.factory-dialog .machine-photo { height: clamp(150px, 32vh, 270px); }

@media (max-width: 900px) {
  .machine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 580px) {
  .machine-grid { grid-template-columns: 1fr; }
  .factory-marker::after { width: 8px; height: 8px; border-width: 1px; top: 2px; right: 1px; }
  .machine-photo { height: 185px; }
  .factory-dialog .machine-photo { height: clamp(150px, 27vh, 220px); }
}

#factory-spot-1 { left: 28.9623%; top: 21.2500%; }
#factory-spot-2 { left: 23.1132%; top: 34.5833%; }
#factory-spot-3 { left: 21.8868%; top: 46.3889%; }
#factory-spot-4 { left: 20.6604%; top: 58.6111%; }
#factory-spot-5 { left: 18.3962%; top: 71.6667%; }
#factory-spot-6 { left: 6.7925%; top: 86.2500%; }
#factory-spot-7 { left: 55.7547%; top: 25.5556%; }
#factory-spot-8 { left: 69.8113%; top: 30.1389%; }
#factory-spot-9 { left: 56.4151%; top: 45.0000%; }
#factory-spot-10 { left: 56.5094%; top: 61.1111%; }
#factory-spot-11 { left: 86.9811%; top: 25.0000%; }
#factory-spot-12 { left: 88.9623%; top: 42.3611%; }
#factory-spot-13 { left: 90.5660%; top: 56.2500%; }
#factory-spot-14 { left: 86.4151%; top: 70.4167%; }
#factory-spot-15 { left: 77.5472%; top: 86.5278%; }
#factory-spot-16 { left: 93.5849%; top: 86.5278%; }
#factory-spot-17 { left: 50.8491%; top: 6.3889%; }
