/* Send Destination uses the same dark popup system as the rest of Kim PWA.
   The app is dark independently of the device's preferred color scheme. */
.live-destination-action {
  position: relative;
  z-index: 2;
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  margin-left: auto;
  place-items: center;
  border: 1px solid var(--accent-border);
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
}
.live-destination-action:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.live-destination-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.status-panel .live-location-head .status-copy .eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-header.live-location-head { position: relative; }
.status-header.live-location-head > .live-destination-action {
  position: absolute;
  top: 0;
  right: 3px;
  margin: 0;
}

.send-destination-overlay[hidden] { display: none !important; }
.send-destination-open { overflow: hidden; }
.send-destination-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: var(--vehicle-overlay, rgba(1, 7, 12, .78));
  backdrop-filter: blur(24px) saturate(125%);
  -webkit-backdrop-filter: blur(24px) saturate(125%);
  overscroll-behavior: contain;
}
.send-destination-sheet {
  width: min(100%, 440px);
  max-height: min(92dvh, 720px);
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0 18px;
  border: 1px solid var(--border-strong, rgba(168, 198, 220, .22));
  border-radius: 28px;
  background: var(--vehicle-popup-bg, #0a1622);
  box-shadow: var(--vehicle-shadow-float, 0 32px 100px rgba(0,0,0,.58));
  color: var(--text, #f5f9fc);
  font-family: inherit;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.send-destination-grip { display: none; }
.send-destination-header {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-soft);
  background: var(--vehicle-header-bg, rgba(8, 19, 29, .82));
}
.send-destination-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--accent-border);
  border-radius: 15px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 24px;
}
.send-destination-heading { min-width: 0; }
.send-destination-heading strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
  letter-spacing: -.025em;
}
.send-destination-heading small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.send-destination-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font: inherit;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}
.send-destination-close:hover,
.send-destination-paste:hover {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}
.send-destination-label {
  display: block;
  margin: 20px 20px 9px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 750;
}
.send-destination-input-row {
  display: flex;
  align-items: stretch;
  gap: 9px;
  margin: 0 20px;
}
.send-destination-input-row input {
  min-width: 0;
  min-height: 46px;
  flex: 1 1 auto;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  outline: 0;
  background: var(--vehicle-inner-bg, rgba(3, 11, 18, .42));
  color: var(--text);
  font: inherit;
  font-size: 13px;
}
.send-destination-input-row input::placeholder { color: var(--muted); opacity: .8; }
.send-destination-input-row input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.send-destination-paste {
  flex: 0 0 auto;
  padding: 0 14px;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  background: var(--surface-soft);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.send-destination-hint {
  margin: 9px 20px 17px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.send-destination-toggle {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 20px 18px;
  padding: 11px 13px;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: var(--vehicle-inner-bg, rgba(3, 11, 18, .42));
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}
.send-destination-toggle input {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--accent-strong);
}
.send-destination-send {
  display: flex;
  width: calc(100% - 40px);
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 20px;
  padding: 10px 14px;
  border: 1px solid rgba(53, 223, 193, .48);
  border-radius: 14px;
  background: linear-gradient(135deg, #48e7ca, #18bfa7);
  box-shadow: 0 12px 28px rgba(24, 191, 167, .18);
  color: #03251f;
  font: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}
.send-destination-send:hover:not(:disabled) { filter: brightness(1.06); }
.send-destination-send:disabled { opacity: .55; cursor: wait; }
.send-destination-status {
  min-height: 18px;
  margin: 12px 20px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
  overflow-wrap: anywhere;
}
.send-destination-status[data-tone="success"] { color: var(--success); }
.send-destination-status[data-tone="error"] { color: var(--danger); }

@media (max-width: 600px) {
  .send-destination-overlay {
    place-items: end center;
    padding: max(10px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .send-destination-sheet {
    width: 100%;
    max-height: min(92dvh, 720px);
    border-radius: 26px;
  }
  .send-destination-header { padding: 17px 16px; }
  .send-destination-label { margin: 18px 16px 9px; }
  .send-destination-input-row { margin: 0 16px; }
  .send-destination-hint { margin: 9px 16px 16px; }
  .send-destination-toggle { margin: 0 16px 16px; }
  .send-destination-send { width: calc(100% - 32px); margin: 0 16px; }
  .send-destination-status { margin: 12px 16px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .send-destination-sheet,
  .send-destination-overlay { animation: none; }
}


/* Optional iOS setup lives inside the existing Send Destination popup. */
.send-destination-ios {
  margin: 0 20px 16px;
  border: 1px solid var(--border-soft);
  border-radius: 15px;
  background: var(--vehicle-inner-bg, rgba(3, 11, 18, .42));
  color: var(--text);
  font-size: 12px;
}
.send-destination-ios summary {
  cursor: pointer;
  padding: 14px;
  color: var(--text-secondary);
  font-weight: 750;
}
.send-destination-ios[open] summary { border-bottom: 1px solid var(--border-soft); }
.send-destination-ios-body { padding: 0 14px 14px; }
.send-destination-ios-body p { color: var(--muted); line-height: 1.55; overflow-wrap: anywhere; }
.send-destination-ios-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.send-destination-ios button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--accent-border);
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}
.send-destination-ios button.ios-secondary { border-color: var(--border-soft); background: var(--surface-soft); color: var(--text-secondary); }
.send-destination-ios button:disabled { opacity: .5; cursor: default; }
.send-destination-ios-status { margin: 10px 0; }
.send-destination-ios-status[data-tone="success"] { color: var(--success); }
.send-destination-ios-status[data-tone="error"] { color: var(--danger); }
.ios-shortcut-token-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; margin: 12px 0; }
.ios-shortcut-token-row[hidden] { display: none; }
.ios-shortcut-token-row label { grid-column: 1 / -1; color: var(--muted); }
.ios-shortcut-token-row input {
  min-width: 0; padding: 9px; border: 1px solid var(--border-strong);
  border-radius: 10px; background: var(--vehicle-popup-bg); color: var(--text);
}
.send-destination-ios-guide { margin-top: 12px; border-top: 1px solid var(--border-soft); padding-top: 11px; }
.send-destination-ios-guide strong { color: var(--text); }
.send-destination-ios-guide code { overflow-wrap: anywhere; }
@media (max-width: 600px) { .send-destination-ios { margin: 0 16px 16px; } }


/* Public signed iOS Shortcut: checked before offering the install link. */
.send-destination-ios .ios-shortcut-install {
  display: flex;
  width: 100%;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border: 1px solid rgba(53, 223, 193, .48);
  border-radius: 13px;
  background: linear-gradient(135deg, #48e7ca, #18bfa7);
  box-shadow: 0 10px 24px rgba(24, 191, 167, .14);
  color: #03251f;
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
}
.send-destination-ios .ios-shortcut-install[aria-disabled="true"] {
  pointer-events: none;
  cursor: default;
  opacity: .46;
}
.send-destination-ios .ios-shortcut-install:not([aria-disabled="true"]):hover {
  filter: brightness(1.06);
}
.send-destination-ios .ios-shortcut-install-status {
  min-height: 16px;
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 11px;
}
.ios-shortcut-steps {
  padding-left: 21px;
  margin: 8px 0 12px;
  color: var(--muted);
  line-height: 1.55;
}
.ios-shortcut-steps li { padding-left: 2px; margin-bottom: 9px; overflow-wrap: anywhere; }
.ios-shortcut-steps b { color: var(--text); }
.ios-shortcut-steps code { color: var(--text-secondary); overflow-wrap: anywhere; }

/* Pairing v2 stays hidden until signed, tested Shortcuts are published. */
.send-destination-ios-v2[hidden],
.send-destination-ios-guide[hidden],
.send-destination-ios .ios-shortcut-install[hidden],
.send-destination-ios button[hidden],
.send-destination-ios-v2 p[hidden] { display: none !important; }
.send-destination-ios-v2 { padding: 12px 0 0; border-top: 1px solid var(--border-soft); }
.ios-pair-install-links { display: grid; gap: 8px; }
.send-destination-ios button.ios-pair-run {
  margin-top: 12px; width: 100%; min-height: 44px;
}
