.pgz-app {
  color: #17211d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  max-width: 1320px;
  margin: 0 auto;
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.pgz-app * {
  box-sizing: border-box;
}

.pgz-app button,
.pgz-app input,
.pgz-app select {
  font: inherit;
}

.pgz-shell {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(320px, 380px);
  gap: 20px;
  align-items: start;
}

.pgz-workspace,
.pgz-panel,
.pgz-modal-card {
  border: 1px solid #d8dfda;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(25, 39, 34, 0.12);
}

.pgz-topbar,
.pgz-selection,
.pgz-panel {
  padding: 20px;
}

.pgz-topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid #d8dfda;
}

.pgz-eyebrow {
  margin: 0 0 6px;
  color: #104b5f;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.pgz-app h2,
.pgz-app h3 {
  margin: 0;
  color: #17211d;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
}

.pgz-app h2 {
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.pgz-app h3 {
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.15;
}

.pgz-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #607069;
  font-size: 0.9rem;
  font-weight: 700;
}

.pgz-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pgz-dot {
  width: 22px;
  height: 14px;
  border: 2px solid #111;
  border-radius: 3px;
}

.pgz-dot.available { background: #fff; }
.pgz-dot.pending { background: #f4c430; }
.pgz-dot.sold { background: #c62828; }
.pgz-dot.unavailable { background: #111; }

.pgz-selection {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid #d8dfda;
  background: #f9fbf7;
}

.pgz-selection p {
  margin: 0;
  color: #607069;
  font-weight: 800;
}

.pgz-window-notice {
  padding: 10px 12px;
  border: 1px solid #bfd1c7;
  border-radius: 8px;
  background: #f4faf6;
  color: #17211d !important;
}

.pgz-window-notice:empty {
  display: none;
}

.pgz-app a {
  color: #176b87;
  text-decoration: underline;
}

.pgz-controls,
.pgz-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.pgz-app label,
.pgz-checks legend {
  display: grid;
  gap: 7px;
  color: #607069;
  font-size: 0.9rem;
  font-weight: 800;
}

.pgz-app input,
.pgz-app select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d8dfda;
  border-radius: 8px;
  padding: 0 12px;
}

.pgz-checks {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #d8dfda;
  border-radius: 8px;
}

.pgz-checks.compact {
  grid-template-columns: repeat(3, minmax(118px, 1fr));
}

.pgz-checks legend,
.pgz-wide {
  grid-column: 1 / -1;
}

.pgz-checks label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #17211d;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.2;
}

.pgz-checks input {
  width: 18px;
  min-height: 18px;
}

.pgz-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

.pgz-map {
  position: relative;
  aspect-ratio: 1338 / 2048;
  overflow: hidden;
  background: #fdfbf6;
}

.pgz-map img {
  display: block;
  width: 100%;
  height: auto;
}

.pgz-booth-layer {
  position: absolute;
  inset: 0;
}

.pgz-map-landmark {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: max-content;
  max-width: 150px;
  padding: 4px 7px;
  border: 1px solid rgba(23, 33, 29, .45);
  border-radius: 6px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 4px 12px rgba(18, 29, 25, .2);
  color: #17211d;
  font-size: clamp(.58rem, .78vw, .74rem);
  font-weight: 800;
  line-height: 1.12;
  text-align: center;
  transform: translate(-50%, calc(-100% - 17px));
  pointer-events: none;
}

.pgz-map-landmark-entrance {
  transform: translate(14px, -50%);
}

.pgz-booth {
  position: absolute;
  display: grid;
  width: clamp(26px, 4.2%, 44px);
  aspect-ratio: 1.3 / 1;
  place-content: center;
  border: 2px solid #111;
  border-radius: 4px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(18, 29, 25, .25);
  color: #111;
  font-size: clamp(0.68rem, 1.8%, 0.86rem);
  font-weight: 800;
  translate: -50% -50%;
}

.pgz-booth.pending_wire {
  border-color: #6b5200;
  background: #f4c430;
  color: #111;
  cursor: not-allowed;
}

.pgz-booth.sold {
  border-color: #741313;
  background: #c62828;
  color: #fff;
  cursor: not-allowed;
}

.pgz-booth.unavailable {
  border-color: #000;
  background: #111;
  color: #fff;
  cursor: not-allowed;
}

.pgz-booth.selected {
  outline: 3px solid #176b87;
  outline-offset: 2px;
  box-shadow: 0 10px 24px rgba(23, 107, 135, .35);
}

.pgz-product-label {
  position: absolute;
  z-index: 3;
  width: max-content;
  max-width: 156px;
  padding: 5px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .99);
  box-shadow: 0 7px 18px rgba(18, 29, 25, .28);
  color: #111a17;
  font-size: clamp(.62rem, .82vw, .78rem);
  font-weight: 900;
  line-height: 1.1;
  overflow-wrap: anywhere;
  pointer-events: none;
  text-align: center;
  translate: -50% calc(-100% - 10px);
}

.pgz-product-label.paired {
  translate: -50% -50%;
}

.pgz-product-label.pending_wire {
  border: 3px solid #f4c430;
}

.pgz-product-label.sold {
  border: 3px solid #c62828;
}

.pgz-consent-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
}

.pgz-regulation-link {
  font-weight: 900;
}

.pgz-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pgz-muted,
.pgz-message {
  color: #607069;
  line-height: 1.5;
}

.pgz-details dl,
.pgz-wire-box dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.pgz-details div,
.pgz-wire-box div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #d8dfda;
}

