/* ===============================
   G-5 ZONE MAP VISUAL POLISH
   =============================== */

/* Base zone style */
.zone-shape {
  transition: all 0.25s ease;
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
}

/* Hover effect */
.zone-shape:hover {
  filter: brightness(1.2);
  transform: scale(1.02);
}

/* Active (clicked) */
.zone-shape.active {
  filter: brightness(1.4);
  transform: scale(1.03);
  animation: zonePulse 0.5s ease;
}

/* Pulse animation */
@keyframes zonePulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.05); }
  100% { transform: scale(1.03); }
}

/* Optional map overlay (depth feel) */
.zone-map-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at center,
    rgba(0,0,0,0.05),
    rgba(0,0,0,0.25)
  );
  pointer-events: none;
}

/* ===============================
   G-6 FULLSCREEN + HYBRID CARD
   =============================== */
html, body {
  width: 100%;
  height: 100%;
}
body.guest-fullscreen {
  overflow: hidden;
  background: #0f172a;
}
body.guest-fullscreen .guest-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
}
body.guest-fullscreen .guest-hidden-ui {
  display: none !important;
}
body.guest-fullscreen .guest-map-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}
body.guest-fullscreen #guest_map_wrap,
body.guest-fullscreen #guest_zone_grid_panel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 0;
}
body.guest-fullscreen .guest-map-wrap {
  overflow: hidden;
}
body.guest-fullscreen .guest-map-svg {
  width: 100%;
  height: 100%;
  display: block;
  background: #0f172a;
}
body.guest-fullscreen .guest-map-label {
  fill: #ffffff;
  paint-order: stroke;
  stroke: rgba(15, 23, 42, 0.8);
  stroke-width: 5px;
  stroke-linejoin: round;
  font-weight: 700;
}
body.guest-fullscreen #guest_map_status {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 20;
  max-width: min(60vw, 560px);
  background: rgba(15, 23, 42, 0.7);
  color: #fff;
  backdrop-filter: blur(8px);
}
.zone-preview-card {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(16px);
  opacity: 0;
  transform: translateY(18px) translateX(10px);
  pointer-events: none;
  transition: opacity .24s ease, transform .28s ease;
  overflow: hidden;
}
.zone-preview-card.open {
  opacity: 1;
  transform: translateY(0) translateX(0);
  pointer-events: auto;
}
.zone-preview-close-handle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.zone-preview-scroll {
  overflow: auto;
  padding: 18px;
}
.zone-preview-content .zone-detail-hero {
  padding-right: 44px;
}
.zone-preview-content .zone-gallery-hero img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: 18px;
}
.zone-preview-inquiry {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}
.zone-preview-cta {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.zone-card.selected,
.zone-card.active {
  border-color: #111827;
  box-shadow: 0 0 0 2px rgba(17,24,39,.12), 0 12px 24px rgba(15,23,42,.10);
}
.zone-shape.active,
.map-zone.active,
.guest-map-zone.active {
  stroke: rgba(255,255,255,0.95);
  stroke-width: 3px;
}
@media (max-width: 768px) {
  .zone-preview-card {
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-height: 60vh;
  }
  body.guest-fullscreen #guest_map_status {
    top: 12px;
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* ===============================
   G-6.3 PREMIUM CARD + IMAGE ZOOM
   =============================== */
body.guest-fullscreen.lightbox-open {
  overflow: hidden;
}
.zone-preview-card {
  width: min(448px, calc(100vw - 32px));
  max-height: calc(100vh - 44px);
  background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(248,250,252,0.96) 100%);
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.35), 0 10px 24px rgba(15, 23, 42, 0.12);
  transition: opacity .24s ease, transform .3s cubic-bezier(.22,1,.36,1), box-shadow .24s ease;
}
.zone-preview-card.open {
  box-shadow: 0 34px 90px rgba(15, 23, 42, 0.38), 0 12px 26px rgba(15, 23, 42, 0.12);
}
.zone-preview-scroll {
  overflow: auto;
  padding: 18px;
  scrollbar-width: thin;
}
.zone-preview-content {
  display: grid;
  gap: 14px;
}
.zone-preview-content .zone-detail-card {
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.9) 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.zone-preview-content .zone-detail-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 56px 18px 18px;
}
.zone-preview-content .zone-detail-hero h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.zone-detail-subtitle {
  margin-top: 6px;
  color: #fff;
  font-size: .92rem;
  font-weight: 500;
}
.zone-preview-close-handle {
  background: rgba(255,255,255,0.88);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}
.zone-gallery-hero {
  padding: 14px;
}
.zone-gallery-shell {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: #e2e8f0;
}
.zone-gallery-slides {
  position: relative;
  min-height: 272px;
}
.zone-gallery-slide {
  position: relative;
  display: none;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.zone-gallery-slide.is-active {
  display: block;
}
.zone-preview-content .zone-gallery-hero img {
  width: 100%;
  height: 272px;
  object-fit: cover;
  border-radius: 16px;
}
.zone-gallery-zoom-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
}
.zone-gallery-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.zone-gallery-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #475569;
  font-size: .9rem;
  font-weight: 600;
}
.zone-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.zone-gallery-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
}
.zone-gallery-thumb img {
  display: block;
  width: 100%;
  height: 62px;
  object-fit: cover;
}
.zone-gallery-thumb.is-active {
  border-color: #111827;
  box-shadow: 0 8px 18px rgba(15,23,42,.14);
}
.zone-gallery-dots {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.zone-gallery-nav {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.9);
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15,23,42,.14);
}
.zone-gallery-nav.prev,
.zone-gallery-nav.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
}
.zone-gallery-nav.prev { left: 12px; }
.zone-gallery-nav.next { right: 12px; }
.zone-preview-content .zone-detail-section,
.zone-preview-content .zone-detail-info-grid {
  padding: 16px 18px;
}
.zone-preview-content .zone-detail-section-title {
  margin-bottom: 12px;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}
