.contact-rail {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  background: var(--paper);
}
.contact-rail .channel-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 52px;
  min-height: 52px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--blue);
  cursor: pointer;
}
.contact-rail .channel-button:last-child { border-bottom: 0; }
.contact-rail svg { width: 22px; height: 22px; flex-shrink: 0; }
.contact-rail .channel-button:hover,
.contact-rail .channel-button[aria-expanded="true"] { background: var(--blue); color: var(--paper); }
.contact-rail .channel-label {
  position: absolute;
  right: calc(100% + 8px);
  padding: 8px 12px;
  white-space: nowrap;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
}
.contact-rail .channel-button:focus-visible:not([aria-expanded="true"]) .channel-label { opacity: 1; }
.contact-panel[hidden], .contact-panel .contact-qr[hidden] { display: none !important; }
.contact-panel {
  box-sizing: border-box;
  position: fixed;
  right: 52px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 61;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 340px;
  max-width: calc(100% - 64px);
  /* Three 52px rail elements, including padding and border. */
  height: 156px;
  max-height: 156px;
  padding: 10px 16px;
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px #00000018;
  animation: contact-unfold .4s ease-out;
}
.contact-panel .contact-close {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}
.contact-panel .contact-rail-copy { min-width: 0; flex: 1; }
.contact-panel h2 {
  font-family: 'Cabinet Grotesk', sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 28px 8px 0;
}
.contact-panel .contact-value { font-size: 15px; line-height: 1.4; overflow-wrap: anywhere; }
.contact-panel .contact-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--blue);
  font-size: 12px;
}
.contact-panel .contact-qr { position: relative; width: 132px; height: 132px; flex: 0 0 132px; background: white; overflow: hidden; }
/* Show the QR from the original card without resynthesizing it. */
.contact-panel .contact-qr img { position: absolute; width: 177.6px; max-width: none; height: 238.2px; left: -22.8px; top: -56.4px; }
.contact-panel.with-qr .contact-value { font-size: 12px; }
.contact-panel.with-qr h2 { font-size: 16px; }
@keyframes contact-unfold { from { opacity: 0; margin-right: -8px; } to { opacity: 1; margin-right: 0; } }
@media (max-width: 900px) {
  .contact-panel { width: calc(100% - 64px); max-width: 340px; padding: 10px; gap: 10px; }
  .contact-panel h2 { font-size: 16px; }
  .contact-panel .contact-value { font-size: 14px; }
  .contact-panel.with-qr h2 { font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) { .contact-panel { animation: none; } }
@media (max-width: 360px) {
  .contact-panel .contact-qr { width: 110px; height: 110px; flex-basis: 110px; }
  .contact-panel .contact-qr img { width: 148px; height: 198.5px; left: -19px; top: -47px; }
  .contact-panel.with-qr h2 { margin-right: 18px; font-size: 14px; }
  .contact-panel .contact-action { gap: 6px; }
}
