.np5-modular-plan-tools,
.np5-plan-views,
.np5-jewel-layouts,
.np5-jewel-exterior-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.jewel-gallery > .np5-jewel-exterior-controls {
  grid-column: 1 / -1;
  padding: 8px 20px;
}

.np5-modular-plan-tools[hidden],
.np5-plan-views[hidden],
.np5-jewel-layouts[hidden],
.np5-jewel-exterior-controls[hidden] {
  display: none !important;
}

.np5-modular-plan-tools {
  grid-column: 1 / -1;
  padding: 0 0 8px;
}

.np5-plan-tool,
.np5-plan-view,
.np5-jewel-layout,
.np5-view-step {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid #b9c5d1;
  border-radius: 0;
  padding: 9px 13px;
  background: #fff;
  color: #102849;
  font: inherit;
  font-size: 13px;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
}

.np5-plan-tool:hover,
.np5-plan-view:hover,
.np5-jewel-layout:hover,
.np5-view-step:hover {
  border-color: #102849;
}

.np5-plan-tool.is-active,
.np5-plan-tool[aria-pressed="true"],
.np5-plan-view[aria-pressed="true"],
.np5-jewel-layout[aria-pressed="true"] {
  border-color: #102849;
  background: #102849;
  color: #fff;
}

.np5-plan-tool:focus-visible,
.np5-plan-view:focus-visible,
.np5-jewel-layout:focus-visible,
.np5-view-step:focus-visible {
  outline: 3px solid #3975a4;
  outline-offset: 2px;
}

.np5-plan-views {
  grid-column: 1 / -1;
  margin: 0 0 2px;
}

.np5-jewel-layouts {
  grid-column: 1 / -1;
  margin: 12px 0 18px;
}

.np5-modular-plan-tools .np5-plan-tool {
  width: 48px;
  height: 48px;
  padding: 8px;
  border: 0;
  background: transparent;
}
.np5-modular-plan-tools .np5-plan-tool:hover { background: #e7edf3; }
.np5-modular-plan-tools .np5-plan-tool:disabled { opacity: .38; cursor: not-allowed; }
.np5-modular-plan-tools .np5-plan-tool:disabled:hover { background: transparent; }
.np5-plan-status {
  grid-column: 1 / -1;
  margin: 0 0 8px;
  color: #102849;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}
.np5-plan-zoom { order: -2; }
.np5-plan-horizontal { order: -1; }
.np5-plan-tool[aria-pressed="true"] { color: #fff; background: #102849; }

.np5-view-counter {
  min-width: 48px;
  color: #52647a;
  font-size: 12px;
  text-align: center;
}

.np5-jewel-exterior-controls {
  justify-content: space-between;
  padding: 8px 0 0;
}

.np5-jewel-exterior-controls .np5-view-step {
  flex: 1 1 0;
}

#specifications .plan-image-button img.np5-jewel-4xl-plan-image {
  width: 100%;
  height: auto;
  min-height: 280px;
  max-height: 72svh;
  object-fit: contain;
}

#specifications .plan-images img.np5-plan-mirrored,
#image-dialog img.np5-plan-mirrored,
#plan .xl-plan img.np5-plan-mirrored,
#xl-plan-dialog img.np5-plan-mirrored {
  transform: scaleY(-1);
}

.np5-plan-mirrored-horizontal { transform: scaleX(-1) !important; }
.np5-plan-mirrored.np5-plan-mirrored-horizontal { transform: scale(-1, -1) !important; }

@media (max-width: 760px) {
  .np5-modular-plan-tools {
    gap: 7px;
  }

  .np5-plan-tool,
  .np5-plan-view,
  .np5-jewel-layout,
  .np5-view-step {
    min-height: 44px;
    padding: 9px 10px;
    font-size: 12px;
  }

  .np5-plan-views {
    gap: 6px;
  }

  .np5-jewel-layouts {
    gap: 6px;
  }

  #specifications .plan-image-button img.np5-jewel-4xl-plan-image {
    max-height: 74svh;
  }
}

@media print {
  @page {
    margin: 12mm;
  }

  body.np5-modular-plan-printing {
    background: #fff !important;
    color: #111 !important;
  }

  body.np5-modular-plan-printing .topbar,
  body.np5-modular-plan-printing .nav,
  body.np5-modular-plan-printing .jewel-subnav,
  body.np5-modular-plan-printing .footer,
  body.np5-modular-plan-printing dialog,
  body.np5-modular-plan-printing .np5-modular-plan-tools,
  body.np5-modular-plan-printing .np5-plan-status,
  body.np5-modular-plan-printing .np5-plan-views,
  body.np5-modular-plan-printing .np5-jewel-layouts,
  body.np5-modular-plan-printing .np5-jewel-exterior-controls,
  body.np5-modular-plan-printing #xl-enlarge {
    display: none !important;
  }

  body.np5-modular-plan-printing main > section:not(#specifications):not(#plan) {
    display: none !important;
  }

  body.np5-modular-plan-printing #specifications,
  body.np5-modular-plan-printing #plan {
    display: block !important;
    width: 100% !important;
    padding: 0 !important;
    background: #fff !important;
  }

  body.np5-modular-plan-printing #specifications .wrap,
  body.np5-modular-plan-printing #plan .wrap {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
  }

  body.np5-modular-plan-printing #specifications .plan-layout {
    display: block !important;
  }

  body.np5-modular-plan-printing #specifications .plan-info {
    margin-bottom: 12px;
  }

  body.np5-modular-plan-printing #specifications .plan-images {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body.np5-modular-plan-printing.np5-jewel-single-plan-print #specifications .plan-images {
    grid-template-columns: 1fr !important;
  }

  body.np5-modular-plan-printing #specifications .plan-images > button {
    break-inside: avoid;
    border: 0 !important;
    padding: 0 !important;
  }

  body.np5-modular-plan-printing #specifications .plan-images > button > span {
    display: none !important;
  }

  body.np5-modular-plan-printing #specifications .plan-images img {
    width: 100% !important;
    height: auto !important;
    max-height: 78vh !important;
    object-fit: contain !important;
  }

  /* A mirrored plan says so on the printed page (the note is set on the plan section by the tools script). */
  body.np5-modular-plan-printing [data-np5-print-note]::before {
    content: attr(data-np5-print-note);
    display: block;
    grid-column: 1 / -1;
    margin: 0 0 4mm;
    color: #111;
    font-size: 11pt;
    font-weight: 600;
  }

  body.np5-modular-plan-printing #plan .xl-plan {
    margin: 0 !important;
  }

  body.np5-modular-plan-printing #plan .xl-plan img {
    width: 100% !important;
    height: auto !important;
    max-height: 82vh !important;
    object-fit: contain !important;
  }
}