.zone-preview-content .info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.zone-preview-content .info-item {
  padding: 12px 14px;
  border-radius: 16px;
}
.zone-preview-content .zone-detail-description {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #334155;
  line-height: 1.55;
}
.zone-type-detail-grid {
  gap: 10px;
}
.zone-type-detail-tile .zone-preview-content .info-item {
  border-radius: 16px;
  background: #fff;
}
.zone-preview-inquiry {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(226, 232, 240, 0.9);
}
.zone-action-mode-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}
.zone-action-mode {
  border-radius: 16px;
}
.zone-preview-card textarea,
.zone-preview-card input {
  border-radius: 14px;
}
.zone-preview-cta .btn {
  border-radius: 16px;
}
.zone-shape.active,
.map-zone.active,
.guest-map-zone.active {
  stroke: rgba(255,255,255,0.98);
  stroke-width: 3px;
  filter: brightness(1.18) saturate(1.08);
}
.zone-shape:hover,
.map-zone:hover,
.guest-map-zone:hover {
  filter: brightness(1.08);
}
.zone-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease;
}
.zone-image-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}
.zone-image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
}
.zone-image-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 30px 80px rgba(0,0,0,.4);
}
.zone-image-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: 26px;
}
.zone-image-lightbox-toolbar {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding-right: 56px;
}
.zone-image-zoom-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
}
.zone-image-zoom-btn:disabled {
  opacity: .45;
}
.zone-image-lightbox-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0,1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 0;
}
.zone-image-lightbox-frame {
  position: relative;
  min-height: 0;
  height: min(68vh, 760px);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(255,255,255,.04);
  display: flex;
  align-items: center;
  justify-content: center;
}
#zone_image_lightbox_img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform .2s ease;
  transform-origin: center center;
  cursor: zoom-in;
}
.zone-lightbox-nav {
  position: static !important;
  transform: none !important;
  background: rgba(255,255,255,.14);
  color: #fff;
}
.zone-image-lightbox-footer {
  display: grid;
  gap: 12px;
}
.zone-image-lightbox-title {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
}
.zone-image-lightbox-meta {
  color: rgba(255,255,255,.72);
  font-size: .9rem;
}
.zone-image-lightbox-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(72px, 88px));
  gap: 10px;
}
.zone-image-lightbox-thumb {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}
.zone-image-lightbox-thumb img {
  width: 100%;
  height: 68px;
  object-fit: cover;
  display: block;
}
.zone-image-lightbox-thumb.is-active {
  border-color: #fff;
}
@media (max-width: 768px) {
  .zone-preview-card {
    width: auto;
    max-height: 62vh;
  }
  .zone-preview-content .zone-gallery-hero img {
    height: 220px;
  }
  .zone-preview-content .info-grid {
    grid-template-columns: 1fr;
  }
  .zone-image-lightbox {
    padding: 12px;
  }
  .zone-image-lightbox-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 14px;
  }
  .zone-image-lightbox-stage {
    grid-template-columns: 1fr;
  }
  .zone-lightbox-nav {
    position: absolute !important;
    top: 50%;
    transform: translateY(-50%) !important;
    z-index: 2;
  }
  .zone-lightbox-nav.prev { left: 10px; }
  .zone-lightbox-nav.next { right: 10px; }
  .zone-image-lightbox-frame {
    height: min(56vh, 520px);
  }
}


/* === G-6.3.1 left glass handle === */
.zone-preview-card { overflow: visible; }
.zone-preview-close-handle {
  position: absolute;
  left: -18px;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px 0 0 14px;
  border: 1px solid rgba(255,255,255,0.22);
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 10px 28px rgba(15,23,42,0.28);
  color: #5a5a5a;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: transform .22s ease, background .22s ease, box-shadow .22s ease, opacity .22s ease;
}
.zone-preview-close-handle:hover {
  transform: translateY(-50%) translateX(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.12));
  box-shadow: 0 14px 32px rgba(15,23,42,0.34);
}
@media (max-width: 640px) {
  .zone-preview-close-handle {
    left: -12px;
    width: 34px;
    height: 64px;
  }
}

/* ===============================
   GUEST-2C FORCE LANDSCAPE + AUTO POLYGON FIT MAP
   Scope: guest.php auto viewBox + guest-fullscreen display behavior
   =============================== */
body.guest-fullscreen .guest-map-svg {
  object-fit: contain;
}
body.guest-fullscreen #guest_map_bg {
  pointer-events: none;
}
@media (orientation: portrait) and (max-width: 767px) {
  body.guest-fullscreen .guest-stage {
    position: fixed;
    inset: auto;
    top: 50%;
    left: 50%;
    width: 100vh;
    height: 100vw;
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
    overflow: hidden;
  }
  body.guest-fullscreen #guest_map_wrap,
  body.guest-fullscreen #guest_zone_grid_panel {
    width: 100%;
    height: 100%;
  }
  body.guest-fullscreen .guest-map-svg {
    width: 100%;
    height: 100%;
  }
  body.guest-fullscreen #guest_map_status {
    max-width: min(60vh, 560px);
  }
}


/* ===============================
   GUEST-3 BACK BUTTON TO INDEX
   Scope: guest.php visible navigation back to index.php with subsite_id state
   =============================== */
