/* Visor de planos: estilos aislados para no afectar el sitio anfitrión. */
.lmplan-scroll-lock {
  overflow: hidden !important;
}

.lmplan-dialog {
  box-sizing: border-box;
  position: fixed;
  inset: 0;
  width: calc(100% - 32px);
  max-width: 1480px;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
  max-height: none;
  margin: auto;
  padding: 0;
  border: 1px solid #dce5df;
  border-radius: 16px;
  background: #fff;
  color: #183c30;
  box-shadow: 0 24px 90px #08251d66;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lmplan-dialog:not([open]) {
  display: none;
}

.lmplan-dialog::backdrop {
  background: #08251dd9;
}

.lmplan-header {
  flex: none;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #dce5df;
  background: #f8faf7;
}

.lmplan-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.lmplan-title {
  margin: 0;
  max-width: 100%;
  font-family: inherit;
  font-size: clamp(20px, 2.2vw, 28px);
  font-weight: 600;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.lmplan-help {
  margin: 8px 0 0;
  color: #496256;
  font-size: 14px;
  line-height: 1.45;
}

.lmplan-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 16px;
}

.lmplan-zoom-controls,
.lmplan-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lmplan-button,
.lmplan-link {
  box-sizing: border-box;
  display: inline-flex;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid #b6c8bc;
  border-radius: 8px;
  background: #fff;
  color: #183c30;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lmplan-button:hover,
.lmplan-link:hover {
  background: #edf3ec;
  border-color: #416957;
}

.lmplan-button:focus-visible,
.lmplan-link:focus-visible,
.lmplan-stage:focus-visible {
  outline: 3px solid #b88a28;
  outline-offset: 3px;
}

.lmplan-button:disabled {
  color: #7d8d82;
  border-color: #d7e0d9;
  background: #f3f6f1;
  cursor: default;
}

.lmplan-button-close {
  flex: none;
  border-color: #183c30;
  background: #183c30;
  color: #fff;
}

.lmplan-button-close:hover {
  background: #28553f;
  border-color: #28553f;
}

.lmplan-button-zoom {
  padding-inline: 12px;
  font-size: 22px;
}

.lmplan-scale {
  min-width: 60px;
  color: #183c30;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.lmplan-link-pdf {
  border-color: #183c30;
  background: #183c30;
  color: #fff;
}

.lmplan-link-pdf:hover {
  border-color: #28553f;
  background: #28553f;
}

.lmplan-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y pinch-zoom;
  background: #fff;
}

.lmplan-canvas {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 100%;
  min-height: 100%;
  padding: 16px;
}

.lmplan-image {
  display: block;
  flex: none;
  max-width: none;
  max-height: none;
  height: auto;
  margin: 0;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
}

.lmplan-status {
  position: absolute;
  inset: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: #496256;
  font-size: 16px;
  line-height: 1.5;
  text-align: center;
}

.lmplan-canvas[hidden],
.lmplan-status[hidden],
.lmplan-link[hidden] {
  display: none;
}

@media (max-width: 640px) {
  .lmplan-dialog {
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  .lmplan-header {
    padding: 16px;
    padding-top: max(16px, env(safe-area-inset-top));
  }

  .lmplan-heading {
    gap: 12px;
  }

  .lmplan-button-close {
    padding-inline: 12px;
  }

  .lmplan-zoom-controls,
  .lmplan-links {
    gap: 6px;
  }

  .lmplan-toolbar {
    gap: 10px;
    margin-top: 12px;
  }

  .lmplan-link {
    padding-inline: 10px;
  }

  .lmplan-scale {
    min-width: 52px;
  }

  .lmplan-stage {
    padding-bottom: env(safe-area-inset-bottom);
  }
}

@media print {
  .lmplan-dialog {
    display: none !important;
  }
}
