/* Contact dock is Web-only, independent of mainline shell and scene events. */
#velWebContactDock {
  --vc-bg: #171c23; --vc-raised: #232a33; --vc-line: #48515c;
  --vc-text: #e8edf2; --vc-muted: #b5bec9;
  position: fixed; left: max(12px, env(safe-area-inset-left));
  bottom: calc(var(--vel-shell-bottom-height, 44px) + 12px + env(safe-area-inset-bottom, 0px));
  z-index: 240; color: var(--vc-text); font-family: inherit;
  pointer-events: none;
}
#velWebContactDock * { box-sizing: border-box; }
#velWebContactDock button, #velWebContactDock input, #velWebContactDock textarea, #velWebContactDock select { font: inherit; }
#velWebContactDock .vel-contact-launch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 42px;
  background: #202832; border: 1px solid #69737e; border-radius: 21px;
  color: #eef1f4; font-size: 12px; font-weight: 700; padding: 5px 13px 5px 6px;
  box-shadow: 0 7px 22px #0009; cursor: pointer; pointer-events: auto;
}
#velWebContactDock .vel-contact-mark {
  display: grid; place-items: center; width: 29px; height: 29px; border-radius: 50%;
  background: #873849; color: white; font-size: 17px; font-weight: 800;
}
#velWebContactDock .vel-contact-launch:hover, #velWebContactDock.vel-contact-open .vel-contact-launch { background: #303944; }
#velWebContactDock .vel-contact-card {
  position: absolute; left: 0; bottom: 54px; width: min(370px, calc(100vw - 24px));
  max-height: min(680px, calc(100dvh - var(--vel-shell-menu-height, 32px) - var(--vel-shell-top-height, 34px) - var(--vel-shell-bottom-height, 44px) - 70px));
  overflow: auto; overscroll-behavior: contain; background: var(--vc-bg);
  border: 1px solid var(--vc-line); border-radius: 12px;
  box-shadow: 0 18px 50px #000b; padding: 15px; pointer-events: auto;
}
#velWebContactDock .vel-contact-card[hidden] { display: none !important; }
#velWebContactDock .vel-contact-head { display: flex; align-items: start; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--vc-line); padding-bottom: 10px; }
#velWebContactDock .vel-contact-kicker { font-size: 9px; letter-spacing: .14em; font-weight: 750; color: var(--vc-muted); }
#velWebContactDock h2 { color: var(--vc-text); font-size: 17px; margin: 5px 0 0; }
#velWebContactDock h2 small { font-size: 10px; font-weight: 500; color: var(--vc-muted); margin-left: 5px; }
#velWebContactDock .vel-contact-close { width: 32px; height: 32px; border-radius: 5px; background: transparent; color: var(--vc-muted); border: 1px solid var(--vc-line); cursor: pointer; font-size: 22px; line-height: 1; }
#velWebContactDock .vel-contact-lead, #velWebContactDock .vel-contact-note { color: var(--vc-muted); font-size: 11px; line-height: 1.6; margin: 10px 0; }
#velWebContactDock form { display: flex; flex-direction: column; gap: 9px; }
#velWebContactDock form > label:not(.vel-contact-check) { display: flex; flex-direction: column; gap: 4px; color: var(--vc-text); font-size: 11px; font-weight: 650; }
#velWebContactDock input:not([type="checkbox"]), #velWebContactDock select, #velWebContactDock textarea {
  display: block; width: 100%; border: 1px solid var(--vc-line); border-radius: 5px;
  padding: 9px; background: var(--vc-raised); color: var(--vc-text); font-size: 12px;
  outline-offset: 2px; min-height: 38px;
}
#velWebContactDock textarea { resize: vertical; min-height: 98px; }
#velWebContactDock .vel-contact-required { color: #e4a1ad; font-weight: 500; }
#velWebContactDock .vel-contact-check { display: flex; align-items: start; gap: 8px; font-size: 11px; line-height: 1.5; color: var(--vc-muted); }
#velWebContactDock .vel-contact-check input { flex: 0 0 16px; width: 16px; height: 16px; margin: 0; accent-color: #984153; }
#velWebContactDock .vel-contact-honey { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
#velWebContactDock .vel-contact-note { margin: 0; font-size: 10px; }
#velWebContactDock .vel-contact-status { font-size: 11px; color: #d4dbe3; margin: 0; min-height: 18px; }
#velWebContactDock .vel-contact-status[data-error="true"] { color: #ffadb6; }
#velWebContactDock .vel-contact-actions { display: flex; gap: 8px; }
#velWebContactDock .vel-contact-actions button { flex: 1 1 0; min-height: 40px; border-radius: 6px; padding: 6px; font-size: 12px; font-weight: 700; cursor: pointer; }
#velWebContactDock .vel-contact-copy { background: var(--vc-raised); color: var(--vc-text); border: 1px solid var(--vc-line); }
#velWebContactDock .vel-contact-send { background: #873849; color: white; border: 1px solid #a15a6a; }
#velWebContactDock .vel-contact-send:disabled { opacity: .45; cursor: not-allowed; }
#velWebContactDock :focus-visible { outline: 2px solid #e3adb8; outline-offset: 2px; }
@media(max-width: 540px) {
  #velWebContactDock { left: max(8px, env(safe-area-inset-left)); bottom: calc(var(--vel-shell-bottom-height,44px) + 8px + env(safe-area-inset-bottom,0px)); }
  #velWebContactDock .vel-contact-card { width: min(350px, calc(100vw - 16px)); padding: 12px; bottom: 51px; }
  #velWebContactDock .vel-contact-launch { padding-right: 10px; font-size: 11px; }
}
@media(prefers-reduced-motion:reduce) { #velWebContactDock * { scroll-behavior: auto; } }

/* The feedback launcher belongs to the app menu, not the Annotate/Measure canvas.
   Preserve the regular contact dialog when requested, but keep the closed
   launcher fully outside all drawing hit targets. */
#velShellMenu #velWebContactDock {
  position: relative; inset: auto; left: auto; bottom: auto;
  display: flex; align-items: center; flex: 0 0 auto;
  margin-inline-start: auto; z-index: 501; pointer-events: auto;
}
#velShellMenu #velWebContactDock .vel-contact-launch {
  display: inline-flex; min-height: 26px; height: 26px;
  padding: 2px 10px; border: 1px solid transparent;
  border-radius: 4px; background: transparent; box-shadow: none;
  font-size: 11px; line-height: 1; font-weight: 600;
}
#velShellMenu #velWebContactDock .vel-contact-mark { display: none; }
#velShellMenu #velWebContactDock .vel-contact-launch:hover,
#velShellMenu #velWebContactDock.vel-contact-open .vel-contact-launch {
  background: #303944; border-color: #48515c;
}
#velWebContactDock .vel-contact-card {
  position: fixed; left: auto; right: max(8px, env(safe-area-inset-right));
  top: calc(var(--vel-shell-menu-height, 32px) + 6px);
  bottom: auto; z-index: 502;
  max-height: min(680px, calc(100dvh - var(--vel-shell-menu-height, 32px) - 20px));
}
#velWebContactDock.vel-contact-fallback {
  left: auto; right: max(8px, env(safe-area-inset-right));
  top: 4px; bottom: auto;
}
#velWebContactDock.vel-contact-fallback .vel-contact-launch {
  min-height: 26px; height: 26px; padding: 2px 8px;
  font-size: 11px; box-shadow: none; border-radius: 4px;
}
#velWebContactDock.vel-contact-fallback .vel-contact-mark { display: none; }
@media (max-width: 540px) {
  #velShellMenu #velWebContactDock .vel-contact-launch { padding-inline: 5px; }
  #velWebContactDock .vel-contact-card {
    width: min(350px, calc(100vw - 16px));
    top: calc(var(--vel-shell-menu-height, 32px) + 4px);
    bottom: auto;
  }
}