.guest-back-button {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.58);
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .02em;
  box-shadow: 0 16px 36px rgba(15,23,42,.28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.guest-back-button:hover {
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
}
@media (orientation: portrait) and (max-width: 767px) {
  .guest-back-button {
    top: 12px;
    left: 12px;
    min-height: 38px;
    padding: 8px 12px;
    font-size: 13px;
  }
}


/* ===============================
   GUEST-4A3 REVISED LEFT EXPANDING SIDE PANEL
   Scope: guest.php action form expands to LEFT of action rail;
   action rail remains stuck to the right zone preview.
   =============================== */
.g5-guest-action-cluster {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: none;
  width: min(1080px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  pointer-events: none;
}
.g5-guest-action-cluster.open { display: block; }
.g5-top-row {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 0;
  pointer-events: auto;
}
.g5-action-shell {
  width: 142px;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(18px) translateX(10px);
  pointer-events: none;
  transition: opacity .24s ease, transform .3s cubic-bezier(.22,1,.36,1);
  order: 2;
}
.g5-action-shell.open { opacity: 1; transform: translateY(0) translateX(0); pointer-events: auto; }
.g5-action-buttons {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100%;
  border-radius: 24px 0 0 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(15,23,42,0.30), 0 10px 24px rgba(15,23,42,0.12);
}
.g5-action-btn {
  flex: 1;
  min-height: 110px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255,255,255,.55);
  border-radius: 0;
  color: #fff;
  font-size: .92rem;
  font-weight: 900;
  letter-spacing: .035em;
  line-height: 1.2;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  box-shadow: none;
  transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}
.g5-action-btn:last-child { border-bottom: 0; }
.g5-action-btn:hover, .g5-action-btn.is-active {
  filter: brightness(1.05);
  transform: translateX(-2px);
  box-shadow: inset -5px 0 0 rgba(255,255,255,.55);
}
.g5-action-inquiry { background: linear-gradient(135deg, #2563eb, #0d6efd); }
.g5-action-kpr { background: linear-gradient(135deg, #16a34a, #198754); }
.g5-action-order { background: linear-gradient(135deg, #f97316, #fd7e14); }
.g5-guest-action-cluster .zone-preview-card {
  position: relative;
  right: auto;
  bottom: auto;
  width: min(520px, 50vw);
  flex: 0 0 min(520px, 50vw);
  max-height: calc(100vh - 48px);
  border-radius: 0 24px 24px 0;
  transform: translateY(18px) translateX(10px);
  order: 3;
}
.g5-guest-action-cluster .zone-preview-card.open { transform: translateY(0) translateX(0); }
.g5-active-panel {
  display: none;
  order: 1;
  pointer-events: auto;
  overflow: auto;
  width: min(390px, 34vw);
  max-height: calc(100vh - 48px);
  padding: 18px;
  border-radius: 24px 0 0 24px;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(226,232,240,.92);
  border-right: 0;
  box-shadow: 0 24px 60px rgba(15,23,42,.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transform: translateY(18px) translateX(10px);
}
.g5-active-panel:not(:empty) { display: block; }
.g5-guest-action-cluster.open .g5-active-panel:not(:empty) { transform: translateY(0) translateX(0); }
.g5-panel-title { font-weight: 900; font-size: 1.05rem; margin-bottom: 12px; color: #0f172a; }
.g5-field { display: grid; gap: 6px; margin-bottom: 10px; font-size: .86rem; font-weight: 700; color: #334155; }
.g5-field input, .g5-active-panel input, .g5-active-panel textarea { width: 100%; border: 1px solid rgba(203,213,225,.95); border-radius: 12px; padding: 10px 12px; background: #fff; }
.g5-active-panel textarea { min-height: 86px; }
body.preview-open .zone-preview-card { right: auto; width: auto; }
@media (max-width: 900px) {
  .g5-guest-action-cluster { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: calc(100vh - 16px); }
  .g5-action-shell { width: 112px; }
  .g5-action-btn { min-height: 86px; font-size: .74rem; padding: 8px; }
  .g5-guest-action-cluster .zone-preview-card { width: calc(100vw - 128px - 16px); flex-basis: calc(100vw - 128px - 16px); max-height: calc(100vh - 16px); }
  .g5-active-panel { width: calc(100vw - 128px - 16px); max-height: calc(42vh); border-radius: 18px 0 0 18px; padding: 14px; }
  .g5-active-panel:not(:empty) + .g5-action-shell + .zone-preview-card { display: none; }
}

/* === GUEST-4A3.2 hotfix: cluster stays attached to preview; only X sits left of action rail === */
.g5-guest-action-cluster {
  right: 24px !important;
  left: auto !important;
}
.g5-top-row,
.g5-action-shell,
.g5-active-panel,
.g5-guest-action-cluster .zone-preview-card {
  position: relative !important;
}
.g5-action-shell,
.g5-active-panel {
  flex-shrink: 0;
  pointer-events: auto;
}
.g5-active-panel[style*="display: block"],
.g5-active-panel:not(:empty) {
  display: block !important;
}
.g5-guest-action-cluster .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle {
  position: absolute !important;
  left: auto !important;
  right: calc(100% + 154px) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 60 !important;
  pointer-events: auto !important;
}
.g5-guest-action-cluster .zone-preview-close-handle:hover,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle:hover {
  transform: translateY(-50%) translateX(-2px) !important;
}
@media (max-width: 900px) {
  .g5-guest-action-cluster {
    right: 8px !important;
    left: auto !important;
  }
  .g5-active-panel:not(:empty) + .g5-action-shell + .zone-preview-card {
    display: flex !important;
  }
  .g5-guest-action-cluster .zone-preview-close-handle,
  body.preview-open .g5-guest-action-cluster .zone-preview-close-handle {
    right: calc(100% + 122px) !important;
  }
}

/* === GUEST-4A3.3 hotfix: restore action button rail visibility ===
   Context: GUEST-4A3.2 intentionally re-anchored the cluster, but the action
   rail can remain visually hidden if the shell opacity/open state is missed.
   Keep the rail in normal flow next to the preview; do not pin it to viewport. */
.g5-guest-action-cluster.open #g5_action_shell,
.g5-guest-action-cluster.open .g5-action-shell,
body.preview-open #g5_action_shell,
body.preview-open .g5-action-shell {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) translateX(0) !important;
  position: relative !important;
  width: 142px !important;
  flex: 0 0 142px !important;
  order: 2 !important;
  z-index: 55 !important;
}

.g5-guest-action-cluster.open .g5-action-buttons,
body.preview-open .g5-action-buttons {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 100% !important;
  visibility: visible !important;
}

.g5-guest-action-cluster.open .g5-action-btn,
body.preview-open .g5-action-btn {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* The previous generic #g5_action_rail overrides do not apply to this build.
   The real rail container is #g5_action_shell. Keep it attached to preview. */
#g5_action_shell {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
}

@media (max-width: 900px) {
  .g5-guest-action-cluster.open #g5_action_shell,
  .g5-guest-action-cluster.open .g5-action-shell,
  body.preview-open #g5_action_shell,
  body.preview-open .g5-action-shell {
    width: 112px !important;
    flex-basis: 112px !important;
  }
}

/* === GUEST-4A4 build: action rail expands into the form container ===
   Layout target: [X] [ACTION RAIL / FORM CONTAINER] [ZONE PREVIEW]
   Scope: guest.php UI only. No API/auth/JSON changes. */
.g5-guest-action-cluster.open #g5_top_row,
body.preview-open #g5_top_row {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 0 !important;
}

.g5-guest-action-cluster.open #g5_action_shell,
.g5-guest-action-cluster.open .g5-action-shell,
body.preview-open #g5_action_shell,
body.preview-open .g5-action-shell {
  order: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  width: 142px !important;
  flex: 0 0 142px !important;
  max-height: calc(100vh - 48px) !important;
  overflow: hidden !important;
  border-radius: 24px 0 0 24px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  transform: translateY(0) translateX(0) !important;
  box-shadow: 0 30px 80px rgba(15,23,42,0.30), 0 10px 24px rgba(15,23,42,0.12) !important;
  background: rgba(255,255,255,.97) !important;
  z-index: 55 !important;
}

.g5-guest-action-cluster.open #g5_action_shell.has-panel,
.g5-guest-action-cluster.open .g5-action-shell.has-panel,
body.preview-open #g5_action_shell.has-panel,
body.preview-open .g5-action-shell.has-panel {
  width: min(390px, 34vw) !important;
  flex-basis: min(390px, 34vw) !important;
}

/* Form is now INSIDE the rail container, not a detached left panel. */
#g5_action_shell #g5_active_panel,
.g5-action-shell .g5-active-panel {
  order: 1 !important;
  width: 100% !important;
  max-height: none !important;
  flex: 1 1 auto !important;
  overflow: auto !important;
  padding: 18px !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: rgba(255,255,255,.98) !important;
  transform: none !important;
}

#g5_action_shell #g5_active_panel:empty,
.g5-action-shell .g5-active-panel:empty {
  display: none !important;
}

#g5_action_shell.has-panel #g5_active_panel:not(:empty),
.g5-action-shell.has-panel .g5-active-panel:not(:empty) {
  display: block !important;
}

#g5_action_shell .g5-action-buttons,
.g5-action-shell .g5-action-buttons {
  order: 2 !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 100% !important;
  border-radius: 24px 0 0 24px !important;
  overflow: hidden !important;
  box-shadow: none !important;
}

#g5_action_shell.has-panel .g5-action-buttons,
.g5-action-shell.has-panel .g5-action-buttons {
  flex: 0 0 auto !important;
  min-height: 132px !important;
  border-radius: 0 !important;
}

#g5_action_shell.has-panel .g5-action-btn,
.g5-action-shell.has-panel .g5-action-btn {
  min-height: 44px !important;
  font-size: .72rem !important;
  padding: 8px 10px !important;
}

.g5-guest-action-cluster.open .zone-preview-card,
body.preview-open .g5-guest-action-cluster .zone-preview-card {
  order: 2 !important;
  border-radius: 0 24px 24px 0 !important;
  transform: translateY(0) translateX(0) !important;
}

/* X sits left of the whole expandable rail container. */
.g5-guest-action-cluster .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle {
  position: absolute !important;
  left: auto !important;
  right: calc(100% + 154px) !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  z-index: 90 !important;
  pointer-events: auto !important;
}

.g5-guest-action-cluster.has-action-panel .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster.has-action-panel .zone-preview-close-handle {
  right: calc(100% + min(402px, 35vw)) !important;
}

@media (max-width: 900px) {
  .g5-guest-action-cluster.open #g5_action_shell,
  .g5-guest-action-cluster.open .g5-action-shell,
  body.preview-open #g5_action_shell,
  body.preview-open .g5-action-shell {
    width: 112px !important;
    flex-basis: 112px !important;
  }

  .g5-guest-action-cluster.open #g5_action_shell.has-panel,
  .g5-guest-action-cluster.open .g5-action-shell.has-panel,
  body.preview-open #g5_action_shell.has-panel,
  body.preview-open .g5-action-shell.has-panel {
    width: min(330px, 46vw) !important;
    flex-basis: min(330px, 46vw) !important;
  }

  .g5-guest-action-cluster .zone-preview-close-handle,
  body.preview-open .g5-guest-action-cluster .zone-preview-close-handle {
    right: calc(100% + 122px) !important;
  }

  .g5-guest-action-cluster.has-action-panel .zone-preview-close-handle,
  body.preview-open .g5-guest-action-cluster.has-action-panel .zone-preview-close-handle {
    right: calc(100% + min(342px, 47vw)) !important;
  }
}

/* === GUEST-4A4.1 hotfix: X follows the action rail toggle edge ===
   Target layout: [ACTION RAIL / FORM CONTAINER] [X] [ZONE PREVIEW]
   The close handle is inside the preview card and anchored to its left edge,
   so it naturally follows the rail as the rail expands/collapses. */
.g5-guest-action-cluster.open #g5_top_row,
body.preview-open #g5_top_row {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 0 !important;
}

.g5-guest-action-cluster.open #g5_action_shell,
.g5-guest-action-cluster.open .g5-action-shell,
body.preview-open #g5_action_shell,
body.preview-open .g5-action-shell {
  order: 1 !important;
  width: 142px !important;
  flex: 0 0 142px !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  transition: width .22s ease, flex-basis .22s ease !important;
}

.g5-guest-action-cluster.open #g5_action_shell.has-panel,
.g5-guest-action-cluster.open .g5-action-shell.has-panel,
body.preview-open #g5_action_shell.has-panel,
body.preview-open .g5-action-shell.has-panel {
  width: min(390px, 34vw) !important;
  flex-basis: min(390px, 34vw) !important;
}

.g5-guest-action-cluster.open .zone-preview-card,
body.preview-open .g5-guest-action-cluster .zone-preview-card {
  order: 2 !important;
  position: relative !important;
}

.g5-guest-action-cluster .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle,
.g5-guest-action-cluster.has-action-panel .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster.has-action-panel .zone-preview-close-handle {
  position: absolute !important;
  left: 0 !important;
  right: auto !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 90 !important;
  pointer-events: auto !important;
}

.g5-guest-action-cluster .zone-preview-close-handle:hover,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle:hover {
  transform: translate(-50%, -50%) scale(1.04) !important;
}

@media (max-width: 900px) {
  .g5-guest-action-cluster.open #g5_action_shell,
  .g5-guest-action-cluster.open .g5-action-shell,
  body.preview-open #g5_action_shell,
  body.preview-open .g5-action-shell {
    width: 112px !important;
    flex-basis: 112px !important;
  }

  .g5-guest-action-cluster.open #g5_action_shell.has-panel,
  .g5-guest-action-cluster.open .g5-action-shell.has-panel,
  body.preview-open #g5_action_shell.has-panel,
  body.preview-open .g5-action-shell.has-panel {
    width: min(330px, 46vw) !important;
    flex-basis: min(330px, 46vw) !important;
  }
}

/* === GUEST-4A4.2 hotfix: X moved outside zone_preview_card and follows rail edge ===
   Target: [ACTION RAIL / FORM CONTAINER] [X] [ZONE PREVIEW]
   Scope: guest.php UI only. No API/auth/JSON changes. */
.g5-guest-action-cluster.open #g5_top_row,
body.preview-open #g5_top_row {
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 0 !important;
  position: relative !important;
}

.g5-guest-action-cluster.open #g5_action_shell,
.g5-guest-action-cluster.open .g5-action-shell,
body.preview-open #g5_action_shell,
body.preview-open .g5-action-shell {
  order: 1 !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  width: 142px !important;
  flex: 0 0 142px !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.g5-guest-action-cluster.open #g5_action_shell.has-panel,
.g5-guest-action-cluster.open .g5-action-shell.has-panel,
body.preview-open #g5_action_shell.has-panel,
body.preview-open .g5-action-shell.has-panel {
  width: min(390px, 34vw) !important;
  flex-basis: min(390px, 34vw) !important;
}

/* Close handle is now a flex item between rail and preview, not inside preview. */
.g5-guest-action-cluster .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle,
.g5-guest-action-cluster.has-action-panel .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster.has-action-panel .zone-preview-close-handle {
  order: 2 !important;
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  align-self: center !important;
  flex: 0 0 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  transform: none !important;
  z-index: 120 !important;
  pointer-events: auto !important;
  overflow: visible !important;
}

.g5-guest-action-cluster .zone-preview-close-handle::before,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle::before {
  content: '';
  position: absolute;
  width: 34px;
  height: 34px;
  left: -17px;
  top: -17px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15,23,42,.22);
  z-index: -1;
}

.g5-guest-action-cluster .zone-preview-close-handle:hover,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle:hover {
  transform: scale(1.04) !important;
}

.g5-guest-action-cluster.open .zone-preview-card,
body.preview-open .g5-guest-action-cluster .zone-preview-card {
  order: 3 !important;
  position: relative !important;
  border-radius: 0 24px 24px 0 !important;
}

@media (max-width: 900px) {
  .g5-guest-action-cluster.open #g5_action_shell,
  .g5-guest-action-cluster.open .g5-action-shell,
  body.preview-open #g5_action_shell,
  body.preview-open .g5-action-shell {
    width: 112px !important;
    flex-basis: 112px !important;
  }

  .g5-guest-action-cluster.open #g5_action_shell.has-panel,
  .g5-guest-action-cluster.open .g5-action-shell.has-panel,
  body.preview-open #g5_action_shell.has-panel,
  body.preview-open .g5-action-shell.has-panel {
    width: min(330px, 46vw) !important;
    flex-basis: min(330px, 46vw) !important;
  }
}

/* =========================================================
   GUEST-4A5 STABLE RAIL ARCHITECTURE
   Stable layout: [ACTION RAIL / FORM] [X] [ZONE PREVIEW]
   No rail width animation, no CSS variables, no fixed X handle.
   ========================================================= */
body.preview-open .g5-guest-action-cluster,
.g5-guest-action-cluster.open {
  position: fixed !important;
  left: auto !important;
  right: 16px !important;
  top: auto !important;
  bottom: 16px !important;
  display: flex !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  width: auto !important;
  max-width: calc(100vw - 32px) !important;
  height: min(78vh, 720px) !important;
  max-height: calc(100vh - 32px) !important;
  overflow: visible !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  z-index: 9500 !important;
}

.g5-guest-action-cluster #g5_top_row,
.g5-guest-action-cluster.open #g5_top_row,
body.preview-open .g5-guest-action-cluster #g5_top_row {
  display: flex !important;
  flex-direction: row !important;
  align-items: stretch !important;
  justify-content: flex-end !important;
  gap: 0 !important;
  width: auto !important;
  height: 100% !important;
  max-height: 100% !important;
  overflow: visible !important;
  position: relative !important;
}

/* Fixed-width rail/form container. It never expands horizontally. */
.g5-guest-action-cluster #g5_action_shell,
.g5-guest-action-cluster .g5-action-shell,
.g5-guest-action-cluster.open #g5_action_shell,
.g5-guest-action-cluster.open .g5-action-shell,
body.preview-open .g5-action-shell,
body.preview-open #g5_action_shell {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  order: 1 !important;
  flex: 0 0 320px !important;
  width: 320px !important;
  min-width: 320px !important;
  max-width: 320px !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  pointer-events: auto !important;
  overflow: hidden !important;
  border-radius: 18px 0 0 18px !important;
  background: rgba(255, 255, 255, .98) !important;
  box-shadow: 0 18px 44px rgba(15, 23, 42, .24) !important;
  z-index: 2 !important;
}

/* X handle is a normal flex item between the rail and preview. */
.g5-guest-action-cluster .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle,
.g5-guest-action-cluster.has-action-panel .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster.has-action-panel .zone-preview-close-handle {
  position: relative !important;
  order: 2 !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 100% !important;
  min-height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: rgba(15, 23, 42, .84) !important;
  color: #fff !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  z-index: 3 !important;
  pointer-events: auto !important;
}

/* Preview stays as the stable right-side panel. */
.g5-guest-action-cluster .zone-preview-card,
.g5-guest-action-cluster .zone-preview-card.open,
body.preview-open .g5-guest-action-cluster .zone-preview-card,
body.preview-open .zone-preview-card {
  position: relative !important;
  order: 3 !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  flex: 0 1 520px !important;
  width: min(520px, calc(100vw - 366px - 32px)) !important;
  min-width: min(420px, calc(100vw - 366px - 32px)) !important;
  height: 100% !important;
  max-height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  margin: 0 !important;
  border-radius: 0 18px 18px 0 !important;
  overflow: hidden !important;
  z-index: 1 !important;
}

.g5-action-shell .g5-active-panel {
  display: none !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 14px !important;
  background: #ffffff !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(148, 163, 184, .35) !important;
}

.g5-action-shell.has-panel .g5-active-panel:not(:empty) {
  display: block !important;
}

.g5-action-shell .g5-action-buttons {
  display: flex !important;
  flex-direction: column !important;
  width: 100% !important;
  min-height: 0 !important;
  gap: 0 !important;
  margin: 0 !important;
}

.g5-action-shell:not(.has-panel) .g5-action-buttons {
  flex: 1 1 auto !important;
}

.g5-action-shell.has-panel .g5-action-buttons {
  flex: 0 0 auto !important;
}

.g5-action-shell .g5-action-btn {
  width: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  border-radius: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-bottom: 1px solid rgba(255, 255, 255, .35) !important;
  letter-spacing: .04em !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  word-break: normal !important;
}

.g5-action-shell:not(.has-panel) .g5-action-btn {
  flex: 1 1 0 !important;
  min-height: 120px !important;
  font-size: 1rem !important;
  padding: 18px 14px !important;
}

.g5-action-shell.has-panel .g5-action-btn {
  flex: 0 0 auto !important;
  min-height: 52px !important;
  font-size: .82rem !important;
  padding: 10px 12px !important;
}

.g5-action-shell .g5-action-btn.is-active {
  outline: 3px solid rgba(255, 255, 255, .82) !important;
  outline-offset: -6px !important;
}

.g5-active-panel .zone-inquiry-panel,
.g5-active-panel .zone-preview-inquiry {
  display: block !important;
  position: relative !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

.g5-active-panel input,
.g5-active-panel textarea,
.g5-active-panel select {
  width: 100% !important;
  box-sizing: border-box !important;
}

@media (max-width: 760px) {
  body.preview-open .g5-guest-action-cluster,
  .g5-guest-action-cluster.open {
    left: 8px !important;
    right: 8px !important;
    bottom: 8px !important;
    height: min(88vh, 640px) !important;
    max-width: calc(100vw - 16px) !important;
  }

  .g5-guest-action-cluster #g5_action_shell,
  .g5-guest-action-cluster .g5-action-shell,
  .g5-guest-action-cluster.open #g5_action_shell,
  .g5-guest-action-cluster.open .g5-action-shell,
  body.preview-open .g5-action-shell,
  body.preview-open #g5_action_shell {
    flex-basis: 260px !important;
    width: 260px !important;
    min-width: 260px !important;
    max-width: 260px !important;
  }

  .g5-guest-action-cluster .zone-preview-card,
  .g5-guest-action-cluster .zone-preview-card.open,
  body.preview-open .g5-guest-action-cluster .zone-preview-card,
  body.preview-open .zone-preview-card {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .g5-action-shell:not(.has-panel) .g5-action-btn {
    min-height: 92px !important;
    font-size: .8rem !important;
    padding: 10px 8px !important;
  }
}

/* ===== GUEST-4A5.1 HOTFIX: real close button, no pseudo X ===== */
.g5-guest-action-cluster .zone-preview-close-handle::before,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle::before,
.zone-preview-close-handle::before {
  content: none !important;
  display: none !important;
}

.g5-guest-action-cluster .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle,
.g5-guest-action-cluster.has-action-panel .zone-preview-close-handle,
body.preview-open .g5-guest-action-cluster.has-action-panel .zone-preview-close-handle,
#zone_detail_close.zone-preview-close-handle {
  position: relative !important;
  order: 2 !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  transform: none !important;
  flex: 0 0 34px !important;
  width: 34px !important;
  height: 100% !important;
  min-height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: rgba(15, 23, 42, .84) !important;
  color: #fff !important;
  font-size: 20px !important;
  font-weight: 900 !important;
  line-height: 1 !important;
  text-align: center !important;
  cursor: pointer !important;
  z-index: 30 !important;
  pointer-events: auto !important;
  overflow: hidden !important;
}

.g5-guest-action-cluster .zone-preview-close-handle:hover,
body.preview-open .g5-guest-action-cluster .zone-preview-close-handle:hover,
#zone_detail_close.zone-preview-close-handle:hover {
  background: rgba(15, 23, 42, .96) !important;
  color: #fff !important;
  opacity: 1 !important;
}
/* ===== END GUEST-4A5.1 HOTFIX ===== */

/* =========================================================
   GUEST-4B INQUIRY API BINDING
   Adds context display + success/error feedback inside rail form.
   ========================================================= */
.g5-inquiry-context {
  margin-bottom: 12px !important;
  padding: 10px 12px !important;
  border-radius: 12px !important;
  background: rgba(37, 99, 235, .08) !important;
  color: #1e3a8a !important;
  font-size: .78rem !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

#g5_active_panel #inq_message,
#g5_active_panel #inq_notes {
  min-height: 74px !important;
}

#g5_active_panel #inq_address {
  margin-top: 10px !important;
}

#inquiry_status.success {
  color: #166534 !important;
  font-weight: 800 !important;
}

#inquiry_status.error {
  color: #b91c1c !important;
  font-weight: 800 !important;
}


/* =========================================================
   GUEST-4E.1 HOTFIX: ORDER 50/50 layout + one-column register form
   Scope: ORDER active only. Preserves GUEST-4A5.1 rail architecture.
   ========================================================= */
body.preview-open.g5-order-active .g5-guest-action-cluster,
.g5-guest-action-cluster.open.g5-order-active {
  left: 16px !important;
  right: 16px !important;
  width: calc(100vw - 32px) !important;
  max-width: calc(100vw - 32px) !important;
  justify-content: flex-end !important;
}

body.preview-open.g5-order-active .g5-guest-action-cluster #g5_top_row,
.g5-guest-action-cluster.open.g5-order-active #g5_top_row {
  width: 100% !important;
  max-width: 100% !important;
}

