/* Drag destinations stay in the same place while hover feedback changes. */
.peer-drop-label { display: none; }
[data-file-id] { -webkit-touch-callout: none; }
.share-file-grip { touch-action: none; cursor: grab; }
#orbit .file-orbit, #orbit .file-orbit * {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
}
#orbit .floating-file, #orbit .share-file-grip {
  touch-action: none;
  -webkit-user-drag: none;
  cursor: grab;
}
#orbit .floating-file * { -webkit-user-drag: none; }
body.share-drag-active .file-orbit { animation-play-state: paused; }

.share-drag-spotlight {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  background: rgb(18 49 33 / 19%);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  contain: strict;
}
.share-drag-spotlight[hidden] { display: none; }

body.share-drag-active {
  --share-drop-orange: #277044;
  --share-drop-ink: #1c4b2f;
  -webkit-user-select: none;
  user-select: none;
}

body.share-drag-active .footer-center {
  top: 0;
  width: min(880px, calc(100% - 32px));
  max-width: calc(100% - 32px);
  gap: 4px;
  pointer-events: none;
}
body.share-drag-active #devices {
  width: max-content;
  max-width: 100%;
  min-height: 68px;
  margin-inline: auto;
  padding: 7px 6px;
  gap: 10px;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  pointer-events: auto;
}
body.share-drag-active #devices::-webkit-scrollbar { display: none; }

body.share-drag-active #devices [data-drop-device-id] {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 140px;
  width: 140px;
  height: 54px;
  gap: 8px;
  padding: 8px 11px;
  border: 2px dashed var(--share-drop-orange);
  border-radius: 19px;
  background: linear-gradient(168deg, #fffdf4 6%, #dceedb 58%, #c2dfc4);
  color: var(--share-drop-ink);
  box-shadow: inset 0 1px 0 #fff, inset 0 2px 8px #266c4221, 0 3px 9px #215e3a21;
  outline: none;
  transform: none;
  transition: background-color .14s, box-shadow .14s, border-color .14s;
  touch-action: pan-x;
}
body.share-drag-active #devices [data-drop-device-id] > svg {
  width: 22px;
  height: 22px;
  color: #266d43;
}
body.share-drag-active #devices [data-drop-device-id] .peer-drop-label {
  display: -webkit-box;
  min-width: 0;
  max-width: 91px;
  max-height: 29px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  text-overflow: ellipsis;
  overflow-wrap: anywhere;
  color: #1e5233;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .035em;
  text-transform: uppercase;
  text-align: left;
}
body.share-drag-active #devices [data-drop-device-id] .favorite-dot {
  right: 4px;
  bottom: 3px;
  color: #287145;
  font-size: 8px;
}
body.share-drag-active #devices [data-drop-device-id]:is(.share-drop-hot, .drop-target-active) {
  border-color: #1f5937;
  background: linear-gradient(165deg, #dceedc, #a4cfaa 58%, #73b982) !important;
  box-shadow: inset 0 1px 0 #e6f3e4, inset 0 2px 10px #266c4226, 0 0 0 3px #6db77d45, 0 5px 15px #24673f30;
  outline: none;
  transform: none;
}

body.share-drag-active #cloud-button {
  filter: drop-shadow(0 0 13px #7ebe8b4d);
}
body.share-drag-active #cloud-button.share-drop-hot {
  filter: drop-shadow(0 0 22px #66b4776b) brightness(1.035);
  transform: none;
}
body.share-drag-active #home-vault-card.share-drop-zone {
  border: 2px dashed var(--share-drop-orange);
  background: linear-gradient(165deg, #eaf5e7, #cce5cd);
  box-shadow: inset 0 2px 9px #266c4229, 0 3px 12px #266d4323;
  outline: none;
}
body.share-drag-active #home-vault-card.share-drop-zone:is(.share-drop-hot, .is-drop-target) {
  border-color: #1f5937;
  background: #a4cfaa;
  box-shadow: inset 0 1px #ddefdc, 0 0 0 3px #6db77d45, 0 5px 15px #24673f2a;
  outline: none;
  transform: none;
}

/* The existing support card becomes a local-save destination only when the
   coordinator marks an internal Kloud file drag. Its footprint stays stable. */
