/* Staging-only migration improvements. Production remains untouched. */
.nav-right:empty { display: none; }

.staging-ribbon {
  position: fixed;
  z-index: 99980;
  right: 14px;
  bottom: 14px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.92);
  color: #fff;
  font: 700 11px/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.ub-mobile-actions,
.ub-sheet-layer { display: none; }

.ub-hp {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 767px) {
  body {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  body.ub-sheet-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  .staging-ribbon {
    top: 76px;
    right: 8px;
    bottom: auto;
    padding: 6px 9px;
    font-size: 9px;
    opacity: 0.82;
  }

  .ub-mobile-actions {
    position: fixed;
    z-index: 99990;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 5px max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px 18px 0 0;
    background: rgba(8, 8, 8, 0.97);
    box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(14px);
    transition: transform 180ms ease, visibility 180ms ease;
  }

  body.ub-menu-open .ub-mobile-actions {
    visibility: hidden;
    transform: translateY(110%);
  }

  .ub-mobile-action {
    appearance: none;
    display: flex;
    min-width: 0;
    min-height: 58px;
    padding: 5px 4px;
    border: 0;
    background: transparent;
    color: #fff;
    font: 700 11px/1.15 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-decoration: none;
    align-items: center;
    justify-content: flex-end;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .ub-mobile-action:focus-visible,
  .ub-sheet button:focus-visible,
  .ub-sheet a:focus-visible,
  .ub-sheet input:focus-visible,
  .ub-sheet select:focus-visible,
  .ub-sheet textarea:focus-visible,
  .ub-sheet summary:focus-visible {
    outline: 3px solid #f4d225;
    outline-offset: 2px;
  }

  .ub-action-icon {
    display: grid;
    width: 28px;
    height: 28px;
    color: #f4d225;
    font: 700 25px/1 system-ui, sans-serif;
    place-items: center;
  }

  .ub-request-icon { font-size: 22px; }

  .ub-whatsapp-action {
    position: relative;
    justify-content: flex-end;
    padding-bottom: 4px;
  }

  .ub-whatsapp-orb {
    display: grid;
    width: 58px;
    height: 58px;
    margin-top: -24px;
    border: 5px solid #090909;
    border-radius: 50%;
    background: #25d366;
    box-shadow: 0 7px 18px rgba(37, 211, 102, 0.3);
    place-items: center;
  }

  .ub-whatsapp-orb svg {
    width: 31px;
    height: 31px;
    fill: #fff;
  }

  .ub-sheet-layer {
    position: fixed;
    z-index: 100010;
    inset: 0;
    display: flex;
    visibility: hidden;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  .ub-sheet-layer.is-open {
    visibility: visible;
    opacity: 1;
  }

  .ub-sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: blur(3px);
  }

  .ub-sheet {
    position: relative;
    width: min(100%, 540px);
    max-height: min(88dvh, 760px);
    overflow: auto;
    padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    background: #fff;
    color: #111;
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.28);
    overscroll-behavior: contain;
    transform: translateY(102%);
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    -webkit-overflow-scrolling: touch;
  }

  .ub-sheet-layer.is-open .ub-sheet { transform: translateY(0); }

  .ub-sheet-handle {
    width: 42px;
    height: 5px;
    margin: 0 auto 10px;
    border-radius: 999px;
    background: #d5d5d5;
  }

  .ub-sheet-close {
    position: absolute;
    top: 16px;
    right: 16px;
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #111;
    font: 400 29px/1 system-ui, sans-serif;
    cursor: pointer;
    place-items: center;
  }

  .ub-sheet-panel { padding-top: 6px; }
  .ub-sheet-panel[hidden] { display: none !important; }

  .ub-sheet-kicker {
    margin: 0 54px 5px 0;
    color: #c0001d;
    font: 800 11px/1.2 system-ui, sans-serif;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .ub-sheet h2 {
    margin: 0 54px 7px 0;
    color: #111;
    font: 800 clamp(25px, 7vw, 32px)/1.08 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -0.035em;
  }

  .ub-sheet-intro {
    margin: 0 0 18px;
    color: #5a5a5a;
    font: 400 14px/1.5 system-ui, sans-serif;
  }

  .ub-message-preview {
    position: relative;
    margin: 8px 0 18px;
    padding: 15px 16px;
    border: 1px solid #d6eadc;
    border-radius: 4px 16px 16px 16px;
    background: #effaf2;
    color: #173f23;
    font: 500 15px/1.5 system-ui, sans-serif;
    white-space: pre-line;
  }

  .ub-primary {
    appearance: none;
    display: flex;
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border: 0;
    border-radius: 14px;
    background: #111;
    color: #fff;
    font: 800 15px/1.2 system-ui, sans-serif;
    text-decoration: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
  }

  .ub-primary:disabled { cursor: wait; opacity: 0.62; }
  .ub-whatsapp-continue { background: #128c4a; }

  .ub-privacy-note {
    margin: 10px 8px 0;
    color: #777;
    font: 400 11px/1.45 system-ui, sans-serif;
    text-align: center;
  }

  .ub-sheet form { margin: 0; }

  .ub-sheet label {
    display: block;
    margin: 13px 0 6px;
    color: #222;
    font: 750 13px/1.3 system-ui, sans-serif;
  }

  .ub-sheet input:not(.ub-photo-input):not(.ub-hp),
  .ub-sheet select,
  .ub-sheet textarea {
    appearance: none;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 12px 13px;
    border: 1px solid #cfcfcf;
    border-radius: 12px;
    background: #fff;
    color: #111;
    font: 400 16px/1.35 system-ui, sans-serif;
    box-shadow: none;
  }

  .ub-sheet textarea { min-height: 88px; resize: vertical; }

  .ub-sheet select {
    padding-right: 38px;
    background-image: linear-gradient(45deg, transparent 50%, #555 50%), linear-gradient(135deg, #555 50%, transparent 50%);
    background-position: calc(100% - 19px) 22px, calc(100% - 14px) 22px;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
  }

  .ub-location-row { display: flex; gap: 8px; }
  .ub-location-row input { min-width: 0; flex: 1; }

  #ub-use-location {
    appearance: none;
    width: 50px;
    min-width: 50px;
    height: 50px;
    padding: 0;
    border: 1px solid #d4b900;
    border-radius: 12px;
    background: #f4d225;
    color: #111;
    font: 800 25px/1 system-ui, sans-serif;
    cursor: pointer;
  }

  #ub-use-location.is-locating { animation: ub-pulse 1s ease-in-out infinite; }

  .ub-location-status,
  .ub-photo-name {
    display: block;
    min-height: 0;
    margin: 5px 2px 0;
    color: #555;
    font: 500 11px/1.35 system-ui, sans-serif;
  }

  .ub-more-details {
    margin: 14px 0;
    padding: 0 13px;
    border: 1px solid #dedede;
    border-radius: 12px;
    background: #fafafa;
  }

  .ub-more-details summary {
    min-height: 48px;
    padding: 14px 0;
    color: #222;
    font: 750 13px/1.3 system-ui, sans-serif;
    cursor: pointer;
  }

  .ub-more-details summary span {
    float: right;
    color: #777;
    font-weight: 500;
  }

  .ub-more-details[open] { padding-bottom: 13px; }

  .ub-photo-label {
    display: flex !important;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px dashed #999;
    border-radius: 11px;
    background: #fff;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
  }

  .ub-photo-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .ub-submit-request { margin-top: 10px; background: #e00025; }

  .ub-form-status {
    min-height: 20px;
    margin: 10px 3px 0;
    font: 700 13px/1.4 system-ui, sans-serif;
    text-align: center;
  }

  .ub-form-status.is-success { color: #177245; }
  .ub-form-status.is-error { color: #c0001d; }
}

@keyframes ub-pulse {
  50% { opacity: 0.55; transform: scale(0.94); }
}

/* Accessible footer contrast and non-colour link affordance. */
.foot-premium .foot-col h4,
.foot-premium .foot-pay-label,
.foot-premium .foot-bottom p,
.foot-premium .foot-bottom p.foot-legal {
  color: #8f8f8f !important;
}

.foot-premium .foot-bottom .foot-legal a {
  color: #fff !important;
  text-decoration: underline !important;
  text-underline-offset: 2px !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .fade-up, .reveal { opacity: 1 !important; transform: none !important; }
}