body.preview-open.g5-order-active #g5_action_shell,
body.preview-open.g5-order-active .g5-action-shell,
.g5-guest-action-cluster.open.g5-order-active #g5_action_shell,
.g5-guest-action-cluster.open.g5-order-active .g5-action-shell {
  flex: 0 0 calc((100vw - 32px - 34px) / 2) !important;
  width: calc((100vw - 32px - 34px) / 2) !important;
  min-width: 0 !important;
  max-width: calc((100vw - 32px - 34px) / 2) !important;
}

body.preview-open.g5-order-active .g5-guest-action-cluster .zone-preview-card,
body.preview-open.g5-order-active .zone-preview-card,
.g5-guest-action-cluster.open.g5-order-active .zone-preview-card,
.g5-guest-action-cluster.open.g5-order-active .zone-preview-card.open {
  flex: 0 0 calc((100vw - 32px - 34px) / 2) !important;
  width: calc((100vw - 32px - 34px) / 2) !important;
  min-width: 0 !important;
  max-width: calc((100vw - 32px - 34px) / 2) !important;
}

#g5_active_panel .g5-customer-register-form,
#g5_active_panel .g5-customer-register-fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  max-width: 100% !important;
}

#g5_active_panel .g5-customer-register-form input,
#g5_active_panel .g5-customer-register-form select,
#g5_active_panel .g5-customer-register-form textarea,
#g5_active_panel .g5-customer-register-fields input,
#g5_active_panel .g5-customer-register-fields select,
#g5_active_panel .g5-customer-register-fields textarea {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  grid-column: 1 / -1 !important;
}