#home-support > .support-save-drop { display: none; }
body.share-drag-active #home-support.share-drop-zone {
  z-index: 2;
  justify-content: center;
  border-color: var(--share-drop-orange);
  border-style: dashed;
  border-radius: 14px;
  background: linear-gradient(165deg, #fffdf4, #dceedb 58%, #c2dfc4);
  color: var(--share-drop-ink) !important;
  box-shadow: inset 0 1px #fff, inset 0 2px 8px #266c4229, 0 3px 10px #22643d21;
  outline: none;
  transform: none;
}
body.share-drag-active #home-support.share-drop-zone > :not(.support-save-drop) { visibility: hidden; }
body.share-drag-active #home-support.share-drop-zone > .support-save-drop {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 13px;
  min-width: 0;
  color: #1e5233;
  font-size: 10px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: .035em;
  text-align: center;
  text-transform: uppercase;
}
.support-save-drop > svg { flex: none; width: 21px; height: 21px; color: #266c42; }
.support-save-drop > span { min-width: 0; overflow-wrap: anywhere; }
body.share-drag-active #home-support.share-drop-zone.share-drop-hot {
  border-color: #1f5937;
  background: linear-gradient(165deg, #dceedc, #a4cfaa 58%, #73b982);
  box-shadow: inset 0 1px #e6f3e4, inset 0 2px 10px #266c4226, 0 0 0 3px #6db77d45, 0 5px 15px #24673f30;
}

/* A save receipt is a separate, quiet line below the file rather than another
   action on its artwork. Fixed artwork-relative corners prevent collisions. */
.file-orbit :is(.file-send-button, .file-remove-button, .file-menu-button, .file-download-badge) {
  border: 1px solid #277044;
  background: linear-gradient(178deg, #bfddc1 0%, #91c69a 45%, #68b579 49%, #43985b 100%);
  box-shadow: inset 0 1px #d9edd9, inset 0 -1px #2f7f4b38, 0 2px 7px #1f56362e;
  color: #1b452c;
}
.file-orbit :is(.file-menu-button, .file-download-badge) { top: 49px; bottom: auto; }
.file-orbit :is(.file-send-button, .file-remove-button, .file-menu-button, .file-download-badge):hover {
  background: linear-gradient(178deg, #cde5ce, #9ccba3 45%, #71b880 49%, #4ba161);
  box-shadow: inset 0 1px #e6f3e4, 0 2px 9px #1f563638;
}
.file-orbit :is(.file-send-button, .file-remove-button, .file-menu-button, .file-download-badge):active {
  box-shadow: inset 0 1px 5px #1e543435, 0 1px 3px #1f563626;
}
.file-save-receipt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  max-width: 104px;
  min-height: 19px;
  padding: 3px 6px;
  border: 1px solid #63b374;
  border-radius: 10px;
  background: linear-gradient(165deg, #edf7ea, #cfe7d0);
  box-shadow: inset 0 1px #fffdf8, 0 2px 5px #215e3a0e;
  color: #215e3a;
  font-size: 8.5px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0;
  vertical-align: top;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.file-orbit > .file-save-receipt {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  display: flex;
  margin: 0;
  transform: translateX(-50%);
}
.file-save-receipt .receipt-mark {
  display: grid;
  place-items: center;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  border: 1px solid #2f7f4b;
  border-radius: 50%;
  background: linear-gradient(#b6d8b9 0%, #88c293 45%, #61b273 50%, #469b5e);
  box-shadow: inset 0 1px #d3e9d4;
  color: #1e5233;
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
}
.file-save-receipt .receipt-mark > svg { display: block; width: 9px; height: 9px; stroke-width: 2.4; }
.file-save-receipt .receipt-copy { min-width: 0; white-space: normal; text-align: center; }
.file-save-receipt[data-save-status="saved"] {
  border-color: #71b880;
  background: linear-gradient(165deg, #edf7ea, #d4ead4);
  color: #21603b;
}
.row-name > .file-save-receipt { margin: 6px 0 0; max-width: 100%; font-size: 9px; }
body.share-drag-active .file-save-receipt { visibility: hidden; }
body.share-drag-active .file-orbit :is(.file-send-button, .file-remove-button, .file-menu-button, .file-download-badge) {
  opacity: 0;
  pointer-events: none;
}
.share-drag-ghost .file-save-receipt { display: none !important; }

body.share-drag-active .share-drag-source {
  opacity: .48;
  animation-play-state: paused;
}
body.share-drag-active .share-drag-source .floating-file,
body.share-drag-active .share-drag-source.floating-file {
  cursor: grabbing;
}

.share-drag-ghost {
  position: fixed;
  z-index: 2147482000;
  display: grid;
  place-items: center;
  gap: 5px;
  width: 94px;
  max-height: 112px;
  padding: 9px;
  border: 1px solid #58ae6c;
  border-radius: 17px;
  background: linear-gradient(155deg, #fffdf7ed, #c7e2c8f2);
  box-shadow: inset 0 1px #fff, 0 9px 26px #1b472c38;
  color: #1c492e;
  font-size: 10px;
  text-align: center;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  animation: none !important;
  transition: none !important;
  will-change: transform;
}
.share-drag-ghost :is(button, .file-download-badge, .vault-drag-handle) { display: none !important; }
.share-drag-ghost > img { display: block; width: 54px; height: 52px; border-radius: 8px; object-fit: contain; }
.share-drag-ghost .floating-file { gap: 5px; animation: none; }
.share-drag-ghost .file-label { max-width: 76px; font-size: 9px; }
.share-drag-ghost .file-art { width: 42px; height: 48px; }
.share-drag-ghost .file-art.photo { width: 54px; height: 48px; }
.share-drag-ghost > span { max-width: 76px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Older engines keep the destinations clear without relying on a mask. */
body.share-drag-active.share-spotlight-fallback :is(header, #refresh-kloud, .sky-grain, .footer-tools, #device-button, .footer-counts),
body.share-drag-active.share-spotlight-fallback #home-support:not(.share-drop-zone),
body.share-drag-active.share-spotlight-fallback #devices .peer:not([data-drop-device-id]),
body.share-drag-active.share-spotlight-fallback #orbit > :not(.share-drag-source) {
  filter: blur(3px) brightness(.8);
}
body.share-drag-active.share-spotlight-fallback #home-vault-card:not(.share-drop-zone) {
  filter: blur(3px) brightness(.8);
}

@media (max-width: 700px) {
  .file-orbit :is(.file-menu-button, .file-download-badge) { top: 35px; bottom: auto; }
  .file-orbit > .file-save-receipt { top: calc(100% + 6px); max-width: 94px; padding: 3px 5px; font-size: 8px; }
  body.share-drag-active #home-support.share-drop-zone > .support-save-drop { gap: 6px; padding: 8px 9px; font-size: 9px; letter-spacing: .025em; }
  .support-save-drop > svg { width: 18px; height: 18px; }
  body.share-drag-active .footer-center {
    width: calc(100% - 20px);
    max-width: calc(100% - 20px);
    top: -1px;
  }
  body.share-drag-active #devices { gap: 8px; min-height: 64px; padding: 6px 4px; }
  body.share-drag-active #devices [data-drop-device-id] {
    flex-basis: 122px;
    width: 122px;
    height: 52px;
    gap: 6px;
    padding: 7px 9px;
    border-radius: 18px;
  }
  body.share-drag-active #devices [data-drop-device-id] > svg { width: 19px; height: 19px; }
  body.share-drag-active #devices [data-drop-device-id] .peer-drop-label {
    max-width: 77px;
    font-size: 9px;
    line-height: 1.4;
    max-height: 27px;
    letter-spacing: .025em;
  }
}

@media (max-width: 480px) {
  /* Four actions use two compact rows, leaving the file name and its receipt
     enough room instead of squeezing them between the artwork and buttons. */
  .file-row:has(.file-save-receipt) .row-actions {
    flex: 0 0 62px;
    flex-wrap: wrap;
    justify-content: flex-end;
    width: 62px;
  }
}

@media (max-width: 700px) and (max-height: 680px) {
  /* Keep the two storage destinations within short phone viewports. Fix only
     the marked cards, not the support row or the rest of the page. */
  body.share-drag-active #home-support.share-drop-zone,
  body.share-drag-active:has(#home-support.share-drop-zone) #home-vault-card.share-drop-zone {
    position: fixed;
    top: auto;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(50vw - 18px);
    min-width: 0;
    max-width: none;
    height: 56px;
    min-height: 56px;
    max-height: 56px;
    margin: 0;
    box-sizing: border-box;
  }
  body.share-drag-active #home-support.share-drop-zone { left: 12px; right: auto; }
  body.share-drag-active:has(#home-support.share-drop-zone) #home-vault-card.share-drop-zone {
    right: 12px;
    left: auto;
    gap: 6px;
    padding: 8px;
  }
  body.share-drag-active:has(#home-support.share-drop-zone) #home-vault-card.share-drop-zone .zp-support-button__copy { padding: 0; }
  body.share-drag-active:has(#home-support.share-drop-zone) #home-vault-card.share-drop-zone .zp-support-button__label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 27px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.4;
    letter-spacing: .02em;
  }
  body.share-drag-active:has(#home-support.share-drop-zone) #home-vault-card.share-drop-zone .zk-plus-mark { flex: none; font-size: 23px; }
  body.share-drag-active:has(#home-support.share-drop-zone) .footer-center {
    position: fixed;
    top: auto;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }
  body.share-drag-active #home-support.share-drop-zone > .support-save-drop {
    gap: 6px;
    padding: 7px 8px;
    font-size: 9px;
    line-height: 1.3;
  }
  body.share-drag-active #home-support.share-drop-zone .support-save-drop > span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 25px;
    overflow: hidden;
    overflow-wrap: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.share-drag-active .share-drop-zone,
  body.share-drag-active #devices [data-drop-device-id],
  .share-drag-ghost { animation: none !important; transition: none !important; }
}