/* One top-menu layout owner for Contact and the two promotional links.
   All three elements remain interactive siblings in normal flex flow.
   No independently fixed right offsets, magic free-space reservations or
   repeated phone/desktop positioning overrides. */
#velShellMenu {
  display: flex;
  align-items: center;
}
/* Let File / Display shrink under OS text enlargement instead of painting
   over Contact. Keep the original menu buttons reachable and preserve their
   accessible names even when visual text needs ellipsis. */
#velShellMenu .vel-menu-list { flex: 1 1 auto !important; min-width: 0 !important; }
#velShellMenu .vel-menu-list > .vel-menu { flex: 0 1 auto !important; min-width: 0 !important; }
#velShellMenu .vel-menu-list > .vel-menu > .vel-menu-btn {
  min-width: 0 !important;
  max-width: 100% !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
#velShellMenu #velWebHeaderActions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 4px;
  margin-inline-start: auto;
  padding-inline: 4px;
  min-width: 0;
  z-index: 501;
}
#velShellMenu #velWebHeaderActions #velWebContactDock {
  position: relative;
  inset: auto;
  margin: 0;
  flex: 0 0 auto;
  min-width: 0;
}
#velShellMenu #velWebHeaderActions .vel-plans-link,
#velShellMenu #velWebHeaderActions .vel-products-link {
  position: relative !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  margin: 0 !important;
  flex: 0 0 auto;
  transform: none !important;
  z-index: auto !important;
}
@media (max-width: 720px) {
  #velShellMenu #velWebHeaderActions { gap: 4px; padding-inline: 4px; }
  #velShellMenu #velWebHeaderActions #velWebContactDock .vel-contact-launch {
    white-space: nowrap;
    padding-inline: 5px;
  }
  #velShellMenu #velWebHeaderActions .vel-plans-link,
  #velShellMenu #velWebHeaderActions .vel-products-link {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    padding: 0 !important;
  }
}