#g5_active_panel .g5-customer-register-form textarea {
  min-height: 72px !important;
  resize: vertical !important;
}

@media (max-width: 760px) {
  body.preview-open.g5-order-active .g5-guest-action-cluster,
  .g5-guest-action-cluster.open.g5-order-active {
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }

  body.preview-open.g5-order-active #g5_action_shell,
  body.preview-open.g5-order-active .g5-action-shell,
  .g5-guest-action-cluster.open.g5-order-active #g5_action_shell,
  .g5-guest-action-cluster.open.g5-order-active .g5-action-shell {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
  }

  body.preview-open.g5-order-active .g5-guest-action-cluster .zone-preview-card,
  body.preview-open.g5-order-active .zone-preview-card,
  .g5-guest-action-cluster.open.g5-order-active .zone-preview-card,
  .g5-guest-action-cluster.open.g5-order-active .zone-preview-card.open {
    flex: 0 0 calc(50% - 34px) !important;
    width: calc(50% - 34px) !important;
    max-width: calc(50% - 34px) !important;
    min-width: 0 !important;
  }
}
/* ===== END GUEST-4E.1 HOTFIX ===== */


/* =========================================================
   GUEST-4G.1 UNIFIED PANEL REAPPLY
   Scope: Inquiry + KPR + ORDER active panels only.
   Keeps rail architecture intact and preserves GUEST-4G reservation lock.
   ========================================================= */
