.dv-managed-row {
  position: relative;
  min-width: 0;
}

html.dv-delete-open,
body.dv-delete-open { overflow: hidden; }

.dv-managed-row > .dv-row {
  width: 100%;
  padding-right: 54px;
}

.dv-manage-button {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.dv-manage-button:hover,
.dv-manage-button:focus-visible,
.dv-manage-button[aria-expanded='true'] {
  border-color: var(--border-light);
  background: var(--surface-variant, #f1f5f9);
  color: var(--text);
  outline: none;
}

.dv-manage-menu {
  position: absolute;
  top: calc(50% + 22px);
  right: 10px;
  z-index: 20;
  min-width: 132px;
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.dv-manage-menu[hidden] { display: none; }

.dv-manage-delete {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #dc2626;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.dv-manage-delete:hover,
.dv-manage-delete:focus-visible {
  background: #fef2f2;
  outline: none;
}

.dv-list-empty {
  margin: 0;
  padding: 28px 16px;
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  color: var(--text-tertiary);
  font-size: 0.72rem;
  text-align: center;
}

.dv-delete-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.16s ease;
}

.dv-delete-overlay[hidden] { display: none; }
.dv-delete-overlay.is-open { opacity: 1; }

.dv-delete-dialog {
  width: min(390px, 100%);
  padding: 22px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.dv-delete-dialog-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  place-items: center;
  border-radius: 50%;
  background: #fee2e2;
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 900;
}

.dv-delete-dialog h2 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.4;
}

.dv-delete-dialog-item {
  margin: 8px 0 0;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dv-delete-dialog-copy {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font-size: 0.7rem;
  line-height: 1.65;
}

.dv-delete-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
}

.dv-delete-dialog-actions button {
  min-height: 42px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  font-weight: 800;
  cursor: pointer;
}

.dv-delete-dialog-actions button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.dv-delete-dialog-actions .dv-delete-confirm {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.dv-delete-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 10001;
  display: flex;
  min-width: min(340px, calc(100vw - 32px));
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 12px 10px 16px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #172033;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.22);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  transform: translateY(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.dv-delete-toast[hidden] { display: none; }

.dv-delete-toast.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dv-delete-toast button {
  min-height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #93c5fd;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 520px) {
  .dv-managed-row > .dv-row { padding-right: 48px; }
  .dv-manage-button { right: 7px; }
  .dv-manage-menu { right: 7px; }

  .dv-delete-overlay {
    align-items: end;
    padding: 0;
  }

  .dv-delete-dialog {
    width: 100%;
    padding: 20px 18px max(18px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 8px 8px 0 0;
  }

  .dv-delete-toast {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 16px;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dv-delete-overlay,
  .dv-delete-toast { transition: none; }
}