.pgz-actions,
.pgz-modal-actions,
.pgz-copy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pgz-app button {
  min-height: 44px;
  border: 1px solid #d8dfda;
  border-radius: 8px;
  background: #fff;
  color: #17211d;
  font-weight: 800;
  cursor: pointer;
}

.pgz-app button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.pgz-app .pgz-booth:disabled {
  opacity: 1;
}

/*
 * I temi WordPress possono applicare ai pulsanti dimensioni minime, padding e
 * trasformazioni pensate per i normali pulsanti della pagina. Queste regole
 * mantengono i segnaposto della mappa compatti e allineati anche su iPhone.
 */
.pgz-app .pgz-map button.pgz-booth {
  -webkit-appearance: none !important;
  appearance: none !important;
  box-sizing: border-box !important;
  position: absolute !important;
  display: grid !important;
  place-content: center !important;
  width: clamp(24px, 3.8%, 42px) !important;
  height: clamp(19px, 2.45%, 32px) !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 2px solid #111 !important;
  border-radius: 4px !important;
  background: #fff !important;
  box-shadow: 0 3px 10px rgba(18, 29, 25, .25) !important;
  color: #111 !important;
  font-family: inherit !important;
  font-size: clamp(10px, 1.2vw, 14px) !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  letter-spacing: 0 !important;
  text-indent: 0 !important;
  white-space: nowrap !important;
  transform: translate(-50%, -50%) !important;
  translate: none !important;
  opacity: 1 !important;
  touch-action: manipulation;
}

.pgz-app .pgz-map button.pgz-booth.pending_wire {
  border-color: #6b5200 !important;
  background: #f4c430 !important;
  color: #111 !important;
}

.pgz-app .pgz-map button.pgz-booth.sold {
  border-color: #741313 !important;
  background: #c62828 !important;
  color: #fff !important;
}

.pgz-app .pgz-map button.pgz-booth.unavailable {
  border-color: #000 !important;
  background: #111 !important;
  color: #fff !important;
}

.pgz-app .pgz-map button.pgz-booth.selected {
  outline: 3px solid #176b87 !important;
  outline-offset: 2px !important;
  box-shadow: 0 10px 24px rgba(23, 107, 135, .35) !important;
}

.pgz-app .pgz-map button.pgz-booth:disabled {
  opacity: 1 !important;
}

.pgz-primary {
  border-color: #176b87 !important;
  background: #176b87 !important;
  color: #fff !important;
}

.pgz-modal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 99999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(16, 27, 23, .45);
}

.pgz-modal-card {
  position: relative !important;
  top: auto !important;
  transform: none !important;
  width: min(680px, 100%);
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: 0 auto !important;
  overflow-y: auto;
  padding: 22px;
}

.pgz-modal-host {
  max-width: none;
  margin: 0;
}

.pgz-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.pgz-wire-box,
.pgz-summary {
  margin: 14px 0;
  padding: 14px;
  border: 1px solid #bfd1c7;
  border-radius: 8px;
  background: #f4faf6;
}

.pgz-summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #17211d;
  font-weight: 800;
}

.pgz-hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .pgz-shell {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pgz-modal {
    padding: 10px;
  }

  .pgz-modal-card {
    max-height: calc(100vh - 20px);
    max-height: calc(100dvh - 20px);
    padding: 16px;
  }

  .pgz-controls,
  .pgz-form-grid,
  .pgz-checks.compact {
    grid-template-columns: 1fr;
  }

  .pgz-topbar {
    display: grid;
  }

  .pgz-app h2 {
    font-size: 2rem;
  }

  .pgz-app .pgz-map button.pgz-booth {
    width: clamp(22px, 6.4vw, 30px) !important;
    height: clamp(17px, 4.9vw, 23px) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border-width: 2px !important;
    border-radius: 4px !important;
    font-size: clamp(10px, 3vw, 13px) !important;
    line-height: 1 !important;
  }

  .pgz-product-label {
    max-width: 104px;
    padding: 3px 5px;
    font-size: 10px;
  }

  .pgz-map-landmark {
    max-width: 92px;
    padding: 3px 4px;
    font-size: 9px;
    transform: translate(-50%, calc(-100% - 12px));
  }

  .pgz-map-landmark-entrance {
    max-width: 88px;
    transform: translate(8px, -50%);
  }
}