body.preview-open.g5-inquiry-active .g5-guest-action-cluster,
body.preview-open.g5-kpr-active .g5-guest-action-cluster,
body.preview-open.g5-order-active .g5-guest-action-cluster,
.g5-guest-action-cluster.open.g5-inquiry-active,
.g5-guest-action-cluster.open.g5-kpr-active,
.g5-guest-action-cluster.open.g5-order-active {
  left: 16px !important;
  right: 16px !important;
  width: calc(100vw - 32px) !important;
  max-width: calc(100vw - 32px) !important;
  justify-content: flex-end !important;
}

body.preview-open.g5-inquiry-active .g5-guest-action-cluster #g5_top_row,
body.preview-open.g5-kpr-active .g5-guest-action-cluster #g5_top_row,
body.preview-open.g5-order-active .g5-guest-action-cluster #g5_top_row,
.g5-guest-action-cluster.open.g5-inquiry-active #g5_top_row,
.g5-guest-action-cluster.open.g5-kpr-active #g5_top_row,
.g5-guest-action-cluster.open.g5-order-active #g5_top_row {
  width: 100% !important;
  max-width: 100% !important;
}

body.preview-open.g5-inquiry-active #g5_action_shell,
body.preview-open.g5-inquiry-active .g5-action-shell,
body.preview-open.g5-kpr-active #g5_action_shell,
body.preview-open.g5-kpr-active .g5-action-shell,
body.preview-open.g5-order-active #g5_action_shell,
body.preview-open.g5-order-active .g5-action-shell,
.g5-guest-action-cluster.open.g5-inquiry-active #g5_action_shell,
.g5-guest-action-cluster.open.g5-inquiry-active .g5-action-shell,
.g5-guest-action-cluster.open.g5-kpr-active #g5_action_shell,
.g5-guest-action-cluster.open.g5-kpr-active .g5-action-shell,
.g5-guest-action-cluster.open.g5-order-active #g5_action_shell,
.g5-guest-action-cluster.open.g5-order-active .g5-action-shell {
  flex: 0 0 calc((100vw - 32px - 34px) / 2) !important;
  width: calc((100vw - 32px - 34px) / 2) !important;
  min-width: 0 !important;
  max-width: calc((100vw - 32px - 34px) / 2) !important;
}

body.preview-open.g5-inquiry-active .g5-guest-action-cluster .zone-preview-card,
body.preview-open.g5-inquiry-active .zone-preview-card,
body.preview-open.g5-kpr-active .g5-guest-action-cluster .zone-preview-card,
body.preview-open.g5-kpr-active .zone-preview-card,
body.preview-open.g5-order-active .g5-guest-action-cluster .zone-preview-card,
body.preview-open.g5-order-active .zone-preview-card,
.g5-guest-action-cluster.open.g5-inquiry-active .zone-preview-card,
.g5-guest-action-cluster.open.g5-inquiry-active .zone-preview-card.open,
.g5-guest-action-cluster.open.g5-kpr-active .zone-preview-card,
.g5-guest-action-cluster.open.g5-kpr-active .zone-preview-card.open,
.g5-guest-action-cluster.open.g5-order-active .zone-preview-card,
.g5-guest-action-cluster.open.g5-order-active .zone-preview-card.open {
  flex: 0 0 calc((100vw - 32px - 34px) / 2) !important;
  width: calc((100vw - 32px - 34px) / 2) !important;
  min-width: 0 !important;
  max-width: calc((100vw - 32px - 34px) / 2) !important;
}

/* Inquiry/KPR/ORDER panel forms: one column, full width */
#g5_active_panel .zone-preview-inquiry,
#g5_active_panel .g5-kpr-panel,
#g5_active_panel .g5-customer-register-form,
#g5_active_panel .g5-customer-register-fields {
  width: 100% !important;
  max-width: 100% !important;
}

#g5_active_panel .zone-preview-inquiry .g5-customer-register-fields,
#g5_active_panel .g5-kpr-panel,
#g5_active_panel .g5-customer-register-form,
#g5_active_panel .g5-customer-register-fields {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

#g5_active_panel .zone-preview-inquiry input,
#g5_active_panel .zone-preview-inquiry select,
#g5_active_panel .zone-preview-inquiry textarea,
#g5_active_panel .g5-kpr-panel input,
#g5_active_panel .g5-kpr-panel select,
#g5_active_panel .g5-kpr-panel textarea,
#g5_active_panel .g5-customer-register-form input,
#g5_active_panel .g5-customer-register-form select,
#g5_active_panel .g5-customer-register-form textarea,
#g5_active_panel .g5-customer-register-fields input,
#g5_active_panel .g5-customer-register-fields select,
#g5_active_panel .g5-customer-register-fields textarea {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
  grid-column: 1 / -1 !important;
  box-sizing: border-box !important;
}

#g5_active_panel .zone-action-mode-row {
  display: none !important;
}

@media (max-width: 760px) {
  body.preview-open.g5-inquiry-active .g5-guest-action-cluster,
  body.preview-open.g5-kpr-active .g5-guest-action-cluster,
  body.preview-open.g5-order-active .g5-guest-action-cluster,
  .g5-guest-action-cluster.open.g5-inquiry-active,
  .g5-guest-action-cluster.open.g5-kpr-active,
  .g5-guest-action-cluster.open.g5-order-active {
    left: 8px !important;
    right: 8px !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
  }

  body.preview-open.g5-inquiry-active #g5_action_shell,
  body.preview-open.g5-inquiry-active .g5-action-shell,
  body.preview-open.g5-kpr-active #g5_action_shell,
  body.preview-open.g5-kpr-active .g5-action-shell,
  body.preview-open.g5-order-active #g5_action_shell,
  body.preview-open.g5-order-active .g5-action-shell,
  .g5-guest-action-cluster.open.g5-inquiry-active #g5_action_shell,
  .g5-guest-action-cluster.open.g5-inquiry-active .g5-action-shell,
  .g5-guest-action-cluster.open.g5-kpr-active #g5_action_shell,
  .g5-guest-action-cluster.open.g5-kpr-active .g5-action-shell,
  .g5-guest-action-cluster.open.g5-order-active #g5_action_shell,
  .g5-guest-action-cluster.open.g5-order-active .g5-action-shell {
    flex: 0 0 50% !important;
    width: 50% !important;
    max-width: 50% !important;
  }

  body.preview-open.g5-inquiry-active .g5-guest-action-cluster .zone-preview-card,
  body.preview-open.g5-inquiry-active .zone-preview-card,
  body.preview-open.g5-kpr-active .g5-guest-action-cluster .zone-preview-card,
  body.preview-open.g5-kpr-active .zone-preview-card,
  body.preview-open.g5-order-active .g5-guest-action-cluster .zone-preview-card,
  body.preview-open.g5-order-active .zone-preview-card,
  .g5-guest-action-cluster.open.g5-inquiry-active .zone-preview-card,
  .g5-guest-action-cluster.open.g5-inquiry-active .zone-preview-card.open,
  .g5-guest-action-cluster.open.g5-kpr-active .zone-preview-card,
  .g5-guest-action-cluster.open.g5-kpr-active .zone-preview-card.open,
  .g5-guest-action-cluster.open.g5-order-active .zone-preview-card,
  .g5-guest-action-cluster.open.g5-order-active .zone-preview-card.open {
    flex: 0 0 calc(50% - 34px) !important;
    width: calc(50% - 34px) !important;
    max-width: calc(50% - 34px) !important;
    min-width: 0 !important;
  }
}
/* ===== END GUEST-4G.1 UNIFIED PANEL REAPPLY ===== */

/* =========================================================
   GUEST-4G.2 MOBILE ACTION RAIL FIX
   Scope: mobile only. Ensures all action buttons remain visible when
   Inquiry/KPR/ORDER panels are active.
   ========================================================= */
@media (max-width: 760px) {
  .g5-guest-action-cluster.open #g5_action_shell,
  .g5-guest-action-cluster.open .g5-action-shell,
  body.preview-open #g5_action_shell,
  body.preview-open .g5-action-shell {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
  }

  .g5-action-shell.has-panel #g5_active_panel,
  .g5-action-shell.has-panel .g5-active-panel,
  #g5_action_shell.has-panel #g5_active_panel,
  #g5_action_shell.has-panel .g5-active-panel {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .g5-action-shell.has-panel .g5-action-buttons,
  #g5_action_shell.has-panel .g5-action-buttons {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .g5-action-shell.has-panel .g5-action-btn,
  #g5_action_shell.has-panel .g5-action-btn {
    flex: 0 0 42px !important;
    min-height: 42px !important;
    height: 42px !important;
    padding: 6px 8px !important;
    font-size: .68rem !important;
    line-height: 1.12 !important;
    white-space: normal !important;
  }

  .g5-action-shell.has-panel .g5-action-btn:last-child,
  #g5_action_shell.has-panel .g5-action-btn:last-child {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}
/* ===== END GUEST-4G.2 MOBILE ACTION RAIL FIX ===== */

/* =========================================================
   GUEST-4G.3 MOBILE RAIL HEIGHT + SCROLL FIX
   Scope: mobile only. Keeps the large stacked action buttons, but
   allows the left action rail to scroll instead of clipping ORDER.
   ========================================================= */
@media (max-width: 760px) {
  body.preview-open .g5-guest-action-cluster,
  .g5-guest-action-cluster.open {
    max-height: calc(100vh - 16px) !important;
    overflow: hidden !important;
  }

  .g5-guest-action-cluster.open #g5_action_shell,
  .g5-guest-action-cluster.open .g5-action-shell,
  body.preview-open #g5_action_shell,
  body.preview-open .g5-action-shell {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100vh - 24px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .g5-action-shell.has-panel .g5-action-buttons,
  #g5_action_shell.has-panel .g5-action-buttons,
  .g5-action-shell .g5-action-buttons,
  #g5_action_shell .g5-action-buttons {
    height: auto !important;
    min-height: max-content !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 18px !important;
  }

  .g5-action-shell.has-panel .g5-action-btn,
  #g5_action_shell.has-panel .g5-action-btn,
  .g5-action-shell .g5-action-btn,
  #g5_action_shell .g5-action-btn {
    flex-shrink: 0 !important;
  }

  .g5-action-shell.has-panel .g5-action-btn:last-child,
  #g5_action_shell.has-panel .g5-action-btn:last-child,
  .g5-action-shell .g5-action-btn:last-child,
  #g5_action_shell .g5-action-btn:last-child {
    margin-bottom: 10px !important;
  }
}
/* ===== END GUEST-4G.3 MOBILE RAIL HEIGHT + SCROLL FIX ===== */

/* GUEST-4G.4 FINAL MOBILE BUTTON FIX */
@media (max-width: 768px) {

  .action-buttons {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;

    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .action-buttons button {
    width: 100% !important;

    height: auto !important;
    min-height: 48px !important;

    padding: 12px 10px !important;
    line-height: 1.2 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    white-space: normal !important;
  }

}
/* =========================================================
   GUEST-4G.5 MOBILE ACTION PANEL SELECTOR FIX
   Scope: CSS-only. Corrects GUEST-4G.4 selector from legacy
   .action-buttons to the actual guest rail classes used in guest.php:
   .g5-action-buttons and .g5-action-btn.
   ========================================================= */
@media (max-width: 768px) {
  body.preview-open #g5_guest_action_cluster,
  #g5_guest_action_cluster.open {
    max-height: calc(100vh - 16px) !important;
    overflow: hidden !important;
  }

  body.preview-open #g5_top_row,
  #g5_guest_action_cluster.open #g5_top_row {
    display: flex !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body.preview-open #g5_action_shell,
  body.preview-open .g5-action-shell,
  #g5_guest_action_cluster.open #g5_action_shell,
  #g5_guest_action_cluster.open .g5-action-shell {
    display: flex !important;
    flex-direction: column !important;
    flex: 0 0 calc((100vw - 16px - 34px - 12px) / 2) !important;
    width: calc((100vw - 16px - 34px - 12px) / 2) !important;
    max-width: calc((100vw - 16px - 34px - 12px) / 2) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-height: calc(100vh - 24px) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  #g5_action_shell.has-panel #g5_active_panel,
  #g5_action_shell.has-panel .g5-active-panel,
  .g5-action-shell.has-panel #g5_active_panel,
  .g5-action-shell.has-panel .g5-active-panel {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  #g5_action_shell .g5-action-buttons,
  .g5-action-shell .g5-action-buttons,
  #g5_action_shell.has-panel .g5-action-buttons,
  .g5-action-shell.has-panel .g5-action-buttons {
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    width: 100% !important;
    height: auto !important;
    min-height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding-bottom: 8px !important;
    box-sizing: border-box !important;
  }

  #g5_action_shell .g5-action-btn,
  .g5-action-shell .g5-action-btn,
  #g5_action_shell.has-panel .g5-action-btn,
  .g5-action-shell.has-panel .g5-action-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    flex-shrink: 0 !important;
    width: 100% !important;
    height: auto !important;
    min-height: 48px !important;
    padding: 10px 8px !important;
    line-height: 1.15 !important;
    font-size: clamp(.62rem, 2.5vw, .78rem) !important;
    white-space: normal !important;
    text-align: center !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    box-sizing: border-box !important;
  }

  #g5_action_shell .g5-action-btn:last-child,
  .g5-action-shell .g5-action-btn:last-child,
  #g5_action_shell.has-panel .g5-action-btn:last-child,
  .g5-action-shell.has-panel .g5-action-btn:last-child {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 0 !important;
  }

  body.preview-open .zone-preview-card,
  body.preview-open .g5-guest-action-cluster .zone-preview-card,
  #g5_guest_action_cluster.open .zone-preview-card,
  #g5_guest_action_cluster.open .zone-preview-card.open {
    flex: 0 0 calc((100vw - 16px - 34px - 12px) / 2) !important;
    width: calc((100vw - 16px - 34px - 12px) / 2) !important;
    max-width: calc((100vw - 16px - 34px - 12px) / 2) !important;
    min-width: 0 !important;
    max-height: calc(100vh - 24px) !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
}
/* ===== END GUEST-4G.5 MOBILE ACTION PANEL SELECTOR FIX ===== */
